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 2022/03/22 00:07:49 UTC

[GitHub] [pinot] walterddr commented on a change in pull request #8379: create routeTable and routeManager API

walterddr commented on a change in pull request #8379:
URL: https://github.com/apache/pinot/pull/8379#discussion_r831641070



##########
File path: pinot-broker/src/main/java/org/apache/pinot/broker/routing/RoutingManager.java
##########
@@ -458,13 +460,42 @@ public boolean routingExists(String tableNameWithType) {
    * <p>NOTE: The broker request should already have the table suffix (_OFFLINE or _REALTIME) appended.
    */
   @Nullable
+  @Override
   public RoutingTable getRoutingTable(BrokerRequest brokerRequest) {
     String tableNameWithType = brokerRequest.getQuerySource().getTableName();
     RoutingEntry routingEntry = _routingEntryMap.get(tableNameWithType);
     if (routingEntry == null) {
       return null;
     }
     InstanceSelector.SelectionResult selectionResult = routingEntry.calculateRouting(brokerRequest);
+    return constructRoutingTableFromInstanceSelectionResult(tableNameWithType, selectionResult);
+  }
+
+  @Override
+  public RoutingTable getRoutingTable(String tableNameWithType) {
+    RoutingEntry routingEntry = _routingEntryMap.get(tableNameWithType);
+    if (routingEntry == null) {
+      return null;
+    }
+    InstanceSelector.SelectionResult selectionResult = routingEntry.calculateRouting(tableNameWithType);
+    return constructRoutingTableFromInstanceSelectionResult(tableNameWithType, selectionResult);
+  }
+
+  @Override
+  public Map<String, ServerInstance> getEnabledServerInstanceMap() {
+    return new HashMap<>(_enabledServerInstanceMap);

Review comment:
       +1. yeah. 




-- 
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-unsubscribe@pinot.apache.org

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



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