boolean disableZoneBalancing = true;
// Do some random swaps within zone
boolean enableRandomSwaps = true;
int swapAttempts = 100;
int swapSuccesses = 10;
Cluster repartitionedCluster = Repartitioner.repartition(currentCluster,
currentStores,
currentCluster,
currentStores,
null,
1,
disableNodeBalancing,
disableZoneBalancing,
enableRandomSwaps,
swapAttempts,
swapSuccesses,
swapZoneIds,
false,
0,
0,
0,
Collections.<Integer> emptyList(),
0);
PartitionBalance repartitionedPb = new PartitionBalance(repartitionedCluster, currentStores);
Set<Integer> allNodeIds = repartitionedCluster.getNodeIds();
Set<Integer> swapNodeIds = null;
for (Integer swapZoneId: swapZoneIds) {
swapNodeIds = repartitionedCluster.getNodeIdsInZone(swapZoneId);
}
// Remove nodes that we don't want to verify the partition count on
allNodeIds.removeAll(swapNodeIds);
for (Integer remainingNodeId : allNodeIds) {
Set<Integer> beforeRepartition = new HashSet<Integer>(currentCluster