Class NewestSegmentFirstIterator
- java.lang.Object
-
- org.apache.druid.server.coordinator.compact.NewestSegmentFirstIterator
-
- All Implemented Interfaces:
Iterator<SegmentsToCompact>,CompactionSegmentIterator
public class NewestSegmentFirstIterator extends Object implements CompactionSegmentIterator
This class iterates all segments of the dataSources configured for compaction from the newest to the oldest.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()SegmentsToCompactnext()Map<String,CompactionStatistics>totalCompactedStatistics()Return a map of dataSourceName to CompactionStatistics.Map<String,CompactionStatistics>totalSkippedStatistics()Return a map of dataSourceName to CompactionStatistics.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Method Detail
-
totalCompactedStatistics
public Map<String,CompactionStatistics> totalCompactedStatistics()
Description copied from interface:CompactionSegmentIteratorReturn a map of dataSourceName to CompactionStatistics. This method returns the aggregated statistics of segments that was already compacted and does not need to be compacted again. Hence, segment that were not returned by theIterator.next()becuase it does not needs compaction. Note that the aggregations returned by this method is only up to the current point of the iterator being iterated.- Specified by:
totalCompactedStatisticsin interfaceCompactionSegmentIterator
-
totalSkippedStatistics
public Map<String,CompactionStatistics> totalSkippedStatistics()
Description copied from interface:CompactionSegmentIteratorReturn a map of dataSourceName to CompactionStatistics. This method returns the aggregated statistics of segments that was skipped as it cannot be compacted. Hence, segment that were not returned by theIterator.next()becuase it cannot be compacted. Note that the aggregations returned by this method is only up to the current point of the iterator being iterated.- Specified by:
totalSkippedStatisticsin interfaceCompactionSegmentIterator
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceIterator<SegmentsToCompact>
-
next
public SegmentsToCompact next()
- Specified by:
nextin interfaceIterator<SegmentsToCompact>
-
-