Class TtlAwareSerializerSnapshot<T>

  • All Implemented Interfaces:
    org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T>

    public class TtlAwareSerializerSnapshot<T>
    extends Object
    implements org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T>
    A TypeSerializerSnapshot for TtlAwareSerializer. This class wraps a TypeSerializerSnapshot with ttl awareness. It will return true when the wrapped TypeSerializerSnapshot is the instance of TtlStateFactory.TtlSerializerSnapshot. Also, it overrides the compatibility type check between TtlSerializerSnapshot and non-ttl TypeSerializerSnapshot.

    If two TtlAwareSerializerSnapshots have the same ttl config, it will return the compatibility check result of the original TypeSerializerSnapshot.

    If two TtlAwareSerializerSnapshots have different ttl config, it will return a wrapped compatibility check result.

    • Constructor Detail

      • TtlAwareSerializerSnapshot

        public TtlAwareSerializerSnapshot()
      • TtlAwareSerializerSnapshot

        public TtlAwareSerializerSnapshot​(org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T> typeSerializerSnapshot,
                                          boolean isTtlEnabled)
      • TtlAwareSerializerSnapshot

        public TtlAwareSerializerSnapshot​(org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T> typeSerializerSnapshot)
    • Method Detail

      • getCurrentVersion

        public int getCurrentVersion()
        Specified by:
        getCurrentVersion in interface org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T>
      • writeSnapshot

        public void writeSnapshot​(org.apache.flink.core.memory.DataOutputView out)
                           throws IOException
        Specified by:
        writeSnapshot in interface org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T>
        Throws:
        IOException
      • readSnapshot

        public void readSnapshot​(int readVersion,
                                 org.apache.flink.core.memory.DataInputView in,
                                 ClassLoader userCodeClassLoader)
                          throws IOException
        Specified by:
        readSnapshot in interface org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T>
        Throws:
        IOException
      • restoreSerializer

        public org.apache.flink.api.common.typeutils.TypeSerializer<T> restoreSerializer()
        Specified by:
        restoreSerializer in interface org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T>
      • resolveSchemaCompatibility

        public org.apache.flink.api.common.typeutils.TypeSerializerSchemaCompatibility<T> resolveSchemaCompatibility​(org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T> oldSerializerSnapshot)
        Specified by:
        resolveSchemaCompatibility in interface org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T>
      • isTtlEnabled

        public boolean isTtlEnabled()
      • getOrinalTypeSerializerSnapshot

        public org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T> getOrinalTypeSerializerSnapshot()