public Integer getNodesPartitionIdForKey ( int nodeId , final byte [ ] key ) { // this is all the partitions the key replicates to. List < Integer > partitionIds = getReplicatingPartitionList ( key ) ; for ( Integer partitionId : partitionIds ) { // check which of the replicating partitions belongs to the node in // question if ( getNodeIdForPartitionId ( partitionId ) == nodeId ) { return partitionId ; } } return null ; }
Determines the partition ID that replicates the key on the given node .