Package org.elasticsearch.gateway
Class GatewayMetaState
java.lang.Object
org.elasticsearch.gateway.GatewayMetaState
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class GatewayMetaState
extends java.lang.Object
implements java.io.Closeable
Loads (and maybe upgrades) cluster metadata at startup, and persistently stores cluster metadata for future restarts.
When started, ensures that this version is compatible with the state stored on disk, and performs a state upgrade if necessary. Note that
the state being loaded when constructing the instance of this class is not necessarily the state that will be used as
ClusterState.metaData()
because it might be stale or incomplete. Master-eligible nodes must perform an election to find a complete and
non-stale state, and master-ineligible nodes receive the real cluster state from the elected master after joining the cluster.-
Constructor Summary
Constructors Constructor Description GatewayMetaState()
-
Method Summary
Modifier and Type Method Description boolean
allPendingAsyncStatesWritten()
void
close()
MetaData
getMetaData()
CoordinationState.PersistedState
getPersistedState()
void
start(Settings settings, TransportService transportService, ClusterService clusterService, MetaStateService metaStateService, MetaDataIndexUpgradeService metaDataIndexUpgradeService, MetaDataUpgrader metaDataUpgrader, PersistedClusterStateService persistedClusterStateService)
-
Constructor Details
-
GatewayMetaState
public GatewayMetaState()
-
-
Method Details
-
getPersistedState
-
getMetaData
-
start
public void start(Settings settings, TransportService transportService, ClusterService clusterService, MetaStateService metaStateService, MetaDataIndexUpgradeService metaDataIndexUpgradeService, MetaDataUpgrader metaDataUpgrader, PersistedClusterStateService persistedClusterStateService) -
close
public void close() throws java.io.IOException- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
allPendingAsyncStatesWritten
public boolean allPendingAsyncStatesWritten()
-