Skip to content

build(flink): migrate to Apache Flink 2.0 (stacks on #31)#33

Merged
Ar-mie merged 4 commits into
MobilityDB:mainfrom
estebanzimanyi:feat/flink-2-migration
Jul 9, 2026
Merged

build(flink): migrate to Apache Flink 2.0 (stacks on #31)#33
Ar-mie merged 4 commits into
MobilityDB:mainfrom
estebanzimanyi:feat/flink-2-migration

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Stacks on #31 — the first two commits are #31 (facade regen + master-tracked JMEOS jar); this PR adds the Flink 2.0 migration on top. When #31 merges, this reduces to the single build(flink) commit.

What

Migrates the processor from Flink 1.16 to Apache Flink 2.0, resolving the version skew with the Java 21 Docker base (Flink 1.16 supported only Java 8/11; Flink 2.0 targets Java 17/21, matching the java-21-amazon-corretto image).

Removed-API migrations:

  • windowing.time.Timejava.time.Duration
  • StreamExecutionEnvironment.fromCollectionfromData
  • RichFunction.open(Configuration)open(OpenContext)
  • RichSinkFunction/addSink → Sink v2 (createWriter) / executeAndCollect
  • decouple the externalized flink-connector-kafka (4.0.1-2.0)
  • drop the unused flink-java and flink-connector-jdbc dependencies
  • delete the dead AISTestSource (legacy SourceFunction)

Sedona

Apache Sedona has no Flink-2.0 build yet (latest 1.9.0 still targets Flink 1.19), so the sedona/** comparison queries are gated behind a -Psedona Maven profile and excluded from the default build. Re-enable with -Psedona once an upstream Sedona/Flink-2.0 release exists.

Verification

mvn clean test10 tests, 0 failures, 0 errors, 0 skipped against the master-tracked JMEOS jar + libmeos.

…inMOD corpus

Adds the BerlinMOD streaming benchmark harness (BerlinMODBenchmark, per
Q-form throughput over the DataStream topology), the benchmark-results
document, and the Kafka producer script for feeding the corpus.

The benchmark runs on the canonical BerlinMOD corpus only (--csv
berlinmod_instants.csv); the invented synthetic fallback is gone.
… jar + libmeos from MobilityDB master

Generate the org.mobilitydb.meos.MeosOps* streaming facades from the
bundled JMEOS jar via tools/codegen_facades.py, recover MeosSetSetJoin
as source, and vendor the JMEOS.jar + libmeos.so built from the current
MobilityDB master surface (MEOS -> MEOS-API catalog -> JMEOS).
- Align the BerlinMODBenchmark Javadoc to the code: the corpus is the real
  BerlinMOD instants CSV (--csv, required); drop the stale --vehicles/--events
  synthetic-mode reference and the dead 'synthetic' corpus label.
- Wrap each cell's Flink job (env.execute) in try-catch so one failing cell is
  recorded and the matrix continues instead of aborting.
- Comment the deliberate keyBy(x -> 0) single-subtask routing in Q5/Q9 (the
  pairwise-meet / all-pairs queries need a global, non-parallel view).
- Cover the benchmark in the suite: add BerlinMODBenchmarkTest (a keyed cell and
  a keyBy(x -> 0) cell over a small in-memory corpus), and remove the nine
  misplaced BerlinMODQ*LocalTest main-drivers that sat in src/main (test-named,
  never run by mvn test, and dependent on an uncommitted sample resource).
Bump flink.version to 2.0.0 and migrate the APIs removed in Flink 2.0:
- windowing.time.Time -> java.time.Duration
- StreamExecutionEnvironment.fromCollection -> fromData
- RichFunction.open(Configuration) -> open(OpenContext)
- RichSinkFunction/addSink -> Sink v2 (createWriter) / executeAndCollect
- decouple the externalized flink-connector-kafka (4.0.1-2.0)
- drop the unused flink-java and flink-connector-jdbc dependencies
- delete the dead AISTestSource (legacy SourceFunction)

Gate the Sedona comparison queries behind a -Psedona profile because
Apache Sedona has no Flink-2.0 build yet (latest targets Flink 1.19);
the MEOS/BerlinMOD path builds on Flink 2.0 by default.
@estebanzimanyi
estebanzimanyi force-pushed the feat/flink-2-migration branch from 30213b8 to 3a2897d Compare July 8, 2026 14:39
@Ar-mie
Ar-mie merged commit 3f5073f into MobilityDB:main Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants