gortiz commented on code in PR #19943:
URL: https://github.com/apache/pinot/pull/19943#discussion_r4404305889
##########
pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QueryScheduler.java:
##########
@@ -74,6 +78,19 @@ public QueryScheduler(PinotConfiguration config, String
instanceId, QueryExecuto
_threadAccountant = threadAccountant;
_latestQueryTime = latestQueryTime;
_resourceManager = resourceManager;
+ // submit() and submitResponse() call each other by default. Fail here
instead of with a StackOverflowError on the
+ // first query.
+ Preconditions.checkState(overrides("submit") ||
overrides("submitResponse"),
+ "%s must override submitResponse(ServerQueryRequest) or the deprecated
submit(ServerQueryRequest)",
+ getClass().getName());
+ }
+
+ private boolean overrides(String methodName) {
+ try {
+ return getClass().getMethod(methodName,
ServerQueryRequest.class).getDeclaringClass() != QueryScheduler.class;
Review Comment:
Right, and since both methods are public, an override can't narrow them to
protected, so `getMethod` always finds 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]