Class Header
- java.lang.Object
-
- org.apache.bookkeeper.bookie.storage.directentrylogger.Header
-
class Header extends java.lang.Object
The 1K block at the head of the entry logger file that contains the fingerprint and meta-data.Header is composed of: Fingerprint: 4 bytes "BKLO" Log file HeaderVersion enum: 4 bytes Ledger map offset: 8 bytes Ledgers Count: 4 bytes
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static byte[]
EMPTY_HEADER
(package private) static int
HEADER_CURRENT_VERSION
(package private) static int
HEADER_V0
(package private) static int
HEADER_V1
(package private) static int
HEADER_VERSION_OFFSET
(package private) static int
LEDGER_COUNT_OFFSET
(package private) static int
LEDGERS_MAP_OFFSET
(package private) static int
LOGFILE_DIRECT_HEADER_SIZE
(package private) static int
LOGFILE_LEGACY_HEADER_SIZE
-
Constructor Summary
Constructors Constructor Description Header()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static void
assertFingerPrint(io.netty.buffer.ByteBuf header)
(package private) static int
extractLedgerCount(io.netty.buffer.ByteBuf header)
(package private) static long
extractLedgerMapOffset(io.netty.buffer.ByteBuf header)
(package private) static int
extractVersion(io.netty.buffer.ByteBuf header)
(package private) static void
writeEmptyHeader(io.netty.buffer.ByteBuf header)
(package private) static void
writeHeader(io.netty.buffer.ByteBuf header, long ledgerMapOffset, int ledgerCount)
-
-
-
Field Detail
-
LOGFILE_LEGACY_HEADER_SIZE
static final int LOGFILE_LEGACY_HEADER_SIZE
- See Also:
- Constant Field Values
-
LOGFILE_DIRECT_HEADER_SIZE
static final int LOGFILE_DIRECT_HEADER_SIZE
- See Also:
- Constant Field Values
-
HEADER_VERSION_OFFSET
static final int HEADER_VERSION_OFFSET
- See Also:
- Constant Field Values
-
LEDGERS_MAP_OFFSET
static final int LEDGERS_MAP_OFFSET
- See Also:
- Constant Field Values
-
LEDGER_COUNT_OFFSET
static final int LEDGER_COUNT_OFFSET
- See Also:
- Constant Field Values
-
HEADER_V0
static final int HEADER_V0
- See Also:
- Constant Field Values
-
HEADER_V1
static final int HEADER_V1
- See Also:
- Constant Field Values
-
HEADER_CURRENT_VERSION
static final int HEADER_CURRENT_VERSION
- See Also:
- Constant Field Values
-
EMPTY_HEADER
static final byte[] EMPTY_HEADER
-
-
Method Detail
-
extractVersion
static int extractVersion(io.netty.buffer.ByteBuf header) throws java.io.IOException
- Throws:
java.io.IOException
-
extractLedgerMapOffset
static long extractLedgerMapOffset(io.netty.buffer.ByteBuf header) throws java.io.IOException
- Throws:
java.io.IOException
-
extractLedgerCount
static int extractLedgerCount(io.netty.buffer.ByteBuf header) throws java.io.IOException
- Throws:
java.io.IOException
-
assertFingerPrint
static void assertFingerPrint(io.netty.buffer.ByteBuf header) throws java.io.IOException
- Throws:
java.io.IOException
-
writeEmptyHeader
static void writeEmptyHeader(io.netty.buffer.ByteBuf header) throws java.io.IOException
- Throws:
java.io.IOException
-
writeHeader
static void writeHeader(io.netty.buffer.ByteBuf header, long ledgerMapOffset, int ledgerCount) throws java.io.IOException
- Throws:
java.io.IOException
-
-