/** * Generally speaking this is the exact same thing as makePreComputeManipulatorFn. It is leveraged in * order to compute PostAggregators on results after they have been completely merged together, which * should actually be done in the mergeResults() call instead of here. * <p> * This should never actually be overridden and it should be removed as quickly as possible. * * @param query The Query that is currently being processed * @param fn The function that should be applied to all metrics in the results * * @return A function that will apply the provided fn to all metrics in the input ResultType object */ public Function<ResultType, ResultType> makePostComputeManipulatorFn(QueryType query, MetricManipulationFn fn) { return makePreComputeManipulatorFn(query, fn); }
@Override public Function makePreComputeManipulatorFn(Query query, MetricManipulationFn fn) { Query realQuery = getRealQuery(query); return warehouse.getToolChest(realQuery).makePreComputeManipulatorFn(realQuery, fn); }
toolChest.makePreComputeManipulatorFn( queryPlus.getQuery(), MetricManipulatorFns.deserializing()
@SuppressWarnings("unchecked") private Sequence<T> getBySegmentServerResults( final QueryRunner serverRunner, final MultipleSpecificSegmentSpec segmentsOfServerSpec, long maxQueuedBytesPerServer ) { Sequence<Result<BySegmentResultValueClass<T>>> resultsBySegments = serverRunner .run( queryPlus.withQuerySegmentSpec(segmentsOfServerSpec).withMaxQueuedBytes(maxQueuedBytesPerServer), responseContext ); // bySegment results need to be de-serialized, see DirectDruidClient.run() return (Sequence<T>) resultsBySegments .map(result -> result.map( resultsOfSegment -> resultsOfSegment.mapResults( toolChest.makePreComputeManipulatorFn(query, MetricManipulatorFns.deserializing())::apply ) )); }
retVal = Sequences.map( retVal, toolChest.makePreComputeManipulatorFn( query, MetricManipulatorFns.deserializing()
toolChest.makePreComputeManipulatorFn(downstreamQuery, MetricManipulatorFns.deserializing())::apply ); })
Sequences.map( segment1Runner.run(queryPlus, responseContext), toolChest.makePreComputeManipulatorFn( (GroupByQuery) queryPlus.getQuery(), MetricManipulatorFns.deserializing() Sequences.map( segment2Runner.run(queryPlus, responseContext), toolChest.makePreComputeManipulatorFn( (GroupByQuery) queryPlus.getQuery(), MetricManipulatorFns.deserializing()
/** * Generally speaking this is the exact same thing as makePreComputeManipulatorFn. It is leveraged in * order to compute PostAggregators on results after they have been completely merged together, which * should actually be done in the mergeResults() call instead of here. * <p> * This should never actually be overridden and it should be removed as quickly as possible. * * @param query The Query that is currently being processed * @param fn The function that should be applied to all metrics in the results * * @return A function that will apply the provided fn to all metrics in the input ResultType object */ public Function<ResultType, ResultType> makePostComputeManipulatorFn(QueryType query, MetricManipulationFn fn) { return makePreComputeManipulatorFn(query, fn); }
@SuppressWarnings("unchecked") private Sequence<T> getBySegmentServerResults( final QueryRunner serverRunner, final MultipleSpecificSegmentSpec segmentsOfServerSpec, long maxQueuedBytesPerServer ) { Sequence<Result<BySegmentResultValueClass<T>>> resultsBySegments = serverRunner .run( queryPlus.withQuerySegmentSpec(segmentsOfServerSpec).withMaxQueuedBytes(maxQueuedBytesPerServer), responseContext ); // bySegment results need to be de-serialized, see DirectDruidClient.run() return (Sequence<T>) resultsBySegments .map(result -> result.map( resultsOfSegment -> resultsOfSegment.mapResults( toolChest.makePreComputeManipulatorFn(query, MetricManipulatorFns.deserializing())::apply ) )); }
retVal = Sequences.map( retVal, toolChest.makePreComputeManipulatorFn( query, MetricManipulatorFns.deserializing()
toolChest.makePreComputeManipulatorFn(downstreamQuery, MetricManipulatorFns.deserializing())::apply ); })