Package org.elasticsearch.gateway
Class MetaStateService
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.gateway.MetaStateService
-
public class MetaStateService extends AbstractComponent
Handles writing and loading bothMetaData
andIndexMetaData
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
deprecationLogger, logger, settings
-
-
Constructor Summary
Constructors Constructor Description MetaStateService(Settings settings, NodeEnvironment nodeEnv, NamedXContentRegistry namedXContentRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexMetaData
loadIndexState(Index index)
Loads the index state for the provided index name, returning null if doesn't exists.void
writeIndex(java.lang.String reason, IndexMetaData indexMetaData)
Writes the index state.-
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
nodeName
-
-
-
-
Constructor Detail
-
MetaStateService
public MetaStateService(Settings settings, NodeEnvironment nodeEnv, NamedXContentRegistry namedXContentRegistry)
-
-
Method Detail
-
loadIndexState
@Nullable public IndexMetaData loadIndexState(Index index) throws java.io.IOException
Loads the index state for the provided index name, returning null if doesn't exists.- Throws:
java.io.IOException
-
writeIndex
public void writeIndex(java.lang.String reason, IndexMetaData indexMetaData) throws java.io.IOException
Writes the index state. This method is public for testing purposes.- Throws:
java.io.IOException
-
-