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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ target/
**/target/
*.class
.idea/
.vscode/
.vscode
*.jar

# Maven build output
flink-processor/target/
Binary file modified flink-processor/jar/JMEOS.jar
Binary file not shown.
Binary file added flink-processor/lib/libmeos.so
Binary file not shown.
32 changes: 32 additions & 0 deletions flink-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<kafka.version>3.2.0</kafka.version>
<log4j.version>2.17.2</log4j.version>
<target.java.version>21</target.java.version>
<!-- MEOS smoke tests run when libmeos is present; the runner resolves it
through the repo lib via LD_LIBRARY_PATH (avoids a stale system
/usr/local/lib/libmeos.so shadowing the pinned one). -->
<meos.enabled>true</meos.enabled>
<meos.lib.dir>${project.basedir}/lib</meos.lib.dir>
</properties>

<dependencies>
Expand Down Expand Up @@ -264,6 +269,33 @@
</execution>
</executions>
</plugin>
<!-- Run the MEOS smoke tests against the pinned libmeos: propagate
meos.enabled to the forked JVM and resolve libmeos from the repo
lib dir (LD_LIBRARY_PATH takes precedence over a stale system lib). -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<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>
<argLine>--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</build>

<!-- Optional extended temporal-type families, mirroring the MobilityDB/MEOS
CMake build flags. Family inclusion is selected at build time with the
same uppercase flag names and ON|OFF (also 1|0) values as MEOS:
-DCBUFFER=ON -DNPOINT=OFF -DPOSE=ON -DRGEO=ON -DH3=ON
Defaults match MEOS: NPOINT is included by default; CBUFFER, POSE, RGEO,
and H3 are excluded unless their flag is ON|1. RGEO requires POSE (enable
both). When a family is excluded, its generated MeosOps* facade sources
and its smoke test are dropped from the build. -->
</project>
25 changes: 25 additions & 0 deletions flink-processor/src/main/java/aisdata/AISData.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*****************************************************************************
*
* This MobilityDB code is provided under The PostgreSQL License.
* Copyright (c) 2020-2026, Université libre de Bruxelles and MobilityDB
* contributors
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without a written
* agreement is hereby granted, provided that the above copyright notice and
* this paragraph and the following two paragraphs appear in all copies.
*
* IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
* EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
* AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
*****************************************************************************/

package aisdata;

public class AISData {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*****************************************************************************
*
* This MobilityDB code is provided under The PostgreSQL License.
* Copyright (c) 2020-2026, Université libre de Bruxelles and MobilityDB
* contributors
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without a written
* agreement is hereby granted, provided that the above copyright notice and
* this paragraph and the following two paragraphs appear in all copies.
*
* IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
* EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
* AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
*****************************************************************************/

package aisdata;

import com.fasterxml.jackson.core.JsonParser;
Expand Down
25 changes: 25 additions & 0 deletions flink-processor/src/main/java/aisdata/AISTestSource.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*****************************************************************************
*
* This MobilityDB code is provided under The PostgreSQL License.
* Copyright (c) 2020-2026, Université libre de Bruxelles and MobilityDB
* contributors
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without a written
* agreement is hereby granted, provided that the above copyright notice and
* this paragraph and the following two paragraphs appear in all copies.
*
* IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
* EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
* AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
*****************************************************************************/

package aisdata;

import org.apache.flink.streaming.api.functions.source.SourceFunction;
Expand Down
32 changes: 29 additions & 3 deletions flink-processor/src/main/java/aisdata/Main.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*****************************************************************************
*
* This MobilityDB code is provided under The PostgreSQL License.
* Copyright (c) 2020-2026, Université libre de Bruxelles and MobilityDB
* contributors
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without a written
* agreement is hereby granted, provided that the above copyright notice and
* this paragraph and the following two paragraphs appear in all copies.
*
* IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
* EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
* AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
*****************************************************************************/

package aisdata;

import java.time.Duration;
Expand All @@ -20,6 +45,7 @@
import org.apache.flink.streaming.api.windowing.time.Time;

import functions.*;
import functions.GeneratedFunctions;
import types.boxes.*;
import types.basic.tpoint.tgeom.*;
import types.basic.tpoint.TPoint.*;
Expand All @@ -37,8 +63,8 @@ public static void main(String[] args) throws Exception {
// Initialize MEOS with proper error handling
try {
logger.info("Initializing MEOS library");
functions.meos_initialize_timezone("UTC");
functions.meos_initialize_error_handler(errorHandler);
GeneratedFunctions.meos_initialize_timezone("UTC");
GeneratedFunctions.meos_initialize_error_handler(errorHandler);

final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(1);
Expand Down Expand Up @@ -93,7 +119,7 @@ public static void main(String[] args) throws Exception {
// Always ensure MEOS is finalized
try {
logger.info("Finalizing MEOS library");
functions.meos_finalize();
GeneratedFunctions.meos_finalize();
} catch (Exception e) {
logger.error("Error during MEOS finalization: {}", e.getMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*****************************************************************************
*
* This MobilityDB code is provided under The PostgreSQL License.
* Copyright (c) 2020-2026, Université libre de Bruxelles and MobilityDB
* contributors
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without a written
* agreement is hereby granted, provided that the above copyright notice and
* this paragraph and the following two paragraphs appear in all copies.
*
* IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
* EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
* AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
*****************************************************************************/

package aisdata;

import org.apache.flink.api.java.tuple.Tuple4;
Expand All @@ -13,6 +38,7 @@
import java.util.ArrayList;
import java.util.List;
import functions.*;
import functions.GeneratedFunctions;
import types.boxes.*;
import types.basic.tpoint.tgeom.*;
import types.basic.tpoint.tgeom.TGeomPointSeq;
Expand All @@ -30,14 +56,15 @@ public class TrajectoryWindowFunction extends
public void open(Configuration parameters) throws Exception {
super.open(parameters);
errorHandler = new error_handler(); // Initialize error handler here
functions.meos_initialize_timezone("UTC");
functions.meos_initialize_error_handler(errorHandler);

GeneratedFunctions.meos_initialize_timezone("UTC");
GeneratedFunctions.meos_initialize_error_handler(errorHandler);
logger.info("MEOS initialized in TrajectoryWindowFunction.open()");
}

// @Override
// public void close() throws Exception {
// functions.meos_finalize();
// GeneratedFunctions.meos_finalize();
// logger.info("MEOS finalized in TrajectoryWindowFunction.close()");
// super.close();
// }
Expand Down
Loading