Class TtlStateFactory.TtlSerializer<T>
- java.lang.Object
-
- org.apache.flink.api.common.typeutils.TypeSerializer<T>
-
- org.apache.flink.api.common.typeutils.CompositeSerializer<TtlValue<T>>
-
- org.apache.flink.runtime.state.ttl.TtlStateFactory.TtlSerializer<T>
-
- All Implemented Interfaces:
Serializable
public static class TtlStateFactory.TtlSerializer<T> extends CompositeSerializer<TtlValue<T>>
Serializer for user state value with TTL. Visibility is public for usage with external tools.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.api.common.typeutils.CompositeSerializer
CompositeSerializer.PrecomputedParameters
-
-
Field Summary
-
Fields inherited from class org.apache.flink.api.common.typeutils.CompositeSerializer
fieldSerializers
-
-
Constructor Summary
Constructors Constructor Description TtlSerializer(CompositeSerializer.PrecomputedParameters precomputed, TypeSerializer<?>... fieldSerializers)
TtlSerializer(TypeSerializer<Long> timestampSerializer, TypeSerializer<T> userValueSerializer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
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.-
Methods inherited from class org.apache.flink.api.common.typeutils.CompositeSerializer
copy, copy, copy, createInstance, deserialize, deserialize, duplicate, equals, getLength, hashCode, isImmutableType, serialize
-
-
-
-
Constructor Detail
-
TtlSerializer
public TtlSerializer(TypeSerializer<Long> timestampSerializer, TypeSerializer<T> userValueSerializer)
-
TtlSerializer
public TtlSerializer(CompositeSerializer.PrecomputedParameters precomputed, TypeSerializer<?>... fieldSerializers)
-
-
Method Detail
-
createInstance
public TtlValue<T> createInstance(@Nonnull Object... values)
Description copied from class:CompositeSerializer
Create new instance from its fields.- Specified by:
createInstance
in classCompositeSerializer<TtlValue<T>>
-
setField
protected void setField(@Nonnull TtlValue<T> v, int index, Object fieldValue)
Description copied from class:CompositeSerializer
Modify field of existing instance. Supported only by mutable types.- Specified by:
setField
in classCompositeSerializer<TtlValue<T>>
-
getField
protected Object getField(@Nonnull TtlValue<T> v, int index)
Description copied from class:CompositeSerializer
Get field of existing instance.- Specified by:
getField
in classCompositeSerializer<TtlValue<T>>
-
createSerializerInstance
protected CompositeSerializer<TtlValue<T>> createSerializerInstance(CompositeSerializer.PrecomputedParameters precomputed, TypeSerializer<?>... originalSerializers)
Description copied from class:CompositeSerializer
Factory for concrete serializer.- Specified by:
createSerializerInstance
in classCompositeSerializer<TtlValue<T>>
-
snapshotConfiguration
public TypeSerializerSnapshot<TtlValue<T>> snapshotConfiguration()
Description copied from class:TypeSerializer
Snapshots the configuration of this TypeSerializer. This method is only relevant if the serializer is used to state stored in checkpoints/savepoints.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.
- Specified by:
snapshotConfiguration
in classTypeSerializer<TtlValue<T>>
- Returns:
- snapshot of the serializer's current configuration (cannot be
null
). - See Also:
TypeSerializerSnapshot.resolveSchemaCompatibility(TypeSerializerSnapshot)
-
isTtlStateSerializer
public static boolean isTtlStateSerializer(TypeSerializer<?> typeSerializer)
-
-