kfaraz commented on code in PR #14875: URL: https://github.com/apache/druid/pull/14875#discussion_r1299691245
########## server/src/main/java/org/apache/druid/server/coordinator/compact/NewestSegmentFirstIterator.java: ########## @@ -84,21 +68,19 @@ public class NewestSegmentFirstIterator implements CompactionSegmentIterator private final ObjectMapper objectMapper; private final Map<String, DataSourceCompactionConfig> compactionConfigs; - private final Map<String, CompactionStatistics> compactedSegments = new HashMap<>(); - private final Map<String, CompactionStatistics> skippedSegments = new HashMap<>(); + private final Map<String, CompactionStatistics> compactedSegmentStats = new HashMap<>(); + private final Map<String, CompactionStatistics> skippedSegmentStats = new HashMap<>(); - // dataSource -> intervalToFind - // searchIntervals keeps track of the current state of which interval should be considered to search segments to - // compact. private final Map<String, CompactibleTimelineObjectHolderCursor> timelineIterators; + // This is needed for datasource that has segmentGranularity configured // If configured segmentGranularity in config is finer than current segmentGranularity, the same set of segments // can belong to multiple intervals in the timeline. We keep track of the compacted intervals between each // run of the compaction job and skip any interval that was already previously compacted. private final Map<String, Set<Interval>> intervalCompactedForDatasource = new HashMap<>(); - private final PriorityQueue<QueueEntry> queue = new PriorityQueue<>( - (o1, o2) -> Comparators.intervalsByStartThenEnd().compare(o2.interval, o1.interval) + private final PriorityQueue<SegmentsToCompact> queue = new PriorityQueue<>( + (o1, o2) -> Comparators.intervalsByStartThenEnd().compare(o2.getUmbrellaInterval(), o1.getUmbrellaInterval()) Review Comment: `QueueEntry` was a redundant class which had the same fields as `SegmentsToCompact`. We were doing the work of determining the `umbrellaInterval` twice. So I removed the `QueueEntry` class and used `SegmentsToCompact` instead. -- 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]
