File tree Expand file tree Collapse file tree 5 files changed +9
-11
lines changed
base/src/main/java/org/eclipse/rdf4j/sail
main/java/org/eclipse/rdf4j/sail/lmdb
test/java/org/eclipse/rdf4j/sail/lmdb/benchmark Expand file tree Collapse file tree 5 files changed +9
-11
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 2626import java .nio .ByteBuffer ;
2727import java .util .concurrent .locks .StampedLock ;
2828
29- import org .eclipse .rdf4j .sail .SailException ;
3029import org .eclipse .rdf4j .sail .lmdb .TripleStore .TripleIndex ;
3130import org .eclipse .rdf4j .sail .lmdb .TxnManager .Txn ;
3231import org .eclipse .rdf4j .sail .lmdb .Varint .GroupMatcher ;
3332import org .lwjgl .PointerBuffer ;
3433import org .lwjgl .system .MemoryStack ;
3534import 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 */
4041class 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 );
Original file line number Diff line number Diff line change 1616
1717import static org .lwjgl .system .MemoryStack .stackPush ;
1818import static org .lwjgl .system .MemoryUtil .NULL ;
19- import static org .lwjgl .util .lmdb .LMDB .MDB_DBS_FULL ;
2019import static org .lwjgl .util .lmdb .LMDB .MDB_KEYEXIST ;
2120import static org .lwjgl .util .lmdb .LMDB .MDB_NOTFOUND ;
2221import static org .lwjgl .util .lmdb .LMDB .MDB_RDONLY ;
3231import java .nio .ByteBuffer ;
3332import java .nio .IntBuffer ;
3433import java .util .Comparator ;
35- import java .util .concurrent .ConcurrentHashMap ;
3634
3735import org .lwjgl .PointerBuffer ;
3836import org .lwjgl .system .MemoryStack ;
Original file line number Diff line number Diff line change 4545import java .nio .file .Path ;
4646
4747import org .apache .commons .io .FileUtils ;
48- import org .eclipse .rdf4j .sail .SailException ;
4948import org .lwjgl .PointerBuffer ;
5049import org .lwjgl .system .MemoryStack ;
5150import org .lwjgl .util .lmdb .MDBStat ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments