@Singleton public class DataSourceMetadataService extends Object
Constructor and Description |
---|
DataSourceMetadataService()
Creates a service to store segment metadata.
|
Modifier and Type | Method and Description |
---|---|
Map<String,SimplifiedIntervalList> |
getAvailableIntervalsByDataSource(DataSourceName dataSourceName)
Get a set of intervals available for each column in the data source.
|
Set<SortedMap<org.joda.time.DateTime,Map<String,SegmentInfo>>> |
getSegments(Set<DataSourceName> dataSourceNames)
Get all the segments associated with the given Set of data source names.
|
protected static Map<String,SimplifiedIntervalList> |
groupIntervalByColumn(DataSourceMetadata metadata)
Group interval in segment metadata by column.
|
protected static ConcurrentSkipListMap<org.joda.time.DateTime,Map<String,SegmentInfo>> |
groupSegmentByTime(DataSourceMetadata metadata)
Group segment metadata by date time.
|
protected static Collector<SegmentInfo,?,Map<String,SegmentInfo>> |
partitionsToMapCollector()
A collector to aggregate all partitions of a segment into a map.
|
void |
update(DataSourceName dataSourceName,
DataSourceMetadata metadata)
Update the information with respect to the segment metadata of a particular data source.
|
void |
update(PhysicalTable table,
DataSourceMetadata metadata)
Deprecated.
Pass the DataSourceName directly, rather than via the PhysicalTable
|
public DataSourceMetadataService()
public Set<SortedMap<org.joda.time.DateTime,Map<String,SegmentInfo>>> getSegments(Set<DataSourceName> dataSourceNames)
dataSourceNames
- A Set of physical data source namespublic Map<String,SimplifiedIntervalList> getAvailableIntervalsByDataSource(DataSourceName dataSourceName)
dataSourceName
- The data source for which to get the availability by column@Deprecated public void update(PhysicalTable table, DataSourceMetadata metadata)
table
- The physical table to which the metadata are referring to.metadata
- The updated datasource metadata.public void update(DataSourceName dataSourceName, DataSourceMetadata metadata)
dataSourceName
- The data source to which the metadata refer.metadata
- The updated datasource metadata.protected static Collector<SegmentInfo,?,Map<String,SegmentInfo>> partitionsToMapCollector()
protected static ConcurrentSkipListMap<org.joda.time.DateTime,Map<String,SegmentInfo>> groupSegmentByTime(DataSourceMetadata metadata)
metadata
- Metadata containing the druid segments informationprotected static Map<String,SimplifiedIntervalList> groupIntervalByColumn(DataSourceMetadata metadata)
metadata
- Metadata containing the druid segments informationCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.