public class SegmentManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SegmentManager.DataSourceState
Represent the state of a data source including the timeline, total segment size, and number of segments.
|
| Constructor and Description |
|---|
SegmentManager(SegmentLoader segmentLoader) |
| Modifier and Type | Method and Description |
|---|---|
void |
dropSegment(DataSegment segment) |
Map<String,Long> |
getDataSourceCounts()
Returns a map of dataSource to the number of segments managed by this segmentManager.
|
Set<String> |
getDataSourceNames() |
Map<String,Long> |
getDataSourceSizes()
Returns a map of dataSource to the total byte size of segments managed by this segmentManager.
|
Optional<Stream<ReferenceCountingIndexedTable>> |
getIndexedTables(DataSourceAnalysis analysis)
Returns the collection of
IndexedTable for the entire timeline (since join conditions do not currently
consider the queries intervals), if the timeline exists for each of its segments that are joinable. |
Optional<VersionedIntervalTimeline<String,ReferenceCountingSegment>> |
getTimeline(DataSourceAnalysis analysis)
Returns the timeline for a datasource, if it exists.
|
boolean |
hasIndexedTables(String dataSourceName) |
boolean |
loadSegment(DataSegment segment,
boolean lazy,
SegmentLazyLoadFailCallback loadFailed)
Load a single segment.
|
@Inject public SegmentManager(SegmentLoader segmentLoader)
public Map<String,Long> getDataSourceSizes()
public Map<String,Long> getDataSourceCounts()
public Optional<VersionedIntervalTimeline<String,ReferenceCountingSegment>> getTimeline(DataSourceAnalysis analysis)
analysis - data source analysis informationIllegalStateException - if 'analysis' does not represent a scan-based datasource of a single tablepublic Optional<Stream<ReferenceCountingIndexedTable>> getIndexedTables(DataSourceAnalysis analysis)
IndexedTable for the entire timeline (since join conditions do not currently
consider the queries intervals), if the timeline exists for each of its segments that are joinable.public boolean hasIndexedTables(String dataSourceName)
public boolean loadSegment(DataSegment segment, boolean lazy, SegmentLazyLoadFailCallback loadFailed) throws SegmentLoadingException
segment - segment to loadlazy - whether to lazy load columns metadataloadFailed - callBack to execute when segment lazy load failedSegmentLoadingException - if the segment cannot be loadedpublic void dropSegment(DataSegment segment)
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.