jon-wei commented on a change in pull request #7494: API to drop data by 
interval
URL: https://github.com/apache/incubator-druid/pull/7494#discussion_r277052246
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java
 ##########
 @@ -700,4 +762,36 @@ static boolean 
isSegmentLoaded(Iterable<ImmutableSegmentLoadInfo> serverView, Se
     }
     return false;
   }
+
+  @VisibleForTesting
+  protected static class MarkDatasourceSegmentsPayload
+  {
+    private final Interval interval;
+    private final Set<String> segmentIds;
+
+    @JsonCreator
+    public MarkDatasourceSegmentsPayload(
+        @JsonProperty("interval") Interval interval,
+        @JsonProperty("segmentIds") Set<String> segmentIds
+    )
+    {
+      this.interval = interval;
+      this.segmentIds = segmentIds;
+    }
+
+    public Interval getInterval()
+    {
+      return interval;
+    }
+
+    public Set<String> getSegmentIds()
+    {
+      return segmentIds;
+    }
+
+    public boolean isValid()
 
 Review comment:
   This could just be a preconditions check in the constructor, and I would use 
a different error message that just tells the user that `intervals` and 
`segmentIds` cannot both be set.
   
   The current error message I don't think is accurate ("Request payload 
contains invalid interval[%s] or segmentIds[%s], atmost one valid value must be 
provided"), since the check is not really for validity of the supplied values 
but for the presence of both.

----------------------------------------------------------------
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]

Reply via email to