org.apache.ignite.internal.processors.cache.persistence.wal.serializer

## Class RecordDataV2Serializer

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordDataV2Serializer

All Implemented Interfaces:
  RecordDataSerializer

    public class RecordDataV2Serializer
    extends Object
    implements RecordDataSerializer

Record data V2 serializer.

### Constructor Summary

Constructors
Constructor and Description
`RecordDataV2Serializer(RecordDataV1Serializer delegateSerializer)` Create an instance of V2 data serializer.

### Method Summary

All Methods Instance Methods Concrete Methods
`WALRecord` `readRecord(WALRecord.RecordType type, ByteBufferBackedDataInput in)` Reads record data of `type` from buffer `in`.
`int` `size(WALRecord rec)` Calculates size of record data.
`void` `writeRecord(WALRecord rec, ByteBuffer buf)` Writes record data to buffer `buf`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RecordDataV2Serializer

    public RecordDataV2Serializer(RecordDataV1Serializer delegateSerializer)

Create an instance of V2 data serializer.

Parameters:
  `delegateSerializer` - V1 data serializer.

### Method Detail

#### size

    public int size(WALRecord rec)
             throws IgniteCheckedException

Calculates size of record data.

Specified by:
  `size` in interface `RecordDataSerializer`
Parameters:
  `rec` - 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)
                         throws IOException,
                                IgniteCheckedException

Reads record data of `type` from buffer `in`.

Specified by:
  `readRecord` in interface `RecordDataSerializer`
Parameters:
  `type` - Record type.
  `in` - Buffer to read.
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 buffer `buf`.

Specified by:
  `writeRecord` in interface `RecordDataSerializer`
Parameters:
  `rec` - WAL record.
  `buf` - Buffer to write.
Throws:
  `IgniteCheckedException` - If it's unable to write record.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018