You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/11/07 19:45:12 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #4795: Enhance RoutingTable to use ServerInstance

Jackie-Jiang commented on a change in pull request #4795: Enhance RoutingTable to use ServerInstance  
URL: https://github.com/apache/incubator-pinot/pull/4795#discussion_r343839535
 
 

 ##########
 File path: pinot-core/src/main/java/org/apache/pinot/core/transport/QueryRouter.java
 ##########
 @@ -55,25 +56,27 @@ public QueryRouter(String brokerId, BrokerMetrics brokerMetrics) {
   }
 
   public AsyncQueryResponse submitQuery(long requestId, String rawTableName,
-      @Nullable BrokerRequest offlineBrokerRequest, @Nullable Map<String, List<String>> offlineRoutingTable,
-      @Nullable BrokerRequest realtimeBrokerRequest, @Nullable Map<String, List<String>> realtimeRoutingTable,
+      @Nullable BrokerRequest offlineBrokerRequest, @Nullable Map<ServerInstance, List<String>> offlineRoutingTable,
+      @Nullable BrokerRequest realtimeBrokerRequest, @Nullable Map<ServerInstance, List<String>> realtimeRoutingTable,
       long timeoutMs) {
     assert offlineBrokerRequest != null || realtimeBrokerRequest != null;
 
     // Build map from server to request based on the routing table
     Map<Server, InstanceRequest> requestMap = new HashMap<>();
     if (offlineBrokerRequest != null) {
       assert offlineRoutingTable != null;
-      for (Map.Entry<String, List<String>> entry : offlineRoutingTable.entrySet()) {
-        Server server = new Server(entry.getKey(), TableType.OFFLINE);
+      for (Map.Entry<ServerInstance, List<String>> entry : offlineRoutingTable.entrySet()) {
 
 Review comment:
   We need seqId to differentiate OFFLINE table response and REALTIME table response, which is very hard to understand.. And that is the main reason why I made a new class and use TableType instead. Also, we don't need to calculate the shortHostName when routing the queries

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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