Package org.apache.bookkeeper.bookie
Class EntryLogManagerForSingleEntryLog
java.lang.Object
org.apache.bookkeeper.bookie.EntryLogManagerBase
org.apache.bookkeeper.bookie.EntryLogManagerForSingleEntryLog
- All Implemented Interfaces:
EntryLogManager
-
Field Summary
Fields inherited from class org.apache.bookkeeper.bookie.EntryLogManagerBase
entryLoggerAllocator, ledgerDirsManager, logSizeLimit, rotatedLogChannels -
Constructor Summary
ConstructorsConstructorDescriptionEntryLogManagerForSingleEntryLog(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, EntryLoggerAllocator entryLoggerAllocator, List<DefaultEntryLogger.EntryLogListener> listeners, DefaultEntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus) -
Method Summary
Modifier and TypeMethodDescriptionlongaddEntry(long ledger, io.netty.buffer.ByteBuf entry, boolean rollLog) voidvoidclose()boolean(package private) voidcreateNewLog(long ledgerId) void(package private) voidflushCurrentLogs method is called during checkpoint, so metadata of the file also should be force written.voidgetCurrentLogForLedger(long ledgerId) (package private) DefaultEntryLogger.BufferedLogChannelgetCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog) longgetCurrentLogIfPresent(long entryLogId) getDirForNextEntryLog(List<File> writableLedgerDirs) 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
-
Constructor Details
-
EntryLogManagerForSingleEntryLog
EntryLogManagerForSingleEntryLog(ServerConfiguration conf, LedgerDirsManager ledgerDirsManager, EntryLoggerAllocator entryLoggerAllocator, List<DefaultEntryLogger.EntryLogListener> listeners, DefaultEntryLogger.RecentEntryLogsStatus recentlyCreatedEntryLogsStatus)
-
-
Method Details
-
addEntry
public long addEntry(long ledger, io.netty.buffer.ByteBuf entry, boolean rollLog) throws IOException - Specified by:
addEntryin interfaceEntryLogManager- Overrides:
addEntryin classEntryLogManagerBase- Throws:
IOException
-
getCurrentLogForLedgerForAddEntry
DefaultEntryLogger.BufferedLogChannel getCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog) throws IOException - Specified by:
getCurrentLogForLedgerForAddEntryin classEntryLogManagerBase- Throws:
IOException
-
createNewLog
- Overrides:
createNewLogin classEntryLogManagerBase- Throws:
IOException
-
setCurrentLogForLedgerAndAddToRotate
public void setCurrentLogForLedgerAndAddToRotate(long ledgerId, DefaultEntryLogger.BufferedLogChannel logChannel) - Specified by:
setCurrentLogForLedgerAndAddToRotatein classEntryLogManagerBase
-
getCurrentLogForLedger
- Specified by:
getCurrentLogForLedgerin classEntryLogManagerBase
-
getCurrentLogIfPresent
-
getDirForNextEntryLog
-
checkpoint
- Throws:
IOException
-
getCurrentLogId
public long getCurrentLogId() -
flushCurrentLogs
- Specified by:
flushCurrentLogsin classEntryLogManagerBase- Throws:
IOException
-
flushRotatedLogs
flushCurrentLogs method is called during checkpoint, so metadata of the file also should be force written.- Specified by:
flushRotatedLogsin classEntryLogManagerBase- Throws:
IOException
-
close
- Throws:
IOException
-
forceClose
public void forceClose() -
prepareEntryMemTableFlush
public void prepareEntryMemTableFlush() -
commitEntryMemTableFlush
- Throws:
IOException
-
prepareSortedLedgerStorageCheckpoint
- Throws:
IOException
-
createNewLogForCompaction
- Throws:
IOException
-