Class FileStoreLogFactory

java.lang.Object
io.aeron.driver.buffer.FileStoreLogFactory
All Implemented Interfaces:
LogFactory, AutoCloseable

public class FileStoreLogFactory extends Object implements LogFactory
Factory for creating RawLogs in the source publications or publication images directories as appropriate.
  • Constructor Details

    • FileStoreLogFactory

      public FileStoreLogFactory(String dataDirectoryName, int filePageSize, boolean checkStorage, long lowStorageWarningThreshold, ErrorHandler errorHandler, AtomicCounter mappedBytesCounter)
      Construct a LogFactory over a file store.
      Parameters:
      dataDirectoryName - where the log buffers will be created.
      filePageSize - of the filesystem.
      checkStorage - for sufficient space before allocating files.
      lowStorageWarningThreshold - when warnings about remaining space will begin.
      errorHandler - to call when an error is encountered.
      mappedBytesCounter - used to keep track of how many bytes are mapped by the driver.
  • Method Details

    • close

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

      public RawLog newPublication(long correlationId, int termBufferLength, boolean useSparseFiles)
      Create new RawLog in the publications' directory for the supplied triplet.
      Specified by:
      newPublication in interface LogFactory
      Parameters:
      correlationId - to use to distinguish this publication
      termBufferLength - length of each term
      useSparseFiles - for the log buffer.
      Returns:
      the newly allocated RawLog
    • newImage

      public RawLog newImage(long correlationId, int termBufferLength, boolean useSparseFiles)
      Create new RawLog in the rebuilt publication images directory for the supplied triplet.
      Specified by:
      newImage in interface LogFactory
      Parameters:
      correlationId - to use to distinguish this connection
      termBufferLength - to use for the log buffer
      useSparseFiles - for the log buffer.
      Returns:
      the newly allocated RawLog