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<VersionedIntervalTimeline<String,ReferenceCountingSegment>> |
getTimeline(DataSourceAnalysis analysis)
Returns the timeline for a datasource, if it exists.
|
boolean |
isSegmentCached(DataSegment segment) |
boolean |
loadSegment(DataSegment segment,
boolean lazy)
Load a single segment.
|
@Inject public SegmentManager(SegmentLoader segmentLoader)
public Map<String,Long> getDataSourceSizes()
public Map<String,Long> getDataSourceCounts()
public boolean isSegmentCached(DataSegment segment)
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 boolean loadSegment(DataSegment segment, boolean lazy) throws SegmentLoadingException
segment - segment to loadlazy - whether to lazy load columns metadataSegmentLoadingException - if the segment cannot be loadedpublic void dropSegment(DataSegment segment)
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.