Record Class WalCompactor.CompactionSnapshot
java.lang.Object
java.lang.Record
com.loomcache.server.persistence.WalCompactor.CompactionSnapshot
- Enclosing class:
WalCompactor
public static record WalCompactor.CompactionSnapshot(long snapshotIndex, long snapshotTerm, byte[] state)
extends Record
Snapshot boundary and state to use for one automatic compaction.
The snapshot index and term must identify a committed/applied WAL entry. The state bytes must represent the state machine exactly at that boundary; entries after the boundary are retained in the WAL.
-
Constructor Summary
ConstructorsConstructorDescriptionCompactionSnapshot(long snapshotIndex, long snapshotTerm, byte[] state) Creates an instance of aCompactionSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thesnapshotIndexrecord component.longReturns the value of thesnapshotTermrecord component.byte[]state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CompactionSnapshot
public CompactionSnapshot(long snapshotIndex, long snapshotTerm, byte[] state) Creates an instance of aCompactionSnapshotrecord class.- Parameters:
snapshotIndex- the value for thesnapshotIndexrecord componentsnapshotTerm- the value for thesnapshotTermrecord componentstate- the value for thestaterecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
snapshotIndex
public long snapshotIndex()Returns the value of thesnapshotIndexrecord component.- Returns:
- the value of the
snapshotIndexrecord component
-
snapshotTerm
public long snapshotTerm()Returns the value of thesnapshotTermrecord component.- Returns:
- the value of the
snapshotTermrecord component
-
state
public byte[] state()Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-