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
25 changes: 12 additions & 13 deletions flink-processor/src/main/java/aisdata/Query8_V2_Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import functions.functions;
import functions.GeneratedFunctions;
import functions.error_handler;
import functions.error_handler_fn;
Expand Down Expand Up @@ -63,8 +62,8 @@ public static void main(String[] args) throws Exception {
logger.info("Java library path: {}", System.getProperty("java.library.path"));

try {
functions.meos_initialize_timezone("UTC");
functions.meos_initialize_error_handler(new error_handler());
GeneratedFunctions.meos_initialize_timezone("UTC");
GeneratedFunctions.meos_initialize_error_handler(new error_handler());

final StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
Expand Down Expand Up @@ -97,7 +96,7 @@ public static void main(String[] args) throws Exception {
logger.error("Error during execution: {}", e.getMessage(), e);
throw e;
} finally {
try { functions.meos_finalize(); }
try { GeneratedFunctions.meos_finalize(); }
catch (Exception e) { logger.error("Error during MEOS finalization: {}", e.getMessage(), e); }
}
}
Expand Down Expand Up @@ -125,8 +124,8 @@ public MeosEkfWindowFunction(double gate, double q, double r, boolean dropOutlie
public void open(OpenContext parameters) throws Exception {
super.open(parameters);
errorHandler = new error_handler();
functions.meos_initialize_timezone("UTC");
functions.meos_initialize_error_handler(errorHandler);
GeneratedFunctions.meos_initialize_timezone("UTC");
GeneratedFunctions.meos_initialize_error_handler(errorHandler);
}

@Override
Expand All @@ -149,19 +148,19 @@ public void process(Integer mmsi, Context context,
AISData event = sorted.get(0);
String wkt = String.format("POINT(%f %f)@%s",
event.getLon(), event.getLat(), millisToTs(event.getTimestamp()));
Pointer inst = functions.tgeompoint_in(wkt);
Pointer inst = GeneratedFunctions.tgeompoint_in(wkt);
if (inst == null) return;
Pointer seedArray = Memory.allocate(runtime, Long.BYTES);
seedArray.putPointer(0, inst);
Pointer singleSeq = functions.tsequence_make(
Pointer singleSeq = GeneratedFunctions.tsequence_make(
seedArray, 1, true, true, TInterpolation.LINEAR.getValue(), true);
if (singleSeq == null) return;
String result = String.format(
"[EKF-V2][Q8] MMSI=%-12d | points=1 | EKF skipped (single point)"
+ " | window [%s - %s]%n"
+ " raw=cleaned: %s",
mmsi, windowStart, windowEnd,
functions.tspatial_as_ewkt(singleSeq, 6));
GeneratedFunctions.tspatial_as_ewkt(singleSeq, 6));
log.info(result);
out.collect(result);
return;
Expand All @@ -172,7 +171,7 @@ public void process(Integer mmsi, Context context,
for (AISData event : sorted) {
String ts = millisToTs(event.getTimestamp());
String wkt = String.format("POINT(%f %f)@%s", event.getLon(), event.getLat(), ts);
Pointer inst = functions.tgeompoint_in(wkt);
Pointer inst = GeneratedFunctions.tgeompoint_in(wkt);
if (inst == null) {
log.error("[EKF-V2] tgeompoint_in returned null for MMSI={} wkt={}", mmsi, wkt);
continue;
Expand All @@ -186,7 +185,7 @@ public void process(Integer mmsi, Context context,
for (int i = 0; i < instants.size(); i++) {
ptrArray.putPointer((long) i * Long.BYTES, instants.get(i));
}
Pointer rawSeq = functions.tsequence_make(
Pointer rawSeq = GeneratedFunctions.tsequence_make(
ptrArray, instants.size(), true, true, TInterpolation.LINEAR.getValue(), true);
if (rawSeq == null) {
log.error("[EKF-V2] tsequence_make returned null for MMSI={}", mmsi);
Expand All @@ -208,8 +207,8 @@ public void process(Integer mmsi, Context context,
+ " cleaned: %s",
mmsi, instants.size(), gate, q, r, dropOutliers,
windowStart, windowEnd,
functions.tspatial_as_ewkt(rawSeq, 6),
functions.tspatial_as_ewkt(cleanedSeq, 6));
GeneratedFunctions.tspatial_as_ewkt(rawSeq, 6),
GeneratedFunctions.tspatial_as_ewkt(cleanedSeq, 6));

log.info(result);
out.collect(result);
Expand Down
1 change: 0 additions & 1 deletion flink-processor/src/main/java/sncbdata/Query8_V2_Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import functions.functions;
import functions.GeneratedFunctions;
import functions.error_handler;
import functions.error_handler_fn;
Expand Down
Loading