Class DataSourcesSnapshot


  • public class DataSourcesSnapshot
    extends Object
    An immutable snapshot of metadata information about used segments and overshadowed segments, coming from SqlSegmentsMetadataManager.
    • Method Detail

      • fromUsedSegments

        public static DataSourcesSnapshot fromUsedSegments​(Iterable<org.apache.druid.timeline.DataSegment> segments,
                                                           com.google.common.collect.ImmutableMap<String,​String> dataSourceProperties)
      • fromUsedSegmentsTimelines

        public static DataSourcesSnapshot fromUsedSegmentsTimelines​(Map<String,​org.apache.druid.timeline.SegmentTimeline> usedSegmentsTimelinesPerDataSource,
                                                                    com.google.common.collect.ImmutableMap<String,​String> dataSourceProperties)
      • getUsedSegmentsTimelinesPerDataSource

        public Map<String,​org.apache.druid.timeline.SegmentTimeline> getUsedSegmentsTimelinesPerDataSource()
      • getOvershadowedSegments

        public com.google.common.collect.ImmutableSet<org.apache.druid.timeline.DataSegment> getOvershadowedSegments()
      • iterateAllUsedSegmentsInSnapshot

        public Iterable<org.apache.druid.timeline.DataSegment> iterateAllUsedSegmentsInSnapshot()
        Returns an iterable to go over all used segments in all data sources. The order in which segments are iterated is unspecified. Note: the iteration may not be as trivially cheap as, for example, iteration over an ArrayList. Try (to some reasonable extent) to organize the code so that it iterates the returned iterable only once rather than several times. This method's name starts with "iterate" because the result is expected to be consumed immediately in a for-each statement or a stream pipeline, like for (DataSegment segment : snapshot.iterateAllUsedSegmentsInSnapshot()) {...}