-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Hi @novakov-alexey,
You told me a few weeks ago you were looking for a way to improve testing for Flink1 and Flink2 without duplicating the tests.
I think the way to improve testability is to reduce code duplication. If we duplicate the code, we also need to duplicate associated tests.
I looked at the code to understand why so many classes have been duplicated between Flink 1.x and 2.x. I'm seeing many methods and APIs that were deprecated in Flink 1.19 and removed in Flink 2.0, so you had to duplicate the code to handle old APIs of Flink 1.18 where the replacement is not yet available and duplicate the code to handle the new APIs of Flink 2.0 when the old ones have been removed.
So if we drop Flink 1.18 support, we can reunify classes that were duplicated due to:
- the deprecation of
ExecutionConfig
in favor ofSerializerConfig
, - the deprecation of
Time
in favor ofDuration
, - the deprecation of
Configuration
in favor ofOpenContext
, - the deprecation of
resolveSchemaCompatibility(newSerializer: TypeSerializer[T])
in favor ofresolveSchemaCompatibility(oldSerializerSnapshot: TypeSerializerSnapshot[T])
inTypeSerializerSnapshot
.
It means we could reunify almost all the code, most notably all the typeinfo, serializers, snapshots, LowPrioImplicits. There is only some API that cannot be reunified like CoGroupedStreams
or ScalaAllWindowFunctionWrapper
because of a breaking change in Flink 2.0 without proper replacement before.
What do you think of this?