Record Class LogStats
java.lang.Object
java.lang.Record
com.loomcache.server.consensus.LogStats
- Record Components:
size- Number of entries in memory (including sentinel)firstIndex- The index of the first entry in memory (usually 1 or lastSnapshotIndex + 1)lastIndex- The highest index in the log (accounting for snapshots)committedIndex- The highest index known to be committed (0 if none)compactedUpTo- The index of the last snapshot (0 if no snapshot)totalAppends- Total number of append operations performedtotalCompactions- Total number of compaction operations performedsizeInBytes- Approximate memory usage in bytes
public record LogStats(int size, long firstIndex, long lastIndex, long committedIndex, long compactedUpTo, long totalAppends, long totalCompactions, long sizeInBytes)
extends Record
Statistics snapshot of the RaftLog state.
Captures a point-in-time view of log metrics including size, indices, and operation counts.
-
Constructor Summary
ConstructorsConstructorDescriptionLogStats(int size, long firstIndex, long lastIndex, long committedIndex, long compactedUpTo, long totalAppends, long totalCompactions, long sizeInBytes) Creates an instance of aLogStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecommittedIndexrecord component.longReturns the value of thecompactedUpTorecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefirstIndexrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of thelastIndexrecord component.intsize()Returns the value of thesizerecord component.longReturns the value of thesizeInBytesrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAppendsrecord component.longReturns the value of thetotalCompactionsrecord component.
-
Constructor Details
-
LogStats
public LogStats(int size, long firstIndex, long lastIndex, long committedIndex, long compactedUpTo, long totalAppends, long totalCompactions, long sizeInBytes) Creates an instance of aLogStatsrecord class.- Parameters:
size- the value for thesizerecord componentfirstIndex- the value for thefirstIndexrecord componentlastIndex- the value for thelastIndexrecord componentcommittedIndex- the value for thecommittedIndexrecord componentcompactedUpTo- the value for thecompactedUpTorecord componenttotalAppends- the value for thetotalAppendsrecord componenttotalCompactions- the value for thetotalCompactionsrecord componentsizeInBytes- the value for thesizeInBytesrecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
size
-
firstIndex
public long firstIndex()Returns the value of thefirstIndexrecord component.- Returns:
- the value of the
firstIndexrecord component
-
lastIndex
-
committedIndex
public long committedIndex()Returns the value of thecommittedIndexrecord component.- Returns:
- the value of the
committedIndexrecord component
-
compactedUpTo
public long compactedUpTo()Returns the value of thecompactedUpTorecord component.- Returns:
- the value of the
compactedUpTorecord component
-
totalAppends
public long totalAppends()Returns the value of thetotalAppendsrecord component.- Returns:
- the value of the
totalAppendsrecord component
-
totalCompactions
public long totalCompactions()Returns the value of thetotalCompactionsrecord component.- Returns:
- the value of the
totalCompactionsrecord component
-
sizeInBytes
public long sizeInBytes()Returns the value of thesizeInBytesrecord component.- Returns:
- the value of the
sizeInBytesrecord component
-