public interface SegmentsMetadataManager
| Modifier and Type | Method and Description |
|---|---|
Collection<ImmutableDruidDataSource> |
getImmutableDataSourcesWithAllUsedSegments()
Returns a set of
ImmutableDruidDataSource objects containing information about all used segments. |
ImmutableDruidDataSource |
getImmutableDataSourceWithUsedSegments(String dataSource)
If there are used segments belonging to the given data source this method returns them as an
ImmutableDruidDataSource object. |
Set<SegmentId> |
getOvershadowedSegments()
Returns a set of overshadowed segment ids.
|
DataSourcesSnapshot |
getSnapshotOfDataSourcesWithAllUsedSegments()
Returns a snapshot of DruidDataSources and overshadowed segments
|
List<org.joda.time.Interval> |
getUnusedSegmentIntervals(String dataSource,
org.joda.time.DateTime maxEndTime,
int limit)
Returns top N unused segment intervals with the end time no later than the specified maxEndTime when ordered by
segment start time, end time.
|
boolean |
isPollingDatabasePeriodically() |
com.google.common.base.Optional<Iterable<DataSegment>> |
iterateAllUsedNonOvershadowedSegmentsForDatasourceInterval(String datasource,
org.joda.time.Interval interval,
boolean requiresLatest)
Returns an iterable to go over all used and non-overshadowed segments of given data sources over given interval.
|
Iterable<DataSegment> |
iterateAllUsedSegments()
Returns an iterable to go over all segments in all data sources.
|
int |
markAsUnusedAllSegmentsInDataSource(String dataSource)
Returns the number of segment entries in the database whose state was changed as the result of this call (that is,
the segments were marked as unused).
|
int |
markAsUnusedSegmentsInInterval(String dataSource,
org.joda.time.Interval interval) |
int |
markAsUsedAllNonOvershadowedSegmentsInDataSource(String dataSource)
Returns the number of segment entries in the database whose state was changed as the result of this call (that is,
the segments were marked as used).
|
int |
markAsUsedNonOvershadowedSegments(String dataSource,
Set<String> segmentIds) |
int |
markAsUsedNonOvershadowedSegmentsInInterval(String dataSource,
org.joda.time.Interval interval) |
boolean |
markSegmentAsUnused(String segmentId)
Returns true if the state of the segment entry is changed in the database as the result of this call (that is, the
segment was marked as unused), false otherwise.
|
boolean |
markSegmentAsUsed(String segmentId)
Returns true if the state of the segment entry is changed in the database as the result of this call (that is, the
segment was marked as used), false otherwise.
|
int |
markSegmentsAsUnused(String dataSource,
Set<String> segmentIds) |
void |
poll() |
Set<String> |
retrieveAllDataSourceNames()
Retrieves all data source names for which there are segment in the database, regardless of whether those segments
are used or not.
|
void |
startPollingDatabasePeriodically() |
void |
stopPollingDatabasePeriodically() |
void startPollingDatabasePeriodically()
void stopPollingDatabasePeriodically()
boolean isPollingDatabasePeriodically()
int markAsUsedAllNonOvershadowedSegmentsInDataSource(String dataSource)
int markAsUsedNonOvershadowedSegmentsInInterval(String dataSource, org.joda.time.Interval interval)
int markAsUsedNonOvershadowedSegments(String dataSource, Set<String> segmentIds) throws UnknownSegmentIdsException
UnknownSegmentIdsExceptionboolean markSegmentAsUsed(String segmentId)
int markAsUnusedAllSegmentsInDataSource(String dataSource)
int markAsUnusedSegmentsInInterval(String dataSource, org.joda.time.Interval interval)
boolean markSegmentAsUnused(String segmentId)
@Nullable ImmutableDruidDataSource getImmutableDataSourceWithUsedSegments(String dataSource)
ImmutableDruidDataSource object. If there are no used segments belonging to the given data source this method
returns null.Collection<ImmutableDruidDataSource> getImmutableDataSourcesWithAllUsedSegments()
ImmutableDruidDataSource objects containing information about all used segments. ImmutableDruidDataSource objects in the returned collection are unique. If there are no used segments, this method
returns an empty collection.Set<SegmentId> getOvershadowedSegments()
DataSourcesSnapshot getSnapshotOfDataSourcesWithAllUsedSegments()
Iterable<DataSegment> iterateAllUsedSegments()
com.google.common.base.Optional<Iterable<DataSegment>> iterateAllUsedNonOvershadowedSegmentsForDatasourceInterval(String datasource, org.joda.time.Interval interval, boolean requiresLatest)
SqlSegmentsMetadataManager.periodicPollDelay will be used.Set<String> retrieveAllDataSourceNames()
getImmutableDataSourcesWithAllUsedSegments() method. This method will include a data source name even if there
are no used segments belonging to it, while getImmutableDataSourcesWithAllUsedSegments() won't return
such a data source.List<org.joda.time.Interval> getUnusedSegmentIntervals(String dataSource, org.joda.time.DateTime maxEndTime, int limit)
void poll()
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.