THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
@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 | ||||||
---|---|---|---|---|---|---|
| ||||||
@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.
...
- Implement the method in all inner Typeserializers
- Mark TypeSerializerSnapshot#resolveSchemaCompatibility as deprecated
- Make the method abstract, remove the default implementation as below
...
language | java |
---|---|
title | Typeserializer.java |
linenumbers | true |
...
Step 3
Remove After several stable version, remove TypeSerializerSnapshot#resolveSchemaCompatibility and related implementation.
...