yupeng9 commented on a change in pull request #7556:
URL: https://github.com/apache/pinot/pull/7556#discussion_r727268599
##########
File path:
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/ExternalViewReader.java
##########
@@ -87,7 +87,18 @@ protected ByteArrayInputStream getInputStream(byte[]
brokerResourceNodeData) {
return new ByteArrayInputStream(brokerResourceNodeData);
}
+ // Return a map from tablename (without type) to live brokers (of format
host:port).
public Map<String, List<String>> getTableToBrokersMap() {
+ return getTableToBrokersMapFromExternalView(false, true);
+
Review comment:
nil: newline
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
##########
@@ -2862,6 +2864,13 @@ public TableStats getTableStats(String
tableNameWithType) {
return new TableStats(creationTime);
}
+ // Return the list of live brokers serving a table. Each entry is of the
following format:
+ // Broker_hostname_port (e.g., broker_12.34.56.78_1234)
+ public List<String> getLiveBrokersForTable(String tableNameWithType) {
+ ExternalViewReader externalViewReader = new ExternalViewReader(new
ZkClient(_helixZkURL));
+ Map<String, List<String>> tableToBrokersMap =
externalViewReader.getTableWithTypeToRawBrokerInstanceIdsMap();
+ return tableToBrokersMap == null ? null :
tableToBrokersMap.get(tableNameWithType);
Review comment:
shall we return empty map other than 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]