本文整理了Java中com.addthis.hydra.data.query.Query.newProcessor
方法的一些代码示例,展示了Query.newProcessor
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.newProcessor
方法的具体详情如下:
包路径:com.addthis.hydra.data.query.Query
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!