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.File
compactedFile
protected java.io.File
compactingFile
protected java.io.File
completeFile
protected int
dstLogId
protected Slogger
slog
protected int
srcLogId
-
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
-
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:CompactionEntryLog
Abort the compaction log. This should delete any resources held by this log.- Specified by:
abort
in interfaceCompactionEntryLog
-
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 interfaceCompactionEntryLog
- Throws:
java.io.IOException
-
finalizeAndCleanup
public void finalizeAndCleanup()
Description copied from interface:CompactionEntryLog
Clean up any temporary resources that were used by the compaction process.- Specified by:
finalizeAndCleanup
in interfaceCompactionEntryLog
-
getDstLogId
public long getDstLogId()
Description copied from interface:CompactionEntryLog
Get the log ID of the entrylog to which compacted entries are being written.- Specified by:
getDstLogId
in interfaceCompactionEntryLog
-
getSrcLogId
public long getSrcLogId()
Description copied from interface:CompactionEntryLog
Get the log ID of the entrylog which is being compacted.- Specified by:
getSrcLogId
in 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)
-
-