public class LogRecordSet extends Object
LogRecords.
Structure:
Bytes 0 - 4 : Metadata (version + flags)
Bytes 4 - 7 : Number of Records
Bytes 8 - 11 : Original Payload Length
Bytes 12 - 15 : Actual Payload Length
Bytes 16 - 16+length-1 : Payload
------------------------------------------------------
Metadata: Version and Flags // 32 Bits
--------------------------------------
0 ... 0 0 0 0 0
|_|
|
Compression Codec: // 2 Bits (Least significant)
-----------------
00 : No Compression
01 : LZ4 Compression
10 : Unused
11 : Unused
| Modifier and Type | Class and Description |
|---|---|
static interface |
LogRecordSet.Reader
Reader to read
LogRecords from this record set. |
static interface |
LogRecordSet.Writer
Writer to append
LogRecords to LogRecordSet. |
| Modifier and Type | Field and Description |
|---|---|
static int |
HEADER_LEN |
| Constructor and Description |
|---|
LogRecordSet() |
| Modifier and Type | Method and Description |
|---|---|
static LogRecordSet.Writer |
newWriter(int initialBufferSize,
CompressionCodec.Type codec) |
static int |
numRecords(byte[] data) |
static int |
numRecords(LogRecord record) |
static LogRecordSet.Reader |
of(LogRecordWithDLSN record) |
public static final int HEADER_LEN
public static int numRecords(LogRecord record) throws IOException
IOExceptionpublic static int numRecords(byte[] data)
throws IOException
IOExceptionpublic static LogRecordSet.Writer newWriter(int initialBufferSize, CompressionCodec.Type codec)
public static LogRecordSet.Reader of(LogRecordWithDLSN record) throws IOException
IOExceptionCopyright © 2016. All Rights Reserved.