Package org.elasticsearch.gateway
Class MetaStateWriterUtils
java.lang.Object
org.elasticsearch.gateway.MetaStateWriterUtils
Maintains the method of writing cluster states to disk for versions prior to
Version.V_7_6_0, preserved to test the classes that
read this state during an upgrade from these older versions.-
Method Summary
Modifier and TypeMethodDescriptionstatic longwriteIndex(NodeEnvironment nodeEnv, String reason, IndexMetadata indexMetadata) Writes the index state.static voidwriteManifestAndCleanup(NodeEnvironment nodeEnv, String reason, Manifest manifest) Writes manifest file (represented byManifest) to disk and performs cleanup of old manifest state file if the write succeeds or newly created manifest state if the write fails.
-
Method Details
-
writeManifestAndCleanup
public static void writeManifestAndCleanup(NodeEnvironment nodeEnv, String reason, Manifest manifest) throws WriteStateException Writes manifest file (represented byManifest) to disk and performs cleanup of old manifest state file if the write succeeds or newly created manifest state if the write fails.- Throws:
WriteStateException- if exception when writing state occurs. See alsoWriteStateException.isDirty()
-
writeIndex
public static long writeIndex(NodeEnvironment nodeEnv, String reason, IndexMetadata indexMetadata) throws WriteStateException Writes the index state.This method is public for testing purposes.
- Throws:
WriteStateException- if exception when writing state occurs.WriteStateException.isDirty()will always return false, because new index state file is not yet referenced by manifest file.
-