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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to