Class RecordDataV1Serializer
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordDataV1Serializer
-
- All Implemented Interfaces:
RecordDataSerializer
- Direct Known Subclasses:
RecordDataV2Serializer
public class RecordDataV1Serializer extends Object implements RecordDataSerializer
Record data V1 serializer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRecordDataV1Serializer.EncryptedDataEntryRepresents encrypted Data Entry (DataEntry.key,value) pair.
-
Field Summary
Fields Modifier and Type Field Description protected GridCacheSharedContextcctxCache shared context.protected IgniteCacheObjectProcessorcoCache object processor to readingDataEntries.protected intpageSizeSize of page used for PageMemory regions.protected intrealPageSizeSize of page without encryption overhead.
-
Constructor Summary
Constructors Constructor Description RecordDataV1Serializer(GridCacheSharedContext cctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GridCacheSharedContextcctx()Return shared cache context.protected intdataSize(DataRecord dataRec)protected intentrySize(DataEntry entry)WALRecordreadRecord(WALRecord.RecordType type, ByteBufferBackedDataInput in, int size)Reads record data oftypefrom bufferin.intsize(WALRecord record)Calculates size of record data.voidwriteRecord(WALRecord rec, ByteBuffer buf)Writes record data to bufferbuf.
-
-
-
Field Detail
-
cctx
protected final GridCacheSharedContext cctx
Cache shared context.
-
pageSize
protected final int pageSize
Size of page used for PageMemory regions.
-
realPageSize
protected final int realPageSize
Size of page without encryption overhead.
-
co
protected final IgniteCacheObjectProcessor co
Cache object processor to readingDataEntries.
-
-
Constructor Detail
-
RecordDataV1Serializer
public RecordDataV1Serializer(GridCacheSharedContext cctx)
- Parameters:
cctx- Cache shared context.
-
-
Method Detail
-
size
public int size(WALRecord record) throws IgniteCheckedException
Calculates size of record data.- Specified by:
sizein interfaceRecordDataSerializer- Parameters:
record- WAL record.- Returns:
- Size of record in bytes.
- Throws:
IgniteCheckedException- If it's unable to calculate record data size.
-
readRecord
public WALRecord readRecord(WALRecord.RecordType type, ByteBufferBackedDataInput in, int size) throws IOException, IgniteCheckedException
Reads record data oftypefrom bufferin.- Specified by:
readRecordin interfaceRecordDataSerializer- Parameters:
type- Record type.in- Buffer to read.size- Record size (0 if unknown).- Returns:
- WAL record.
- Throws:
IOException- In case of I/O problems.IgniteCheckedException- If it's unable to read record.
-
writeRecord
public void writeRecord(WALRecord rec, ByteBuffer buf) throws IgniteCheckedException
Writes record data to bufferbuf.- Specified by:
writeRecordin interfaceRecordDataSerializer- Parameters:
rec- WAL record.buf- Buffer to write.- Throws:
IgniteCheckedException- If it's unable to write record.
-
cctx
public GridCacheSharedContext cctx()
Return shared cache context.- Returns:
- Shared cache context.
-
dataSize
protected int dataSize(DataRecord dataRec) throws IgniteCheckedException
- Parameters:
dataRec- Data record to serialize.- Returns:
- Full data record size.
- Throws:
IgniteCheckedException- If failed to obtain the length of one of the entries.
-
entrySize
protected int entrySize(DataEntry entry) throws IgniteCheckedException
- Parameters:
entry- Entry to get size for.- Returns:
- Entry size.
- Throws:
IgniteCheckedException- If failed to get key or value bytes length.
-
-