@Test public void shardingForZeroServer() { assertThat(jobShardingStrategy.sharding(Collections.<String>emptyList(), getJobShardingStrategyOption(3)), is(Collections.EMPTY_MAP)); }
@Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { if (serversList.isEmpty()) { return Collections.emptyMap(); } Map<String, List<Integer>> result = shardingAliquot(serversList, option.getShardingTotalCount()); addAliquant(serversList, option.getShardingTotalCount(), result); return result; }
AverageAllocationJobShardingStrategy implements JobShardingStrategy { @Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { if (serversList.isEmpty()) { return Collections.emptyMap(); } Map<String, List<Integer>> result = shardingAliquot(serversList, option.getShardingTotalCount()); addAliquant(serversList, option.getShardingTotalCount(), result); return result; } }
AverageAllocationJobShardingStrategy implements JobShardingStrategy { @Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { if (serversList.isEmpty()) { return Collections.emptyMap(); } Map<String, List<Integer>> result = shardingAliquot(serversList, option.getShardingTotalCount()); addAliquant(serversList, option.getShardingTotalCount(), result); return result; }  }
AverageAllocationJobShardingStrategy implements JobShardingStrategy { @Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { if (serversList.isEmpty()) { return Collections.emptyMap(); } Map<String, List<Integer>> result = shardingAliquot(serversList, option.getShardingTotalCount()); addAliquant(serversList, option.getShardingTotalCount(), result); return result; }  @Override Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option); }
AverageAllocationJobShardingStrategy implements JobShardingStrategy { @Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { if (serversList.isEmpty()) { return Collections.emptyMap(); } Map<String, List<Integer>> result = shardingAliquot(serversList, option.getShardingTotalCount()); addAliquant(serversList, option.getShardingTotalCount(), result); return result; }  @Override Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option);  }