com.addthis.hydra.data.query.Query.newProcessor()方法的使用及代码示例

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

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

Query.newProcessor介绍

暂无

代码示例

代码示例来源:origin: addthis/hydra

/**
 * Part 1 - SETUP
 * Initialize query run -- parse options, create Query object
 */
protected void setup() throws Exception {
  long startTime = System.currentTimeMillis();
  MeshQuerySource.queueTimes.update(creationTime - startTime, TimeUnit.MILLISECONDS);
  query = CodecJSON.decodeString(Query.class, options.get("query"));
  // set as soon as possible (and especially before creating op processor)
  query.queryPromise = bridge.queryPromise;
  // Parse the query and return a reference to the last QueryOpProcessor.
  ChannelProgressivePromise opPromise =
      new DefaultChannelProgressivePromise(null, ImmediateEventExecutor.INSTANCE);
  queryOpProcessor = query.newProcessor(bridge, opPromise);
}

代码示例来源:origin: addthis/hydra

protected void writeQuery(final ChannelHandlerContext ctx, Query msg, ChannelPromise promise)
    throws Exception {
  this.requestPromise = promise;
  this.queryUser = new DataChannelOutputToNettyBridge(ctx, promise);
  this.query = msg;
  query.queryPromise = queryPromise;
  // create a processor chain based in query ops terminating the query user
  this.opProcessorConsumer = query.newProcessor(queryUser, opPromise);
  queryEntry = new QueryEntry(query, opsLog, this, aggregator);
  // Check if the uuid is repeated, then make a new one
  if (queryTracker.running.putIfAbsent(query.uuid(), queryEntry) != null) {
    throw new QueryException("Query uuid somehow already in use : " + query.uuid());
  }
  log.debug("Executing.... {} {}", query.uuid(), queryEntry);
  ctx.pipeline().remove(this);
  opPromise.addListener(this);
  queryPromise.addListener(this);
  requestPromise.addListener(this);
  ctx.write(opProcessorConsumer, queryPromise);
}

相关文章