Record Class WalReader.WalRecoveryMetadata

java.lang.Object
java.lang.Record
com.loomcache.server.persistence.WalReader.WalRecoveryMetadata
Enclosing class:
WalReader

public static record WalReader.WalRecoveryMetadata(List<LogEntry> entries, long lastValidIndex, int totalEntriesRecovered, int corruptedEntriesSkipped, long corruptionPosition) extends Record
Recovery metadata returned after reading a WAL file.

Contains the recovered log entries and statistics useful for diagnostics: - entries: list of successfully recovered LogEntry objects - lastValidIndex: the index of the last valid entry in the WAL (0 if no valid entries) - totalEntriesRecovered: count of successfully recovered entries - corruptedEntriesSkipped: count of corrupted entries skipped - corruptionPosition: byte offset of the first corruption, or -1 if no corruption

  • Constructor Summary

    Constructors
    Constructor
    Description
    WalRecoveryMetadata(List<LogEntry> entries, long lastValidIndex, int totalEntriesRecovered, int corruptedEntriesSkipped, long corruptionPosition)
    Creates an instance of a WalRecoveryMetadata record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the corruptedEntriesSkipped record component.
    long
    Returns the value of the corruptionPosition record component.
    Returns the value of the entries record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the lastValidIndex record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the totalEntriesRecovered record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WalRecoveryMetadata

      public WalRecoveryMetadata(List<LogEntry> entries, long lastValidIndex, int totalEntriesRecovered, int corruptedEntriesSkipped, long corruptionPosition)
      Creates an instance of a WalRecoveryMetadata record class.
      Parameters:
      entries - the value for the entries record component
      lastValidIndex - the value for the lastValidIndex record component
      totalEntriesRecovered - the value for the totalEntriesRecovered record component
      corruptedEntriesSkipped - the value for the corruptedEntriesSkipped record component
      corruptionPosition - the value for the corruptionPosition 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.
    • entries

      public List<LogEntry> entries()
      Returns the value of the entries record component.
      Returns:
      the value of the entries record component
    • lastValidIndex

      public long lastValidIndex()
      Returns the value of the lastValidIndex record component.
      Returns:
      the value of the lastValidIndex record component
    • totalEntriesRecovered

      public int totalEntriesRecovered()
      Returns the value of the totalEntriesRecovered record component.
      Returns:
      the value of the totalEntriesRecovered record component
    • corruptedEntriesSkipped

      public int corruptedEntriesSkipped()
      Returns the value of the corruptedEntriesSkipped record component.
      Returns:
      the value of the corruptedEntriesSkipped record component
    • corruptionPosition

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