Module org.elasticsearch.server
Package org.elasticsearch.index.translog
Record Class Translog.Serialized
java.lang.Object
java.lang.Record
org.elasticsearch.index.translog.Translog.Serialized
- Enclosing class:
Translog
public static record Translog.Serialized(BytesReference header, BytesReference source, int length, int checksum)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionSerialized(BytesReference header, BytesReference source, int checksum) Serialized(BytesReference header, BytesReference source, int length, int checksum) Creates an instance of aSerializedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintchecksum()Returns the value of thechecksumrecord component.static Translog.Serializedcreate(BytesReference header, BytesReference source, Checksum checksum) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.header()Returns the value of theheaderrecord component.intlength()Returns the value of thelengthrecord component.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.void
-
Constructor Details
-
Serialized
-
Serialized
Creates an instance of aSerializedrecord class.- Parameters:
header- the value for theheaderrecord componentsource- the value for thesourcerecord componentlength- the value for thelengthrecord componentchecksum- the value for thechecksumrecord component
-
-
Method Details
-
toBytesReference
- Throws:
IOException
-
create
public static Translog.Serialized create(BytesReference header, @Nullable BytesReference source, Checksum checksum) throws IOException - Throws:
IOException
-
writeToTranslogBuffer
- Throws:
IOException
-
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 '=='. -
header
Returns the value of theheaderrecord component.- Returns:
- the value of the
headerrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
length
public int length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-
checksum
public int checksum()Returns the value of thechecksumrecord component.- Returns:
- the value of the
checksumrecord component
-