Package com.illumon.iris.binarystore
Class BinaryRecordV2
java.lang.Object
com.illumon.iris.binarystore.BinaryRecordV2
- All Implemented Interfaces:
Record
public class BinaryRecordV2 extends Object implements Record
This class implements binary record entry writing for the V2 binary log format.
The binary store v2 format supports record entries.
This class encapsulates the payload of such a record.
Format of a V2 binary Record (as distinct from a Row) is:
Format of a V2 binary Record (as distinct from a Row) is:
- Size (int) - per v2 binary format
- Row Flags (byte) - per v2 binary format
- record data:
- record type (int)
- version (int)
- any additional data for the record type
- checksum (int) - per v2 binary format
- command id (int)
- optional additional data
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
BinaryRecordV2.BinaryStoreRecordSetter<T extends RecordData>
Nested classes/interfaces inherited from interface com.illumon.iris.binarystore.Record
Record.RecordSetter<T extends RecordData>
-
Field Summary
Fields Modifier and Type Field Description protected ByteBuffer
dataBuffer
protected RowSetter<RecordData>
recordSetter
protected BinaryStoreWriterV2
writer
-
Constructor Summary
Constructors Constructor Description BinaryRecordV2(BinaryStoreWriterV2 writer)
-
Method Summary
Modifier and Type Method Description <T extends RecordData>
Record.RecordSetter<T>getRecordSetter(Class<T> tClass)
Gets a typed record setter for an entry.static void
populateBuffer(ByteBuffer theBuffer, RecordData recordData)
Populate the given buffer with all the record data and all surrounding v2 binary row requirements.void
setRecordData(RecordData recordData)
Set record data using the default/primary record writer.void
writeRecord(WritableByteChannel channel)
Write a record entry to the provided output channel.
-
Field Details
-
Constructor Details
-
Method Details
-
getRecordSetter
Description copied from interface:Record
Gets a typed record setter for an entry.- Specified by:
getRecordSetter
in interfaceRecord
- Returns:
- setter for the record.
-
setRecordData
Set record data using the default/primary record writer.- Parameters:
recordData
- the data to set
-
writeRecord
Description copied from interface:Record
Write a record entry to the provided output channel. The implementor is responsible for providing the data buffer.- Specified by:
writeRecord
in interfaceRecord
- Throws:
IOException
-
populateBuffer
Populate the given buffer with all the record data and all surrounding v2 binary row requirements.- Parameters:
theBuffer
- populate this bufferrecordData
- The data payload
-