public static List < Integer > getStolenPrimaryPartitions ( final Cluster currentCluster , final Cluster finalCluster , final int stealNodeId ) { List < Integer > finalList = new ArrayList < Integer > ( finalCluster . getNodeById ( stealNodeId ) . getPartitionIds ( ) ) ; List < Integer > currentList = new ArrayList < Integer > ( ) ; if ( currentCluster . hasNodeWithId ( stealNodeId ) ) { currentList = currentCluster . getNodeById ( stealNodeId ) . getPartitionIds ( ) ; } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Current cluster does not contain stealer node (cluster : [[[" + currentCluster + "]]], node id " + stealNodeId + ")" ) ; } } finalList . removeAll ( currentList ) ; return finalList ; }
For a particular stealer node find all the primary partitions tuples it will steal .