@Test public void assertHasRunningItemsForAll() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false); when(jobNodeStorage.isJobNodeExisted("sharding/1/running")).thenReturn(true); assertTrue(executionService.hasRunningItems()); }
public boolean hasRunningItems(final Collection<Integer> items) { JobConfiguration jobConfig = configService.load(true); if (!jobConfig.isMonitorExecution()) { return false; } for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getRunningNode(each))) { return true; } } return false; }
ExecutionService { public boolean hasRunningItems(final Collection<Integer> items) { JobConfiguration jobConfig = configService.load(true); if (!jobConfig.isMonitorExecution()) { return false; } for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getRunningNode(each))) { return true; } } return false; } }
ExecutionService { public boolean hasRunningItems(final Collection<Integer> items) { JobConfiguration jobConfig = configService.load(true); if (!jobConfig.isMonitorExecution()) { return false; } for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getRunningNode(each))) { return true; } } return false; } ExecutionService(final CoordinatorRegistryCenter regCenter, final String jobName); }
ExecutionService { public boolean hasRunningItems(final Collection<Integer> items) { JobConfiguration jobConfig = configService.load(true); if (!jobConfig.isMonitorExecution()) { return false; } for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getRunningNode(each))) { return true; } } return false; } 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 boolean hasRunningItems(final Collection<Integer> items) { JobConfiguration jobConfig = configService.load(true); if (!jobConfig.isMonitorExecution()) { return false; } for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getRunningNode(each))) { return true; } } return false; } 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);  }