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
ConstructorsConstructorDescriptionWalRecoveryMetadata(List<LogEntry> entries, long lastValidIndex, int totalEntriesRecovered, int corruptedEntriesSkipped, long corruptionPosition) Creates an instance of aWalRecoveryMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecorruptedEntriesSkippedrecord component.longReturns the value of thecorruptionPositionrecord component.entries()Returns the value of theentriesrecord 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 thelastValidIndexrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalEntriesRecoveredrecord component.
-
Constructor Details
-
WalRecoveryMetadata
public WalRecoveryMetadata(List<LogEntry> entries, long lastValidIndex, int totalEntriesRecovered, int corruptedEntriesSkipped, long corruptionPosition) Creates an instance of aWalRecoveryMetadatarecord class.- Parameters:
entries- the value for theentriesrecord componentlastValidIndex- the value for thelastValidIndexrecord componenttotalEntriesRecovered- the value for thetotalEntriesRecoveredrecord componentcorruptedEntriesSkipped- the value for thecorruptedEntriesSkippedrecord componentcorruptionPosition- the value for thecorruptionPositionrecord 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. -
entries
-
lastValidIndex
public long lastValidIndex()Returns the value of thelastValidIndexrecord component.- Returns:
- the value of the
lastValidIndexrecord component
-
totalEntriesRecovered
public int totalEntriesRecovered()Returns the value of thetotalEntriesRecoveredrecord component.- Returns:
- the value of the
totalEntriesRecoveredrecord component
-
corruptedEntriesSkipped
public int corruptedEntriesSkipped()Returns the value of thecorruptedEntriesSkippedrecord component.- Returns:
- the value of the
corruptedEntriesSkippedrecord component
-
corruptionPosition
public long corruptionPosition()Returns the value of thecorruptionPositionrecord component.- Returns:
- the value of the
corruptionPositionrecord component
-