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 long
addEntry(long ledger, io.netty.buffer.ByteBuf entry, boolean rollLog)
void
checkpoint()
void
close()
boolean
commitEntryMemTableFlush()
(package private) void
createNewLog(long ledgerId)
DefaultEntryLogger.BufferedLogChannel
createNewLogForCompaction()
void
flushCurrentLogs()
(package private) void
flushRotatedLogs()
flushCurrentLogs method is called during checkpoint, so metadata of the file also should be force written.void
forceClose()
DefaultEntryLogger.BufferedLogChannel
getCurrentLogForLedger(long ledgerId)
(package private) DefaultEntryLogger.BufferedLogChannel
getCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog)
long
getCurrentLogId()
DefaultEntryLogger.BufferedLogChannel
getCurrentLogIfPresent(long entryLogId)
java.io.File
getDirForNextEntryLog(java.util.List<java.io.File> writableLedgerDirs)
void
prepareEntryMemTableFlush()
void
prepareSortedLedgerStorageCheckpoint(long numBytesFlushed)
void
setCurrentLogForLedgerAndAddToRotate(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:
addEntry
in interfaceEntryLogManager
- Overrides:
addEntry
in classEntryLogManagerBase
- Throws:
java.io.IOException
-
getCurrentLogForLedgerForAddEntry
DefaultEntryLogger.BufferedLogChannel getCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog) throws java.io.IOException
- Specified by:
getCurrentLogForLedgerForAddEntry
in classEntryLogManagerBase
- Throws:
java.io.IOException
-
createNewLog
void createNewLog(long ledgerId) throws java.io.IOException
- Overrides:
createNewLog
in classEntryLogManagerBase
- Throws:
java.io.IOException
-
setCurrentLogForLedgerAndAddToRotate
public void setCurrentLogForLedgerAndAddToRotate(long ledgerId, DefaultEntryLogger.BufferedLogChannel logChannel)
- Specified by:
setCurrentLogForLedgerAndAddToRotate
in classEntryLogManagerBase
-
getCurrentLogForLedger
public DefaultEntryLogger.BufferedLogChannel getCurrentLogForLedger(long ledgerId)
- Specified by:
getCurrentLogForLedger
in 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:
flushCurrentLogs
in classEntryLogManagerBase
- Throws:
java.io.IOException
-
flushRotatedLogs
void flushRotatedLogs() throws java.io.IOException
flushCurrentLogs method is called during checkpoint, so metadata of the file also should be force written.- Specified by:
flushRotatedLogs
in 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
-
-