Skip to content

Call the generated JMEOS surface from the AIS and SNCB mains - #45

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:refactor/bind-generated-functions
Jul 22, 2026
Merged

Call the generated JMEOS surface from the AIS and SNCB mains#45
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:refactor/bind-generated-functions

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Binds functions.GeneratedFunctions in the two mains that call JMEOS's hand-maintained facade.

JMEOS carries two FFI facades: GeneratedFunctions, emitted from the MEOS-API catalog at build time, and functions.functions, maintained by hand. A GitHub code search across MobilitySpark, MobilityFlink and MobilityKafka finds the hand facade only in aisdata/Query8_V2_Main.java and sncbdata/Query8_V2_Main.java; the generators of all three consumers read functions.GeneratedFunctions alone (codegen_jvm.py line 59, codegen_spark_udfs.py line 1000).

Those two call sites are what keeps the JVM surface from having a single generated source. A hand-maintained declaration binds its C symbol by name and jnr-ffi resolves it on first call, so a MEOS rename surfaces as UnsatisfiedLinkError: unknown at run time — the failure mode behind the sixteen JMEOS declarations that named symbols absent from libmeos.

Every signature involved is identical between the two facades, tsequence_make(Pointer instants, int count, boolean, boolean, int, boolean) included, and the caller passes a Pointer from Memory.allocate, so the twelve call sites change only in the class they name. The SNCB main imports the facade without calling it, and that import goes with them. grep -rn "functions\.functions" --include=*.java over the repository then returns nothing.

Against MobilityDB master da39ebf91 — libmeos and the catalog derived from that commit, the JMEOS jar built from JMEOS main against it and installed as org.jmeos:meos:1.0mvn -Dmeos.lib.dir=… -Dmeos.enabled=true clean test is 12 tests, 0 failures, 0 errors.

JMEOS carries two FFI facades: functions.GeneratedFunctions, emitted from the
MEOS-API catalog at build time, and the hand-maintained functions.functions.
These two mains are the only callers of the hand one left in the ecosystem, and
holding it alive costs the surface its single generated source: a MEOS rename
reaches a hand-maintained declaration as an UnsatisfiedLinkError at call time.

Bind GeneratedFunctions instead. Every signature involved is identical between
the two facades, including tsequence_make, whose first parameter is a Pointer in
both, so the call sites change only in the class they name. The SNCB main
imported the facade without calling it; that import goes too.
@estebanzimanyi
estebanzimanyi merged commit c1d495c into MobilityDB:main Jul 22, 2026
1 check passed
@estebanzimanyi
estebanzimanyi deleted the refactor/bind-generated-functions branch July 22, 2026 14:42
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.

1 participant