Package org.apache.bookkeeper.bookie
Class DefaultEntryLogger.BufferedLogChannel
- java.lang.Object
-
- org.apache.bookkeeper.bookie.BufferedChannelBase
-
- org.apache.bookkeeper.bookie.BufferedReadChannel
-
- org.apache.bookkeeper.bookie.BufferedChannel
-
- org.apache.bookkeeper.bookie.DefaultEntryLogger.BufferedLogChannel
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Enclosing class:
- DefaultEntryLogger
static class DefaultEntryLogger.BufferedLogChannel extends BufferedChannel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.bookkeeper.bookie.BufferedChannelBase
BufferedChannelBase.BufferedChannelClosedException
-
-
Field Summary
-
Fields inherited from class org.apache.bookkeeper.bookie.BufferedChannel
position, unpersistedBytes, unpersistedBytesBound, writeBuffer, writeBufferStartPosition, writeCapacity
-
Fields inherited from class org.apache.bookkeeper.bookie.BufferedReadChannel
cacheHitCount, invocationCount, readBuffer, readBufferStartPosition, readCapacity, sealed
-
Fields inherited from class org.apache.bookkeeper.bookie.BufferedChannelBase
fileChannel
-
-
Constructor Summary
Constructors Constructor Description BufferedLogChannel(io.netty.buffer.ByteBufAllocator allocator, java.nio.channels.FileChannel fc, int writeCapacity, int readCapacity, long logId, java.io.File logFile, long unpersistedBytesBound)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
appendLedgersMap()
Append the ledger map at the end of the entry log.java.lang.Long
getLedgerIdAssigned()
ConcurrentLongLongHashMap
getLedgersMap()
java.io.File
getLogFile()
long
getLogId()
void
registerWrittenEntry(long ledgerId, long entrySize)
void
setLedgerIdAssigned(java.lang.Long ledgerId)
java.lang.String
toString()
-
Methods inherited from class org.apache.bookkeeper.bookie.BufferedChannel
clear, close, flush, flushAndForceWrite, flushAndForceWriteIfRegularFlush, forceWrite, getFileChannelPosition, getNumOfBytesInWriteBuffer, getUnpersistedBytes, position, read, write
-
Methods inherited from class org.apache.bookkeeper.bookie.BufferedReadChannel
read, size
-
Methods inherited from class org.apache.bookkeeper.bookie.BufferedChannelBase
validateAndGetFileChannel
-
-
-
-
Method Detail
-
getLogId
public long getLogId()
-
getLogFile
public java.io.File getLogFile()
-
registerWrittenEntry
public void registerWrittenEntry(long ledgerId, long entrySize)
-
getLedgersMap
public ConcurrentLongLongHashMap getLedgersMap()
-
getLedgerIdAssigned
public java.lang.Long getLedgerIdAssigned()
-
setLedgerIdAssigned
public void setLedgerIdAssigned(java.lang.Long ledgerId)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
appendLedgersMap
void appendLedgersMap() throws java.io.IOException
Append the ledger map at the end of the entry log. Updates the entry log file header with the offset and size of the map.- Throws:
java.io.IOException
-
-