Jackie-Jiang commented on code in PR #13179:
URL: https://github.com/apache/pinot/pull/13179#discussion_r1617767169
##########
pinot-common/src/main/java/org/apache/pinot/common/response/BrokerResponse.java:
##########
@@ -32,264 +34,241 @@
public interface BrokerResponse {
/**
- * Set exceptions caught during request handling, into the broker response.
+ * Convert the broker response to JSON String.
*/
- void setExceptions(List<ProcessingException> exceptions);
-
- void addToExceptions(QueryProcessingException processingException);
+ default String toJsonString()
+ throws IOException {
+ return JsonUtils.objectToString(this);
+ }
/**
- * Set the number of servers got queried by the broker.
- *
- * @param numServersQueried number of servers got queried.
+ * Returns the result table.
*/
- void setNumServersQueried(int numServersQueried);
+ @Nullable
+ ResultTable getResultTable();
/**
- * Set the number of servers responded to the broker.
- *
- * @param numServersResponded number of servers responded.
+ * Sets the result table. We expose this method to allow modifying the
results on the client side, e.g. hiding the
+ * results and only showing the stats.
*/
- void setNumServersResponded(int numServersResponded);
+ void setResultTable(@Nullable ResultTable resultTable);
Review Comment:
I feel that is a little bit overkilling if the only benefit is getting rid
of this setter. I'm not a big fan of this only setter as well, but I feel it is
much simpler and easier to understand if we want to allow client to override it
--
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]