Class LogEntry

java.lang.Object
io.permazen.kv.raft.LogEntry

public class LogEntry extends Object
Represents one unapplied Raft log entry.
  • Field Details

  • Method Details

    • getAge

      public int getAge()
      Get the age of this log entry since instantiation.
      Returns:
      age in milliseconds
    • getTerm

      public long getTerm()
      Get the term of this instance.
      Returns:
      associated log entry term
    • getIndex

      public long getIndex()
      Get the index of this instance.
      Returns:
      associated log entry index
    • getConfigChange

      public String[] getConfigChange()
      Get the cluster config change associated with this log entry, if any.

      The returned array is a copy; changes have no effect on this instance.

      Returns:
      cluster config change, or null if none
      See Also:
      • RaftKVTransaction.configChange
    • getFileSize

      public long getFileSize()
      Get the size of the on-disk file for this log entry.
      Returns:
      log entry file size
    • getFile

      public File getFile()
      Get the on-disk file for this log entry.
      Returns:
      log entry file
    • parseFileName

      public static long[] parseFileName(String fileName)
      Parse a log file name, extracting the log term and index.
      Parameters:
      fileName - file name
      Returns:
      array of length two containing [index, term], or null if parse fails
      Throws:
      IllegalArgumentException - if fileName is null
    • toString

      public String toString()
      Overrides:
      toString in class Object