@Test public void assertReconcile() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").reconcileIntervalMinutes(1).build()); when(shardingService.isNeedSharding()).thenReturn(false); when(shardingService.hasShardingInfoInOfflineServers()).thenReturn(true); reconcileService.runOneIteration(); verify(shardingService).isNeedSharding(); verify(shardingService).hasShardingInfoInOfflineServers(); verify(shardingService).setReshardingFlag(); }
@Override protected void runOneIteration() { int reconcileIntervalMinutes = configService.load(true).getReconcileIntervalMinutes(); if (reconcileIntervalMinutes > 0 && (System.currentTimeMillis() - lastReconcileTime >= reconcileIntervalMinutes * 60 * 1000)) { lastReconcileTime = System.currentTimeMillis(); if (!shardingService.isNeedSharding() && shardingService.hasShardingInfoInOfflineServers()) { log.warn("Elastic Job: job status node has inconsistent value,start reconciling..."); shardingService.setReshardingFlag(); } } }
ReconcileService extends AbstractScheduledService { @Override protected void runOneIteration() { int reconcileIntervalMinutes = configService.load(true).getReconcileIntervalMinutes(); if (reconcileIntervalMinutes > 0 && (System.currentTimeMillis() - lastReconcileTime >= reconcileIntervalMinutes * 60 * 1000)) { lastReconcileTime = System.currentTimeMillis(); if (!shardingService.isNeedSharding() && shardingService.hasShardingInfoInOfflineServers()) { log.warn("Elastic Job: job status node has inconsistent value,start reconciling..."); shardingService.setReshardingFlag(); } } } }
ReconcileService extends AbstractScheduledService { @Override protected void runOneIteration() { int reconcileIntervalMinutes = configService.load(true).getReconcileIntervalMinutes(); if (reconcileIntervalMinutes > 0 && (System.currentTimeMillis() - lastReconcileTime >= reconcileIntervalMinutes * 60 * 1000)) { lastReconcileTime = System.currentTimeMillis(); if (!shardingService.isNeedSharding() && shardingService.hasShardingInfoInOfflineServers()) { log.warn("Elastic Job: job status node has inconsistent value,start reconciling..."); shardingService.setReshardingFlag(); } } } ReconcileService(final CoordinatorRegistryCenter regCenter, final String jobName); }
ReconcileService extends AbstractScheduledService { @Override protected void runOneIteration() { int reconcileIntervalMinutes = configService.load(true).getReconcileIntervalMinutes(); if (reconcileIntervalMinutes > 0 && (System.currentTimeMillis() - lastReconcileTime >= reconcileIntervalMinutes * 60 * 1000)) { lastReconcileTime = System.currentTimeMillis(); if (!shardingService.isNeedSharding() && shardingService.hasShardingInfoInOfflineServers()) { log.warn("Elastic Job: job status node has inconsistent value,start reconciling..."); shardingService.setReshardingFlag(); } } } ReconcileService(final CoordinatorRegistryCenter regCenter, final String jobName);  }
ReconcileService extends AbstractScheduledService { @Override protected void runOneIteration() { int reconcileIntervalMinutes = configService.load(true).getReconcileIntervalMinutes(); if (reconcileIntervalMinutes > 0 && (System.currentTimeMillis() - lastReconcileTime >= reconcileIntervalMinutes * 60 * 1000)) { lastReconcileTime = System.currentTimeMillis(); if (!shardingService.isNeedSharding() && shardingService.hasShardingInfoInOfflineServers()) { log.warn("Elastic Job: job status node has inconsistent value,start reconciling..."); shardingService.setReshardingFlag(); } } } ReconcileService(final CoordinatorRegistryCenter regCenter, final String jobName);   }