public static class TtlStateFactory.TtlSerializer<T> extends CompositeSerializer<TtlValue<T>> implements TypeSerializerConfigSnapshot.SelfResolvingTypeSerializer<TtlValue<T>>
CompositeSerializer.ConfigSnapshot, CompositeSerializer.PrecomputedParameters
fieldSerializers
Constructor and Description |
---|
TtlSerializer(CompositeSerializer.PrecomputedParameters precomputed,
TypeSerializer<?>... fieldSerializers) |
TtlSerializer(TypeSerializer<Long> timestampSerializer,
TypeSerializer<T> userValueSerializer) |
Modifier and Type | Method and Description |
---|---|
TtlValue<T> |
createInstance(Object... values)
Create new instance from its fields.
|
protected CompositeSerializer<TtlValue<T>> |
createSerializerInstance(CompositeSerializer.PrecomputedParameters precomputed,
TypeSerializer<?>... originalSerializers)
Factory for concrete serializer.
|
protected Object |
getField(TtlValue<T> v,
int index)
Get field of existing instance.
|
static boolean |
isTtlStateSerializer(TypeSerializer<?> typeSerializer) |
TypeSerializerSchemaCompatibility<TtlValue<T>> |
resolveSchemaCompatibilityViaRedirectingToNewSnapshotClass(TypeSerializerConfigSnapshot<TtlValue<T>> deprecatedConfigSnapshot)
Resolve Schema Compatibility.
|
protected void |
setField(TtlValue<T> v,
int index,
Object fieldValue)
Modify field of existing instance.
|
TypeSerializerSnapshot<TtlValue<T>> |
snapshotConfiguration()
Snapshots the configuration of this TypeSerializer.
|
copy, copy, copy, createInstance, deserialize, deserialize, duplicate, equals, getLength, hashCode, isImmutableType, serialize
public TtlSerializer(TypeSerializer<Long> timestampSerializer, TypeSerializer<T> userValueSerializer)
public TtlSerializer(CompositeSerializer.PrecomputedParameters precomputed, TypeSerializer<?>... fieldSerializers)
public TtlValue<T> createInstance(@Nonnull Object... values)
CompositeSerializer
createInstance
in class CompositeSerializer<TtlValue<T>>
protected void setField(@Nonnull TtlValue<T> v, int index, Object fieldValue)
CompositeSerializer
setField
in class CompositeSerializer<TtlValue<T>>
protected Object getField(@Nonnull TtlValue<T> v, int index)
CompositeSerializer
getField
in class CompositeSerializer<TtlValue<T>>
protected CompositeSerializer<TtlValue<T>> createSerializerInstance(CompositeSerializer.PrecomputedParameters precomputed, TypeSerializer<?>... originalSerializers)
CompositeSerializer
createSerializerInstance
in class CompositeSerializer<TtlValue<T>>
public TypeSerializerSnapshot<TtlValue<T>> snapshotConfiguration()
TypeSerializer
The snapshot of the TypeSerializer is supposed to contain all information that affects the serialization format of the serializer. The snapshot serves two purposes: First, to reproduce the serializer when the checkpoint/savepoint is restored, and second, to check whether the serialization format is compatible with the serializer used in the restored program.
IMPORTANT: TypeSerializerSnapshots changed after Flink 1.6. Serializers implemented against Flink versions up to 1.6 should still work, but adjust to new model to enable state evolution and be future-proof. See the class-level comments, section "Upgrading TypeSerializers to the new TypeSerializerSnapshot model" for details.
snapshotConfiguration
in class TypeSerializer<TtlValue<T>>
null
).TypeSerializerSnapshot.resolveSchemaCompatibility(TypeSerializer)
public TypeSerializerSchemaCompatibility<TtlValue<T>> resolveSchemaCompatibilityViaRedirectingToNewSnapshotClass(TypeSerializerConfigSnapshot<TtlValue<T>> deprecatedConfigSnapshot)
TypeSerializerConfigSnapshot.SelfResolvingTypeSerializer
Given an instance of a TypeSerializerConfigSnapshot
this method should
redirect the compatibility check to the new TypeSerializerSnapshot
class along
with the relevant information as present in the given deprecatedConfigSnapshot
.
resolveSchemaCompatibilityViaRedirectingToNewSnapshotClass
in interface TypeSerializerConfigSnapshot.SelfResolvingTypeSerializer<TtlValue<T>>
deprecatedConfigSnapshot
- the not yet migrated config snapshot class.deprecatedConfigSnapshot
with this
serializer.public static boolean isTtlStateSerializer(TypeSerializer<?> typeSerializer)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.