Class DirectCompactionEntryLog
- java.lang.Object
-
- org.apache.bookkeeper.bookie.storage.directentrylogger.DirectCompactionEntryLog
-
- All Implemented Interfaces:
CompactionEntryLog
public abstract class DirectCompactionEntryLog extends java.lang.Object implements CompactionEntryLog
DirectCompactionEntryLog.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.FilecompactedFileprotected java.io.FilecompactingFileprotected java.io.FilecompleteFileprotected intdstLogIdprotected Sloggerslogprotected intsrcLogId
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()Abort the compaction log.static java.io.FilecompactedFile(java.io.File directory, int newLogId, int compactedLogId)static java.io.FilecompactingFile(java.io.File directory, int logId)voidfinalizeAndCleanup()Clean up any temporary resources that were used by the compaction process.longgetDstLogId()Get the log ID of the entrylog to which compacted entries are being written.longgetSrcLogId()Get the log ID of the entrylog which is being compacted.voidmakeAvailable()Make the log written by the compaction process available for reads.(package private) static CompactionEntryLognewLog(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 CompactionEntryLogrecoverLog(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
-
Methods inherited from interface org.apache.bookkeeper.bookie.storage.CompactionEntryLog
addEntry, flush, markCompacted, scan
-
-
-
-
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:CompactionEntryLogAbort the compaction log. This should delete any resources held by this log.- Specified by:
abortin interfaceCompactionEntryLog
-
makeAvailable
public void makeAvailable() throws java.io.IOExceptionDescription copied from interface:CompactionEntryLogMake the log written by the compaction process available for reads.- Specified by:
makeAvailablein interfaceCompactionEntryLog- Throws:
java.io.IOException
-
finalizeAndCleanup
public void finalizeAndCleanup()
Description copied from interface:CompactionEntryLogClean up any temporary resources that were used by the compaction process.- Specified by:
finalizeAndCleanupin interfaceCompactionEntryLog
-
getDstLogId
public long getDstLogId()
Description copied from interface:CompactionEntryLogGet the log ID of the entrylog to which compacted entries are being written.- Specified by:
getDstLogIdin interfaceCompactionEntryLog
-
getSrcLogId
public long getSrcLogId()
Description copied from interface:CompactionEntryLogGet the log ID of the entrylog which is being compacted.- Specified by:
getSrcLogIdin interfaceCompactionEntryLog
-
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)
-
-