Class Header
java.lang.Object
org.apache.bookkeeper.bookie.storage.directentrylogger.Header
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
FieldsModifier and TypeFieldDescription(package private) static final byte[](package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(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 Details
-
LOGFILE_LEGACY_HEADER_SIZE
static final int LOGFILE_LEGACY_HEADER_SIZE- See Also:
-
LOGFILE_DIRECT_HEADER_SIZE
static final int LOGFILE_DIRECT_HEADER_SIZE- See Also:
-
HEADER_VERSION_OFFSET
static final int HEADER_VERSION_OFFSET- See Also:
-
LEDGERS_MAP_OFFSET
static final int LEDGERS_MAP_OFFSET- See Also:
-
LEDGER_COUNT_OFFSET
static final int LEDGER_COUNT_OFFSET- See Also:
-
HEADER_V0
static final int HEADER_V0- See Also:
-
HEADER_V1
static final int HEADER_V1- See Also:
-
HEADER_CURRENT_VERSION
static final int HEADER_CURRENT_VERSION- See Also:
-
EMPTY_HEADER
static final byte[] EMPTY_HEADER
-
-
Constructor Details
-
Header
Header()
-
-
Method Details
-
extractVersion
- Throws:
IOException
-
extractLedgerMapOffset
- Throws:
IOException
-
extractLedgerCount
- Throws:
IOException
-
assertFingerPrint
- Throws:
IOException
-
writeEmptyHeader
- Throws:
IOException
-
writeHeader
static void writeHeader(io.netty.buffer.ByteBuf header, long ledgerMapOffset, int ledgerCount) throws IOException - Throws:
IOException
-