Class PromoteNewestMemberOnCoordinatorLeave
java.lang.Object
org.jgroups.protocols.pbcast.GMS.DefaultMembershipPolicy
org.jgroups.util.PromoteNewestMemberOnCoordinatorLeave
- All Implemented Interfaces:
MembershipChangePolicy
MembershipChangePolicy which promotes the newest member when the existing coordinator leaves.
This minimizes the number of coordinator changes; during a rolling restart there will be only a single coordinator change.
- Since:
- 5.5.1
- Author:
- Christian Fredriksson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNewMembership(Collection<Address> currentMembers, Collection<Address> joiners, Collection<Address> leavers, Collection<Address> suspects) Takes the existing membership list and removes suspected and left members, then adds new members to the end of the listMethods inherited from class GMS.DefaultMembershipPolicy
getNewMembership, getNewMembershipOld
-
Constructor Details
-
PromoteNewestMemberOnCoordinatorLeave
public PromoteNewestMemberOnCoordinatorLeave()
-
-
Method Details
-
getNewMembership
public List<Address> getNewMembership(Collection<Address> currentMembers, Collection<Address> joiners, Collection<Address> leavers, Collection<Address> suspects) Description copied from class:GMS.DefaultMembershipPolicyTakes the existing membership list and removes suspected and left members, then adds new members to the end of the list- Specified by:
getNewMembershipin interfaceMembershipChangePolicy- Overrides:
getNewMembershipin classGMS.DefaultMembershipPolicy- Parameters:
currentMembers- The list of current members. Guaranteed to be non-null (but may be empty)joiners- The joining members. Guaranteed to be non-null (but may be empty)leavers- Members that are leaving. Guaranteed to be non-null (but may be empty)suspects- Members which are suspected. Guaranteed to be non-null (but may be empty)- Returns:
- The new membership. Needs to be non-null and cannot contain duplicates
-