public static Cluster swapPartitions ( final Cluster nextCandidateCluster , final int nodeIdA , final int partitionIdA , final int nodeIdB , final int partitionIdB ) { Cluster returnCluster = Cluster . cloneCluster ( nextCandidateCluster ) ; // Swap partitions between nodes! returnCluster = UpdateClusterUtils . createUpdatedCluster ( returnCluster , nodeIdA , Lists . newArrayList ( partitionIdB ) ) ; returnCluster = UpdateClusterUtils . createUpdatedCluster ( returnCluster , nodeIdB , Lists . newArrayList ( partitionIdA ) ) ; return returnCluster ; }
Swaps two specified partitions .