Skip to content

Commit

Permalink
use traditional addAll instead of stream
Browse files Browse the repository at this point in the history
  • Loading branch information
albertobastos committed Jan 16, 2025
1 parent 6055448 commit de63dde
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,10 @@ protected BrokerResponse handleRequest(long requestId, String query, SqlNodeAndO

DispatchableSubPlan dispatchableSubPlan = queryPlanResult.getQueryPlan();

Set<QueryServerInstance> servers = dispatchableSubPlan.getQueryStageList().stream()
.map(DispatchablePlanFragment::getServerInstances)
.reduce(new HashSet<QueryServerInstance>(), (all, some) -> {
all.addAll(some);
return all;
});
Set<QueryServerInstance> servers = new HashSet<>();
for (DispatchablePlanFragment planFragment: dispatchableSubPlan.getQueryStageList()) {
servers.addAll(planFragment.getServerInstances());
}

Set<String> tableNames = queryPlanResult.getTableNames();
_brokerMetrics.addMeteredGlobalValue(BrokerMeter.MULTI_STAGE_QUERIES_GLOBAL, 1);
Expand Down

0 comments on commit de63dde

Please sign in to comment.