Skip to content

Commit 33ad2f2

Browse files
authored
Merge main into develop (#5377)
2 parents b2f7895 + 400a468 commit 33ad2f2

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

core/sail/base/src/main/java/org/eclipse/rdf4j/sail/TripleSourceIterationWrapper.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ public boolean hasNext() throws QueryEvaluationException {
4848
} catch (QueryEvaluationException e) {
4949
throw e;
5050
} catch (Exception e) {
51-
if (e instanceof InterruptedException) {
52-
Thread.currentThread().interrupt();
53-
}
5451
throw new QueryEvaluationException(e);
5552
}
5653
}
@@ -75,9 +72,6 @@ public T next() throws QueryEvaluationException {
7572
} catch (IllegalStateException | QueryEvaluationException e) {
7673
throw e;
7774
} catch (Exception e) {
78-
if (e instanceof InterruptedException) {
79-
Thread.currentThread().interrupt();
80-
}
8175
throw new QueryEvaluationException(e);
8276
}
8377
}

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbRecordIterator.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@
2626
import java.nio.ByteBuffer;
2727
import java.util.concurrent.locks.StampedLock;
2828

29-
import org.eclipse.rdf4j.sail.SailException;
3029
import org.eclipse.rdf4j.sail.lmdb.TripleStore.TripleIndex;
3130
import org.eclipse.rdf4j.sail.lmdb.TxnManager.Txn;
3231
import org.eclipse.rdf4j.sail.lmdb.Varint.GroupMatcher;
3332
import org.lwjgl.PointerBuffer;
3433
import org.lwjgl.system.MemoryStack;
3534
import org.lwjgl.util.lmdb.MDBVal;
35+
import org.slf4j.Logger;
36+
import org.slf4j.LoggerFactory;
3637

3738
/**
3839
* A record iterator that wraps a native LMDB iterator.
3940
*/
4041
class LmdbRecordIterator implements RecordIterator {
42+
private static final Logger log = LoggerFactory.getLogger(LmdbRecordIterator.class);
4143
private final Pool pool;
4244

4345
private final TripleIndex index;
@@ -126,6 +128,11 @@ class LmdbRecordIterator implements RecordIterator {
126128
public long[] next() {
127129
long stamp = txnLock.readLock();
128130
try {
131+
if (closed) {
132+
log.debug("Calling next() on an LmdbRecordIterator that is already closed, returning null");
133+
return null;
134+
}
135+
129136
if (txnRefVersion != txnRef.version()) {
130137
// cursor must be renewed
131138
mdb_cursor_renew(txn, cursor);

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbUtil.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import static org.lwjgl.system.MemoryStack.stackPush;
1818
import static org.lwjgl.system.MemoryUtil.NULL;
19-
import static org.lwjgl.util.lmdb.LMDB.MDB_DBS_FULL;
2019
import static org.lwjgl.util.lmdb.LMDB.MDB_KEYEXIST;
2120
import static org.lwjgl.util.lmdb.LMDB.MDB_NOTFOUND;
2221
import static org.lwjgl.util.lmdb.LMDB.MDB_RDONLY;
@@ -32,7 +31,6 @@
3231
import java.nio.ByteBuffer;
3332
import java.nio.IntBuffer;
3433
import java.util.Comparator;
35-
import java.util.concurrent.ConcurrentHashMap;
3634

3735
import org.lwjgl.PointerBuffer;
3836
import org.lwjgl.system.MemoryStack;

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/TxnRecordCache.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import java.nio.file.Path;
4646

4747
import org.apache.commons.io.FileUtils;
48-
import org.eclipse.rdf4j.sail.SailException;
4948
import org.lwjgl.PointerBuffer;
5049
import org.lwjgl.system.MemoryStack;
5150
import org.lwjgl.util.lmdb.MDBStat;

core/sail/lmdb/src/test/java/org/eclipse/rdf4j/sail/lmdb/benchmark/QueryBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class QueryBenchmark {
112112

113113
public static void main(String[] args) throws RunnerException {
114114
Options opt = new OptionsBuilder()
115-
.include("QueryBenchmark") // adapt to run other benchmark tests
115+
.include("QueryBenchmark.*") // adapt to run other benchmark tests
116116
.forks(1)
117117
.build();
118118

0 commit comments

Comments
 (0)