Package org.elasticsearch.gateway
Class GatewayMetaState
org.elasticsearch.gateway.GatewayMetaState
- All Implemented Interfaces:
,
public class GatewayMetaState
extends
implements
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.-
Field Summary
Modifier and TypeFieldDescriptionstatic
Fake node ID for a voting configuration written by a master-ineligible data node to indicate that its on-disk state is potentially stale (since it is written asynchronously after application, rather than before acceptance). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
close()
void
start(Settings settings, TransportService transportService, ClusterService clusterService, MetaStateService metaStateService, IndexMetadataVerifier indexMetadataVerifier, MetadataUpgrader metadataUpgrader, PersistedClusterStateService persistedClusterStateService)
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
STALE_STATE_CONFIG_NODE_ID
public static final STALE_STATE_CONFIG_NODE_IDFake node ID for a voting configuration written by a master-ineligible data node to indicate that its on-disk state is potentially stale (since it is written asynchronously after application, rather than before acceptance). This node ID means that if the node is restarted as a master-eligible node then it does not win any elections until it has received a fresh cluster state.- See Also:
- Constant Field Values
-
-
Constructor Details
-
GatewayMetaState
public GatewayMetaState()
-
-
Method Details
-
getPersistedState
-
getMetadata
-
start
public void start(Settings settings, TransportService transportService, ClusterService clusterService, MetaStateService metaStateService, IndexMetadataVerifier indexMetadataVerifier, MetadataUpgrader metadataUpgrader, PersistedClusterStateService persistedClusterStateService) -
close
public void close() throws- Specified by:
in interface
- Specified by:
in interface
- Throws:
-
allPendingAsyncStatesWritten
public boolean allPendingAsyncStatesWritten()
-