public class GatewayMetaState extends AbstractComponent implements ClusterStateListener
Modifier and Type | Class and Description |
---|---|
static class |
GatewayMetaState.IndexMetaWriteInfo |
deprecationLogger, logger, settings
Constructor and Description |
---|
GatewayMetaState(Settings settings,
NodeEnvironment nodeEnv,
MetaStateService metaStateService,
DanglingIndicesState danglingIndicesState,
TransportNodesListGatewayMetaState nodesListGatewayMetaState,
MetaDataIndexUpgradeService metaDataIndexUpgradeService,
MetaDataUpgrader metaDataUpgrader) |
Modifier and Type | Method and Description |
---|---|
void |
clusterChanged(ClusterChangedEvent event)
Called when cluster state changes.
|
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
@Inject public GatewayMetaState(Settings settings, NodeEnvironment nodeEnv, MetaStateService metaStateService, DanglingIndicesState danglingIndicesState, TransportNodesListGatewayMetaState nodesListGatewayMetaState, MetaDataIndexUpgradeService metaDataIndexUpgradeService, MetaDataUpgrader metaDataUpgrader) throws java.lang.Exception
java.lang.Exception
public MetaData loadMetaState() throws java.lang.Exception
java.lang.Exception
public void clusterChanged(ClusterChangedEvent event)
ClusterStateListener
clusterChanged
in interface ClusterStateListener
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)