Skip to content

Commit 73d1883

Browse files
committed
fix for test
1 parent d0b96b7 commit 73d1883

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/util/QueryEvaluator.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,10 @@ private void addWorkbenchMetadata(TupleResultBuilder builder, WorkbenchRequest r
550550
private List<BindingSet> collectBindingSets(TupleQueryResult result) throws QueryEvaluationException {
551551
List<BindingSet> bindings = new ArrayList<>();
552552
while (result.hasNext()) {
553+
bindings.add(result.next());
553554
if (bindings.size() % MATERIALIZATION_CHECKPOINT_INTERVAL == 0) {
554-
QueryExecutionContext.checkpoint("WORKBENCH_TUPLE_RESULT");
555+
checkpointMaterialization("WORKBENCH_TUPLE_RESULT");
555556
}
556-
bindings.add(result.next());
557557
}
558558
return bindings;
559559
}
@@ -562,15 +562,22 @@ private List<Statement> collectStatements(GraphQuery query) throws QueryEvaluati
562562
List<Statement> statements = new ArrayList<>();
563563
try (var result = query.evaluate()) {
564564
while (result.hasNext()) {
565+
statements.add(result.next());
565566
if (statements.size() % MATERIALIZATION_CHECKPOINT_INTERVAL == 0) {
566-
QueryExecutionContext.checkpoint("WORKBENCH_GRAPH_RESULT");
567+
checkpointMaterialization("WORKBENCH_GRAPH_RESULT");
567568
}
568-
statements.add(result.next());
569569
}
570570
}
571571
return statements;
572572
}
573573

574+
private void checkpointMaterialization(String operator) throws QueryEvaluationException {
575+
QueryCircuitBreakerHandle handle = QueryExecutionContext.getHandle();
576+
if (handle != null) {
577+
QUERY_CIRCUIT_BREAKER.checkpoint(handle, operator);
578+
}
579+
}
580+
574581
private String extractRepositoryId(RepositoryConnection connection) {
575582
if (connection == null || connection.getRepository() == null) {
576583
return "unknown-workbench-repository";

0 commit comments

Comments
 (0)