@Test public void assertGetDisabledItems() { when(jobNodeStorage.isJobNodeExisted("sharding/0/disabled")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("sharding/1/disabled")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("sharding/2/disabled")).thenReturn(false); assertThat(executionService.getDisabledItems(Arrays.asList(0, 1, 2)), is(Arrays.asList(0, 1))); }
public List<Integer> getDisabledItems(final List<Integer> items) { List<Integer> result = new ArrayList<>(items.size()); for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getDisabledNode(each))) { result.add(each); } } return result; }
ExecutionService { public List<Integer> getDisabledItems(final List<Integer> items) { List<Integer> result = new ArrayList<>(items.size()); for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getDisabledNode(each))) { result.add(each); } } return result; } }
ExecutionService { public List<Integer> getDisabledItems(final List<Integer> items) { List<Integer> result = new ArrayList<>(items.size()); for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getDisabledNode(each))) { result.add(each); } } return result; } ExecutionService(final CoordinatorRegistryCenter regCenter, final String jobName); }
ExecutionService { public List<Integer> getDisabledItems(final List<Integer> items) { List<Integer> result = new ArrayList<>(items.size()); for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getDisabledNode(each))) { result.add(each); } } return result; } 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 List<Integer> getDisabledItems(final List<Integer> items) { List<Integer> result = new ArrayList<>(items.size()); for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ShardingNode.getDisabledNode(each))) { result.add(each); } } return result; } 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);  }