public class BootstrapDiscoveryProvider extends io.atomix.utils.event.AbstractListenerManager<NodeDiscoveryEvent,NodeDiscoveryEventListener> implements NodeDiscoveryProvider
The bootstrap member provider takes a set of peer addresses and uses them
to join the cluster. Using the MessagingService, each node sends a heartbeat to
its configured bootstrap peers. Peers respond to each heartbeat message with a list of all known peers, thus
propagating membership information using a gossip style protocol.
A phi accrual failure detector is used to detect failures and remove peers from the configuration. In order to avoid
flapping of membership following a ClusterMembershipEvent.Type#MEMBER_ADDED event, the implementation attempts
to heartbeat all newly discovered peers before triggering a ClusterMembershipEvent.Type#MEMBER_REMOVED event.
| Modifier and Type | Class and Description |
|---|---|
static class |
BootstrapDiscoveryProvider.Type
Bootstrap member location provider type.
|
| Modifier and Type | Field and Description |
|---|---|
static BootstrapDiscoveryProvider.Type |
TYPE |
| Constructor and Description |
|---|
BootstrapDiscoveryProvider(Collection<Node> bootstrapNodes) |
BootstrapDiscoveryProvider(Node... bootstrapNodes) |
| Modifier and Type | Method and Description |
|---|---|
static BootstrapDiscoveryBuilder |
builder()
Creates a new bootstrap provider builder.
|
BootstrapDiscoveryConfig |
config() |
Set<Node> |
getNodes()
Returns the set of active nodes.
|
CompletableFuture<Void> |
join(BootstrapService bootstrap,
Node localNode)
Joins the cluster.
|
CompletableFuture<Void> |
leave(Node localNode)
Leaves the cluster.
|
addListener, removeListenerpublic static final BootstrapDiscoveryProvider.Type TYPE
public BootstrapDiscoveryProvider(Node... bootstrapNodes)
public BootstrapDiscoveryProvider(Collection<Node> bootstrapNodes)
public static BootstrapDiscoveryBuilder builder()
public BootstrapDiscoveryConfig config()
config in interface io.atomix.utils.config.Configured<NodeDiscoveryConfig>public Set<Node> getNodes()
NodeDiscoveryProvidergetNodes in interface NodeDiscoveryProviderpublic CompletableFuture<Void> join(BootstrapService bootstrap, Node localNode)
NodeDiscoveryProviderjoin in interface NodeDiscoveryProviderbootstrap - the bootstrap servicelocalNode - the local node infopublic CompletableFuture<Void> leave(Node localNode)
NodeDiscoveryProviderleave in interface NodeDiscoveryProviderlocalNode - the local node infoCopyright © 2013–2018. All rights reserved.