@Override public Function makePreComputeManipulatorFn(Query query, MetricManipulationFn fn) { Query realQuery = getRealQuery(query); return warehouse.getToolChest(realQuery).makePreComputeManipulatorFn(realQuery, fn); }
@Override public Function makePostComputeManipulatorFn(Query query, MetricManipulationFn fn) { Query realQuery = getRealQuery(query); return warehouse.getToolChest(realQuery).makePostComputeManipulatorFn(realQuery, fn); }
private <T> QueryRunner<T> makeRunner(Query<T> query, QueryRunner<T> baseClientRunner) { QueryToolChest<T, Query<T>> toolChest = warehouse.getToolChest(query); // This does not adhere to the fluent workflow. See https://github.com/apache/incubator-druid/issues/5517 return new ResultLevelCachingQueryRunner<>(makeRunner(query, baseClientRunner, toolChest), toolChest, query, objectMapper, cache, cacheConfig); }
@Override public QueryMetrics makeMetrics(Query query) { Query realQuery = getRealQuery(query); return warehouse.getToolChest(realQuery).makeMetrics(realQuery); }
/** * Initializes this object to execute a specific query. Does not actually execute the query. * * @param baseQuery the query */ @SuppressWarnings("unchecked") public void initialize(final Query baseQuery) { transition(State.NEW, State.INITIALIZED); String queryId = baseQuery.getId(); if (Strings.isNullOrEmpty(queryId)) { queryId = UUID.randomUUID().toString(); } this.baseQuery = baseQuery.withId(queryId); this.toolChest = warehouse.getToolChest(baseQuery); }
private void emitQueryTime(long requestTimeNs, boolean success) { QueryMetrics queryMetrics = DruidMetrics.makeRequestMetrics( queryMetricsFactory, warehouse.getToolChest(query), query, req.getRemoteAddr() ); queryMetrics.success(success); queryMetrics.reportQueryTime(requestTimeNs).emit(emitter); } }
@Override public Sequence run(QueryPlus queryPlus, Map responseContext) { Query realQuery = getRealQuery(queryPlus.getQuery()); return warehouse.getToolChest(realQuery).mergeResults(runner).run(queryPlus.withQuery(realQuery), responseContext); } };
@Override public Sequence run(QueryPlus queryPlus, Map responseContext) { Query realQuery = getRealQuery(queryPlus.getQuery()); QueryToolChest realQueryToolChest = warehouse.getToolChest(realQuery); QueryRunner realQueryRunner = realQueryToolChest.preMergeQueryDecoration( new MaterializedViewQueryRunner(runner, optimizer) ); return realQueryRunner.run(queryPlus.withQuery(realQuery), responseContext); } };
SpecificQueryRunnable(final QueryPlus<T> queryPlus, final Map<String, Object> responseContext) { this.queryPlus = queryPlus; this.responseContext = responseContext; this.query = queryPlus.getQuery(); this.toolChest = warehouse.getToolChest(query); this.strategy = toolChest.getCacheStrategy(query); this.useCache = CacheUtil.useCacheOnBrokers(query, strategy, cacheConfig); this.populateCache = CacheUtil.populateCacheOnBrokers(query, strategy, cacheConfig); this.isBySegment = QueryContexts.isBySegment(query); // Note that enabling this leads to putting uncovered intervals information in the response headers // and might blow up in some cases https://github.com/apache/incubator-druid/issues/2108 this.uncoveredIntervalsLimit = QueryContexts.getUncoveredIntervalsLimit(query); this.downstreamQuery = query.withOverriddenContext(makeDownstreamQueryContext()); // For nested queries, we need to look at the intervals of the inner most query. this.intervals = query.getIntervalsOfInnerMostQuery(); }
QueryToolChest<T, Query<T>> toolChest = warehouse.getToolChest(query); boolean isBySegment = QueryContexts.isBySegment(query);
WAREHOUSE.getToolChest(query) ); HashMap<String, Object> context = new HashMap<String, Object>();
WAREHOUSE.getToolChest(query1) ); HashMap<String, Object> context = new HashMap<String, Object>();
private <T> QueryRunner<T> makeRunner(Query<T> query, QueryRunner<T> baseClientRunner) { QueryToolChest<T, Query<T>> toolChest = warehouse.getToolChest(query); // This does not adhere to the fluent workflow. See https://github.com/apache/incubator-druid/issues/5517 return new ResultLevelCachingQueryRunner<>(makeRunner(query, baseClientRunner, toolChest), toolChest, query, objectMapper, cache, cacheConfig); }
/** * Initializes this object to execute a specific query. Does not actually execute the query. * * @param baseQuery the query */ @SuppressWarnings("unchecked") public void initialize(final Query baseQuery) { transition(State.NEW, State.INITIALIZED); String queryId = baseQuery.getId(); if (Strings.isNullOrEmpty(queryId)) { queryId = UUID.randomUUID().toString(); } this.baseQuery = baseQuery.withId(queryId); this.toolChest = warehouse.getToolChest(baseQuery); }
private void emitQueryTime(long requestTimeNs, boolean success) { QueryMetrics queryMetrics = DruidMetrics.makeRequestMetrics( queryMetricsFactory, warehouse.getToolChest(query), query, req.getRemoteAddr() ); queryMetrics.success(success); queryMetrics.reportQueryTime(requestTimeNs).emit(emitter); } }
SpecificQueryRunnable(final QueryPlus<T> queryPlus, final Map<String, Object> responseContext) { this.queryPlus = queryPlus; this.responseContext = responseContext; this.query = queryPlus.getQuery(); this.toolChest = warehouse.getToolChest(query); this.strategy = toolChest.getCacheStrategy(query); this.useCache = CacheUtil.useCacheOnBrokers(query, strategy, cacheConfig); this.populateCache = CacheUtil.populateCacheOnBrokers(query, strategy, cacheConfig); this.isBySegment = QueryContexts.isBySegment(query); // Note that enabling this leads to putting uncovered intervals information in the response headers // and might blow up in some cases https://github.com/apache/incubator-druid/issues/2108 this.uncoveredIntervalsLimit = QueryContexts.getUncoveredIntervalsLimit(query); this.downstreamQuery = query.withOverriddenContext(makeDownstreamQueryContext()); }
QueryToolChest<T, Query<T>> toolChest = warehouse.getToolChest(query); boolean isBySegment = QueryContexts.isBySegment(query);