Class AIOSequentialFileFactory

java.lang.Object
org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory
org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory
All Implemented Interfaces:
SequentialFileFactory

public final class AIOSequentialFileFactory extends AbstractSequentialFileFactory
  • Constructor Details

    • AIOSequentialFileFactory

      public AIOSequentialFileFactory(File journalDir, int maxIO)
    • AIOSequentialFileFactory

      public AIOSequentialFileFactory(File journalDir, IOCriticalErrorListener listener, int maxIO)
    • AIOSequentialFileFactory

      public AIOSequentialFileFactory(File journalDir, int bufferSize, int bufferTimeout, int maxIO, boolean logRates)
    • AIOSequentialFileFactory

      public AIOSequentialFileFactory(File journalDir, int bufferSize, int bufferTimeout, int maxIO, boolean logRates, IOCriticalErrorListener listener, org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer)
  • Method Details

    • isSyncSupported

      public boolean isSyncSupported()
    • beforeClose

      public void beforeClose()
    • afterClose

      public void afterClose()
    • getCallback

    • enableBufferReuse

      public void enableBufferReuse()
    • disableBufferReuse

      public void disableBufferReuse()
    • createSequentialFile

      public SequentialFile createSequentialFile(String fileName)
    • isSupportsCallbacks

      public boolean isSupportsCallbacks()
    • isSupported

      public static boolean isSupported()
    • isSupported

      public static boolean isSupported(File journalPath)
    • allocateDirectBuffer

      public ByteBuffer allocateDirectBuffer(int size)
      Description copied from interface: SequentialFileFactory
      used for cases where you need direct buffer outside of the journal context. This is because the native layer has a method that can be reused in certain cases like paging
    • releaseDirectBuffer

      public void releaseDirectBuffer(ByteBuffer buffer)
      Description copied from interface: SequentialFileFactory
      used for cases where you need direct buffer outside of the journal context. This is because the native layer has a method that can be reused in certain cases like paging
    • newBuffer

      public ByteBuffer newBuffer(int size)
      Description copied from interface: SequentialFileFactory
      Note: You need to release the buffer if is used for reading operations. You don't need to do it if using writing operations (AIO Buffer Lister will take of writing operations)
      Returns:
      the allocated ByteBuffer
    • newBuffer

      public ByteBuffer newBuffer(int size, boolean zeroed)
      Description copied from interface: SequentialFileFactory
      Note: You need to release the buffer if is used for reading operations. You don't need to do it if using writing operations (AIO Buffer Lister will take of writing operations)
      Parameters:
      zeroed - if true the returned ByteBuffer must be zeroed, otherwise it tries to save zeroing it.
      Returns:
      the allocated ByteBuffer
    • clearBuffer

      public void clearBuffer(ByteBuffer directByteBuffer)
    • getAlignment

      public int getAlignment()
      Specified by:
      getAlignment in interface SequentialFileFactory
      Overrides:
      getAlignment in class AbstractSequentialFileFactory
    • wrapBuffer

      public ByteBuffer wrapBuffer(byte[] bytes)
    • calculateBlockSize

      public int calculateBlockSize(int position)
    • releaseBuffer

      public void releaseBuffer(ByteBuffer buffer)
      Specified by:
      releaseBuffer in interface SequentialFileFactory
      Overrides:
      releaseBuffer in class AbstractSequentialFileFactory
    • start

      public void start()
      Specified by:
      start in interface SequentialFileFactory
      Overrides:
      start in class AbstractSequentialFileFactory
    • stop

      public void stop()
      Specified by:
      stop in interface SequentialFileFactory
      Overrides:
      stop in class AbstractSequentialFileFactory
    • toString

      public String toString()
      Overrides:
      toString in class Object