jackjlli commented on a change in pull request #4047: Create leadControllerResource in helix cluster URL: https://github.com/apache/incubator-pinot/pull/4047#discussion_r289983563
########## File path: pinot-common/src/main/java/org/apache/pinot/common/config/TagNameUtils.java ########## @@ -45,7 +46,18 @@ public static boolean hasValidServerTagSuffix(String tagName) { return false; } - public static TenantRole getTenantRoleFromTag(String tagName) throws InvalidConfigException { + public static boolean isServerTag(String tagName) + throws InvalidConfigException { + return TenantRole.SERVER == getTenantRoleFromTag(tagName); + } + + public static boolean isBrokerTags(String tagName) + throws InvalidConfigException { + return TenantRole.BROKER == getTenantRoleFromTag(tagName); + } + + // Make this method private to avoid exposing null out of this class. + private static TenantRole getTenantRoleFromTag(String tagName) throws InvalidConfigException { Review comment: I think one of the reasons of keeping that is `tagName` can be misconfigured. This method `isServerTag` is to check whether it's a wrong tag name. Otherwise it will just return `false` and provides no extra information, which makes it harder to figure out. ---------------------------------------------------------------- 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