Class NodeMetadata

java.lang.Object
org.elasticsearch.env.NodeMetadata

public final class NodeMetadata extends Object
Metadata associated with this node: its persistent node ID and its version. The metadata is persisted in the data folder of this node and is reused across restarts.
  • Field Details

  • Constructor Details

    • NodeMetadata

      public NodeMetadata(String nodeId, Version nodeVersion, Version oldestIndexVersion)
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • nodeId

      public String nodeId()
    • nodeVersion

      public Version nodeVersion()
    • previousNodeVersion

      public Version previousNodeVersion()
      When a node starts we read the existing node metadata from disk (see NodeEnvironment@loadNodeMetadata), store a reference to the node version that we read from there in previousNodeVersion and then proceed to upgrade the version to the current version of the node (upgradeToCurrentVersion() before storing the node metadata again on disk. In doing so, previousNodeVersion refers to the previously last known version that this node was started on.
    • oldestIndexVersion

      public Version oldestIndexVersion()
    • verifyUpgradeToCurrentVersion

      public void verifyUpgradeToCurrentVersion()
    • upgradeToCurrentVersion

      public NodeMetadata upgradeToCurrentVersion()