private void executeJobInternal(final JobExecutionMultipleShardingContext shardingContext) { if (shardingContext.getShardingItems().isEmpty()) { log.debug("Elastic job: sharding item is empty, job execution context:{}.", shardingContext); return; } executionService.registerJobBegin(shardingContext); executeJob(shardingContext); executionService.registerJobCompleted(shardingContext); if (configService.isFailover()) { failoverService.updateFailoverComplete(shardingContext.getShardingItems()); } }
@Test public void assertUpdateFailoverComplete() { failoverService.updateFailoverComplete(Arrays.asList(0, 1)); verify(jobNodeStorage).removeJobNodeIfExisted("execution/0/failover"); verify(jobNodeStorage).removeJobNodeIfExisted("execution/1/failover"); }