Interface SequentialFile

    • Method Detail

      • isOpen

        boolean isOpen()
      • exists

        boolean exists()
      • open

        void open()
           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • afterComplete

        default void afterComplete​(java.lang.Runnable run)
      • open

        void open​(int maxIO,
                  boolean useExecutor)
           throws java.lang.Exception
        The maximum number of simultaneous writes accepted
        Parameters:
        maxIO -
        Throws:
        java.lang.Exception
      • map

        java.nio.ByteBuffer map​(int position,
                                long size)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • fits

        boolean fits​(int size)
      • calculateBlockStart

        int calculateBlockStart​(int position)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getFileName

        java.lang.String getFileName()
      • fill

        void fill​(int size)
           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • delete

        void delete()
             throws java.io.IOException,
                    java.lang.InterruptedException,
                    org.apache.activemq.artemis.api.core.ActiveMQException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
        org.apache.activemq.artemis.api.core.ActiveMQException
      • write

        void write​(org.apache.activemq.artemis.api.core.ActiveMQBuffer bytes,
                   boolean sync,
                   IOCallback callback)
            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • write

        void write​(org.apache.activemq.artemis.api.core.ActiveMQBuffer bytes,
                   boolean sync)
            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • write

        void write​(EncodingSupport bytes,
                   boolean sync,
                   IOCallback callback)
            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • write

        void write​(EncodingSupport bytes,
                   boolean sync)
            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • writeDirect

        void writeDirect​(java.nio.ByteBuffer bytes,
                         boolean sync,
                         IOCallback callback)
        Write directly to the file without using any buffer
        Parameters:
        bytes - the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, use a buffer from the corresponding SequentialFileFactory.newBuffer(int).
      • writeDirect

        void writeDirect​(java.nio.ByteBuffer bytes,
                         boolean sync)
                  throws java.lang.Exception
        Write directly to the file without using intermediate any buffer
        Parameters:
        bytes - the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, use a buffer from the corresponding SequentialFileFactory.newBuffer(int).
        Throws:
        java.lang.Exception
      • blockingWriteDirect

        void blockingWriteDirect​(java.nio.ByteBuffer bytes,
                                 boolean sync,
                                 boolean releaseBuffer)
                          throws java.lang.Exception
        Write directly to the file without using any intermediate buffer and wait completion.
        If releaseBuffer is true the provided bytes should be released through SequentialFileFactory.releaseBuffer(ByteBuffer), if supported.
        Parameters:
        bytes - the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). If releaseBuffer is true use a buffer from SequentialFileFactory.newBuffer(int), SequentialFileFactory.allocateDirectBuffer(int) otherwise.
        sync - if true will durable flush the written data on the file, false otherwise
        releaseBuffer - if true will release the buffer, false otherwise
        Throws:
        java.lang.Exception
      • read

        int read​(java.nio.ByteBuffer bytes,
                 IOCallback callback)
          throws java.lang.Exception
        Parameters:
        bytes - the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, use a buffer from the corresponding SequentialFileFactory.newBuffer(int).
        Throws:
        java.lang.Exception
      • read

        int read​(java.nio.ByteBuffer bytes)
          throws java.lang.Exception
        Parameters:
        bytes - the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, use a buffer from the corresponding SequentialFileFactory.newBuffer(int).
        Throws:
        java.lang.Exception
      • position

        void position​(long pos)
               throws java.io.IOException
        Throws:
        java.io.IOException
      • position

        long position()
      • close

        void close()
            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        default void close​(boolean waitSync,
                           boolean blockOnWait)
                    throws java.lang.Exception
        When closing a file from a finalize block, you cant wait on syncs or anything like that. otherwise the VM may hung. Especially on the testsuite.
        Throws:
        java.lang.Exception
      • sync

        void sync()
           throws java.io.IOException
        Throws:
        java.io.IOException
      • size

        long size()
           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • renameTo

        void renameTo​(java.lang.String newFileName)
               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • copyTo

        void copyTo​(SequentialFile newFileName)
             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setTimedBuffer

        void setTimedBuffer​(TimedBuffer buffer)
      • getJavaFile

        java.io.File getJavaFile()
        Returns a native File of the file underlying this sequential file.
      • appendTo

        static long appendTo​(java.nio.file.Path src,
                             java.nio.file.Path dst)
                      throws java.io.IOException
        Throws:
        java.io.IOException