kfaraz commented on code in PR #18968:
URL: https://github.com/apache/druid/pull/18968#discussion_r2850861573


##########
server/src/main/java/org/apache/druid/server/compaction/CompactionCandidate.java:
##########
@@ -37,76 +39,200 @@
  */
 public class CompactionCandidate
 {
-  private final List<DataSegment> segments;
-  private final Interval umbrellaInterval;
-  private final Interval compactionInterval;
-  private final String dataSource;
-  private final long totalBytes;
-  private final int numIntervals;
-
-  private final CompactionStatus currentStatus;
-
-  public static CompactionCandidate from(
-      List<DataSegment> segments,
-      @Nullable Granularity targetSegmentGranularity
-  )
+  /**
+   * Non-empty list of segments of a datasource being proposed for compaction.
+   * A proposed compaction typically contains all the segments of a single 
time chunk.
+   */
+  public static class ProposedCompaction

Review Comment:
   > don't we need the uncompacted & compacted stats in CompactionStatus to 
sort CompactionCandidate?
   
   We do, that's why we shouldn't be touching the `CompactionStatus` class at 
all.
   
   The `Eligibility` is its own thing. It does not need be put inside any other 
class.
   In `CompactionJobQueue`, we will pick a `CompactionCandidate` from the queue 
and then ask the search policy on whether that candidate is eligible or not. 
Based on the eligibility, we will launch the job (info of job type i.e 
incremental or not) will also be included inside the eligibility object 
returned by the policy.
   
   Similarly, `CompactSegments` can also check the eligibility of a candidate.
   
   So, effectively, we are moving the call `searchPolicy.checkEligibility()` 
from `CompactionStatusTracker` to `CompactSegments` and `CompactionJobQueue`. 
We need to do this because we are getting rid of the method 
`CompactionStatusTracker.computeCompactionStatus()`.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to