Package io.atomix.cluster.protocol
Interface GroupMembershipProtocol
- All Superinterfaces:
io.atomix.utils.config.Configured<GroupMembershipProtocolConfig>,io.atomix.utils.event.ListenerService<GroupMembershipEvent,GroupMembershipEventListener>
- All Known Implementing Classes:
HeartbeatMembershipProtocol,SwimMembershipProtocol
public interface GroupMembershipProtocol extends io.atomix.utils.event.ListenerService<GroupMembershipEvent,GroupMembershipEventListener>, io.atomix.utils.config.Configured<GroupMembershipProtocolConfig>
Group membership protocol.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceGroupMembershipProtocol.Type<C extends GroupMembershipProtocolConfig>Group membership protocol type. -
Method Summary
Modifier and Type Method Description MembergetMember(MemberId memberId)Returns the specified member.Set<Member>getMembers()Returns the set of current cluster members.CompletableFuture<Void>join(BootstrapService bootstrap, NodeDiscoveryService discovery, Member localMember)Joins the cluster.CompletableFuture<Void>leave(Member localMember)Leaves the cluster.
-
Method Details
-
getMembers
Returns the set of current cluster members.- Returns:
- set of cluster members
-
getMember
Returns the specified member.- Parameters:
memberId- the member identifier- Returns:
- the member or
nullif no node with the given identifier exists
-
join
CompletableFuture<Void> join(BootstrapService bootstrap, NodeDiscoveryService discovery, Member localMember)Joins the cluster.- Parameters:
bootstrap- the bootstrap servicediscovery- the discovery servicelocalMember- the local member info- Returns:
- a future to be completed once the join is complete
-
leave
Leaves the cluster.- Parameters:
localMember- the local member info- Returns:
- a future to be completed once the leave is complete
-