Jackie-Jiang commented on a change in pull request #4047: Create
leadControllerResource in helix cluster
URL: https://github.com/apache/incubator-pinot/pull/4047#discussion_r289960549
##########
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:
We don't need this method. Directly implement in each public methods.
E.g.
`public static boolean isOfflineServerTag(String tagName) { return
tagName.endsWith(ServerType.OFFLINE.toString()); }`
`public static boolean isRealtimeServerTag(String tagName) { return
tagName.endsWith(ServerType.REALTIME.toString()); }`
`public static boolean isServerTag(String tagName) { return
isOfflineServerTag(tagName) || isRealtimeServerTag(tagName); }`
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]