Package org.apache.druid.client
Class DataSourcesSnapshot
- java.lang.Object
-
- org.apache.druid.client.DataSourcesSnapshot
-
public class DataSourcesSnapshot extends Object
An immutable snapshot of metadata information about used segments and overshadowed segments, coming fromSqlSegmentsMetadataManager.
-
-
Constructor Summary
Constructors Constructor Description DataSourcesSnapshot(Map<String,ImmutableDruidDataSource> dataSourcesWithAllUsedSegments)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataSourcesSnapshotfromUsedSegments(Iterable<org.apache.druid.timeline.DataSegment> segments, com.google.common.collect.ImmutableMap<String,String> dataSourceProperties)static DataSourcesSnapshotfromUsedSegmentsTimelines(Map<String,org.apache.druid.timeline.SegmentTimeline> usedSegmentsTimelinesPerDataSource, com.google.common.collect.ImmutableMap<String,String> dataSourceProperties)ImmutableDruidDataSourcegetDataSource(String dataSourceName)Map<String,ImmutableDruidDataSource>getDataSourcesMap()Collection<ImmutableDruidDataSource>getDataSourcesWithAllUsedSegments()com.google.common.collect.ImmutableSet<org.apache.druid.timeline.DataSegment>getOvershadowedSegments()Map<String,org.apache.druid.timeline.SegmentTimeline>getUsedSegmentsTimelinesPerDataSource()Iterable<org.apache.druid.timeline.DataSegment>iterateAllUsedSegmentsInSnapshot()Returns an iterable to go over all used segments in all data sources.
-
-
-
Constructor Detail
-
DataSourcesSnapshot
public DataSourcesSnapshot(Map<String,ImmutableDruidDataSource> dataSourcesWithAllUsedSegments)
-
-
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)
-
getDataSourcesWithAllUsedSegments
public Collection<ImmutableDruidDataSource> getDataSourcesWithAllUsedSegments()
-
getDataSourcesMap
public Map<String,ImmutableDruidDataSource> getDataSourcesMap()
-
getDataSource
@Nullable public ImmutableDruidDataSource getDataSource(String dataSourceName)
-
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()) {...}
-
-