Interface IWALBuffer

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Implementing Classes:
    AbstractWALBuffer, WALBuffer

    public interface IWALBuffer
    extends java.lang.AutoCloseable
    This class serializes and flushes WALEntry. If search is enabled, the order of search index should be protected by the upper layer, and the value should start from 1.
    • Method Detail

      • write

        void write​(WALEntry walEntry)
        Write WALEntry into wal buffer.
        Parameters:
        walEntry - info will be written into wal buffer
      • getCurrentWALFileVersion

        long getCurrentWALFileVersion()
        Get current log version id
      • getCurrentWALFileSize

        long getCurrentWALFileSize()
        Get current wal file's size
      • getCurrentSearchIndex

        long getCurrentSearchIndex()
        Get current search index
      • close

        void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • waitForFlush

        void waitForFlush()
                   throws java.lang.InterruptedException
        Wait for next flush operation done
        Throws:
        java.lang.InterruptedException
      • waitForFlush

        boolean waitForFlush​(long time,
                             java.util.concurrent.TimeUnit unit)
                      throws java.lang.InterruptedException
        Wait for next flush operation done
        Throws:
        java.lang.InterruptedException
      • isAllWALEntriesConsumed

        boolean isAllWALEntriesConsumed()