java.lang.Object
java.lang.Record
org.elasticsearch.cluster.metadata.Manifest
- All Implemented Interfaces:
ToXContent,ToXContentFragment
public record Manifest(long currentTerm, long clusterStateVersion, long globalGeneration, Map<Index,Long> indexGenerations)
extends Record
implements 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
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theclusterStateVersionrecord component.longReturns the value of thecurrentTermrecord component.static Manifestempty()final booleanIndicates whether some other object is "equal to" this one.static ManifestfromXContent(XContentParser parser) longReturns the value of theglobalGenerationrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theindexGenerationsrecord component.booleanisEmpty()booleanfinal StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) static ManifestunknownCurrentTermAndVersion(long globalGeneration, Map<Index, Long> indexGenerations) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
FORMAT
-
-
Constructor Details
-
Manifest
public Manifest(long currentTerm, long clusterStateVersion, long globalGeneration, Map<Index, Long> indexGenerations) Creates an instance of aManifestrecord class.- Parameters:
currentTerm- the value for thecurrentTermrecord componentclusterStateVersion- the value for theclusterStateVersionrecord componentglobalGeneration- the value for theglobalGenerationrecord componentindexGenerations- the value for theindexGenerationsrecord component
-
-
Method Details
-
unknownCurrentTermAndVersion
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
fromXContent
- Throws:
IOException
-
isEmpty
public boolean isEmpty() -
empty
-
isGlobalGenerationMissing
public boolean isGlobalGenerationMissing() -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
currentTerm
public long currentTerm()Returns the value of thecurrentTermrecord component.- Returns:
- the value of the
currentTermrecord component
-
clusterStateVersion
public long clusterStateVersion()Returns the value of theclusterStateVersionrecord component.- Returns:
- the value of the
clusterStateVersionrecord component
-
globalGeneration
public long globalGeneration()Returns the value of theglobalGenerationrecord component.- Returns:
- the value of the
globalGenerationrecord component
-
indexGenerations
Returns the value of theindexGenerationsrecord component.- Returns:
- the value of the
indexGenerationsrecord component
-