Package io.aeron

Class LogBuffers

java.lang.Object
io.aeron.LogBuffers
All Implemented Interfaces:
AutoCloseable

public final class LogBuffers extends Object implements AutoCloseable
Takes a log file name and maps the file into memory and wraps it with UnsafeBuffers as appropriate.
See Also:
  • Constructor Details

    • LogBuffers

      public LogBuffers(String logFileName)
      Construct the log buffers for a given log file.
      Parameters:
      logFileName - to be mapped.
  • Method Details

    • duplicateTermBuffers

      public UnsafeBuffer[] duplicateTermBuffers()
      Duplicate the underlying ByteBuffers and wrap them for thread local access.
      Returns:
      duplicates of the wrapped underlying ByteBuffers.
    • metaDataBuffer

      public UnsafeBuffer metaDataBuffer()
      Get the buffer which holds the log metadata.
      Returns:
      the buffer which holds the log metadata.
    • fileChannel

      public FileChannel fileChannel()
      The FileChannel for the mapped log.
      Returns:
      the FileChannel for the mapped log.
    • preTouch

      public void preTouch()
      Pre touch memory pages, so they are faulted in to be available before access.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • termLength

      public int termLength()
      The length of the term buffer in each log partition.
      Returns:
      length of the term buffer in each log partition.
    • incRef

      public int incRef()
      Increment reference count.
      Returns:
      current reference count after increment.
    • decRef

      public int decRef()
      Decrement reference count.
      Returns:
      current reference counter after decrement.
    • lingerDeadlineNs

      public void lingerDeadlineNs(long timeNs)
      Set the deadline for how long to linger around once unreferenced.
      Parameters:
      timeNs - the deadline for how long to linger around once unreferenced.
    • lingerDeadlineNs

      public long lingerDeadlineNs()
      The deadline for how long to linger around once unreferenced.
      Returns:
      the deadline for how long to linger around once unreferenced.