Record Class Manifest

java.lang.Object
java.lang.Record
org.elasticsearch.cluster.metadata.Manifest
All Implemented Interfaces:
org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentFragment

public record Manifest(long currentTerm, long clusterStateVersion, long globalGeneration, Map<Index,Long> indexGenerations) extends Record implements org.elasticsearch.xcontent.ToXContentFragment
This class represents the manifest file, which is the entry point for reading meta data from disk. Metadata consists of global metadata and index metadata. When new version of metadata is written it's assigned some generation long value. Global metadata generation could be obtained by calling globalGeneration(). Index metadata generation could be obtained by calling indexGenerations().
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent

    org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     

    Fields inherited from interface org.elasticsearch.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Manifest(long currentTerm, long clusterStateVersion, long globalGeneration, Map<Index,Long> indexGenerations)
    Creates an instance of a Manifest record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the clusterStateVersion record component.
    long
    Returns the value of the currentTerm record component.
    static Manifest
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    static Manifest
    fromXContent(org.elasticsearch.xcontent.XContentParser parser)
     
    long
    Returns the value of the globalGeneration record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the indexGenerations record component.
    boolean
     
    boolean
     
    final String
    Returns a string representation of this record class.
    org.elasticsearch.xcontent.XContentBuilder
    toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params)
     
    static Manifest
    unknownCurrentTermAndVersion(long globalGeneration, Map<Index,Long> indexGenerations)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment

    isFragment
  • Field Details

  • Constructor Details

    • Manifest

      public Manifest(long currentTerm, long clusterStateVersion, long globalGeneration, Map<Index,Long> indexGenerations)
      Creates an instance of a Manifest record class.
      Parameters:
      currentTerm - the value for the currentTerm record component
      clusterStateVersion - the value for the clusterStateVersion record component
      globalGeneration - the value for the globalGeneration record component
      indexGenerations - the value for the indexGenerations record component
  • Method Details

    • unknownCurrentTermAndVersion

      public static Manifest unknownCurrentTermAndVersion(long globalGeneration, Map<Index,Long> indexGenerations)
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • fromXContent

      public static Manifest fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • isEmpty

      public boolean isEmpty()
    • empty

      public static Manifest empty()
    • isGlobalGenerationMissing

      public boolean isGlobalGenerationMissing()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • currentTerm

      public long currentTerm()
      Returns the value of the currentTerm record component.
      Returns:
      the value of the currentTerm record component
    • clusterStateVersion

      public long clusterStateVersion()
      Returns the value of the clusterStateVersion record component.
      Returns:
      the value of the clusterStateVersion record component
    • globalGeneration

      public long globalGeneration()
      Returns the value of the globalGeneration record component.
      Returns:
      the value of the globalGeneration record component
    • indexGenerations

      public Map<Index,Long> indexGenerations()
      Returns the value of the indexGenerations record component.
      Returns:
      the value of the indexGenerations record component