Class Header
- java.lang.Object
-
- org.apache.bookkeeper.bookie.storage.directentrylogger.Header
-
class Header extends java.lang.ObjectThe 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 intHEADER_CURRENT_VERSION(package private) static intHEADER_V0(package private) static intHEADER_V1(package private) static intHEADER_VERSION_OFFSET(package private) static intLEDGER_COUNT_OFFSET(package private) static intLEDGERS_MAP_OFFSET(package private) static intLOGFILE_DIRECT_HEADER_SIZE(package private) static intLOGFILE_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 voidassertFingerPrint(io.netty.buffer.ByteBuf header)(package private) static intextractLedgerCount(io.netty.buffer.ByteBuf header)(package private) static longextractLedgerMapOffset(io.netty.buffer.ByteBuf header)(package private) static intextractVersion(io.netty.buffer.ByteBuf header)(package private) static voidwriteEmptyHeader(io.netty.buffer.ByteBuf header)(package private) static voidwriteHeader(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
-
-