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

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

本文整理了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

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

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

  1. protected void writeQuery(final ChannelHandlerContext ctx, Query msg, ChannelPromise promise)
  2. throws Exception {
  3. this.requestPromise = promise;
  4. this.queryUser = new DataChannelOutputToNettyBridge(ctx, promise);
  5. this.query = msg;
  6. query.queryPromise = queryPromise;
  7. // create a processor chain based in query ops terminating the query user
  8. this.opProcessorConsumer = query.newProcessor(queryUser, opPromise);
  9. queryEntry = new QueryEntry(query, opsLog, this, aggregator);
  10. // Check if the uuid is repeated, then make a new one
  11. if (queryTracker.running.putIfAbsent(query.uuid(), queryEntry) != null) {
  12. throw new QueryException("Query uuid somehow already in use : " + query.uuid());
  13. }
  14. log.debug("Executing.... {} {}", query.uuid(), queryEntry);
  15. ctx.pipeline().remove(this);
  16. opPromise.addListener(this);
  17. queryPromise.addListener(this);
  18. requestPromise.addListener(this);
  19. ctx.write(opProcessorConsumer, queryPromise);
  20. }

相关文章