navina commented on code in PR #18316:
URL: https://github.com/apache/pinot/pull/18316#discussion_r3140721365


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/SingleConnectionBrokerRequestHandler.java:
##########
@@ -142,7 +142,28 @@ protected BrokerResponseNative processBrokerRequest(long 
requestId, BrokerReques
         serversNotResponded.add(entry.getKey());
       }
     }
-    int numServersResponded = dataTableMap.size();
+    return new ScatterResult(dataTableMap, serversNotResponded, 
totalResponseSize, timedOut,
+        asyncQueryResponse.getException());
+  }
+
+  /**
+   * Executes the reduce step on the given dataTableMap and populates the 
response with scatter stats.
+   * Subclasses may pass a dataTableMap that differs from 
scatterResult.getDataTableMap() (e.g., with
+   * additional cached DataTables merged in), while scatterResult is always 
used for server stats so
+   * that cached entries are never counted as real servers queried.
+   */
+  protected BrokerResponseNative doReduce(BrokerRequest originalBrokerRequest, 
BrokerRequest serverBrokerRequest,
+      Map<ServerRoutingInstance, DataTable> dataTableMap, ScatterResult 
scatterResult,

Review Comment:
   good catch. I think we need only the `ScatterResult` instance as it holds 
the same dataTableMap



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to