-
Notifications
You must be signed in to change notification settings - Fork 22
[refacto] Drop Flink 1.18 support to reunify most of Flink 1 & 2 code #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[refacto] Drop Flink 1.18 support to reunify most of Flink 1 & 2 code #275
Conversation
…hemaCompatibility()
modules/flink-2-api/src/main/scala/org/apache/flinkx/api/DataStream.scala
Show resolved
Hide resolved
modules/flink-1-api/src/main/scala/org/apache/flinkx/api/extensions/ops.scala
Show resolved
Hide resolved
modules/flink-2-api/src/main/scala/org/apache/flinkx/api/AllWindowedStream.scala
Show resolved
Hide resolved
modules/flink-2-api/src/main/scala/org/apache/flinkx/api/CoGroupedStreams.scala
Show resolved
Hide resolved
modules/flink-2-api/src/test/scala/org/apache/flinkx/api/StreamExecutionEnvironmentTest.scala
Show resolved
Hide resolved
modules/flink-common-api/src/main/scala/org/apache/flinkx/api/typeinfo/CaseClassTypeInfo.scala
Show resolved
Hide resolved
|
||
object serializers extends LowPrioImplicits { | ||
override protected val config: ExecutionConfig = new ExecutionConfig() | ||
trait serializers extends LowPrioImplicits { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to a trait to be overridable by users.
modules/flink-common-api/src/main/scala/org/apache/flinkx/api/serializers.scala
Show resolved
Hide resolved
modules/flink-common-api/src/main/scala/org/apache/flinkx/api/serializers.scala
Show resolved
Hide resolved
modules/flink-common-api/src/main/scala/org/apache/flinkx/api/serializers.scala
Show resolved
Hide resolved
modules/flink-common-api/src/main/scala-2/org/apache/flinkx/api/LowPrioImplicits.scala
Show resolved
Hide resolved
I though we will get rid of flink-1 and flink-2 separation in the codebase, probably I was wrong. Great effort, lots of duplicated code was removed, which is helpful! |
Actually it's completely rational and even desirable to have to maintain different APIs for Flink 1 & 2 because the whole point for Flink to go for a major release was to do breaking changes in their APIs, and now they will introduce new features in Flink 2, so the APIs will continue to diverge. |
yes, it was probably unavoidable. |
@arnaud-daroussin do you plan to comment or change something else? |
@novakov-alexey no, I think the work is done. Even the last commit was completely optional. Actually I have a lot of things to propose that are waiting for this refactoring 😉 |
Hi @novakov-alexey,
Here is the changes we talked about in this issue #252.
As expected in the issue, I was able to reunify all the code about:
function
andfunction.util
)WrappingFunction
because the one from Flink 1 was moved in Flink 2: not a big deal.async
)serializer
,mapper
) includingLowPrioImplicits
classes andserializers
object.typeinfo
)TypeSerializer.createSerializer(ExecutionConfig)
in Flink 1.19+, the method must be defined, but because of the fact the method was deleted in Flink 2, we cannot define the method as overriding. Luckily, it is legit to implement a method required in a trait without theoverride
keyword, so the same code is valid for both Flink 1.19+ & Flink 2!ProductTypeInformation
andCaseClassTypeInfo
.OutputTag
orClosureCleaner
.So it lefts in specific Flink 1 & 2 project only what seems normal to be split: the Stream API and associated classes (
conv
object,ScalaStreamOps
class,extensions
package).