public class RecordV1Serializer extends Object implements RecordSerializer
Enum.ordinal() incremented by 1| Modifier and Type | Field and Description |
|---|---|
static int |
FILE_WAL_POINTER_SIZE
Length of WAL Pointer
|
static int |
HEADER_RECORD_SIZE |
static int |
REC_TYPE_SIZE
Length of Type
|
| Constructor and Description |
|---|
RecordV1Serializer(GridCacheSharedContext cctx) |
| Modifier and Type | Method and Description |
|---|---|
static void |
putPosition(ByteBuffer buf,
FileWALPointer ptr)
Saves position, WAL pointer (requires
FILE_WAL_POINTER_SIZE bytes) |
static FileWALPointer |
readPosition(DataInput in) |
WALRecord |
readRecord(FileInput in0,
WALPointer expPtr)
Loads record from input
|
int |
size(WALRecord record)
Calculates record size in byte including expected wal pointer, CRC and type field
|
int |
version() |
void |
writeRecord(WALRecord record,
ByteBuffer buf) |
public static final int REC_TYPE_SIZE
public static final int FILE_WAL_POINTER_SIZE
public static final int HEADER_RECORD_SIZE
public RecordV1Serializer(GridCacheSharedContext cctx)
cctx - Cache shared context.public int version()
version in interface RecordSerializerpublic void writeRecord(WALRecord record, ByteBuffer buf) throws IgniteCheckedException
writeRecord in interface RecordSerializerrecord - Entry to write.buf - Buffer.IgniteCheckedExceptionpublic WALRecord readRecord(FileInput in0, WALPointer expPtr) throws IOException, IgniteCheckedException
readRecord in interface RecordSerializerin0 - Data input to read data from.expPtr - expected WAL pointer for record. Used to validate actual position against expected from the fileIOExceptionIgniteCheckedExceptionpublic int size(WALRecord record) throws IgniteCheckedException
size in interface RecordSerializerrecord - Record.IgniteCheckedExceptionpublic static void putPosition(ByteBuffer buf, FileWALPointer ptr)
FILE_WAL_POINTER_SIZE bytes)buf - Byte buffer to serialize version to.ptr - File WAL pointer to write.public static FileWALPointer readPosition(DataInput in) throws IOException
in - Data input to read pointer from.IOException - If failed to write.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.2.0 Release Date : September 15 2017