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 |
deprecationLogger, logger, settings
Constructor and Description |
---|
NodeJoinController(ClusterService clusterService,
AllocationService allocationService,
ElectMasterService electMaster,
Settings settings) |
Modifier and Type | Method and Description |
---|---|
void |
handleJoinRequest(DiscoveryNode node,
MembershipAction.JoinCallback callback)
processes or queues an incoming join request.
|
void |
startElectionContext()
Accumulates any future incoming join request.
|
void |
stopElectionContext(java.lang.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
public NodeJoinController(ClusterService clusterService, AllocationService allocationService, ElectMasterService electMaster, Settings settings)
public void waitToBeElectedAsMaster(int requiredMasterJoins, TimeValue timeValue, NodeJoinController.ElectionCallback callback)
You must start accumulating joins before calling this method. See startElectionContext()
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 startElectionContext()
stopElectionContext(String)
is called.public void stopElectionContext(java.lang.String reason)
public void handleJoinRequest(DiscoveryNode node, MembershipAction.JoinCallback callback)
Note: doesn't do any validation. This should have been done before.