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

## Class RecordSerializerFactoryImpl

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

All Implemented Interfaces:
  RecordSerializerFactory

    public class RecordSerializerFactoryImpl
    extends Object
    implements RecordSerializerFactory

### Constructor Summary

Constructors
Constructor and Description
`RecordSerializerFactoryImpl(GridCacheSharedContext cctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`RecordSerializer` `createSerializer(int ver)` Factory method for creation `RecordSerializer`.
`boolean` `marshalledMode()`
`RecordSerializerFactoryImpl` `marshalledMode(boolean marshalledMode)` If marshalledMode is on, created serializer will read `MarshalledRecord` with raw binary data instead of actual record.
`IgniteBiPredicate<WALRecord.RecordType,WALPointer>` `recordDeserializeFilter()`
`RecordSerializerFactoryImpl` `recordDeserializeFilter(IgniteBiPredicate<WALRecord.RecordType,WALPointer> readTypeFilter)` Specifies deserialization filter.
`boolean` `skipPositionCheck()`
`RecordSerializerFactoryImpl` `skipPositionCheck(boolean skipPositionCheck)` If skipPositionCheck is true, created serializer won't check that actual position of record in file is equal to position in saved record's WALPointer.
`boolean` `writePointer()`
`RecordSerializerFactoryImpl` `writePointer(boolean writePointer)` TODO: This flag was added under IGNITE-6029, but still unused.

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

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

### Constructor Detail

#### RecordSerializerFactoryImpl

    public RecordSerializerFactoryImpl(GridCacheSharedContext cctx)

Parameters:
  `cctx` - Cctx.

### Method Detail

#### createSerializer

    public RecordSerializer createSerializer(int ver)
                                      throws IgniteCheckedException

Factory method for creation `RecordSerializer`.

Specified by:
  `createSerializer` in interface `RecordSerializerFactory`
Parameters:
  `ver` - Serializer version.
Returns:
  record serializer.
Throws:
  `IgniteCheckedException`

#### writePointer

    public boolean writePointer()

Returns:
  Write pointer.

#### writePointer

    public RecordSerializerFactoryImpl writePointer(boolean writePointer)

TODO: This flag was added under IGNITE-6029, but still unused. Should be either handled or removed.

Specified by:
  `writePointer` in interface `RecordSerializerFactory`
Parameters:
  `writePointer` - Write pointer flag.

#### recordDeserializeFilter

    public IgniteBiPredicate<WALRecord.RecordType,WALPointer> recordDeserializeFilter()

Returns:
  Read type filter.

#### recordDeserializeFilter

    public RecordSerializerFactoryImpl recordDeserializeFilter(IgniteBiPredicate<WALRecord.RecordType,WALPointer> readTypeFilter)

Specifies deserialization filter. Created serializer will read bulk `FilteredRecord` instead of actual record if record type/pointer doesn't satisfy filter.

Specified by:
  `recordDeserializeFilter` in interface `RecordSerializerFactory`
Parameters:
  `readTypeFilter` - Read type filter.

#### marshalledMode

    public boolean marshalledMode()

Returns:
  Marshalled mode. Records are not deserialized in this mode, with binary representation are read instead.

#### marshalledMode

    public RecordSerializerFactoryImpl marshalledMode(boolean marshalledMode)

If marshalledMode is on, created serializer will read `MarshalledRecord` with raw binary data instead of actual record. Useful for copying binary data from WAL.

Specified by:
  `marshalledMode` in interface `RecordSerializerFactory`
Parameters:
  `marshalledMode` - Marshalled mode.

#### skipPositionCheck

    public boolean skipPositionCheck()

Returns:
  Skip position check flag. Should be set for reading compacted wal file with skipped physical records.

#### skipPositionCheck

    public RecordSerializerFactoryImpl skipPositionCheck(boolean skipPositionCheck)

If skipPositionCheck is true, created serializer won't check that actual position of record in file is equal to position in saved record's WALPointer. Must be true if we are reading from compacted WAL segment.

Specified by:
  `skipPositionCheck` in interface `RecordSerializerFactory`
Parameters:
  `skipPositionCheck` - Skip position check.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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