Package io.atomix.raft.storage.log.entry
Record Class SerializedApplicationEntry
java.lang.Object
java.lang.Record
io.atomix.raft.storage.log.entry.SerializedApplicationEntry
- All Implemented Interfaces:
ApplicationEntry,RaftEntry
public record SerializedApplicationEntry(long lowestPosition, long highestPosition, org.agrona.DirectBuffer data)
extends Record
implements ApplicationEntry
Stores an entry that contains serialized records, ordered by their position; the lowestPosition
and highestPosition metadata allow for fast binary search over a collection of entries to quickly
find a particular record.
-
Constructor Summary
ConstructorsConstructorDescriptionSerializedApplicationEntry(long lowestPosition, long highestPosition, ByteBuffer data) SerializedApplicationEntry(long lowestPosition, long highestPosition, org.agrona.DirectBuffer data) Creates an instance of aSerializedApplicationEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionorg.agrona.DirectBufferdata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thehighestPositionrecord component.longReturns the value of thelowestPositionrecord component.toSerializable(long term, RaftEntrySerializer serializer) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SerializedApplicationEntry
-
SerializedApplicationEntry
public SerializedApplicationEntry(long lowestPosition, long highestPosition, org.agrona.DirectBuffer data) Creates an instance of aSerializedApplicationEntryrecord class.- Parameters:
lowestPosition- the value for thelowestPositionrecord componenthighestPosition- the value for thehighestPositionrecord componentdata- the value for thedatarecord component
-
-
Method Details
-
toSerializable
- Specified by:
toSerializablein interfaceRaftEntry
-
dataWriter
- Specified by:
dataWriterin interfaceApplicationEntry
-
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 '=='. -
lowestPosition
public long lowestPosition()Returns the value of thelowestPositionrecord component.- Specified by:
lowestPositionin interfaceApplicationEntry- Returns:
- the value of the
lowestPositionrecord component
-
highestPosition
public long highestPosition()Returns the value of thehighestPositionrecord component.- Specified by:
highestPositionin interfaceApplicationEntry- Returns:
- the value of the
highestPositionrecord component
-
data
public org.agrona.DirectBuffer data()Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-