Package io.atomix.cluster.protocol
Class SwimMembershipProtocol
java.lang.Object
io.atomix.utils.event.AbstractListenerManager<GroupMembershipEvent,GroupMembershipEventListener>
io.atomix.cluster.protocol.SwimMembershipProtocol
- All Implemented Interfaces:
GroupMembershipProtocol,Configured<GroupMembershipProtocolConfig>,ListenerService<GroupMembershipEvent,GroupMembershipEventListener>
public class SwimMembershipProtocol
extends AbstractListenerManager<GroupMembershipEvent,GroupMembershipEventListener>
implements GroupMembershipProtocol
SWIM group membership protocol implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBootstrap member location provider type. -
Field Summary
FieldsFields inherited from class io.atomix.utils.event.AbstractListenerManager
listenerRegistry -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new bootstrap provider builder.config()Returns the specified member.Returns the set of current cluster members.join(BootstrapService bootstrap, NodeDiscoveryService discovery, Member member) Joins the cluster.Leaves the cluster.protected voidpost(GroupMembershipEvent event) Methods inherited from class io.atomix.utils.event.AbstractListenerManager
addListener, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.atomix.utils.event.ListenerService
addListener, removeListener
-
Field Details
-
TYPE
-
-
Method Details
-
builder
Creates a new bootstrap provider builder.- Returns:
- a new bootstrap provider builder
-
config
- Specified by:
configin interfaceConfigured<GroupMembershipProtocolConfig>
-
getMembers
Description copied from interface:GroupMembershipProtocolReturns the set of current cluster members.- Specified by:
getMembersin interfaceGroupMembershipProtocol- Returns:
- set of cluster members
-
getMember
Description copied from interface:GroupMembershipProtocolReturns the specified member.- Specified by:
getMemberin interfaceGroupMembershipProtocol- Parameters:
memberId- the member identifier- Returns:
- the member or
nullif no node with the given identifier exists
-
join
public CompletableFuture<Void> join(BootstrapService bootstrap, NodeDiscoveryService discovery, Member member) Description copied from interface:GroupMembershipProtocolJoins the cluster.- Specified by:
joinin interfaceGroupMembershipProtocol- Parameters:
bootstrap- the bootstrap servicediscovery- the discovery servicemember- the local member info- Returns:
- a future to be completed once the join is complete
-
leave
Description copied from interface:GroupMembershipProtocolLeaves the cluster.- Specified by:
leavein interfaceGroupMembershipProtocol- Parameters:
member- the local member info- Returns:
- a future to be completed once the leave is complete
-
post
- Overrides:
postin classAbstractListenerManager<GroupMembershipEvent,GroupMembershipEventListener>
-