Class NodesShutdownMetadata

java.lang.Object
org.elasticsearch.cluster.metadata.NodesShutdownMetadata
All Implemented Interfaces:
ClusterState.FeatureAware, Diffable<Metadata.Custom>, Metadata.Custom, NamedDiffable<Metadata.Custom>, NamedWriteable, VersionedNamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class NodesShutdownMetadata
extends java.lang.Object
implements Metadata.Custom
Contains the data about nodes which are currently configured to shut down, either permanently or temporarily. Stored in the cluster state as custom metadata.
  • Field Details

    • TYPE

      public static final java.lang.String TYPE
      See Also:
      Constant Field Values
    • NODE_SHUTDOWN_VERSION

      public static final Version NODE_SHUTDOWN_VERSION
    • PARSER

      public static final org.elasticsearch.common.xcontent.ConstructingObjectParser<NodesShutdownMetadata,​java.lang.Void> PARSER
  • Constructor Details

    • NodesShutdownMetadata

      public NodesShutdownMetadata​(java.util.Map<java.lang.String,​SingleNodeShutdownMetadata> nodes)
    • NodesShutdownMetadata

      public NodesShutdownMetadata​(StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
  • Method Details

    • fromXContent

      public static NodesShutdownMetadata fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)
    • readDiffFrom

      public static NamedDiff<Metadata.Custom> readDiffFrom​(StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      java.io.IOException
    • getAllNodeMetdataMap

      public java.util.Map<java.lang.String,​SingleNodeShutdownMetadata> getAllNodeMetdataMap()
      Returns:
      A map of NodeID to shutdown metadata.
    • putSingleNodeMetadata

      public NodesShutdownMetadata putSingleNodeMetadata​(SingleNodeShutdownMetadata nodeShutdownMetadata)
      Add or update the shutdown metadata for a single node.
      Parameters:
      nodeShutdownMetadata - The single node shutdown metadata to add or update.
      Returns:
      A new NodesShutdownMetadata that reflects the updated value.
    • removeSingleNodeMetadata

      public NodesShutdownMetadata removeSingleNodeMetadata​(java.lang.String nodeId)
      Removes all shutdown metadata for a particular node ID.
      Parameters:
      nodeId - The node ID to remove shutdown metadata for.
      Returns:
      A new NodesShutdownMetadata that does not contain shutdown metadata for the given node.
    • diff

      public Diff<Metadata.Custom> diff​(Metadata.Custom previousState)
      Description copied from interface: Diffable
      Returns serializable object representing differences between this and previousState
      Specified by:
      diff in interface Diffable<Metadata.Custom>
    • context

      public java.util.EnumSet<Metadata.XContentContext> context()
      Specified by:
      context in interface Metadata.Custom
    • getWriteableName

      public java.lang.String getWriteableName()
      Description copied from interface: VersionedNamedWriteable
      Returns the name of the writeable object
      Specified by:
      getWriteableName in interface NamedWriteable
      Specified by:
      getWriteableName in interface VersionedNamedWriteable
    • getMinimalSupportedVersion

      public Version getMinimalSupportedVersion()
      Description copied from interface: VersionedNamedWriteable
      The minimal version of the recipient this object can be sent to
      Specified by:
      getMinimalSupportedVersion in interface VersionedNamedWriteable
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      java.io.IOException