Interface SequentialFileFactory

    • Method Detail

      • getCriticalAnalyzer

        default org.apache.activemq.artemis.utils.critical.CriticalAnalyzer getCriticalAnalyzer()
      • createSequentialFile

        SequentialFile createSequentialFile​(java.lang.String fileName)
      • createSequentialFile

        default SequentialFile createSequentialFile​(java.lang.String fileName,
                                                    int capacity)
      • getMaxIO

        int getMaxIO()
      • listFiles

        java.util.List<java.lang.String> listFiles​(java.lang.String extension)
                                            throws java.lang.Exception
        Lists files that end with the given extension.

        This method inserts a ".' before the extension.

        Parameters:
        extension -
        Returns:
        Throws:
        java.lang.Exception
      • isSupportsCallbacks

        boolean isSupportsCallbacks()
      • onIOError

        void onIOError​(java.lang.Exception exception,
                       java.lang.String message,
                       SequentialFile file)
        The SequentialFile will call this method when a disk IO Error happens during the live phase.
      • allocateDirectBuffer

        java.nio.ByteBuffer allocateDirectBuffer​(int size)
        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

        void releaseDirectBuffer​(java.nio.ByteBuffer buffer)
        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

        java.nio.ByteBuffer newBuffer​(int size)
        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:
        size -
        Returns:
        the allocated ByteBuffer
      • newBuffer

        default java.nio.ByteBuffer newBuffer​(int size,
                                              boolean zeroed)
        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:
        size -
        zeroed - if true the returned ByteBuffer must be zeroed, otherwise it tries to save zeroing it.
        Returns:
        the allocated ByteBuffer
      • releaseBuffer

        void releaseBuffer​(java.nio.ByteBuffer buffer)
      • deactivateBuffer

        void deactivateBuffer()
      • wrapBuffer

        java.nio.ByteBuffer wrapBuffer​(byte[] bytes)
      • getAlignment

        int getAlignment()
      • calculateBlockSize

        int calculateBlockSize​(int bytes)
      • getDirectory

        java.io.File getDirectory()
      • clearBuffer

        void clearBuffer​(java.nio.ByteBuffer buffer)
      • start

        void start()
      • stop

        void stop()
      • createDirs

        void createDirs()
                 throws java.lang.Exception
        Creates the directory if it does not exist yet.
        Throws:
        java.lang.Exception
      • flush

        void flush()
      • isDatasync

        boolean isDatasync()
      • getBufferSize

        long getBufferSize()