Record Class DeltaSnapshot
java.lang.Object
java.lang.Record
com.loomcache.server.persistence.DeltaSnapshot
- Record Components:
baseSnapshotIndex- the Raft index of the base (full) snapshot this delta builds onchangedStructures- map of structure ID to serialized state for structures that changeddeletedStructures- set of structure IDs that were removed since the base snapshottimestamp- millisecond timestamp when this delta was created
public record DeltaSnapshot(long baseSnapshotIndex, Map<String,byte[]> changedStructures, Set<String> deletedStructures, long timestamp)
extends Record
Represents a delta (incremental) snapshot capturing only changed and deleted
data structures since the last full or delta snapshot.
Delta snapshots are much smaller than full snapshots when only a few structures
changed, reducing I/O and snapshot latency. They form a chain from a base
StateMachineSnapshotManager.FullSnapshot that can be materialized back
into a full snapshot for restoration.
-
Constructor Summary
ConstructorsConstructorDescriptionDeltaSnapshot(long baseSnapshotIndex, Map<String, byte[]> changedStructures, Set<String> deletedStructures, long timestamp) Creates an instance of aDeltaSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thebaseSnapshotIndexrecord component.Returns the value of thechangedStructuresrecord component.Returns the value of thedeletedStructuresrecord 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 thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DeltaSnapshot
public DeltaSnapshot(long baseSnapshotIndex, Map<String, byte[]> changedStructures, Set<String> deletedStructures, long timestamp) Creates an instance of aDeltaSnapshotrecord class.- Parameters:
baseSnapshotIndex- the value for thebaseSnapshotIndexrecord componentchangedStructures- the value for thechangedStructuresrecord componentdeletedStructures- the value for thedeletedStructuresrecord componenttimestamp- the value for thetimestamprecord 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. -
baseSnapshotIndex
public long baseSnapshotIndex()Returns the value of thebaseSnapshotIndexrecord component.- Returns:
- the value of the
baseSnapshotIndexrecord component
-
changedStructures
Returns the value of thechangedStructuresrecord component.- Returns:
- the value of the
changedStructuresrecord component
-
deletedStructures
Returns the value of thedeletedStructuresrecord component.- Returns:
- the value of the
deletedStructuresrecord component
-
timestamp
-