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

 ##########
 File path: 
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/NullableSerializer.java
 ##########
 @@ -233,45 +247,25 @@ public int hashCode() {
        }
 
        @Override
-       public NullableSerializerConfigSnapshot<T> snapshotConfiguration() {
-               return new 
NullableSerializerConfigSnapshot<>(originalSerializer);
+       public TypeSerializerSnapshot<T> snapshotConfiguration() {
+               return new NullableSerializerSnapshot<>(this);
        }
 
-       @Override
-       public CompatibilityResult<T> 
ensureCompatibility(TypeSerializerConfigSnapshot configSnapshot) {
-               if (configSnapshot instanceof NullableSerializerConfigSnapshot) 
{
-                       List<Tuple2<TypeSerializer<?>, 
TypeSerializerConfigSnapshot>> previousKvSerializersAndConfigs =
-                               ((NullableSerializerConfigSnapshot) 
configSnapshot).getNestedSerializersAndConfigs();
-
-                       CompatibilityResult<T> compatResult = 
CompatibilityUtil.resolveCompatibilityResult(
-                               previousKvSerializersAndConfigs.get(0).f0,
-                               UnloadableDummyTypeSerializer.class,
-                               previousKvSerializersAndConfigs.get(0).f1,
-                               originalSerializer);
-
-                       if (!compatResult.isRequiresMigration()) {
-                               return CompatibilityResult.compatible();
-                       } else if (compatResult.getConvertDeserializer() != 
null) {
-                               return CompatibilityResult.requiresMigration(
-                                       new NullableSerializer<>(
-                                               new 
TypeDeserializerAdapter<>(compatResult.getConvertDeserializer()), 
padNullValue()));
-                       }
-               }
-
-               return CompatibilityResult.requiresMigration();
-       }
 
        /**
         * Configuration snapshot for serializers of nullable types, containing 
the
         * configuration snapshot of its original serializer.
 
 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:
[email protected]


With regards,
Apache Git Services

Reply via email to