Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleTypeserializer.java
linenumberstrue
@PublicEvolving
public abstract class TypeSerializer<T> {
	// Check whether the serializer is compatible with the old one.
    public abstract TypeSerializerSchemaCompatibility<T> resolveSchemaCompatibility(TypeSerializerSnapshot<T> typeSerializerSnapshot) {
		// Incompatible as default
		return TypeSerializerSchemaCompatibility.incompatible();
    }
}

Proposed Changes

Because Both TypeSerializer and TypeSerializerSnapshot are public interfaces, we have several steps to migrate the logic.

...

Add an extra method in TypeSerializer.java as below.

Code Block
languagejava
titleTypeserializer.java
linenumberstrue
@PublicEvolving
public abstract class TypeSerializer<T> {
	// Check whether the serializer is compatible with the old one.
    public TypeSerializerSchemaCompatibility<T> resolveSchemaCompatibility(TypeSerializerSnapshot<T> typeSerializerSnapshot) {
		// Incompatible as default
		return TypeSerializerSchemaCompatibility.incompatible();
    }
}

above.

Typeserializer#resolveSchemaCompatibility will return TYPE.INCOMPATIBLE default.

...

  1. Implement the method in all inner Typeserializers
  2. Mark TypeSerializerSnapshot#resolveSchemaCompatibility as deprecated
  3. Make the method abstract, remove the default implementation as below

...

languagejava
titleTypeserializer.java
linenumberstrue

...

Step 3

Remove After several stable version, remove TypeSerializerSnapshot#resolveSchemaCompatibility and related implementation.

...