Package org.apache.bookkeeper.bookie
Class EntryLogManagerForEntryLogPerLedger
java.lang.Object
org.apache.bookkeeper.bookie.EntryLogManagerBase
org.apache.bookkeeper.bookie.EntryLogManagerForEntryLogPerLedger
- All Implemented Interfaces:
EntryLogManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) class(package private) class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final EntryLogManagerForEntryLogPerLedger.EntryLogsPerLedgerCounterFields inherited from class org.apache.bookkeeper.bookie.EntryLogManagerBase
entryLoggerAllocator, ledgerDirsManager, logSizeLimit, rotatedLogChannels -
Constructor Summary
ConstructorsConstructorDescriptionEntryLogManagerForEntryLogPerLedger(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, EntryLoggerAllocator entryLoggerAllocator, List<DefaultEntryLogger.EntryLogListener> listeners, DefaultEntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus, StatsLogger statsLogger) -
Method Summary
Modifier and TypeMethodDescriptionlongaddEntry(long ledger, io.netty.buffer.ByteBuf entry, boolean rollLog) voidvoidclose()boolean(package private) voidcreateNewLog(long ledgerId) flushCurrentLogs method is called during checkpoint, so metadata of the file also should be force written.(package private) void(package private) voidvoidif disk of the logChannel is full or if the entrylog limit is reached of if the logchannel is not initialized, then createNewLog.void(package private) ConcurrentMap<Long,EntryLogManagerForEntryLogPerLedger.EntryLogAndLockTuple> getCurrentLogForLedger(long ledgerId) (package private) DefaultEntryLogger.BufferedLogChannelgetCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog) getCurrentLogIfPresent(long entryLogId) getCurrentLogWithDirInfoForLedger(long ledgerId) getDirForNextEntryLog(List<File> writableLedgerDirs) (package private) LockgetLock(long ledgerId) voidvoidprepareSortedLedgerStorageCheckpoint(long numBytesFlushed) voidsetCurrentLogForLedgerAndAddToRotate(long ledgerId, DefaultEntryLogger.BufferedLogChannel logChannel) Methods inherited from class org.apache.bookkeeper.bookie.EntryLogManagerBase
createNewLog, flush, flushLogChannel, getRotatedLogChannels, reachEntryLogLimit, readEntryLogHardLimit, selectDirForNextEntryLog
-
Field Details
-
entryLogsPerLedgerCounter
-
-
Constructor Details
-
EntryLogManagerForEntryLogPerLedger
EntryLogManagerForEntryLogPerLedger(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, EntryLoggerAllocator entryLoggerAllocator, List<DefaultEntryLogger.EntryLogListener> listeners, DefaultEntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus, StatsLogger statsLogger) throws IOException - Throws:
IOException
-
-
Method Details
-
getLock
- Throws:
IOException
-
setCurrentLogForLedgerAndAddToRotate
public void setCurrentLogForLedgerAndAddToRotate(long ledgerId, DefaultEntryLogger.BufferedLogChannel logChannel) throws IOException - Specified by:
setCurrentLogForLedgerAndAddToRotatein classEntryLogManagerBase- Throws:
IOException
-
getCurrentLogForLedger
public DefaultEntryLogger.BufferedLogChannel getCurrentLogForLedger(long ledgerId) throws IOException - Specified by:
getCurrentLogForLedgerin classEntryLogManagerBase- Throws:
IOException
-
getCurrentLogWithDirInfoForLedger
public EntryLogManagerForEntryLogPerLedger.BufferedLogChannelWithDirInfo getCurrentLogWithDirInfoForLedger(long ledgerId) throws IOException - Throws:
IOException
-
getCopyOfCurrentLogs
public Set<EntryLogManagerForEntryLogPerLedger.BufferedLogChannelWithDirInfo> getCopyOfCurrentLogs() -
getCurrentLogIfPresent
-
checkpoint
- Throws:
IOException
-
prepareSortedLedgerStorageCheckpoint
- Throws:
IOException
-
prepareEntryMemTableFlush
public void prepareEntryMemTableFlush() -
commitEntryMemTableFlush
- Throws:
IOException
-
doEntryLogMapCleanup
void doEntryLogMapCleanup() -
getCacheAsMap
ConcurrentMap<Long,EntryLogManagerForEntryLogPerLedger.EntryLogAndLockTuple> getCacheAsMap() -
getDirForNextEntryLog
-
close
- Throws:
IOException
-
forceClose
public void forceClose() -
flushCurrentLogs
- Specified by:
flushCurrentLogsin classEntryLogManagerBase- Throws:
IOException
-
createNewLogForCompaction
flushCurrentLogs method is called during checkpoint, so metadata of the file also should be force written.- Throws:
IOException
-
addEntry
public long addEntry(long ledger, io.netty.buffer.ByteBuf entry, boolean rollLog) throws IOException - Specified by:
addEntryin interfaceEntryLogManager- Overrides:
addEntryin classEntryLogManagerBase- Throws:
IOException
-
createNewLog
- Overrides:
createNewLogin classEntryLogManagerBase- Throws:
IOException
-
getCurrentLogForLedgerForAddEntry
DefaultEntryLogger.BufferedLogChannel getCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog) throws IOException - Specified by:
getCurrentLogForLedgerForAddEntryin classEntryLogManagerBase- Throws:
IOException
-
flushRotatedLogs
if disk of the logChannel is full or if the entrylog limit is reached of if the logchannel is not initialized, then createNewLog. If allDisks are full then proceed with the current logChannel, since Bookie must have turned to readonly mode and the addEntry traffic would be from GC and it is ok to proceed in this case.- Specified by:
flushRotatedLogsin classEntryLogManagerBase- Throws:
IOException
-