public class NodeJoinController extends AbstractComponent
ZenDiscovery
). Incoming nodes
are directly added to the cluster state or are accumulated during master election.Modifier and Type | Class and Description |
---|---|
static interface |
NodeJoinController.ElectionCallback |
Modifier and Type | Field and Description |
---|---|
protected Map<DiscoveryNode,List<MembershipAction.JoinCallback>> |
pendingJoinRequests |
deprecationLogger, logger, settings
Constructor and Description |
---|
NodeJoinController(ClusterService clusterService,
RoutingService routingService,
DiscoverySettings discoverySettings,
Settings settings) |
Modifier and Type | Method and Description |
---|---|
void |
handleJoinRequest(DiscoveryNode node,
MembershipAction.JoinCallback callback)
processes or queues an incoming join request.
|
void |
startAccumulatingJoins()
Accumulates any future incoming join request.
|
void |
stopAccumulatingJoins(String reason)
Stopped accumulating joins.
|
void |
waitToBeElectedAsMaster(int requiredMasterJoins,
TimeValue timeValue,
NodeJoinController.ElectionCallback callback)
waits for enough incoming joins from master eligible nodes to complete the master election
|
logDeprecatedSetting, logRemovedSetting, nodeName
protected final Map<DiscoveryNode,List<MembershipAction.JoinCallback>> pendingJoinRequests
public NodeJoinController(ClusterService clusterService, RoutingService routingService, DiscoverySettings discoverySettings, Settings settings)
public void waitToBeElectedAsMaster(int requiredMasterJoins, TimeValue timeValue, NodeJoinController.ElectionCallback callback)
You must start accumulating joins before calling this method. See startAccumulatingJoins()
The method will return once the local node has been elected as master or some failure/timeout has happened. The exact outcome is communicated via the callback parameter, which is guaranteed to be called.
requiredMasterJoins
- the number of joins from master eligible needed to complete the electiontimeValue
- how long to wait before failing. a timeout is communicated via the callback's onFailure method.callback
- the result of the election (success or failure) will be communicated by calling methods on this
objectpublic void startAccumulatingJoins()
stopAccumulatingJoins(String)
is called.public void stopAccumulatingJoins(String reason)
public void handleJoinRequest(DiscoveryNode node, MembershipAction.JoinCallback callback)
Note: doesn't do any validation. This should have been done before.
Copyright © 2009–2017. All rights reserved.