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_r255428962
########## File path: flink-scala/src/main/scala/org/apache/flink/api/scala/typeutils/SpecificCaseClassSerializer.scala ########## @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.api.scala.typeutils + +import java.io.ObjectInputStream +import java.lang.invoke.{MethodHandle, MethodHandles} + +import org.apache.flink.api.common.typeutils.CompositeTypeSerializerUtil.delegateCompatibilityCheckToNewSnapshot +import org.apache.flink.api.common.typeutils.TypeSerializerConfigSnapshot.SelfResolvingTypeSerializer +import org.apache.flink.api.common.typeutils._ +import org.apache.flink.api.java.typeutils.runtime.TupleSerializerConfigSnapshot +import org.apache.flink.api.scala.typeutils.SpecificCaseClassSerializer.lookupConstructor + +import scala.collection.JavaConverters._ +import scala.reflect.runtime.universe + +class SpecificCaseClassSerializer[T <: Product]( + clazz: Class[T], + scalaFieldSerializers: Array[TypeSerializer[_]] +) extends CaseClassSerializer[T](clazz, scalaFieldSerializers) Review comment: I think it is possible to inline the case class serializer class to the `SpecificCaseClassSerializer` but I'd suggest to do it as a followup step because: 1. I'm not sure how this would affect java deserialization (dropping a super class) when restoring from previous Flink versions that used java serialization. 2. there are still some places that refer to case class serializer (tuple comparator, etc') and maybe it is a bit more complicated than search and replace 😅 3. It would have complicated your reviewing with a lot of noise. ---------------------------------------------------------------- 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
