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

### Field Summary

### Fields inherited from interface org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordSerializerFactory

`LATEST_SERIALIZER_VERSION`

### Constructor Summary

Constructors
Constructor and Description
`RecordSerializerFactoryImpl(GridCacheSharedContext cctx)`
`RecordSerializerFactoryImpl(GridCacheSharedContext cctx, @Nullable IgniteBiPredicate<WALRecord.RecordType,WALPointer> readTypeFilter)`

### 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(@Nullable 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.

#### RecordSerializerFactoryImpl

    public RecordSerializerFactoryImpl(GridCacheSharedContext cctx,
                                       @Nullable
                                       @Nullable IgniteBiPredicate<WALRecord.RecordType,WALPointer> readTypeFilter)

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(@Nullable
                                                               @Nullable 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.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023