gortiz commented on code in PR #13706:
URL: https://github.com/apache/pinot/pull/13706#discussion_r1708886566
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -836,6 +840,31 @@ protected BrokerResponse handleRequest(long requestId,
String query, @Nullable S
}
}
+ @VisibleForTesting
+ static String addRoutingPolicyInErrMsg(String errorMessage, String
realtimeRoutingPolicy,
+ String offlineRoutingPolicy) {
+ if (realtimeRoutingPolicy != null && offlineRoutingPolicy != null) {
+ return String.format("%s, with routing policy: %s [realtime], %s
[offline]", errorMessage, realtimeRoutingPolicy,
+ offlineRoutingPolicy);
+ }
+ if (realtimeRoutingPolicy != null) {
+ return String.format("%s, with routing policy: %s [realtime]",
errorMessage, realtimeRoutingPolicy);
+ }
+ if (offlineRoutingPolicy != null) {
+ return String.format("%s, with routing policy: %s [offline]",
errorMessage, offlineRoutingPolicy);
+ }
Review Comment:
Is there a reason to use `String.format` here? It is pretty inefficient and
IMHO more difficult to read that just concatenating Strings.
--
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]