Interface SplitBrainProtectionFunction

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface SplitBrainProtectionFunction
    A function that can be used to conclude whether the minimum cluster size property is satisfied? The split brain protection function is consulted:
    • When a cluster membership change occurs (member added or removed)
    • Whenever a hearbeat is received from a member, in case the SplitBrainProtectionFunction also implements HeartbeatAware
    A SplitBrainProtectionFunction that implements HeartbeatAware will be also notified of heartbeats. Additionally, a SplitBrainProtectionFunction that implements MembershipListener will be notified of membership events. All listener invocations are executed before the SplitBrainProtectionFunction's apply(Collection) method is invoked.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean apply​(java.util.Collection<Member> members)
      Determines whether the minimum cluster size property is satisfied based on the current list of members in the cluster.
    • Method Detail

      • apply

        boolean apply​(java.util.Collection<Member> members)
        Determines whether the minimum cluster size property is satisfied based on the current list of members in the cluster. Lite members are excluded and only data members are provided to this method.
        This method should not block nor execute time-consuming operations, otherwise it may stall other split brain protection function invocations.
        Parameters:
        members - snapshot of current member list
        Returns:
        boolean whether the minimum cluster size property is satisfied