You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/06/19 03:14:21 UTC

[GitHub] [druid] maytasm commented on a change in pull request #10054: Add safeguard to make sure new Rules added are aware of Rule usage in loadstatus API

maytasm commented on a change in pull request #10054:
URL: https://github.com/apache/druid/pull/10054#discussion_r442608656



##########
File path: server/src/main/java/org/apache/druid/server/coordinator/rules/Rule.java
##########
@@ -51,6 +51,14 @@
 
   boolean appliesTo(Interval interval, DateTime referenceTimestamp);
 
+  /**
+   * Returns whether this Rules should be matched and considered in loadstatus API.
+   * In general, Rules that load segment onto any Druid node should return true.
+   * Any Rule that returns true for this method should add a compute logic (as if case condition) for the particular
+   * Rule class in {@link DruidCoordinator#computeUnderReplicationCountsPerDataSourcePerTierForSegments}
+   */
+  boolean matchLoadStatusCount();

Review comment:
       I don't like calling it `isLoadRule` because there is a class/interface `LoadRule` and not all things that return true for this method are of the class/subclass of that class/interface `LoadRule`. But I agree let's not tie it to API. How about calling it `isRuleLoadSegments` or `canLoadSegments` or `isLoadSegments`.
   Although, I still want to leave the comment `Any Rule that returns true for this method should add a compute logic (as if case condition) for the particular Rule class in {@link DruidCoordinator#computeUnderReplicationCountsPerDataSourcePerTierForSegments}` there. Since that will help people find the appropriate place to change/add when creating new Rule. What do you think?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org