- 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 SplitBrainProtectionFunctionA 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
HeartbeatAwarewill be also notified of heartbeats. Additionally, a
MembershipListenerwill be notified of membership events. All listener invocations are executed before the
apply(Collection)method is invoked.
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.
members- snapshot of current member list
- boolean whether the minimum cluster size property is satisfied