Class TypeSerializerSchemaCompatibility<T>

  • Type Parameters:
    T - the type of data serialized by the serializer that was being checked.

    @PublicEvolving
    public class TypeSerializerSchemaCompatibility<T>
    extends Object
    A TypeSerializerSchemaCompatibility represents information about whether or not a TypeSerializer can be safely used to read data written by a previous type serializer.

    Typically, the compatibility of the new serializer is resolved by checking the serializer snapshot against the TypeSerializerSnapshot of the previous serializer. Depending on the type of the resolved compatibility result, migration (i.e., reading bytes with the previous serializer and then writing it again with the new serializer) may be required before the new serializer can be used.

    See Also:
    TypeSerializer, TypeSerializerSnapshot.resolveSchemaCompatibility(TypeSerializerSnapshot)
    • Method Detail

      • compatibleAsIs

        public static <T> TypeSerializerSchemaCompatibility<T> compatibleAsIs()
        Returns a result that indicates that the new serializer is compatible and no migration is required. The new serializer can continued to be used as is.
        Returns:
        a result that indicates migration is not required for the new serializer.
      • compatibleAfterMigration

        public static <T> TypeSerializerSchemaCompatibility<T> compatibleAfterMigration()
        Returns a result that indicates that the new serializer can be used after migrating the written bytes, i.e. reading it with the old serializer and then writing it again with the new serializer.
        Returns:
        a result that indicates that the new serializer can be used after migrating the written bytes.
      • compatibleWithReconfiguredSerializer

        public static <T> TypeSerializerSchemaCompatibility<T> compatibleWithReconfiguredSerializer​(TypeSerializer<T> reconfiguredSerializer)
        Returns a result that indicates a reconfigured version of the new serializer is compatible, and should be used instead of the original new serializer.
        Parameters:
        reconfiguredSerializer - the reconfigured version of the new serializer.
        Returns:
        a result that indicates a reconfigured version of the new serializer is compatible, and should be used instead of the original new serializer.
      • incompatible

        public static <T> TypeSerializerSchemaCompatibility<T> incompatible()
        Returns a result that indicates there is no possible way for the new serializer to be use-able. This normally indicates that there is no common Java class between what the previous bytes can be deserialized into and what can be written by the new serializer.

        In this case, there is no possible way for the new serializer to continue to be used, even with migration. Recovery of the Flink job will fail.

        Returns:
        a result that indicates incompatibility between the new and previous serializer.
      • isCompatibleAsIs

        public boolean isCompatibleAsIs()
        Returns whether or not the type of the compatibility is TypeSerializerSchemaCompatibility.Type.COMPATIBLE_AS_IS.
        Returns:
        whether or not the type of the compatibility is TypeSerializerSchemaCompatibility.Type.COMPATIBLE_AS_IS.
      • isCompatibleAfterMigration

        public boolean isCompatibleAfterMigration()
        Returns whether or not the type of the compatibility is TypeSerializerSchemaCompatibility.Type.COMPATIBLE_AFTER_MIGRATION.
        Returns:
        whether or not the type of the compatibility is TypeSerializerSchemaCompatibility.Type.COMPATIBLE_AFTER_MIGRATION.
      • isCompatibleWithReconfiguredSerializer

        public boolean isCompatibleWithReconfiguredSerializer()
        Returns whether or not the type of the compatibility is TypeSerializerSchemaCompatibility.Type.COMPATIBLE_WITH_RECONFIGURED_SERIALIZER.
        Returns:
        whether or not the type of the compatibility is TypeSerializerSchemaCompatibility.Type.COMPATIBLE_WITH_RECONFIGURED_SERIALIZER.
      • isIncompatible

        public boolean isIncompatible()
        Returns whether or not the type of the compatibility is TypeSerializerSchemaCompatibility.Type.INCOMPATIBLE.
        Returns:
        whether or not the type of the compatibility is TypeSerializerSchemaCompatibility.Type.INCOMPATIBLE.