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 on
changedStructures - map of structure ID to serialized state for structures that changed
deletedStructures - set of structure IDs that were removed since the base snapshot
timestamp - 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 Details

    • DeltaSnapshot

      public DeltaSnapshot(long baseSnapshotIndex, Map<String,byte[]> changedStructures, Set<String> deletedStructures, long timestamp)
      Creates an instance of a DeltaSnapshot record class.
      Parameters:
      baseSnapshotIndex - the value for the baseSnapshotIndex record component
      changedStructures - the value for the changedStructures record component
      deletedStructures - the value for the deletedStructures record component
      timestamp - the value for the timestamp record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • baseSnapshotIndex

      public long baseSnapshotIndex()
      Returns the value of the baseSnapshotIndex record component.
      Returns:
      the value of the baseSnapshotIndex record component
    • changedStructures

      public Map<String,byte[]> changedStructures()
      Returns the value of the changedStructures record component.
      Returns:
      the value of the changedStructures record component
    • deletedStructures

      public Set<String> deletedStructures()
      Returns the value of the deletedStructures record component.
      Returns:
      the value of the deletedStructures record component
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component