@Override public TypeSerializerSchemaCompatibility<Map<K, V>> resolveSchemaCompatibility(TypeSerializer<Map<K, V>> newSerializer) { if (newSerializer instanceof MapSerializer) { List<Tuple2<TypeSerializer<?>, TypeSerializerSnapshot<?>>> nestedSerializersAndConfigs = getNestedSerializersAndConfigs(); // redirect the compatibility check to the new MapSerializerSnapshot return CompositeTypeSerializerUtil.delegateCompatibilityCheckToNewSnapshot( newSerializer, new MapSerializerSnapshot<>(), nestedSerializersAndConfigs.get(0).f1, nestedSerializersAndConfigs.get(1).f1); } else { return super.resolveSchemaCompatibility(newSerializer); } }
@Override @SuppressWarnings("unchecked") public TypeSerializerSchemaCompatibility<Either<L, R>> resolveSchemaCompatibility( TypeSerializer<Either<L, R>> newSerializer) { // this class was shared between the Java Either Serializer and the // Scala Either serializer if (newSerializer.getClass() == EitherSerializer.class) { List<Tuple2<TypeSerializer<?>, TypeSerializerSnapshot<?>>> nestedSerializersAndConfigs = getNestedSerializersAndConfigs(); return CompositeTypeSerializerUtil.delegateCompatibilityCheckToNewSnapshot( newSerializer, new JavaEitherSerializerSnapshot<>(), nestedSerializersAndConfigs.get(0).f1, nestedSerializersAndConfigs.get(1).f1); } else { // Scala Either Serializer, or other. // fall back to the backwards compatibility path return super.resolveSchemaCompatibility(newSerializer); } } }
@Override @SuppressWarnings("unchecked") public TypeSerializerSchemaCompatibility<C> resolveSchemaCompatibility(TypeSerializer<C> newSerializer) { if (!(newSerializer instanceof ListSerializer)) { return super.resolveSchemaCompatibility(newSerializer); } return CompositeTypeSerializerUtil.delegateCompatibilityCheckToNewSnapshot( newSerializer, (CompositeTypeSerializerSnapshot<C, ? extends TypeSerializer>) new ListSerializerSnapshot<>(), getSingleNestedSerializerAndConfig().f1); }
@Override @SuppressWarnings("unchecked") public TypeSerializerSchemaCompatibility<Either<L, R>> resolveSchemaCompatibility( TypeSerializer<Either<L, R>> newSerializer) { // this class was shared between the Java Either Serializer and the // Scala Either serializer if (newSerializer.getClass() == EitherSerializer.class) { return checkJavaSerializerCompatibility((EitherSerializer<L, R>) newSerializer); } else { // Scala Either Serializer, or other. // fall back to the backwards compatibility path return super.resolveSchemaCompatibility(newSerializer); } }
@Override public TypeSerializerSchemaCompatibility<C> resolveSchemaCompatibility(TypeSerializer<C> newSerializer) { if (newSerializer instanceof ListSerializer) { ListSerializerSnapshot<T> listSerializerSnapshot = new ListSerializerSnapshot<>(((ListSerializer<T>) newSerializer).getElementSerializer()); return listSerializerSnapshot.resolveSchemaCompatibility((ListSerializer) newSerializer); } else { return super.resolveSchemaCompatibility(newSerializer); } }
@Override public TypeSerializerSchemaCompatibility<Map<K, V>> resolveSchemaCompatibility(TypeSerializer<Map<K, V>> newSerializer) { if (newSerializer instanceof MapSerializer) { // redirect the compatibility check to the new MapSerializerConfigSnapshot MapSerializer<K, V> mapSerializer = (MapSerializer<K, V>) newSerializer; MapSerializerSnapshot<K, V> mapSerializerSnapshot = new MapSerializerSnapshot<>(mapSerializer.getKeySerializer(), mapSerializer.getValueSerializer()); return mapSerializerSnapshot.resolveSchemaCompatibility(newSerializer); } else { return super.resolveSchemaCompatibility(newSerializer); } }