Class SingleNodeDiscovery
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.common.component.AbstractLifecycleComponent
-
- org.elasticsearch.discovery.single.SingleNodeDiscovery
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,LifecycleComponent,Releasable,Discovery
public class SingleNodeDiscovery extends AbstractLifecycleComponent implements Discovery
A discovery implementation where the only member of the cluster is the local node.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.discovery.Discovery
Discovery.AckListener, Discovery.FailedToCommitClusterStateException
-
-
Field Summary
Fields Modifier and Type Field Description protected TransportServicetransportService-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
deprecationLogger, logger, settings
-
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle
-
-
Constructor Summary
Constructors Constructor Description SingleNodeDiscovery(Settings settings, TransportService transportService, MasterService masterService, ClusterApplier clusterApplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClusterStatecreateInitialState(DiscoveryNode localNode)protected voiddoClose()protected voiddoStart()protected voiddoStop()voidpublish(ClusterChangedEvent event, Discovery.AckListener ackListener)Publish all the changes to the cluster from the master (can be called just by the master).voidstartInitialJoin()Triggers the first join cycleDiscoveryStatsstats()-
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
logDeprecatedSetting, logRemovedSetting, nodeName
-
Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
-
Methods inherited from interface org.elasticsearch.common.component.LifecycleComponent
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.lease.Releasable
close
-
-
-
-
Field Detail
-
transportService
protected final TransportService transportService
-
-
Constructor Detail
-
SingleNodeDiscovery
public SingleNodeDiscovery(Settings settings, TransportService transportService, MasterService masterService, ClusterApplier clusterApplier)
-
-
Method Detail
-
publish
public void publish(ClusterChangedEvent event, Discovery.AckListener ackListener)
Description copied from interface:DiscoveryPublish all the changes to the cluster from the master (can be called just by the master). The publish process should apply this state to the master as well! TheDiscovery.AckListenerallows to keep track of the ack received from nodes, and verify whether they updated their own cluster state or not. The method is guaranteed to throw aDiscovery.FailedToCommitClusterStateExceptionif the change is not committed and should be rejected. Any other exception signals the something wrong happened but the change is committed.
-
stats
public DiscoveryStats stats()
-
startInitialJoin
public void startInitialJoin()
Description copied from interface:DiscoveryTriggers the first join cycle- Specified by:
startInitialJoinin interfaceDiscovery
-
doStart
protected void doStart()
- Specified by:
doStartin classAbstractLifecycleComponent
-
createInitialState
protected ClusterState createInitialState(DiscoveryNode localNode)
-
doStop
protected void doStop()
- Specified by:
doStopin classAbstractLifecycleComponent
-
doClose
protected void doClose() throws java.io.IOException- Specified by:
doClosein classAbstractLifecycleComponent- Throws:
java.io.IOException
-
-