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
10 changes: 10 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ jobs:
set -o pipefail
mvn -B -Dmeos.lib.dir=/usr/local/lib clean test | tee "$RUNNER_TEMP/build.log"

# The build prints no warning: Maven's [WARNING] lines and the WARNING:
# lines JUnit and the JVM print during the tests. One of either fails
# the step and is listed.
- name: Refuse a build warning
run: |
if grep -E '^\[WARNING\]|^WARNING:' "$RUNNER_TEMP/build.log"; then
echo "::error::the build prints $(grep -cE '^\[WARNING\]|^WARNING:' "$RUNNER_TEMP/build.log") warning line(s)"
exit 1
fi

# The build's own summary states two things this job's conclusion does
# not: a test reported SKIPPED asserts nothing while the job still reads
# success, and a test the run never collects appears in no count at all,
Expand Down
6 changes: 0 additions & 6 deletions benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@
</dependency>

<!-- JUnit dependency -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>

<!-- Jackson dependencies for JSON processing -->
<dependency>
Expand Down
20 changes: 5 additions & 15 deletions benchmark/src/main/java/org/mobilitydb/meos/MeosSetSetJoin.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package org.mobilitydb.meos;

import com.kenai.jffi.MemoryIO;
import functions.GeneratedFunctions;
import java.lang.ref.Reference;
import java.lang.reflect.Field;
import jnr.ffi.Memory;
import jnr.ffi.Pointer;
import jnr.ffi.Runtime;
import sun.misc.Unsafe;

/**
* NxN cross-stream set-set join operator over two arrays of temporal geometries.
Expand All @@ -23,10 +22,11 @@
*
* <p>The backing C functions take {@code (Temporal **arr1, int n1, Temporal **arr2, int n2,
* [double dist,] int *count [, SpanSet ***periods])} and return a flat {@code int *} of
* {@code 2*count} indices (caller frees). Native result buffers are freed via {@code Unsafe}.
* {@code 2*count} indices (caller frees). Native result buffers are freed through jffi's {@code MemoryIO}, which calls the system
* free MEOS allocates with.
*/
public final class MeosSetSetJoin {
private static final Unsafe UNSAFE;
private static final MemoryIO IO = MemoryIO.getInstance();

private MeosSetSetJoin() {
}
Expand Down Expand Up @@ -113,17 +113,7 @@ private static int[][] readPairsAndFree(Pointer res, int cnt) {

private static void free(Pointer p) {
if (p != null) {
UNSAFE.freeMemory(p.address());
}
}

static {
try {
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
UNSAFE = (Unsafe) f.get(null);
} catch (ReflectiveOperationException e) {
throw new ExceptionInInitializerError(e);
IO.freeMemory(p.address());
}
}

Expand Down
20 changes: 5 additions & 15 deletions binding/src/main/java/org/mobilitydb/meos/MeosSetSetJoin.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package org.mobilitydb.meos;

import com.kenai.jffi.MemoryIO;
import functions.GeneratedFunctions;
import java.lang.ref.Reference;
import java.lang.reflect.Field;
import jnr.ffi.Memory;
import jnr.ffi.Pointer;
import jnr.ffi.Runtime;
import sun.misc.Unsafe;

/**
* NxN cross-stream set-set join operator over two arrays of temporal geometries.
Expand All @@ -23,10 +22,11 @@
*
* <p>The backing C functions take {@code (Temporal **arr1, int n1, Temporal **arr2, int n2,
* [double dist,] int *count [, SpanSet ***periods])} and return a flat {@code int *} of
* {@code 2*count} indices (caller frees). Native result buffers are freed via {@code Unsafe}.
* {@code 2*count} indices (caller frees). Native result buffers are freed through jffi's {@code MemoryIO}, which calls the system
* free MEOS allocates with.
*/
public final class MeosSetSetJoin {
private static final Unsafe UNSAFE;
private static final MemoryIO IO = MemoryIO.getInstance();

private MeosSetSetJoin() {
}
Expand Down Expand Up @@ -113,17 +113,7 @@ private static int[][] readPairsAndFree(Pointer res, int cnt) {

private static void free(Pointer p) {
if (p != null) {
UNSAFE.freeMemory(p.address());
}
}

static {
try {
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
UNSAFE = (Unsafe) f.get(null);
} catch (ReflectiveOperationException e) {
throw new ExceptionInInitializerError(e);
IO.freeMemory(p.address());
}
}

Expand Down
Loading