igalshilman commented on a change in pull request #7658: [FLINK-10493][core] 
Migrating the TupleSerializerBase serializers family
URL: https://github.com/apache/flink/pull/7658#discussion_r255435295
 
 

 ##########
 File path: 
flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TypeInformationGen.scala
 ##########
 @@ -144,21 +142,20 @@ private[flink] trait TypeInformationGen[C <: Context] {
           for (i <- 0 until getArity) {
             fieldSerializers(i) = types(i).createSerializer(executionConfig)
           }
+          // 
-------------------------------------------------------------------------------------
+          // NOTE:
+          // the following anonymous class is needed here, and should not be 
removed
+          // (although appears to be unused) since it is required for 
backwards compatibility
+          // with Flink versions pre 1.8, that were using Java deserialization.
+          // 
-------------------------------------------------------------------------------------
+          val unused = new SpecificCaseClassSerializer[T](getTypeClass(), 
fieldSerializers) {
 
-          new CaseClassSerializer[T](getTypeClass(), fieldSerializers) {
             override def createInstance(fields: Array[AnyRef]): T = {
 
 Review comment:
   we need to override it because the readObject of the super class is not 
being invoked, otherwise we get an NPE while restoring from previous Flink 
versions.
   You can reproduce that via commenting this statement out, and run 
`ScalaCaseClassSerializerSnapshotMigrationTest`

----------------------------------------------------------------
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