Package org.apache.bookkeeper.bookie
Class EntryLogManagerBase
java.lang.Object
org.apache.bookkeeper.bookie.EntryLogManagerBase
- All Implemented Interfaces:
EntryLogManager
- Direct Known Subclasses:
EntryLogManagerForEntryLogPerLedger,EntryLogManagerForSingleEntryLog
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final EntryLoggerAllocator(package private) final LedgerDirsManager(package private) final longThe maximum size of a entry logger file.(package private) List<DefaultEntryLogger.BufferedLogChannel> -
Constructor Summary
ConstructorsConstructorDescriptionEntryLogManagerBase(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, EntryLoggerAllocator entryLoggerAllocator, List<DefaultEntryLogger.EntryLogListener> listeners) -
Method Summary
Modifier and TypeMethodDescriptionlongaddEntry(long ledger, io.netty.buffer.ByteBuf entry, boolean rollLog) (package private) voidcreateNewLog(long ledgerId) (package private) voidcreateNewLog(long ledgerId, String reason) voidflush()(package private) abstract void(package private) voidflushLogChannel(DefaultEntryLogger.BufferedLogChannel logChannel, boolean forceMetadata) (package private) abstract void(package private) abstract DefaultEntryLogger.BufferedLogChannelgetCurrentLogForLedger(long ledgerId) (package private) abstract DefaultEntryLogger.BufferedLogChannelgetCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog) (package private) List<DefaultEntryLogger.BufferedLogChannel>(package private) booleanreachEntryLogLimit(DefaultEntryLogger.BufferedLogChannel logChannel, long size) (package private) booleanreadEntryLogHardLimit(DefaultEntryLogger.BufferedLogChannel logChannel, long size) (package private) File(package private) abstract voidsetCurrentLogForLedgerAndAddToRotate(long ledgerId, DefaultEntryLogger.BufferedLogChannel logChannel) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.bookie.EntryLogManager
checkpoint, close, commitEntryMemTableFlush, createNewLogForCompaction, forceClose, getCurrentLogIfPresent, getDirForNextEntryLog, prepareEntryMemTableFlush, prepareSortedLedgerStorageCheckpoint
-
Field Details
-
rotatedLogChannels
-
entryLoggerAllocator
-
ledgerDirsManager
-
logSizeLimit
final long logSizeLimitThe maximum size of a entry logger file.
-
-
Constructor Details
-
EntryLogManagerBase
EntryLogManagerBase(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, EntryLoggerAllocator entryLoggerAllocator, List<DefaultEntryLogger.EntryLogListener> listeners)
-
-
Method Details
-
addEntry
public long addEntry(long ledger, io.netty.buffer.ByteBuf entry, boolean rollLog) throws IOException - Specified by:
addEntryin interfaceEntryLogManager- Throws:
IOException
-
reachEntryLogLimit
-
readEntryLogHardLimit
-
getCurrentLogForLedger
abstract DefaultEntryLogger.BufferedLogChannel getCurrentLogForLedger(long ledgerId) throws IOException - Throws:
IOException
-
getCurrentLogForLedgerForAddEntry
abstract DefaultEntryLogger.BufferedLogChannel getCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog) throws IOException - Throws:
IOException
-
setCurrentLogForLedgerAndAddToRotate
abstract void setCurrentLogForLedgerAndAddToRotate(long ledgerId, DefaultEntryLogger.BufferedLogChannel logChannel) throws IOException - Throws:
IOException
-
flushCurrentLogs
- Throws:
IOException
-
flushRotatedLogs
- Throws:
IOException
-
getRotatedLogChannels
List<DefaultEntryLogger.BufferedLogChannel> getRotatedLogChannels() -
flush
- Specified by:
flushin interfaceEntryLogManager- Throws:
IOException
-
flushLogChannel
void flushLogChannel(DefaultEntryLogger.BufferedLogChannel logChannel, boolean forceMetadata) throws IOException - Throws:
IOException
-
createNewLog
- Throws:
IOException
-
createNewLog
- Throws:
IOException
-
selectDirForNextEntryLog
-