Skip to content

Commit

Permalink
Do not use async evaluation for last binding.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwenzel committed Sep 2, 2024
1 parent c60d066 commit cf08b87
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,21 @@ public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(
while (bindings.hasNext() && bindingSetList.size() < InnerJoinIterator.BATCH_SIZE) {
bindingSetList.add(bindings.next());
}
resultIters.add(new AsyncIterator<>(() -> ((BatchQueryEvaluationStep) precompiled)
.evaluate(bindingSetList), executorService));
if (! bindings.hasNext()) {
resultIters.add(((BatchQueryEvaluationStep) precompiled).evaluate(bindingSetList));
} else {
resultIters.add(new AsyncIterator<>(() -> ((BatchQueryEvaluationStep) precompiled)
.evaluate(bindingSetList), executorService));
}
}
} else {
while (bindings.hasNext()) {
BindingSet bs = bindings.next();
resultIters.add(new AsyncIterator<>(() -> precompiled.evaluate(bs), executorService));
if (! bindings.hasNext()) {
resultIters.add(precompiled.evaluate(bs));
} else {
resultIters.add(new AsyncIterator<>(() -> precompiled.evaluate(bs), executorService));
}
}
}

Expand Down

0 comments on commit cf08b87

Please sign in to comment.