code: private void updateQueue(String dataSourceName, DataSourceCompactionConfig config)
    {
      final CompactibleTimelineObjectHolderCursor compactibleTimelineObjectHolderCursor = timelineIterators.get(
          dataSourceName
      );
  
      if (compactibleTimelineObjectHolderCursor == null) {
        log.warn("Cannot find timeline for dataSource[%s]. Skip this dataSource", dataSourceName);
        return;
      }
  
      final SegmentsToCompact segmentsToCompact = findSegmentsToCompact(
          compactibleTimelineObjectHolderCursor,
          config
      );
  
      if (segmentsToCompact.getNumSegments() > 1) {
        queue.add(new QueueEntry(segmentsToCompact.segments));
      }
    }
docs: Find the next segments to compact for the given dataSource and add them to the queue.
  {@link #timelineIterators} is updated according to the found segments. That is, the found segments are removed from
  the timeline of the given dataSource.