Interface SequentialFileFactory

    • Method Detail

      • createSequentialFile

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

        int getMaxIO()
      • listFiles

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

        This method inserts a ".' before the extension.

        Parameters:
        extension -
        Returns:
        Throws:
        Exception
      • isSupportsCallbacks

        boolean isSupportsCallbacks()
      • onIOError

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

        default void onIOError​(Throwable exception,
                               String message)
      • allocateDirectBuffer

        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​(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

        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 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​(ByteBuffer buffer)
      • deactivateBuffer

        void deactivateBuffer()
      • wrapBuffer

        ByteBuffer wrapBuffer​(byte[] bytes)
      • getAlignment

        int getAlignment()
      • calculateBlockSize

        int calculateBlockSize​(int bytes)
      • getDirectory

        File getDirectory()
      • clearBuffer

        void clearBuffer​(ByteBuffer buffer)
      • start

        void start()
      • stop

        void stop()
      • createDirs

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

        void flush()
      • isDatasync

        boolean isDatasync()
      • getBufferSize

        long getBufferSize()