mcvsubbu commented on a change in pull request #4323: [Controller Separation]
Add logic for lead controller resource
URL: https://github.com/apache/incubator-pinot/pull/4323#discussion_r295898587
##########
File path:
pinot-common/src/main/java/org/apache/pinot/common/utils/helix/HelixHelper.java
##########
@@ -500,4 +503,42 @@ public IdealState apply(IdealState idealState) {
public static Set<String> getBrokerInstancesForTenant(List<InstanceConfig>
instanceConfigs, String tenant) {
return new HashSet<>(HelixHelper.getInstancesWithTag(instanceConfigs,
TagNameUtils.getBrokerTagForTenant(tenant)));
}
+
+ /**
+ * Gets hash code for table.
+ * @param rawTableName table name
+ * @return hash code
+ */
+ public static int getHashCodeForTable(String rawTableName) {
+ return rawTableName.hashCode();
+ }
+
+ /**
+ * Gets lead controller for table from lead controller resource.
+ * If the resource is disabled or no controller registered as participant,
there is no instance in "MASTER" state.
+ * @param leadControllerResourceExternalView external view of lead
controller resource
+ * @param rawTableName table name without type
+ * @return leader of partition, null if not found.
Review comment:
Add a note in the comments the side-effects of changing this method so as to
return a different lead controller for the same resource -- multiple
controllers may run the periodic task for the same table, realtime servers may
have trouble completing. etc. describe the scenarios. Alternatively, you can
add the description in the design document and put a pointer 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.
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]