io.druid.query.QueryToolChest.makePreComputeManipulatorFn()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(67)

本文整理了Java中io.druid.query.QueryToolChest.makePreComputeManipulatorFn方法的一些代码示例,展示了QueryToolChest.makePreComputeManipulatorFn的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryToolChest.makePreComputeManipulatorFn方法的具体详情如下:
包路径:io.druid.query.QueryToolChest
类名称:QueryToolChest
方法名:makePreComputeManipulatorFn

QueryToolChest.makePreComputeManipulatorFn介绍

[英]Creates a Function that can take in a ResultType and return a new ResultType having applied the MetricManipulatorFn to each of the metrics.

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.
[中]创建一个函数,该函数可以接受ResultType并返回一个新的ResultType,该函数已将MetricManipulatorFn应用于每个度量。
这是因为查询工具箱是唯一了解ResultType内部序列化格式的工具,所以它的主要职责是“分解”该结构,并将给定的函数应用于所有度量。
在代理上的处理管道中很早就调用了该函数。

代码示例

代码示例来源:origin: com.n3twork.druid/druid-processing

public Function<ResultType, ResultType> makePostComputeManipulatorFn(QueryType query, MetricManipulationFn fn)
{
 return makePreComputeManipulatorFn(query, fn);
}

代码示例来源:origin: io.druid/druid-processing

/**
 * 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);
}

代码示例来源:origin: com.n3twork.druid/druid-server

retVal = Sequences.map(
  retVal,
  toolChest.makePreComputeManipulatorFn(
    query,
    MetricManipulatorFns.deserializing()

代码示例来源:origin: io.druid/druid-server

@SuppressWarnings("unchecked")
private Sequence<T> getBySegmentServerResults(
  final QueryRunner serverRunner,
  final MultipleSpecificSegmentSpec segmentsOfServerSpec
)
{
 Sequence<Result<BySegmentResultValueClass<T>>> resultsBySegments = serverRunner
   .run(queryPlus.withQuerySegmentSpec(segmentsOfServerSpec), 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
     )
   ));
}

代码示例来源:origin: io.druid/druid-server

retVal = Sequences.map(
  retVal,
  toolChest.makePreComputeManipulatorFn(
    query,
    MetricManipulatorFns.deserializing()

代码示例来源:origin: io.druid/druid-server

})
  .map(
    toolChest.makePreComputeManipulatorFn(downstreamQuery, MetricManipulatorFns.deserializing())::apply
  );
if (cachePopulator != null) {

相关文章