Package org.apache.bookkeeper.bookie
Class EntryLoggerAllocator
- java.lang.Object
-
- org.apache.bookkeeper.bookie.EntryLoggerAllocator
-
class EntryLoggerAllocator extends java.lang.ObjectAn allocator pre-allocates entry log files.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.concurrent.ExecutorServiceallocatorExecutor(package private) io.netty.buffer.ByteBuflogfileHeader(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) voidclearCompactingLogId()(package private) DefaultEntryLogger.BufferedLogChannelcreateNewLog(java.io.File dirForNextEntryLog)(package private) DefaultEntryLogger.BufferedLogChannelcreateNewLogForCompaction(java.io.File dirForNextEntryLog)(package private) longgetPreallocatedLogId()(package private) java.util.concurrent.Future<DefaultEntryLogger.BufferedLogChannel>getPreallocationFuture()get the preallocation for tests.booleanisSealed(long logId)(package private) voidsetLastLogId(java.io.File dir, long logId)writes the given id to the "lastId" file in the given directory.(package private) voidsetWritingCompactingLogId(long logId)(package private) voidsetWritingLogId(long logId)(package private) voidstop()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.IOExceptionwrites 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.
-
-