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 in GMS 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
  • Method Details

    • getNewMembership

      List<Address> getNewMembership(Collection<Address> current_members, Collection<Address> joiners, Collection<Address> leavers, 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

      List<Address> getNewMembership(Collection<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