jihoonson commented on a change in pull request #6676: Handoff should ignore 
segments that are dropped by drop rules
URL: https://github.com/apache/incubator-druid/pull/6676#discussion_r237218955
 
 

 ##########
 File path: server/src/main/java/org/apache/druid/server/http/RulesResource.java
 ##########
 @@ -152,6 +155,30 @@ public Response getDatasourceRuleHistory(
     }
   }
 
+  @GET
+  @Path("/{dataSourceName}/intervals/{interval}/dropped")
+  @Produces(MediaType.APPLICATION_JSON)
+  @ResourceFilters(RulesResourceFilter.class)
+  public Response isSpecificIntervalDroppedByRule(
+      @PathParam("dataSourceName") String dataSourceName,
+      @PathParam("interval") String interval
+  )
+  {
+    final List<Rule> rules = 
databaseRuleManager.getRulesWithDefault(dataSourceName);
+    final Interval theInterval = Intervals.of(interval.replace('_', '/'));
+    final DateTime now = DateTimes.nowUtc();
+    boolean dropped = false;
+    for (Rule rule : rules) {
+      if (rule.appliesTo(theInterval, now)) {
+        if (rule instanceof DropRule) {
+          dropped = true;
 
 Review comment:
   This looks not correct. First of all, rules can be empty. This effectively 
makes any segments to not be loaded into historicals. Also, only the first 
matched rule is applied. Even if there is a matched drop rule, a segment can be 
loaded if any load rule matches before checking the drop rule.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]

Reply via email to