// Compare to original partition ids list
assertTrue("Original and interm partition ids don't match",
originalPartitions.equals(finalPartitions));
// Make sure that there is no data movement
RebalancePlan rebalancePlan = ClusterTestUtils.makePlan(initialCluster,
storeDefs,
interimCluster,
storeDefs);
// Make sure we have a plan
assertEquals(rebalancePlan.getPlan().size(), 1);
// Make sure there is no cross zones between zones in the plan
assertEquals(rebalancePlan.getPartitionStoresMovedXZone(), 0);
// Make sure there is no data movement between nodes
assertEquals(rebalancePlan.getPartitionStoresMoved(), 0);
for(Integer nodeId: interimCluster.getNodeIds()) {
Set<Integer> remainingNodes = Sets.symmetricDifference(interimCluster.getNodeIds(),
Sets.newHashSet(nodeId));
for(Integer otherNodeId: remainingNodes) {
assertTrue("Something went wrong as there is data movement between nodes",
rebalancePlan.getNodeMoveMap().get(nodeId, otherNodeId) == 0);
}
}
// Also get the adjusted store definitions, with the zone dropped
Cluster finalCluster = RebalanceUtils.dropZone(interimCluster, dropZoneId);