private boolean checkPartitionOwner ( ) { InternalPartitionServiceImpl partitionService = getService ( ) ; PartitionStateManager partitionStateManager = partitionService . getPartitionStateManager ( ) ; InternalPartitionImpl partition = partitionStateManager . getPartitionImpl ( getPartitionId ( ) ) ; PartitionReplica owner = partition . getOwnerReplicaOrNull ( ) ; NodeEngine nodeEngine = getNodeEngine ( ) ; if ( owner == null || ! owner . isIdentical ( nodeEngine . getLocalMember ( ) ) ) { ILogger logger = getLogger ( ) ; if ( logger . isFinestEnabled ( ) ) { logger . finest ( "This node is not owner partition. Cannot process request. partitionId=" + getPartitionId ( ) + ", replicaIndex=" + getReplicaIndex ( ) + ", namespaces=" + namespaces ) ; } return false ; } return true ; }
Checks if we are the primary owner of the partition .