private boolean shouldAcceptMastership ( MemberMap memberMap , MemberImpl candidate ) { assert lock . isHeldByCurrentThread ( ) : "Called without holding cluster service lock!" ; for ( MemberImpl member : memberMap . headMemberSet ( candidate , false ) ) { if ( ! membershipManager . isMemberSuspected ( member . getAddress ( ) ) ) { if ( logger . isFineEnabled ( ) ) { logger . fine ( "Should not accept mastership claim of " + candidate + ", because " + member + " is not suspected at the moment and is before than " + candidate + " in the member list." ) ; } return false ; } } return true ; }
mastership is accepted when all members before the candidate is suspected