Package org.apache.bookkeeper.bookie
Class EntryLoggerAllocator
- java.lang.Object
-
- org.apache.bookkeeper.bookie.EntryLoggerAllocator
-
class EntryLoggerAllocator extends java.lang.Object
An allocator pre-allocates entry log files.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.concurrent.ExecutorService
allocatorExecutor
(package private) io.netty.buffer.ByteBuf
logfileHeader
(package private) java.util.concurrent.Future<DefaultEntryLogger.BufferedLogChannel>
preallocation
-
Constructor Summary
Constructors Constructor Description EntryLoggerAllocator(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, DefaultEntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus, long logId, io.netty.buffer.ByteBufAllocator byteBufAllocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
clearCompactingLogId()
(package private) DefaultEntryLogger.BufferedLogChannel
createNewLog(java.io.File dirForNextEntryLog)
(package private) DefaultEntryLogger.BufferedLogChannel
createNewLogForCompaction(java.io.File dirForNextEntryLog)
(package private) long
getPreallocatedLogId()
(package private) java.util.concurrent.Future<DefaultEntryLogger.BufferedLogChannel>
getPreallocationFuture()
get the preallocation for tests.boolean
isSealed(long logId)
(package private) void
setLastLogId(java.io.File dir, long logId)
writes the given id to the "lastId" file in the given directory.(package private) void
setWritingCompactingLogId(long logId)
(package private) void
setWritingLogId(long logId)
(package private) void
stop()
Stop the allocator.
-
-
-
Field Detail
-
preallocation
java.util.concurrent.Future<DefaultEntryLogger.BufferedLogChannel> preallocation
-
allocatorExecutor
java.util.concurrent.ExecutorService allocatorExecutor
-
logfileHeader
final io.netty.buffer.ByteBuf logfileHeader
-
-
Constructor Detail
-
EntryLoggerAllocator
EntryLoggerAllocator(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, DefaultEntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus, long logId, io.netty.buffer.ByteBufAllocator byteBufAllocator)
-
-
Method Detail
-
getPreallocatedLogId
long getPreallocatedLogId()
-
isSealed
public boolean isSealed(long logId)
-
createNewLog
DefaultEntryLogger.BufferedLogChannel createNewLog(java.io.File dirForNextEntryLog) throws java.io.IOException
- Throws:
java.io.IOException
-
createNewLogForCompaction
DefaultEntryLogger.BufferedLogChannel createNewLogForCompaction(java.io.File dirForNextEntryLog) throws java.io.IOException
- Throws:
java.io.IOException
-
setWritingLogId
void setWritingLogId(long logId)
-
setWritingCompactingLogId
void setWritingCompactingLogId(long logId)
-
clearCompactingLogId
void clearCompactingLogId()
-
setLastLogId
void setLastLogId(java.io.File dir, long logId) throws java.io.IOException
writes the given id to the "lastId" file in the given directory.- Throws:
java.io.IOException
-
stop
void stop()
Stop the allocator.
-
getPreallocationFuture
java.util.concurrent.Future<DefaultEntryLogger.BufferedLogChannel> getPreallocationFuture()
get the preallocation for tests.
-
-