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> |
getAverageRowCountForDatasource() |
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. |
Map<String,SegmentRowCountDistribution> |
getRowCountDistribution() |
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) |
boolean |
loadSegment(DataSegment segment,
boolean lazy,
SegmentLazyLoadFailCallback loadFailed,
ExecutorService loadSegmentIntoPageCacheExec)
Load a single segment.
|
@Inject public SegmentManager(SegmentLoader segmentLoader)
public Map<String,Long> getDataSourceSizes()
public Map<String,SegmentRowCountDistribution> getRowCountDistribution()
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
SegmentLoadingExceptionpublic boolean loadSegment(DataSegment segment, boolean lazy, SegmentLazyLoadFailCallback loadFailed, ExecutorService loadSegmentIntoPageCacheExec) throws SegmentLoadingException
segment - segment to loadlazy - whether to lazy load columns metadataloadFailed - callBack to execute when segment lazy load failedloadSegmentIntoPageCacheExec - If null is specified, the default thread pool in segment loader to load
segments into page cache on download will be used. You can specify a dedicated
thread pool of larger capacity when this function is called during historical
process bootstrap to speed up initial loading.SegmentLoadingException - if the segment cannot be loadedpublic void dropSegment(DataSegment segment)
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.