Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions benchmark/src/test/java/berlinmod/BerlinMODFullMatrixTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ void fullMatrix() {
}

// Q5 ("pairs of vehicles meeting near P") is the one cell whose count
// differs between the pure-Java Haversine approximation (scaffold) and
// the MEOS geodetic engine (integration): the MEOS pair-meeting path
// emits none under these params while the planar approximation is more
// permissive. The other 26 cells are engine-invariant. TODO(meos):
// reconcile the Q5 pair-meeting semantics across the two engines.
boolean meos = Boolean.getBoolean("meos.enabled");
// depends on the engine: the MEOS geodetic pair-meeting path emits none
// under these params, where the pure-Java Haversine scaffold emits 199
// continuous, 7 windowed and 28 snapshot pairs. The other 26 cells are
// engine-invariant. TODO(meos): reconcile the Q5 pair-meeting semantics
// across the two engines.

// ---- continuous outputs ----
assertCount(driver, BerlinMODTopology.Q1_CONTINUOUS_OUTPUT, "Q1-continuous", 5,
Expand All @@ -90,7 +89,7 @@ void fullMatrix() {
Serdes.Integer().deserializer(), new BooleanDeserializer());
assertCount(driver, BerlinMODTopology.Q4_CONTINUOUS_OUTPUT, "Q4-continuous", 2,
Serdes.Integer().deserializer(), new LongDeserializer());
assertCount(driver, BerlinMODTopology.Q5_CONTINUOUS_OUTPUT, "Q5-continuous", meos ? 0 : 199,
assertCount(driver, BerlinMODTopology.Q5_CONTINUOUS_OUTPUT, "Q5-continuous", 0,
new StringDeserializer(), new DoubleDeserializer());
assertCount(driver, BerlinMODTopology.Q6_CONTINUOUS_OUTPUT, "Q6-continuous", 200,
Serdes.Integer().deserializer(), new DoubleDeserializer());
Expand All @@ -110,7 +109,7 @@ void fullMatrix() {
new LongDeserializer(), new LongDeserializer());
assertCount(driver, BerlinMODTopology.Q4_WINDOWED_OUTPUT, "Q4-windowed", 21,
new LongDeserializer(), new StringDeserializer());
assertCount(driver, BerlinMODTopology.Q5_WINDOWED_OUTPUT, "Q5-windowed", meos ? 0 : 7,
assertCount(driver, BerlinMODTopology.Q5_WINDOWED_OUTPUT, "Q5-windowed", 0,
new StringDeserializer(), new DoubleDeserializer());
assertCount(driver, BerlinMODTopology.Q6_WINDOWED_OUTPUT, "Q6-windowed", 46,
new LongDeserializer(), new StringDeserializer());
Expand All @@ -130,7 +129,7 @@ void fullMatrix() {
new LongDeserializer(), new IntegerDeserializer());
assertCount(driver, BerlinMODTopology.Q4_SNAPSHOT_OUTPUT, "Q4-snapshot", 57,
new LongDeserializer(), new StringDeserializer());
assertCount(driver, BerlinMODTopology.Q5_SNAPSHOT_OUTPUT, "Q5-snapshot", meos ? 0 : 28,
assertCount(driver, BerlinMODTopology.Q5_SNAPSHOT_OUTPUT, "Q5-snapshot", 0,
new StringDeserializer(), new DoubleDeserializer());
assertCount(driver, BerlinMODTopology.Q6_SNAPSHOT_OUTPUT, "Q6-snapshot", 141,
new LongDeserializer(), new StringDeserializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.mobilitydb.meos.MeosOpsFreeGeo;

import java.util.HashSet;
Expand All @@ -43,10 +42,8 @@
* {@link MeosOpsFreeGeo} set-set family) against an independent per-pair scalar
* baseline ({@code edwithin_tgeo_tgeo} / {@code eintersects_tgeo_tgeo}). The two
* code paths must agree exactly on which trip pairs ever meet / are always
* disjoint. Runs only with {@code -Dmeos.enabled=true} and an extended libmeos
* on the library path.
* disjoint. It needs an extended libmeos on the library path.
*/
@EnabledIfSystemProperty(named = "meos.enabled", matches = "true")
class BerlinMODSetSetJoinTest {

// Four trajectory trips: T1 crosses T0's path mid-window; T3 coincides with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*
* <p><b>Typical usage</b> — per-vehicle-pair "did they come within
* 100m of each other in the last 5 minutes?" via
* {@code MeosOpsTGeo.edwithin_tgeo_tgeo}:
* {@code MeosOpsFreeGeo.edwithin_tgeo_tgeo}:
*
* <pre>{@code
* KStream<Integer, VehiclePosition> a = ...; // keyed by regionId
Expand All @@ -60,7 +60,7 @@
* MeosCrossStreamJoiner.joiner((left, right) -> {
* Pointer leftT = left.toTGeoPointer();
* Pointer rightT = right.toTGeoPointer();
* if (MeosOpsTGeo.edwithin_tgeo_tgeo(leftT, rightT, 100.0) != 0) {
* if (MeosOpsFreeGeo.edwithin_tgeo_tgeo(leftT, rightT, 100.0) != 0) {
* return new MeetingEvent(left.id(), right.id(), System.currentTimeMillis());
* }
* return null; // joined out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
*
* <p>The {@code windowed} tier (per the v4 baseline: 161 of 2,097
* emitted methods) emits one MEOS-derived value per window. Canonical
* examples are {@code temporal_length(tgeo)} (one length per
* trajectory window) and {@code temporal_twavg(tnumber)} (one
* examples are {@code tpoint_length(tpoint)} (one length per
* trajectory window) and {@code tnumber_twavg(tnumber)} (one
* time-weighted average per window).
*
* <p>Kafka Streams' {@code KStream.groupByKey().windowedBy(...).aggregate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Run with:
```bash
mvn -q exec:java \
-Dexec.mainClass=org.mobilitydb.kafka.meos.wirings.demo.MeosWiringsDemoTopology \
-Dmeos.enabled=true
-Dmobilitykafka.meos.enabled=true
```

The demo uses `TopologyTestDriver` (kafka-streams-test-utils) — no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand All @@ -43,7 +42,6 @@
* family ({@code -DCBUFFER=ON}); the family requires a libmeos built with
* {@code -DCBUFFER=ON}.
*/
@EnabledIfSystemProperty(named = "meos.enabled", matches = "true")
class MeosCbufferSmokeTest {

@BeforeAll
Expand All @@ -59,9 +57,9 @@ static void finalizeMeos() {

@Test
void cbuffer() {
Pointer cb = MeosOpsFreeCbuffer.cbuffer_make(MeosOpsFreeGeo.geom_in("POINT(1 1)", 0), 0.5);
Pointer cb = MeosOpsCbuffer.cbuffer_make(MeosOpsGeometry.geom_in("POINT(1 1)", 0), 0.5);
assertNotNull(cb);
assertEquals(0.5, MeosOpsFreeCbuffer.cbuffer_radius(cb), 1e-9);
assertNotNull(MeosOpsFreeCbuffer.cbuffer_out(cb, 6));
assertEquals(0.5, MeosOpsCbuffer.cbuffer_radius(cb), 1e-9);
assertNotNull(MeosOpsCbuffer.cbuffer_out(cb, 6));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,18 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* Runtime check that the always-built MEOS facade families (core and geo) call
* into libmeos and return correct results. Each constructs a value through a
* {@code MeosOps*} facade method and reads it back. Runs only with
* {@code -Dmeos.enabled=true} and a libmeos on the load path. The
* optional families have their own gated smoke tests
* {@code MeosOps*} facade method and reads it back, against a libmeos on the
* load path. The optional families have their own smoke tests
* ({@link MeosCbufferSmokeTest}, {@link MeosNpointSmokeTest},
* {@link MeosPoseSmokeTest}), each compiled only when its build flag includes
* the family.
* {@link MeosPoseSmokeTest}).
*/
@EnabledIfSystemProperty(named = "meos.enabled", matches = "true")
class MeosFacadeSmokeTest {

@BeforeAll
Expand Down Expand Up @@ -86,8 +82,8 @@ void geoStbox() {

@Test
void geoGeometry() {
Pointer geom = MeosOpsFreeGeo.geom_in("POINT(1 1)", 0);
Pointer geom = MeosOpsGeometry.geom_in("POINT(1 1)", 0);
assertNotNull(geom);
assertTrue(MeosOpsFreeGeo.geo_as_text(geom, 6).toUpperCase().contains("POINT"));
assertTrue(MeosOpsGeo.geo_as_text(geom, 6).toUpperCase().contains("POINT"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand All @@ -42,7 +41,6 @@
* correct results. Compiled and run when the build includes the npoint family
* (the default; dropped with {@code -DNPOINT=OFF}).
*/
@EnabledIfSystemProperty(named = "meos.enabled", matches = "true")
class MeosNpointSmokeTest {

@BeforeAll
Expand All @@ -58,9 +56,9 @@ static void finalizeMeos() {

@Test
void npoint() {
Pointer np = MeosOpsFreeNpoint.npoint_make(1, 0.5);
Pointer np = MeosOpsNpoint.npoint_make(1, 0.5);
assertNotNull(np);
assertEquals(1, MeosOpsFreeNpoint.npoint_route(np));
assertEquals(0.5, MeosOpsFreeNpoint.npoint_position(np), 1e-9);
assertEquals(1, MeosOpsNpoint.npoint_route(np));
assertEquals(0.5, MeosOpsNpoint.npoint_position(np), 1e-9);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand All @@ -43,7 +42,6 @@
* family ({@code -DPOSE=ON}); the family requires a libmeos built with
* {@code -DPOSE=ON}.
*/
@EnabledIfSystemProperty(named = "meos.enabled", matches = "true")
class MeosPoseSmokeTest {

@BeforeAll
Expand All @@ -59,9 +57,9 @@ static void finalizeMeos() {

@Test
void pose() {
Pointer pose = MeosOpsFreePose.pose_in("Pose(Point(1 1), 0.5)");
Pointer pose = MeosOpsPose.pose_in("Pose(Point(1 1), 0.5)");
assertNotNull(pose);
assertNotNull(MeosOpsFreePose.pose_out(pose, 6));
assertEquals(0.5, MeosOpsFreePose.pose_yaw(pose), 1e-9);
assertNotNull(MeosOpsPose.pose_out(pose, 6));
assertEquals(0.5, MeosOpsPose.pose_yaw(pose), 1e-9);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
* <pre>{@code
* mvn -q exec:java \
* -Dexec.mainClass=org.mobilitydb.kafka.meos.wirings.demo.MeosWiringsDemoTopology \
* -Dmeos.enabled=true
* -Dmobilitykafka.meos.enabled=true
* }</pre>
*/
public final class MeosWiringsDemoTopology {
Expand Down Expand Up @@ -191,7 +191,7 @@ public static void main(String[] args) {

if (!MeosOpsRuntime.MEOS_AVAILABLE) {
LOG.warn("MEOS not available — topology built but not executed. "
+ "Set -Dmeos.enabled=true and ensure libmeos is loadable to run.");
+ "Set -Dmobilitykafka.meos.enabled=true and ensure libmeos is loadable to run.");
return;
}

Expand Down
4 changes: 0 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<junit.version>5.11.4</junit.version>
<jmeos.version>1.0</jmeos.version>
<jnr.version>2.1.10</jnr.version>
<meos.enabled>true</meos.enabled>
<!-- The native libmeos.so both modules load at test time, installed under /usr/local
by the provision-meos action; the binding and the benchmark share one library. -->
<meos.lib.dir>/usr/local/lib</meos.lib.dir>
Expand All @@ -48,9 +47,6 @@
<version>3.2.5</version>
<configuration>
<reuseForks>false</reuseForks>
<systemPropertyVariables>
<meos.enabled>${meos.enabled}</meos.enabled>
</systemPropertyVariables>
<environmentVariables>
<LD_LIBRARY_PATH>${meos.lib.dir}</LD_LIBRARY_PATH>
</environmentVariables>
Expand Down
Loading