ankitsultana commented on a change in pull request #8188:
URL: https://github.com/apache/pinot/pull/8188#discussion_r811607897



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
##########
@@ -3181,15 +3181,54 @@ public TableStats getTableStats(String 
tableNameWithType) {
   }
 
   /**
-   * Return the list of live brokers serving the corresponding table.
-   *  Each entry in the broker list is of the following format:
-   *  Broker_hostname_port
+   * Return the list of live brokers serving the corresponding table. Based on 
the
+   * input tableName, there can be 3 cases:
+   *
+   * 1. If the tableName has a type-suffix, then brokers for only that 
table-type
+   *    will be returned.
+   * 2. If the tableName doesn't have a type-suffix and there's only 1 type 
for that
+   *    table, then the brokers for that table-type would be returned.
+   * 3. If the tableName doesn't have a type-suffix and there are both REALTIME
+   *    and OFFLINE tables, then the intersection of the brokers for the two 
table-types
+   *    would be returned. Intersection is taken since the method guarantees 
to return
+   *    brokers which can serve the given table. In case of no type provided, 
it returns
+   *    broker which can serve both table-types.
+   *
+   * @param tableName name of table with or without type suffix.
+   * @return list of brokers serving the given table in the format: 
Broker_hostname_port.
+   * @throws TableNotFoundException when no table exists with the given name.
    */
-  public List<String> getLiveBrokersForTable(String tableNameWithType) {
+  public List<String> getLiveBrokersForTable(String tableName)
+      throws TableNotFoundException {
     ExternalView ev = 
_helixDataAccessor.getProperty(_keyBuilder.externalView(Helix.BROKER_RESOURCE_INSTANCE));
     if (ev == null) {
-      return Collections.EMPTY_LIST;
+      return new ArrayList<>();

Review comment:
       @Jackie-Jiang : Can you specify which exception should we return when 
ExternalView is null?




-- 
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]

Reply via email to