@Test public void testGetToReleasePartitions() throws Exception { String groupId3 = "test_group3"; String topic3 = "Topic.test-3"; List<String> topics3 = new ArrayList<String>(); topics3.add(topic3); String consumerId3 = "D-00456-consumerId-3"; ZkCoordinator zkCoordinator3 = new DynamicCoordinator(topics3, groupId3, consumerId3, zkConnector); zkCoordinator3.takePartition(topic3, 0); zkCoordinator3.takePartition(topic3, 1); zkCoordinator3.takePartition(topic3, 2); Set<Integer> toRelease = zkCoordinator3.getToReleasePartitions(topic3, 2); assertEquals(2, toRelease.size()); Set<Integer> partitions = new HashSet<Integer>(); partitions.add(0); partitions.add(1); partitions.add(2); assertTrue(partitions.containsAll(toRelease)); }
@Override public synchronized Set<Integer> getToReleasePartitions(String topic, int count) { return getRandomReleasePartitions(topic, count); }
DynamicCoordinator extends ZkCoordinator { @Override public synchronized Set<Integer> getToReleasePartitions(String topic, int count) { return getRandomReleasePartitions(topic, count); } }
DynamicCoordinator extends ZkCoordinator { @Override public synchronized Set<Integer> getToReleasePartitions(String topic, int count) { return getRandomReleasePartitions(topic, count); } DynamicCoordinator(List<String> topics, String groupId,
			String consumerId, KafkaController.ZkConnector zk); }
DynamicCoordinator extends ZkCoordinator { @Override public synchronized Set<Integer> getToReleasePartitions(String topic, int count) { return getRandomReleasePartitions(topic, count); } DynamicCoordinator(List<String> topics, String groupId,
			String consumerId, KafkaController.ZkConnector zk); @Override synchronized Map<String, Integer> getRebalanceCount(); @Override synchronized Set<Integer> getToTakePartitions(String topic); @Override synchronized Set<Integer> getToReleasePartitions(String topic,
			int count); }
DynamicCoordinator extends ZkCoordinator { @Override public synchronized Set<Integer> getToReleasePartitions(String topic, int count) { return getRandomReleasePartitions(topic, count); } DynamicCoordinator(List<String> topics, String groupId,
			String consumerId, KafkaController.ZkConnector zk); @Override synchronized Map<String, Integer> getRebalanceCount(); @Override synchronized Set<Integer> getToTakePartitions(String topic); @Override synchronized Set<Integer> getToReleasePartitions(String topic,
			int count);  }