Skip to content

Commit

Permalink
Close iterator and add missing locking.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwenzel committed Jul 18, 2024
1 parent 1fe5e46 commit 03afdf1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,11 @@ public boolean hasNext() {
currentTuple = getFirstTuple(URIs.createURI(previousTuple.getItem()), previousTuple.getItemId(),
previousTuple.getPropertyId() + 1, null);
}
return currentTuple != null;
if (currentTuple == null) {
close();
return false;
}
return true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ public void put(KvinTuple... tuples) {

@Override
public void put(Iterable<KvinTuple> tuples) {
hotStore.put(tuples);
Lock readLock = readLock();
try {
hotStore.put(tuples);
} finally {
readLock.release();
}
}

public void createNewHotDataStore() throws IOException {
Expand Down

0 comments on commit 03afdf1

Please sign in to comment.