Package org.apache.druid.query.topn
Class DefaultTopNQueryMetrics
- java.lang.Object
-
- org.apache.druid.query.DefaultQueryMetrics<TopNQuery>
-
- org.apache.druid.query.topn.DefaultTopNQueryMetrics
-
- All Implemented Interfaces:
QueryMetrics<TopNQuery>,TopNQueryMetrics
public class DefaultTopNQueryMetrics extends DefaultQueryMetrics<TopNQuery> implements TopNQueryMetrics
-
-
Field Summary
-
Fields inherited from class org.apache.druid.query.DefaultQueryMetrics
builder, metrics, ownerThread
-
-
Constructor Summary
Constructors Constructor Description DefaultTopNQueryMetrics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopNQueryMetricsaddProcessedRows(long numRows)Called with the number of rows, processed via each cursor, processed for the query within the segment.voidalgorithm(TopNAlgorithm algorithm)voidcolumnValueSelector(ColumnValueSelector columnValueSelector)This method is called exactly once with the columnValueSelector object of each cursor, processed for the query.voidcursor(Cursor cursor)This method is called exactly once with each cursor, processed for the query.voiddimension(TopNQuery query)SetsTopNQuery.getDimensionSpec().getDimension()of the given query as dimension.voiddimensionCardinality(int cardinality)voidgranularity(TopNQuery query)Sets the granularity ofBaseQuery.getGranularity()of the given query as dimension.voidnumComplexMetrics(TopNQuery query)Sets the number of "complex" metrics of the given topN query as dimension.voidnumMetrics(TopNQuery query)Sets the number of metrics of the given topN query as dimension.voidnumValuesPerPass(TopNParams params)This method may setTopNParams.getNumValuesPerPass()of the query as dimension.voidquery(TopNQuery query)Pulls all information from the query object into dimensions of future metrics.voidstartRecordingScanTime()Calls to this method andTopNQueryMetrics.stopRecordingScanTime()wrap scanning of each cursor, processed for the query.TopNQueryMetricsstopRecordingScanTime()Calls ofTopNQueryMetrics.startRecordingScanTime()and this method wrap scanning of each cursor, processed for the query.voidthreshold(TopNQuery query)SetsTopNQuery.getThreshold()of the given query as dimension.-
Methods inherited from class org.apache.druid.query.DefaultQueryMetrics
checkModifiedFromOwnerThread, context, dataSource, duration, emit, hasFilters, identity, interval, makeBitmapResultFactory, parallelMergeParallelism, queryId, queryId, queryType, remoteAddress, reportBackPressureTime, reportBitmapConstructionTime, reportCpuTime, reportMetric, reportNodeBytes, reportNodeTime, reportNodeTimeToFirstByte, reportParallelMergeFastestPartitionTime, reportParallelMergeInputRows, reportParallelMergeInputSequences, reportParallelMergeOutputRows, reportParallelMergeParallelism, reportParallelMergeSlowestPartitionTime, reportParallelMergeTaskCount, reportParallelMergeTotalCpuTime, reportParallelMergeTotalTime, reportPreFilteredRows, reportQueriedSegmentCount, reportQueryBytes, reportQueryTime, reportSegmentAndCacheTime, reportSegmentRows, reportSegmentTime, reportWaitTime, segment, server, setDimension, sqlQueryId, sqlQueryId, status, subQueryId, success, vectorized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.query.QueryMetrics
context, dataSource, duration, emit, filterBundle, hasFilters, identity, interval, makeBitmapResultFactory, parallelMergeParallelism, postFilters, preFilters, queryId, queryId, queryType, remoteAddress, reportBackPressureTime, reportBitmapConstructionTime, reportCpuTime, reportNodeBytes, reportNodeTime, reportNodeTimeToFirstByte, reportParallelMergeFastestPartitionTime, reportParallelMergeInputRows, reportParallelMergeInputSequences, reportParallelMergeOutputRows, reportParallelMergeParallelism, reportParallelMergeSlowestPartitionTime, reportParallelMergeTaskCount, reportParallelMergeTotalCpuTime, reportParallelMergeTotalTime, reportPreFilteredRows, reportQueriedSegmentCount, reportQueryBytes, reportQueryTime, reportSegmentAndCacheTime, reportSegmentRows, reportSegmentTime, reportWaitTime, segment, server, sqlQueryId, sqlQueryId, status, subQueryId, success, vectorized
-
-
-
-
Method Detail
-
query
public void query(TopNQuery query)
Description copied from interface:QueryMetricsPulls all information from the query object into dimensions of future metrics.- Specified by:
queryin interfaceQueryMetrics<TopNQuery>- Overrides:
queryin classDefaultQueryMetrics<TopNQuery>
-
threshold
public void threshold(TopNQuery query)
Description copied from interface:TopNQueryMetricsSetsTopNQuery.getThreshold()of the given query as dimension.- Specified by:
thresholdin interfaceTopNQueryMetrics
-
dimension
public void dimension(TopNQuery query)
Description copied from interface:TopNQueryMetricsSetsTopNQuery.getDimensionSpec().getDimension()of the given query as dimension.- Specified by:
dimensionin interfaceTopNQueryMetrics
-
numMetrics
public void numMetrics(TopNQuery query)
Description copied from interface:TopNQueryMetricsSets the number of metrics of the given topN query as dimension.- Specified by:
numMetricsin interfaceTopNQueryMetrics
-
numComplexMetrics
public void numComplexMetrics(TopNQuery query)
Description copied from interface:TopNQueryMetricsSets the number of "complex" metrics of the given topN query as dimension. By default it is assumed that "complex" metric is a metric of not long or double type, but it could be redefined in the implementation of this method.- Specified by:
numComplexMetricsin interfaceTopNQueryMetrics
-
granularity
public void granularity(TopNQuery query)
Description copied from interface:TopNQueryMetricsSets the granularity ofBaseQuery.getGranularity()of the given query as dimension.- Specified by:
granularityin interfaceTopNQueryMetrics
-
dimensionCardinality
public void dimensionCardinality(int cardinality)
- Specified by:
dimensionCardinalityin interfaceTopNQueryMetrics
-
algorithm
public void algorithm(TopNAlgorithm algorithm)
- Specified by:
algorithmin interfaceTopNQueryMetrics
-
cursor
public void cursor(Cursor cursor)
Description copied from interface:TopNQueryMetricsThis method is called exactly once with each cursor, processed for the query.- Specified by:
cursorin interfaceTopNQueryMetrics
-
columnValueSelector
public void columnValueSelector(ColumnValueSelector columnValueSelector)
Description copied from interface:TopNQueryMetricsThis method is called exactly once with the columnValueSelector object of each cursor, processed for the query.- Specified by:
columnValueSelectorin interfaceTopNQueryMetrics
-
numValuesPerPass
public void numValuesPerPass(TopNParams params)
Description copied from interface:TopNQueryMetricsThis method may setTopNParams.getNumValuesPerPass()of the query as dimension.- Specified by:
numValuesPerPassin interfaceTopNQueryMetrics
-
addProcessedRows
public TopNQueryMetrics addProcessedRows(long numRows)
Description copied from interface:TopNQueryMetricsCalled with the number of rows, processed via each cursor, processed for the query within the segment. The total number of processed rows, reported via this method for a TopNQueryMetrics instance, is smaller or equal toQueryMetrics.reportPreFilteredRows(long), because matchers fromQueryMetrics.filterBundle(FilterBundle.BundleInfo)are additionally applied. If there are no postFilters, preFilteredRows and processedRows are equal.- Specified by:
addProcessedRowsin interfaceTopNQueryMetrics
-
startRecordingScanTime
public void startRecordingScanTime()
Description copied from interface:TopNQueryMetricsCalls to this method andTopNQueryMetrics.stopRecordingScanTime()wrap scanning of each cursor, processed for the query.- Specified by:
startRecordingScanTimein interfaceTopNQueryMetrics
-
stopRecordingScanTime
public TopNQueryMetrics stopRecordingScanTime()
Description copied from interface:TopNQueryMetricsCalls ofTopNQueryMetrics.startRecordingScanTime()and this method wrap scanning of each cursor, processed for the query.- Specified by:
stopRecordingScanTimein interfaceTopNQueryMetrics
-
-