public interface IndexerMetadataStorageCoordinator
| Modifier and Type | Method and Description |
|---|---|
SegmentIdWithShardSpec |
allocatePendingSegment(String dataSource,
String sequenceName,
String previousSegmentId,
org.joda.time.Interval interval,
ShardSpecFactory shardSpecFactory,
String maxVersion,
boolean skipSegmentLineageCheck)
Allocate a new pending segment in the pending segments table.
|
Set<DataSegment> |
announceHistoricalSegments(Set<DataSegment> segments)
Attempts to insert a set of segments to the metadata storage.
|
SegmentPublishResult |
announceHistoricalSegments(Set<DataSegment> segments,
DataSourceMetadata startMetadata,
DataSourceMetadata endMetadata)
Attempts to insert a set of segments to the metadata storage.
|
SegmentPublishResult |
commitMetadataOnly(String dataSource,
DataSourceMetadata startMetadata,
DataSourceMetadata endMetadata)
Similar to
announceHistoricalSegments(Set), but meant for streaming ingestion tasks for handling
the case where the task ingested no records and created no segments, but still needs to update the metadata
with the progress that the task made. |
boolean |
deleteDataSourceMetadata(String dataSource)
Removes entry for 'dataSource' from the dataSource metadata table.
|
int |
deletePendingSegments(String dataSource,
org.joda.time.Interval deleteInterval)
Delete pending segments created in the given interval for the given dataSource from the pending segments table.
|
void |
deleteSegments(Set<DataSegment> segments) |
DataSourceMetadata |
getDataSourceMetadata(String dataSource)
Read dataSource metadata.
|
List<DataSegment> |
getUnusedSegmentsForInterval(String dataSource,
org.joda.time.Interval interval)
Get all published segments which include ONLY data within the given interval and are not marked as used.
|
Collection<Pair<DataSegment,String>> |
getUsedSegmentAndCreatedDateForInterval(String dataSource,
org.joda.time.Interval interval)
Get all published segments which are marked as used and the created_date of these segments in a given datasource
and interval.
|
default Collection<DataSegment> |
getUsedSegmentsForInterval(String dataSource,
org.joda.time.Interval interval,
Segments visibility)
Get all published segments which may include any data in the interval and are marked as used.
|
Collection<DataSegment> |
getUsedSegmentsForIntervals(String dataSource,
List<org.joda.time.Interval> intervals,
Segments visibility)
Get all published segments which may include any data in the interval and are marked as used.
|
boolean |
insertDataSourceMetadata(String dataSource,
DataSourceMetadata dataSourceMetadata)
Insert dataSourceMetadata entry for 'dataSource'.
|
boolean |
resetDataSourceMetadata(String dataSource,
DataSourceMetadata dataSourceMetadata)
Resets dataSourceMetadata entry for 'dataSource' to the one supplied.
|
void |
updateSegmentMetadata(Set<DataSegment> segments) |
default Collection<DataSegment> getUsedSegmentsForInterval(String dataSource, org.joda.time.Interval interval, Segments visibility)
dataSource - The datasource to queryinterval - The interval for which all applicable and used datasources are requested. Start is inclusive,
end is exclusivevisibility - Whether only visible or visible as well as overshadowed segments should be returned. The
visibility is considered within the specified interval: that is, a segment which is visible
outside of the specified interval, but overshadowed within the specified interval will not be
returned if Segments.ONLY_VISIBLE is passed. See more precise description in the doc for
Segments.Collection<Pair<DataSegment,String>> getUsedSegmentAndCreatedDateForInterval(String dataSource, org.joda.time.Interval interval)
dataSource - The datasource to queryinterval - The interval for which all applicable and used datasources are requested. Start is inclusive,
end is exclusiveCollection<DataSegment> getUsedSegmentsForIntervals(String dataSource, List<org.joda.time.Interval> intervals, Segments visibility)
dataSource - The datasource to queryintervals - The intervals for which all applicable and used datasources are requested.visibility - Whether only visible or visible as well as overshadowed segments should be returned. The
visibility is considered within the specified intervals: that is, a segment which is visible
outside of the specified intervals, but overshadowed on the specified intervals will not be
returned if Segments.ONLY_VISIBLE is passed. See more precise description in the doc for
Segments.Set<DataSegment> announceHistoricalSegments(Set<DataSegment> segments) throws IOException
segments - set of segments to addIOExceptionSegmentIdWithShardSpec allocatePendingSegment(String dataSource, String sequenceName, @Nullable String previousSegmentId, org.joda.time.Interval interval, ShardSpecFactory shardSpecFactory, String maxVersion, boolean skipSegmentLineageCheck)
dataSource - dataSource for which to allocate a segmentsequenceName - name of the group of ingestion tasks producing a segment seriespreviousSegmentId - previous segment in the series; may be null or empty, meaning this is the first segmentinterval - interval for which to allocate a segmentshardSpecFactory - shardSpecFactory containing all necessary information to create a shardSpec for the
new segmentIdmaxVersion - use this version if we have no better version to use. The returned segment identifier may
have a version lower than this one, but will not have one higher.skipSegmentLineageCheck - if true, perform lineage validation using previousSegmentId for this sequence.
Should be set to false if replica tasks would index events in same orderint deletePendingSegments(String dataSource, org.joda.time.Interval deleteInterval)
created_date field of the pending segments table is checked to find segments to be deleted.dataSource - dataSourcedeleteInterval - interval to check the created_date of pendingSegmentsSegmentPublishResult announceHistoricalSegments(Set<DataSegment> segments, @Nullable DataSourceMetadata startMetadata, @Nullable DataSourceMetadata endMetadata) throws IOException
segments - set of segments to add, must all be from the same dataSourcestartMetadata - dataSource metadata pre-insert must match this startMetadata according to
DataSourceMetadata.matches(DataSourceMetadata). If null, this insert will
not involve a metadata transactionendMetadata - dataSource metadata post-insert will have this endMetadata merged in with
DataSourceMetadata.plus(DataSourceMetadata). If null, this insert will not
involve a metadata transactionIllegalArgumentException - if startMetadata and endMetadata are not either both null or both non-nullRuntimeException - if the state of metadata storage after this call is unknownIOExceptionSegmentPublishResult commitMetadataOnly(String dataSource, DataSourceMetadata startMetadata, DataSourceMetadata endMetadata)
announceHistoricalSegments(Set), but meant for streaming ingestion tasks for handling
the case where the task ingested no records and created no segments, but still needs to update the metadata
with the progress that the task made.
The metadata should undergo the same validation checks as performed by announceHistoricalSegments.dataSource - the datasourcestartMetadata - dataSource metadata pre-insert must match this startMetadata according to
DataSourceMetadata.matches(DataSourceMetadata).endMetadata - dataSource metadata post-insert will have this endMetadata merged in with
DataSourceMetadata.plus(DataSourceMetadata).IllegalArgumentException - if either startMetadata and endMetadata are nullRuntimeException - if the state of metadata storage after this call is unknownDataSourceMetadata getDataSourceMetadata(String dataSource)
boolean deleteDataSourceMetadata(String dataSource)
dataSource - identifierboolean resetDataSourceMetadata(String dataSource, DataSourceMetadata dataSourceMetadata) throws IOException
dataSource - identifierdataSourceMetadata - value to setIOExceptionboolean insertDataSourceMetadata(String dataSource, DataSourceMetadata dataSourceMetadata)
dataSource - identifierdataSourceMetadata - value to setvoid updateSegmentMetadata(Set<DataSegment> segments)
void deleteSegments(Set<DataSegment> segments)
List<DataSegment> getUnusedSegmentsForInterval(String dataSource, org.joda.time.Interval interval)
dataSource - The datasource the segments belong tointerval - Filter the data segments to ones that include data in this interval exclusively. Start is
inclusive, end is exclusiveCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.