Package org.apache.druid.server
Class ClientQuerySegmentWalker
java.lang.Object
org.apache.druid.server.ClientQuerySegmentWalker
- All Implemented Interfaces:
QuerySegmentWalker
Query handler for the Broker processes (see CliBroker).
This class is responsible for:
1) Running queries on the cluster using its 'clusterClient' 2) Running queries locally (when all datasources are global) using its 'localClient' 3) Inlining subqueries if necessary, in service of the above two goals
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClientQuerySegmentWalker(ServiceEmitter emitter, QuerySegmentWalker clusterClient, QuerySegmentWalker localClient, QueryRunnerFactoryConglomerate conglomerate, JoinableFactory joinableFactory, RetryQueryRunnerConfig retryConfig, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ServerConfig serverConfig, Cache cache, CacheConfig cacheConfig, SubqueryGuardrailHelper subqueryGuardrailHelper, SubqueryCountStatsProvider subqueryStatsProvider, GenericQueryMetricsFactory genericQueryMetricsFactory) -
Method Summary
Modifier and TypeMethodDescriptionstatic DataSourcegenerateSubqueryIds(DataSource rootDataSource, String parentQueryId, String parentSqlQueryId, String parentQueryResourceId) This method returns the datasource by populating all theQueryDataSourcewith correct nesting level and sibling order of all the subqueries that are present.<T> QueryRunner<T>getQueryRunnerForIntervals(Query<T> query, Iterable<org.joda.time.Interval> intervals) <T> QueryRunner<T>getQueryRunnerForSegments(Query<T> query, Iterable<SegmentDescriptor> specs)
-
Field Details
-
ROWS_COUNT_METRIC
- See Also:
-
BYTES_COUNT_METRIC
- See Also:
-
-
Constructor Details
-
ClientQuerySegmentWalker
public ClientQuerySegmentWalker(ServiceEmitter emitter, QuerySegmentWalker clusterClient, QuerySegmentWalker localClient, QueryRunnerFactoryConglomerate conglomerate, JoinableFactory joinableFactory, RetryQueryRunnerConfig retryConfig, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ServerConfig serverConfig, Cache cache, CacheConfig cacheConfig, SubqueryGuardrailHelper subqueryGuardrailHelper, SubqueryCountStatsProvider subqueryStatsProvider, GenericQueryMetricsFactory genericQueryMetricsFactory)
-
-
Method Details
-
getQueryRunnerForIntervals
public <T> QueryRunner<T> getQueryRunnerForIntervals(Query<T> query, Iterable<org.joda.time.Interval> intervals) - Specified by:
getQueryRunnerForIntervalsin interfaceQuerySegmentWalker
-
getQueryRunnerForSegments
public <T> QueryRunner<T> getQueryRunnerForSegments(Query<T> query, Iterable<SegmentDescriptor> specs) - Specified by:
getQueryRunnerForSegmentsin interfaceQuerySegmentWalker
-
generateSubqueryIds
public static DataSource generateSubqueryIds(DataSource rootDataSource, @Nullable String parentQueryId, @Nullable String parentSqlQueryId, String parentQueryResourceId) This method returns the datasource by populating all theQueryDataSourcewith correct nesting level and sibling order of all the subqueries that are present. It also plumbs parent query's id and sql id in case the subqueries don't have it set by default- Parameters:
rootDataSource- Datasource whose subqueries need to be populatedparentQueryId- Parent Query's ID, can be null if it does not need to update this in the subqueriesparentSqlQueryId- Parent Query's SQL Query ID, can be null if it does not need to update this in the subqueriesparentQueryResourceId- Parent Query's Query Resource ID- Returns:
- DataSource populated with the subqueries
-