tzulitai commented on a change in pull request #7590: [FLINK-11329][core] 
Migrating CompositeSerializers
URL: https://github.com/apache/flink/pull/7590#discussion_r252140553
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/CoGroupedStreams.java
 ##########
 @@ -618,63 +619,87 @@ public boolean canEqual(Object obj) {
                }
 
                @Override
-               public TypeSerializerConfigSnapshot<TaggedUnion<T1, T2>> 
snapshotConfiguration() {
-                       return new 
UnionSerializerConfigSnapshot<>(oneSerializer, twoSerializer);
-               }
-
-               @Override
-               public CompatibilityResult<TaggedUnion<T1, T2>> 
ensureCompatibility(TypeSerializerConfigSnapshot<?> configSnapshot) {
-                       if (configSnapshot instanceof 
UnionSerializerConfigSnapshot) {
-                               List<Tuple2<TypeSerializer<?>, 
TypeSerializerSnapshot<?>>> previousSerializersAndConfigs =
-                                       ((UnionSerializerConfigSnapshot<?, ?>) 
configSnapshot).getNestedSerializersAndConfigs();
-
-                               CompatibilityResult<T1> 
oneSerializerCompatResult = CompatibilityUtil.resolveCompatibilityResult(
-                                       previousSerializersAndConfigs.get(0).f0,
-                                       UnloadableDummyTypeSerializer.class,
-                                       previousSerializersAndConfigs.get(0).f1,
-                                       oneSerializer);
-
-                               CompatibilityResult<T2> 
twoSerializerCompatResult = CompatibilityUtil.resolveCompatibilityResult(
-                                       previousSerializersAndConfigs.get(1).f0,
-                                       UnloadableDummyTypeSerializer.class,
-                                       previousSerializersAndConfigs.get(1).f1,
-                                       twoSerializer);
-
-                               if 
(!oneSerializerCompatResult.isRequiresMigration() && 
!twoSerializerCompatResult.isRequiresMigration()) {
-                                       return CompatibilityResult.compatible();
-                               } else if 
(oneSerializerCompatResult.getConvertDeserializer() != null && 
twoSerializerCompatResult.getConvertDeserializer() != null) {
-                                       return 
CompatibilityResult.requiresMigration(
-                                               new UnionSerializer<>(
-                                                       new 
TypeDeserializerAdapter<>(oneSerializerCompatResult.getConvertDeserializer()),
-                                                       new 
TypeDeserializerAdapter<>(twoSerializerCompatResult.getConvertDeserializer())));
-                               }
-                       }
-
-                       return CompatibilityResult.requiresMigration();
+               public TypeSerializerSnapshot<TaggedUnion<T1, T2>> 
snapshotConfiguration() {
+                       return new UnionSerializerSnapshot<>(this);
                }
        }
 
        /**
         * The {@link TypeSerializerConfigSnapshot} for the {@link 
UnionSerializer}.
 
 Review comment:
   nit: Add `@deprecated` message

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to