public class BootstrapDiscoveryProvider extends 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(java.util.Collection<Node> bootstrapNodes) |
BootstrapDiscoveryProvider(Node... bootstrapNodes) |
| Modifier and Type | Method and Description |
|---|---|
static BootstrapDiscoveryBuilder |
builder()
Creates a new bootstrap provider builder.
|
BootstrapDiscoveryConfig |
config() |
java.util.Set<Node> |
getNodes()
Returns the set of active nodes.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
join(BootstrapService bootstrap,
Node localNode)
Joins the cluster.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
leave(Node localNode)
Leaves the cluster.
|
addListener, removeListenerequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, removeListenerpublic static final BootstrapDiscoveryProvider.Type TYPE
public BootstrapDiscoveryProvider(Node... bootstrapNodes)
public BootstrapDiscoveryProvider(java.util.Collection<Node> bootstrapNodes)
public static BootstrapDiscoveryBuilder builder()
public BootstrapDiscoveryConfig config()
config in interface Configured<NodeDiscoveryConfig>public java.util.Set<Node> getNodes()
NodeDiscoveryProvidergetNodes in interface NodeDiscoveryProviderpublic java.util.concurrent.CompletableFuture<java.lang.Void> join(BootstrapService bootstrap, Node localNode)
NodeDiscoveryProviderjoin in interface NodeDiscoveryProviderbootstrap - the bootstrap servicelocalNode - the local node infopublic java.util.concurrent.CompletableFuture<java.lang.Void> leave(Node localNode)
NodeDiscoveryProviderleave in interface NodeDiscoveryProviderlocalNode - the local node infoCopyright © 2013-2019. All Rights Reserved.