@Test public void assertSharding2() { Map<String, List<Integer>> expected = new LinkedHashMap<String, List<Integer>>(3); expected.put("host0", Collections.singletonList(1)); expected.put("host1", Collections.<Integer>emptyList()); expected.put("host2", Collections.singletonList(0)); assertThat( rotateServerByNameJobShardingStrategy.sharding(Arrays.asList("host0", "host1", "host2"), new JobShardingStrategyOption("2", 2, Collections.<Integer, String>emptyMap())), is(expected)); }
@Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { return averageAllocationJobShardingStrategy.sharding(rotateServerList(serversList, option.getJobName()), option); }
RotateServerByNameJobShardingStrategy implements JobShardingStrategy { @Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { return averageAllocationJobShardingStrategy.sharding(rotateServerList(serversList, option.getJobName()), option); } }
RotateServerByNameJobShardingStrategy implements JobShardingStrategy { @Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { return averageAllocationJobShardingStrategy.sharding(rotateServerList(serversList, option.getJobName()), option); }  }
RotateServerByNameJobShardingStrategy implements JobShardingStrategy { @Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { return averageAllocationJobShardingStrategy.sharding(rotateServerList(serversList, option.getJobName()), option); }  @Override Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option); }
RotateServerByNameJobShardingStrategy implements JobShardingStrategy { @Override public Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option) { return averageAllocationJobShardingStrategy.sharding(rotateServerList(serversList, option.getJobName()), option); }  @Override Map<String, List<Integer>> sharding(final List<String> serversList, final JobShardingStrategyOption option);  }