kfaraz commented on code in PR #18968:
URL: https://github.com/apache/druid/pull/18968#discussion_r2795122751
##########
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:
What we need is a way to distinguish between a candidate before and after
the status has been computed, so that we can avoid the null checks on
`currentStatus`. I don't think this change fully achieves that.
Also, the name `CompactionCandidate` captures the intent better as it
defines a potential "candidate" for compaction. So let's stick with it.
Instead of this change, you may consider adding a new class
`CompactionCandidateAndStatus` which will be used by both the methods of the
search policy. The new class will contain only a `candidate` field and a
`status` field.
I don't think we will need this class to contain the `Eligibility` or the
`CompactionMode` since it will be computed and used only by the
`CompactionJobQueue`.
--
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]