use of com.netflix.metacat.connector.druid.converter.DataSource in project metacat by Netflix.
the class DruidConnectorPartitionService method getPartitions.
/**
* {@inheritDoc}
*/
@Override
public List<PartitionInfo> getPartitions(final ConnectorRequestContext context, final QualifiedName name, final PartitionListRequest partitionsRequest) {
final ObjectNode node = this.druidClient.getAllDataByName(name.getTableName());
final DataSource dataSource = DruidConverterUtil.getDatasourceFromAllSegmentJsonObject(node);
final List<PartitionInfo> partitionInfos = new ArrayList<>();
dataSource.getSegmentList().forEach(p -> partitionInfos.add(this.druidConnectorInfoConverter.getPartitionInfoFromSegment(p)));
return partitionInfos;
}
use of com.netflix.metacat.connector.druid.converter.DataSource in project metacat by Netflix.
the class DruidConnectorTableService method get.
/**
* {@inheritDoc}
*/
@Override
public TableInfo get(@Nonnull final ConnectorRequestContext context, @Nonnull final QualifiedName name) {
log.debug("Get table metadata for qualified name {} for request {}", name, context);
final ObjectNode node = this.druidClient.getLatestDataByName(name.getTableName());
final DataSource dataSource = DruidConverterUtil.getDatasourceFromLatestSegmentJsonObject(node);
return this.druidConnectorInfoConverter.getTableInfoFromDatasource(dataSource);
}
Aggregations