@Test public void assertRegisterJobCompletedWithMonitorExecution() { JobRegistry.getInstance().setJobRunning("test_job", true); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(true).build()); executionService.registerJobCompleted(getShardingContext()); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/0/running"); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/1/running"); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/2/running"); assertFalse(JobRegistry.getInstance().isJobRunning("test_job")); }
public void registerJobCompleted(final ShardingContexts shardingContexts) { JobRegistry.getInstance().setJobRunning(jobName, false); if (!configService.load(true).isMonitorExecution()) { return; } for (int each : shardingContexts.getShardingItemParameters().keySet()) { jobNodeStorage.removeJobNodeIfExisted(ShardingNode.getRunningNode(each)); } }
ExecutionService { public void registerJobCompleted(final ShardingContexts shardingContexts) { JobRegistry.getInstance().setJobRunning(jobName, false); if (!configService.load(true).isMonitorExecution()) { return; } for (int each : shardingContexts.getShardingItemParameters().keySet()) { jobNodeStorage.removeJobNodeIfExisted(ShardingNode.getRunningNode(each)); } } }
ExecutionService { public void registerJobCompleted(final ShardingContexts shardingContexts) { JobRegistry.getInstance().setJobRunning(jobName, false); if (!configService.load(true).isMonitorExecution()) { return; } for (int each : shardingContexts.getShardingItemParameters().keySet()) { jobNodeStorage.removeJobNodeIfExisted(ShardingNode.getRunningNode(each)); } } ExecutionService(final CoordinatorRegistryCenter regCenter, final String jobName); }
ExecutionService { public void registerJobCompleted(final ShardingContexts shardingContexts) { JobRegistry.getInstance().setJobRunning(jobName, false); if (!configService.load(true).isMonitorExecution()) { return; } for (int each : shardingContexts.getShardingItemParameters().keySet()) { jobNodeStorage.removeJobNodeIfExisted(ShardingNode.getRunningNode(each)); } } ExecutionService(final CoordinatorRegistryCenter regCenter, final String jobName); void registerJobBegin(final ShardingContexts shardingContexts); void registerJobCompleted(final ShardingContexts shardingContexts); void clearAllRunningInfo(); void clearRunningInfo(final List<Integer> items); boolean hasRunningItems(final Collection<Integer> items); boolean hasRunningItems(); boolean misfireIfHasRunningItems(final Collection<Integer> items); void setMisfire(final Collection<Integer> items); List<Integer> getMisfiredJobItems(final Collection<Integer> items); void clearMisfire(final Collection<Integer> items); List<Integer> getDisabledItems(final List<Integer> items); }
ExecutionService { public void registerJobCompleted(final ShardingContexts shardingContexts) { JobRegistry.getInstance().setJobRunning(jobName, false); if (!configService.load(true).isMonitorExecution()) { return; } for (int each : shardingContexts.getShardingItemParameters().keySet()) { jobNodeStorage.removeJobNodeIfExisted(ShardingNode.getRunningNode(each)); } } ExecutionService(final CoordinatorRegistryCenter regCenter, final String jobName); void registerJobBegin(final ShardingContexts shardingContexts); void registerJobCompleted(final ShardingContexts shardingContexts); void clearAllRunningInfo(); void clearRunningInfo(final List<Integer> items); boolean hasRunningItems(final Collection<Integer> items); boolean hasRunningItems(); boolean misfireIfHasRunningItems(final Collection<Integer> items); void setMisfire(final Collection<Integer> items); List<Integer> getMisfiredJobItems(final Collection<Integer> items); void clearMisfire(final Collection<Integer> items); List<Integer> getDisabledItems(final List<Integer> items);  }