Class MetaStateWriterUtils

java.lang.Object
org.elasticsearch.gateway.MetaStateWriterUtils

public class MetaStateWriterUtils extends Object
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 Type
    Method
    Description
    static long
    writeIndex(org.elasticsearch.env.NodeEnvironment nodeEnv, String reason, org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata)
    Writes the index state.
    static void
    writeManifestAndCleanup(org.elasticsearch.env.NodeEnvironment nodeEnv, String reason, org.elasticsearch.cluster.metadata.Manifest manifest)
    Writes manifest file (represented by Manifest) to disk and performs cleanup of old manifest state file if the write succeeds or newly created manifest state if the write fails.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • writeManifestAndCleanup

      public static void writeManifestAndCleanup(org.elasticsearch.env.NodeEnvironment nodeEnv, String reason, org.elasticsearch.cluster.metadata.Manifest manifest) throws org.elasticsearch.gateway.WriteStateException
      Writes manifest file (represented by Manifest) to disk and performs cleanup of old manifest state file if the write succeeds or newly created manifest state if the write fails.
      Throws:
      org.elasticsearch.gateway.WriteStateException - if exception when writing state occurs. See also WriteStateException.isDirty()
    • writeIndex

      public static long writeIndex(org.elasticsearch.env.NodeEnvironment nodeEnv, String reason, org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata) throws org.elasticsearch.gateway.WriteStateException
      Writes the index state.

      This method is public for testing purposes.

      Throws:
      org.elasticsearch.gateway.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.