Repository navigation
[ISSUE #155] refactor: target Flink 2.2.1 on main (Java 17) - #158
Merged
Merged
Conversation
Now that the codebase is new-API only, supporting Flink 2.x is just the
version switch:
- flink.version 1.20.3 -> 2.2.1, Java 17 bytecode.
- The CI build matrix drops JDK 11 (Flink 2.x requires Java 17 at compile
time), but spotless 2.27.1 silently skips its Java formatter on JDK 16+
("Spotless check skipped"), so the style check moves to a dedicated
JDK 11 job. Leaving it inside the build job would have dropped the only
style gate that actually runs.
- Drop the deprecated-overload bridges that only 1.20 needs
(Sink.InitContext, createSerializer(ExecutionConfig)); 2.x declares
the WriterInitContext / SerializerConfig overloads abstract.
- The grpc ITCase collects with sink.legacy.RichSinkFunction, the 2.x
package; 1.20 has no sink.legacy subpackage.
The 1.x maintenance branch (v3.0) keeps 1.20.3 and the bridges; the diff
between the two lines is exactly this commit, so fixes cherry-pick both
ways without adaptation in the shared code.
Verified: mvn clean package green on JDK 17 (remoting 146 / grpc 80 unit
tests), spotless:check green on JDK 11, both SQL fat-jars produced.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Step 3 of #155. #157 made the codebase new-API only, so supporting Flink 2.x is now just the version switch. This makes
mainthe 2.x line, the same shapeapache/flink-connector-kafkauses (2.x onmain, 1.x on a maintenance branch).The 1.x line already exists: branch
v3.0points at the #157 merge commit0b3ae9d(Flink 1.20.3 / Java 11). The diff between the two lines is exactly this commit, so a fix cherry-picks both ways without adaptation in the shared code.Changes
flink.version1.20.3 -> 2.2.1,target.java.version/ compilerrelease11 -> 17.Sink.InitContext+InitContextAdapterinRocketMQSink/RocketMQGrpcSink,createSerializer(ExecutionConfig)inAckableMessageTypeInfo): 2.x declares theWriterInitContext/SerializerConfigoverloads abstract, and 1.20 calls those overloads at runtime too, so the bridges only served callers still passing the old context types.RocketMQGrpcITCasecollects withsink.legacy.RichSinkFunction, the 2.x package (1.20 has nosink.legacysubpackage).Spotless check skipped), so keepingspotless:checkinside the JDK 17 job would have dropped the only style gate that actually runs. It moves to a dedicated JDK 11 job — formatting does not compile against Flink, so it can stay on 11.Verification
mvn -B clean packagegreen on JDK 17: 146 remoting (4 skipped) + 80 grpc unit tests, 0 failures; both SQL fat-jars produced.mvn -B spotless:checkgreen on JDK 11 (this is the leg that actually formats).flink:2.2.1-scala_2.12-java17base,flink-oss-fs-hadoop-2.2.1, checkpoint/savepoint to OSS): 1000 x 4KB passthrough reconciles 1001/1001 against broker physical offsets with 0 missing / 0 unexpected / 0 duplicate, on both a direct nameserver deployment and a proxy deployment; startup-offset (latest / timestamp / specific), tag and SQL92 filter cases match the expected id sets exactly; transactional sink commits 101/101 on the direct deployment at both 10s and 45s checkpoint intervals; TM/JM deletion, broker kill and a 60s nameserver outage all recover with 0 missing (the job stays RUNNING with a single JobID, no split re-assignment).Note for the next release
Both lines currently carry project version
3.0.0, so the two artifacts would collide on the same GAV with different content. Following the Kafka convention, release artifacts should carry the Flink version as a second segment (3.0.0-1.20fromv3.0,3.0.0-2.2frommain).