jackjlli commented on a change in pull request #4545: Add APIs to get leader for all tables or a given table URL: https://github.com/apache/incubator-pinot/pull/4545#discussion_r321821985
########## File path: pinot-common/src/main/java/org/apache/pinot/common/utils/helix/LeadControllerUtils.java ########## @@ -58,4 +65,15 @@ public static String generatePartitionName(int partitionId) { public static int extractPartitionId(String partitionName) { return Integer.parseInt(partitionName.substring(partitionName.lastIndexOf('_') + 1)); } + + /** + * Checks from ZK if resource config of leadControllerResource is enabled. + */ + public static boolean isLeadControllerResourceEnabled(HelixManager helixManager) { + HelixDataAccessor helixDataAccessor = helixManager.getHelixDataAccessor(); + PropertyKey propertyKey = helixDataAccessor.keyBuilder().resourceConfig(Helix.LEAD_CONTROLLER_RESOURCE_NAME); + ResourceConfig resourceConfig = helixDataAccessor.getProperty(propertyKey); + String enableResource = resourceConfig.getSimpleConfig(Helix.LEAD_CONTROLLER_RESOURCE_ENABLED_KEY); Review comment: Done. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org