@@ -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