Class DirectCompactionEntryLog

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void abort()
      Abort the compaction log.
      static java.io.File compactedFile​(java.io.File directory, int newLogId, int compactedLogId)  
      static java.io.File compactingFile​(java.io.File directory, int logId)  
      void finalizeAndCleanup()
      Clean up any temporary resources that were used by the compaction process.
      long getDstLogId()
      Get the log ID of the entrylog to which compacted entries are being written.
      long getSrcLogId()
      Get the log ID of the entrylog which is being compacted.
      void makeAvailable()
      Make the log written by the compaction process available for reads.
      (package private) static CompactionEntryLog newLog​(int srcLogId, int dstLogId, java.io.File ledgerDir, long maxFileSize, java.util.concurrent.ExecutorService writeExecutor, BufferPool writeBuffers, NativeIO nativeIO, io.netty.buffer.ByteBufAllocator allocator, Slogger slog)  
      (package private) static CompactionEntryLog recoverLog​(int srcLogId, int dstLogId, java.io.File ledgerDir, int readBufferSize, int maxSaneEntrySize, NativeIO nativeIO, io.netty.buffer.ByteBufAllocator allocator, OpStatsLogger readBlockStats, Slogger slog)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • srcLogId

        protected final int srcLogId
      • dstLogId

        protected final int dstLogId
      • slog

        protected final Slogger slog
      • compactingFile

        protected final java.io.File compactingFile
      • compactedFile

        protected final java.io.File compactedFile
      • completeFile

        protected final java.io.File completeFile
    • Method Detail

      • newLog

        static CompactionEntryLog newLog​(int srcLogId,
                                         int dstLogId,
                                         java.io.File ledgerDir,
                                         long maxFileSize,
                                         java.util.concurrent.ExecutorService writeExecutor,
                                         BufferPool writeBuffers,
                                         NativeIO nativeIO,
                                         io.netty.buffer.ByteBufAllocator allocator,
                                         Slogger slog)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • recoverLog

        static CompactionEntryLog recoverLog​(int srcLogId,
                                             int dstLogId,
                                             java.io.File ledgerDir,
                                             int readBufferSize,
                                             int maxSaneEntrySize,
                                             NativeIO nativeIO,
                                             io.netty.buffer.ByteBufAllocator allocator,
                                             OpStatsLogger readBlockStats,
                                             Slogger slog)
      • abort

        public void abort()
        Description copied from interface: CompactionEntryLog
        Abort the compaction log. This should delete any resources held by this log.
        Specified by:
        abort in interface CompactionEntryLog
      • makeAvailable

        public void makeAvailable()
                           throws java.io.IOException
        Description copied from interface: CompactionEntryLog
        Make the log written by the compaction process available for reads.
        Specified by:
        makeAvailable in interface CompactionEntryLog
        Throws:
        java.io.IOException
      • compactingFile

        public static java.io.File compactingFile​(java.io.File directory,
                                                  int logId)
      • compactedFile

        public static java.io.File compactedFile​(java.io.File directory,
                                                 int newLogId,
                                                 int compactedLogId)