ClusterStateApplier
public class GatewayMetaState extends AbstractComponent implements ClusterStateApplier
Modifier and Type | Class | Description |
---|---|---|
static class |
GatewayMetaState.IndexMetaWriteInfo |
deprecationLogger, logger, settings
Constructor | Description |
---|---|
GatewayMetaState(Settings settings,
NodeEnvironment nodeEnv,
MetaStateService metaStateService,
MetaDataIndexUpgradeService metaDataIndexUpgradeService,
MetaDataUpgrader metaDataUpgrader) |
Modifier and Type | Method | Description |
---|---|---|
void |
applyClusterState(ClusterChangedEvent event) |
Called when a new cluster state (
ClusterChangedEvent.state() needs to be applied |
static java.util.Set<Index> |
getRelevantIndices(ClusterState state,
ClusterState previousState,
java.util.Set<Index> previouslyWrittenIndices) |
|
static java.util.Set<Index> |
getRelevantIndicesForMasterEligibleNode(ClusterState state) |
|
static java.util.Set<Index> |
getRelevantIndicesOnDataOnlyNode(ClusterState state,
ClusterState previousState,
java.util.Set<Index> previouslyWrittenIndices) |
|
protected static boolean |
isDataOnlyNode(ClusterState state) |
|
MetaData |
loadMetaState() |
|
static java.lang.Iterable<GatewayMetaState.IndexMetaWriteInfo> |
resolveStatesToBeWritten(java.util.Set<Index> previouslyWrittenIndices,
java.util.Set<Index> potentiallyUnwrittenIndices,
MetaData previousMetaData,
MetaData newMetaData) |
Loads the current meta state for each index in the new cluster state and checks if it has to be persisted.
|
logDeprecatedSetting, logRemovedSetting, nodeName
public GatewayMetaState(Settings settings, NodeEnvironment nodeEnv, MetaStateService metaStateService, MetaDataIndexUpgradeService metaDataIndexUpgradeService, MetaDataUpgrader metaDataUpgrader) throws java.io.IOException
java.io.IOException
public MetaData loadMetaState() throws java.io.IOException
java.io.IOException
public void applyClusterState(ClusterChangedEvent event)
ClusterStateApplier
ClusterChangedEvent.state()
needs to be appliedapplyClusterState
in interface ClusterStateApplier
public static java.util.Set<Index> getRelevantIndices(ClusterState state, ClusterState previousState, java.util.Set<Index> previouslyWrittenIndices)
protected static boolean isDataOnlyNode(ClusterState state)
public static java.lang.Iterable<GatewayMetaState.IndexMetaWriteInfo> resolveStatesToBeWritten(java.util.Set<Index> previouslyWrittenIndices, java.util.Set<Index> potentiallyUnwrittenIndices, MetaData previousMetaData, MetaData newMetaData)
previouslyWrittenIndices
- A list of indices for which the state was already written beforepotentiallyUnwrittenIndices
- The list of indices for which state should potentially be writtenpreviousMetaData
- The last meta data we know of. meta data for all indices in previouslyWrittenIndices list is persisted nownewMetaData
- The new metadatapublic static java.util.Set<Index> getRelevantIndicesOnDataOnlyNode(ClusterState state, ClusterState previousState, java.util.Set<Index> previouslyWrittenIndices)
public static java.util.Set<Index> getRelevantIndicesForMasterEligibleNode(ClusterState state)