mqliang commented on a change in pull request #7556:
URL: https://github.com/apache/pinot/pull/7556#discussion_r726803300
##########
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);
+
+ }
+
+ // Return a map from tablename (with type) to live brokers (of raw instance
format broker_host_port).
+ public Map<String, List<String>> getTableWithTypeToRawBrokerInstanceIdsMap()
{
+ return getTableToBrokersMapFromExternalView(true, false);
+ }
+
+ private Map<String, List<String>>
getTableToBrokersMapFromExternalView(boolean tableWithType, boolean
useUrlFormat) {
Map<String, Set<String>> brokerUrlsMap = new HashMap<>();
try {
byte[] brokerResourceNodeData =
_zkClient.readData("/EXTERNALVIEW/brokerResource", true);
Review comment:
You can reuse the BROKER_EXTERNAL_VIEW_PATH constant to replace String
"/EXTERNALVIEW/brokerResource" here.
--
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]