use of org.apache.druid.java.util.common.guava.MappedSequence in project druid by druid-io.
the class SegmentMetadataQueryQueryToolChest method mergeResults.
@Override
public QueryRunner<SegmentAnalysis> mergeResults(final QueryRunner<SegmentAnalysis> runner) {
return new BySegmentSkippingQueryRunner<SegmentAnalysis>(runner) {
@Override
public Sequence<SegmentAnalysis> doRun(QueryRunner<SegmentAnalysis> baseRunner, QueryPlus<SegmentAnalysis> queryPlus, ResponseContext context) {
SegmentMetadataQuery updatedQuery = ((SegmentMetadataQuery) queryPlus.getQuery()).withFinalizedAnalysisTypes(config);
QueryPlus<SegmentAnalysis> updatedQueryPlus = queryPlus.withQuery(updatedQuery);
return new MappedSequence<>(CombiningSequence.create(baseRunner.run(updatedQueryPlus, context), makeOrdering(updatedQuery), createMergeFn(updatedQuery)), MERGE_TRANSFORM_FN::apply);
}
private Ordering<SegmentAnalysis> makeOrdering(SegmentMetadataQuery query) {
return (Ordering<SegmentAnalysis>) SegmentMetadataQueryQueryToolChest.this.createResultComparator(query);
}
private BinaryOperator<SegmentAnalysis> createMergeFn(final SegmentMetadataQuery inQ) {
return SegmentMetadataQueryQueryToolChest.this.createMergeFn(inQ);
}
};
}
Aggregations