Class LargestWinningPolicy

  • All Implemented Interfaces:
    MembershipChangePolicy

    public class LargestWinningPolicy
    extends GMS.DefaultMembershipPolicy
    Policy which picks the new coordinator in a merge from the largest subview. JIRA: https://issues.redhat.com/browse/JGRP-1976
    Since:
    3.6.7
    Author:
    Osamu Nagano
    • Constructor Detail

      • LargestWinningPolicy

        public LargestWinningPolicy()
    • Method Detail

      • getNewMembership

        public java.util.List<Address> getNewMembership​(java.util.Collection<java.util.Collection<Address>> subviews)
        Called when a merge happened. The largest subview wins.
        Specified by:
        getNewMembership in interface MembershipChangePolicy
        Overrides:
        getNewMembership in class GMS.DefaultMembershipPolicy
        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. Needs to be non-null and cannot contain duplicates