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