public class ScanQueryQueryToolChest extends QueryToolChest<ScanResultValue,ScanQuery>
Constructor and Description |
---|
ScanQueryQueryToolChest() |
Modifier and Type | Method and Description |
---|---|
com.fasterxml.jackson.core.type.TypeReference<ScanResultValue> |
getResultTypeReference()
Returns a TypeReference object that is just passed through to Jackson in order to deserialize
the results of this type of query.
|
com.metamx.emitter.service.ServiceMetricEvent.Builder |
makeMetricBuilder(ScanQuery query)
Creates a builder that is used to generate a metric for this specific query type.
|
com.google.common.base.Function<ScanResultValue,ScanResultValue> |
makePreComputeManipulatorFn(ScanQuery query,
MetricManipulationFn fn)
Creates a Function that can take in a ResultType and return a new ResultType having applied
the MetricManipulatorFn to each of the metrics.
|
QueryRunner<ScanResultValue> |
mergeResults(QueryRunner<ScanResultValue> runner)
This method wraps a QueryRunner.
|
QueryRunner<ScanResultValue> |
preMergeQueryDecoration(QueryRunner<ScanResultValue> runner)
Wraps a QueryRunner.
|
filterSegments, getCacheStrategy, makePostComputeManipulatorFn, postMergeQueryDecoration
public QueryRunner<ScanResultValue> mergeResults(QueryRunner<ScanResultValue> runner)
QueryToolChest
mergeResults
in class QueryToolChest<ScanResultValue,ScanQuery>
runner
- A QueryRunner that provides a series of ResultType objects in time order (ascending or descending)public com.metamx.emitter.service.ServiceMetricEvent.Builder makeMetricBuilder(ScanQuery query)
QueryToolChest
makeMetricBuilder
in class QueryToolChest<ScanResultValue,ScanQuery>
query
- The query that is being processedpublic com.google.common.base.Function<ScanResultValue,ScanResultValue> makePreComputeManipulatorFn(ScanQuery query, MetricManipulationFn fn)
QueryToolChest
This exists because the QueryToolChest is the only thing that understands the internal serialization format of ResultType, so it's primary responsibility is to "decompose" that structure and apply the given function to all metrics.
This function is called very early in the processing pipeline on the Broker.
makePreComputeManipulatorFn
in class QueryToolChest<ScanResultValue,ScanQuery>
query
- The Query that is currently being processedfn
- The function that should be applied to all metrics in the resultspublic com.fasterxml.jackson.core.type.TypeReference<ScanResultValue> getResultTypeReference()
QueryToolChest
getResultTypeReference
in class QueryToolChest<ScanResultValue,ScanQuery>
public QueryRunner<ScanResultValue> preMergeQueryDecoration(QueryRunner<ScanResultValue> runner)
QueryToolChest
In fact, the return value of this method is always passed to mergeResults, so it is equivalent to just implement this functionality as extra decoration on the QueryRunner during mergeResults().
In the interests of potentially simplifying these interfaces, the recommendation is to actually not override this method and instead apply anything that might be needed here in the mergeResults() call.
preMergeQueryDecoration
in class QueryToolChest<ScanResultValue,ScanQuery>
runner
- The runner to be wrappedCopyright © 2011–2017. All rights reserved.