Class CompactionCandidate

java.lang.Object
org.apache.druid.server.compaction.CompactionCandidate

public class CompactionCandidate extends Object
Non-empty list of segments of a datasource being considered for compaction. A candidate typically contains all the segments of a single time chunk.
  • Method Details

    • getCompactionInterval

      public static org.joda.time.Interval getCompactionInterval(List<DataSegment> segments, @Nullable Granularity targetSegmentGranularity)
    • from

      public static CompactionCandidate from(List<DataSegment> segments, @Nullable Granularity targetSegmentGranularity, CompactionStatus currentStatus)
    • getSegments

      public List<DataSegment> getSegments()
      Returns:
      Non-empty list of segments that make up this candidate.
    • numSegments

      public int numSegments()
    • getUmbrellaInterval

      public org.joda.time.Interval getUmbrellaInterval()
      Umbrella interval of all the segments in this candidate. This typically corresponds to a single time chunk in the segment timeline.
    • getCompactionInterval

      public org.joda.time.Interval getCompactionInterval()
      Interval aligned to the target segment granularity used for the compaction task. This interval completely contains the umbrellaInterval.
    • getDataSource

      public String getDataSource()
    • getStats

      public CompactionStatistics getStats()
    • getCompactedStats

      @Nullable public CompactionStatistics getCompactedStats()
    • getUncompactedStats

      @Nullable public CompactionStatistics getUncompactedStats()
    • getUncompactedSegments

      @Nullable public List<DataSegment> getUncompactedSegments()
    • getCurrentStatus

      @Nonnull public CompactionStatus getCurrentStatus()
      Non-null current compaction status of the time chunk corresponding to this candidate.
    • withCurrentStatus

      public CompactionCandidate withCurrentStatus(CompactionStatus status)
      Creates a copy of this CompactionCandidate object with the given status.
    • toString

      public String toString()
      Overrides:
      toString in class Object