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
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the value of theclusterStateVersion
record component.long
Returns the value of thecurrentTerm
record component.static Manifest
empty()
final boolean
Indicates whether some other object is "equal to" this one.static Manifest
fromXContent
(XContentParser parser) long
Returns the value of theglobalGeneration
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theindexGenerations
record component.boolean
isEmpty()
boolean
final String
toString()
Returns a string representation of this record class.toXContent
(XContentBuilder builder, 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
-
FORMAT
-
-
Constructor Details
-
Manifest
public Manifest(long currentTerm, long clusterStateVersion, long globalGeneration, Map<Index, Long> indexGenerations) Creates an instance of aManifest
record class.- Parameters:
currentTerm
- the value for thecurrentTerm
record componentclusterStateVersion
- the value for theclusterStateVersion
record componentglobalGeneration
- the value for theglobalGeneration
record componentindexGenerations
- the value for theindexGenerations
record component
-
-
Method Details
-
unknownCurrentTermAndVersion
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in 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 thecurrentTerm
record component.- Returns:
- the value of the
currentTerm
record component
-
clusterStateVersion
public long clusterStateVersion()Returns the value of theclusterStateVersion
record component.- Returns:
- the value of the
clusterStateVersion
record component
-
globalGeneration
public long globalGeneration()Returns the value of theglobalGeneration
record component.- Returns:
- the value of the
globalGeneration
record component
-
indexGenerations
Returns the value of theindexGenerations
record component.- Returns:
- the value of the
indexGenerations
record component
-