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 SummaryFields 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 SummaryConstructors Constructor Description EntryLoggerAllocator(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, DefaultEntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus, long logId, io.netty.buffer.ByteBufAllocator byteBufAllocator)
 - 
Method SummaryAll 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- 
preallocationjava.util.concurrent.Future<DefaultEntryLogger.BufferedLogChannel> preallocation 
 - 
allocatorExecutorjava.util.concurrent.ExecutorService allocatorExecutor 
 - 
logfileHeaderfinal io.netty.buffer.ByteBuf logfileHeader 
 
- 
 - 
Constructor Detail- 
EntryLoggerAllocatorEntryLoggerAllocator(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, DefaultEntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus, long logId, io.netty.buffer.ByteBufAllocator byteBufAllocator) 
 
- 
 - 
Method Detail- 
getPreallocatedLogIdlong getPreallocatedLogId() 
 - 
isSealedpublic boolean isSealed(long logId) 
 - 
createNewLogDefaultEntryLogger.BufferedLogChannel createNewLog(java.io.File dirForNextEntryLog) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
createNewLogForCompactionDefaultEntryLogger.BufferedLogChannel createNewLogForCompaction(java.io.File dirForNextEntryLog) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
setWritingLogIdvoid setWritingLogId(long logId) 
 - 
setWritingCompactingLogIdvoid setWritingCompactingLogId(long logId) 
 - 
clearCompactingLogIdvoid clearCompactingLogId() 
 - 
setLastLogIdvoid 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
 
 - 
stopvoid stop() Stop the allocator.
 - 
getPreallocationFuturejava.util.concurrent.Future<DefaultEntryLogger.BufferedLogChannel> getPreallocationFuture() get the preallocation for tests.
 
- 
 
-