Package org.jgroups.stack
Interface MembershipChangePolicy
-
- All Known Implementing Classes:
GMS.DefaultMembershipPolicy
,LargestWinningPolicy
public interface MembershipChangePolicy
Policy used to determine the new membership after a membership change (join, leave) or a merge. Can be installed inGMS
to override the default policy, which adds new members at the end on a regular membership change, and adds all subviews into a new membership which is lexically sorted in case of a merge.- Since:
- 3.4
- Author:
- Bela Ban
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<Address>
getNewMembership(java.util.Collection<java.util.Collection<Address>> subviews)
Compute a new membership based on a number of subviewsjava.util.List<Address>
getNewMembership(java.util.Collection<Address> current_members, java.util.Collection<Address> joiners, java.util.Collection<Address> leavers, java.util.Collection<Address> suspects)
Computes a new membership based on existing, joining, leaving and suspected members.
-
-
-
Method Detail
-
getNewMembership
java.util.List<Address> getNewMembership(java.util.Collection<Address> current_members, java.util.Collection<Address> joiners, java.util.Collection<Address> leavers, java.util.Collection<Address> suspects)
Computes a new membership based on existing, joining, leaving and suspected members. The first element of the new membership will be the coordinator.- Parameters:
current_members
- 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. The first element of the list is the (old or existing) coordinator. There cannot be any duplicate members
-
getNewMembership
java.util.List<Address> getNewMembership(java.util.Collection<java.util.Collection<Address>> subviews)
Compute a new membership based on a number of subviews- Parameters:
subviews
- A list of membership lists, e.g. [{A,B,C}, {M,N,O,P}, {X,Y,Z}]. This is a merge between 3 subviews. Guaranteed to be non-null (but may be empty)- Returns:
- The new membership. The first element of the list is the (old or existing) coordinator. There cannot be any duplicate members
-
-