Class LogReader

java.lang.Object
org.apache.camel.component.wal.LogReader
All Implemented Interfaces:
AutoCloseable

public class LogReader extends Object implements AutoCloseable
A reader for write-ahead log files
  • Field Details

  • Constructor Details

    • LogReader

      public LogReader(File logFile) throws IOException
      Constructor
      Parameters:
      logFile - the report file name
      Throws:
      IOException - in case of I/O errors
    • LogReader

      public LogReader(File logFile, int capacity) throws IOException
      Constructor
      Parameters:
      logFile - the report file name
      Throws:
      IOException - in case of I/O errors
  • Method Details

    • getHeader

      public Header getHeader()
      Gets the file header
      Returns:
      the file header
    • readEntry

      public org.apache.camel.component.wal.PersistedLogEntry readEntry() throws IOException
      Read an entry from the file.
      Returns:
      A log entry from the file or null when reaching the end-of-file or if the file is empty
      Throws:
      IOException - if unable to read the entry
    • close

      public void close()
      Close the reader and release resources
      Specified by:
      close in interface AutoCloseable