Package io.atomix.cluster.impl
Class DiscoveryMembershipProtocol
java.lang.Object
io.atomix.utils.event.AbstractListenerManager<GroupMembershipEvent,GroupMembershipEventListener>
io.atomix.cluster.impl.DiscoveryMembershipProtocol
- All Implemented Interfaces:
NodeDiscoveryEventListener,GroupMembershipProtocol,Configured<GroupMembershipProtocolConfig>,EventFilter<NodeDiscoveryEvent>,EventListener<NodeDiscoveryEvent>,ListenerService<GroupMembershipEvent,GroupMembershipEventListener>
public final class DiscoveryMembershipProtocol
extends AbstractListenerManager<GroupMembershipEvent,GroupMembershipEventListener>
implements GroupMembershipProtocol, NodeDiscoveryEventListener
A
GroupMembershipProtocol implementation which uses the node discovery service to add and
remove new members. Members can be either initially provided as is, or will be added/removed as
nodes are added/removed in the associated NodeDiscoveryService passed during join(BootstrapService, NodeDiscoveryService, Member).-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.atomix.utils.event.AbstractListenerManager
listenerRegistry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfig()voidevent(NodeDiscoveryEvent event) Returns the specified member.Returns the set of current cluster members.join(BootstrapService bootstrap, NodeDiscoveryService discovery, Member localMember) Joins the cluster.Leaves the cluster.Methods inherited from class io.atomix.utils.event.AbstractListenerManager
addListener, post, 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.EventFilter
isRelevantMethods inherited from interface io.atomix.utils.event.ListenerService
addListener, removeListener
-
Constructor Details
-
DiscoveryMembershipProtocol
public DiscoveryMembershipProtocol() -
DiscoveryMembershipProtocol
-
DiscoveryMembershipProtocol
-
-
Method Details
-
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 localMember) Description copied from interface:GroupMembershipProtocolJoins the cluster.- Specified by:
joinin interfaceGroupMembershipProtocol- Parameters:
bootstrap- the bootstrap servicediscovery- the discovery servicelocalMember- 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:
localMember- the local member info- Returns:
- a future to be completed once the leave is complete
-
event
- Specified by:
eventin interfaceEventListener<NodeDiscoveryEvent>
-
config
- Specified by:
configin interfaceConfigured<GroupMembershipProtocolConfig>
-