本文整理汇总了Java中org.wso2.siddhi.core.query.selector.QuerySelector类的典型用法代码示例。如果您正苦于以下问题:Java QuerySelector类的具体用法?Java QuerySelector怎么用?Java QuerySelector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
QuerySelector类属于org.wso2.siddhi.core.query.selector包,在下文中一共展示了QuerySelector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: constructQuerySelector
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
public static QuerySelector constructQuerySelector(OutStream outStream, Selector selector, OutputRateManager outputRateManager, List<QueryEventSource> queryEventSourceList,
ConcurrentMap<String, EventTable> eventTableMap,
SiddhiContext siddhiContext) {
boolean currentOn = false;
boolean expiredOn = false;
String id = null;
if (outStream != null) {
if (outStream.getOutputEventsFor() == OutStream.OutputEventsFor.CURRENT_EVENTS || outStream.getOutputEventsFor() == OutStream.OutputEventsFor.ALL_EVENTS) {
currentOn = true;
}
if (outStream.getOutputEventsFor() == OutStream.OutputEventsFor.EXPIRED_EVENTS || outStream.getOutputEventsFor() == OutStream.OutputEventsFor.ALL_EVENTS) {
expiredOn = true;
}
id = outStream.getStreamId();
} else {
currentOn = true;
expiredOn = true;
}
return new QuerySelector(id, selector, outputRateManager, queryEventSourceList, eventTableMap, siddhiContext, currentOn, expiredOn);
}
示例2: QueryRuntime
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
public QueryRuntime(Query query, SiddhiAppContext siddhiAppContext, StreamRuntime streamRuntime,
QuerySelector selector,
OutputRateLimiter outputRateLimiter, OutputCallback outputCallback, MetaComplexEvent
metaComplexEvent, boolean synchronised, String queryName) {
this.query = query;
this.siddhiAppContext = siddhiAppContext;
this.streamRuntime = streamRuntime;
this.selector = selector;
this.outputCallback = outputCallback;
this.synchronised = synchronised;
this.queryId = queryName;
outputRateLimiter.setOutputCallback(outputCallback);
setOutputRateLimiter(outputRateLimiter);
setMetaComplexEvent(metaComplexEvent);
init();
}
示例3: populateStoreQueryRuntime
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
private static void populateStoreQueryRuntime(FindStoreQueryRuntime findStoreQueryRuntime,
MatchingMetaInfoHolder metaStreamInfoHolder, Selector selector,
List<VariableExpressionExecutor> variableExpressionExecutors,
SiddhiAppContext siddhiAppContext,
Map<String, Table> tableMap, String queryName, int metaPosition) {
QuerySelector querySelector = SelectorParser.parse(selector,
new ReturnStream(OutputStream.OutputEventType.CURRENT_EVENTS), siddhiAppContext,
metaStreamInfoHolder.getMetaStateEvent(), tableMap, variableExpressionExecutors, queryName,
metaPosition);
QueryParserHelper.reduceMetaComplexEvent(metaStreamInfoHolder.getMetaStateEvent());
QueryParserHelper.updateVariablePosition(metaStreamInfoHolder.getMetaStateEvent(), variableExpressionExecutors);
querySelector.setEventPopulator(
StateEventPopulatorFactory.constructEventPopulator(metaStreamInfoHolder.getMetaStateEvent()));
findStoreQueryRuntime.setStateEventPool(new StateEventPool(metaStreamInfoHolder.getMetaStateEvent(), 5));
findStoreQueryRuntime.setSelector(querySelector);
}
示例4: clone
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
public QueryRuntime clone(String key, ConcurrentMap<String, StreamJunction> localStreamJunctionMap) {
StreamRuntime clonedStreamRuntime = this.streamRuntime.clone(key);
QuerySelector clonedSelector = this.selector.clone(key);
OutputRateLimiter clonedOutputRateLimiter = outputRateLimiter.clone(key);
QueryRuntime queryRuntime = new QueryRuntime(query,siddhiContext,clonedStreamRuntime,clonedSelector,clonedOutputRateLimiter,this.metaStateEvent);
queryRuntime.queryId = this.queryId + key;
queryRuntime.setToLocalStream(toLocalStream);
queryRuntime.setDefinitionMap(definitionMap);
if (!toLocalStream) {
queryRuntime.outputRateLimiter.setOutputCallback(outputCallback);
queryRuntime.outputCallback = this.outputCallback;
} else {
OutputCallback clonedQueryOutputCallback = OutputParser.constructOutputCallback(query.getOutputStream(), key, localStreamJunctionMap, outputStreamDefinition, siddhiContext);
queryRuntime.outputRateLimiter.setOutputCallback(clonedQueryOutputCallback);
queryRuntime.outputCallback = clonedQueryOutputCallback;
}
return queryRuntime;
}
示例5: parse
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
public static QuerySelector parse(Selector selector, OutputStream outStream, SiddhiContext context, MetaStateEvent metaStateEvent, List<VariableExpressionExecutor> executors) {
boolean currentOn = false;
boolean expiredOn = false;
String id = null;
if (outStream != null) {
if (outStream.getOutputEventType() == OutputStream.OutputEventType.CURRENT_EVENTS || outStream.getOutputEventType() == OutputStream.OutputEventType.ALL_EVENTS) {
currentOn = true;
}
if (outStream.getOutputEventType() == OutputStream.OutputEventType.EXPIRED_EVENTS || outStream.getOutputEventType() == OutputStream.OutputEventType.ALL_EVENTS) {
expiredOn = true;
}
id = outStream.getId();
} else {
currentOn = true;
expiredOn = true;
}
QuerySelector querySelector = new QuerySelector(id, selector, currentOn, expiredOn, context);
querySelector.setAttributeProcessorList(getAttributeProcessors(selector, outStream,context, metaStateEvent, executors));
return querySelector;
}
示例6: constructQuerySelector
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
public static QuerySelector constructQuerySelector(Map<String, StreamDefinition> tempStreamDefinitionMap, OutputStream outStream, Selector selector, OutputRateManager outputRateManager
, SiddhiContext siddhiContext, MetaStreamEvent metaStreamEvent, List<VariableExpressionExecutor> variableExpressionExecutors) {
boolean currentOn = false;
boolean expiredOn = false;
String id = null;
if (outStream != null) {
if (outStream.getOutputEventType() == OutputStream.OutputEventType.CURRENT_EVENTS || outStream.getOutputEventType() == OutputStream.OutputEventType.ALL_EVENTS) {
currentOn = true;
}
if (outStream.getOutputEventType() == OutputStream.OutputEventType.EXPIRED_EVENTS || outStream.getOutputEventType() == OutputStream.OutputEventType.ALL_EVENTS) {
expiredOn = true;
}
id = outStream.getId();
} else {
currentOn = true;
expiredOn = true;
}
return new QuerySelector(id, selector, outputRateManager, siddhiContext, currentOn, expiredOn, tempStreamDefinitionMap, metaStreamEvent, variableExpressionExecutors);
}
示例7: QueryPartitioner
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
public QueryPartitioner(String partitionId, QueryCreator queryCreator, List<QueryCallback> queryCallbackList, OutputCallback outputCallback, List<QuerySelector> querySelectorList,
ConcurrentMap<String, PartitionDefinition> partitionDefinitionMap, SiddhiContext siddhiContext) {
this.queryCreator = queryCreator;
this.queryCallbackList = queryCallbackList;
this.outputCallback = outputCallback;
this.querySelectorList = querySelectorList;
if (partitionId != null) {
PartitionDefinition partitionDefinition = partitionDefinitionMap.get(partitionId);
if (partitionDefinition == null) {
throw new QueryCreationException("Partition ID " + partitionId + " was not defined!");
}
List<QueryEventSource> tempQueryEventSourceList = new ArrayList<QueryEventSource>();
Map<String, EventTable> eventTableMap = new HashMap<String, EventTable>();
for (QueryEventSource queryEventSource : queryCreator.getQueryEventSourceList()) {
ArrayList<PartitionExecutor> executorList = new ArrayList<PartitionExecutor>();
partitionExecutors.add(executorList);
tempQueryEventSourceList.clear();
tempQueryEventSourceList.add(queryEventSource);
for (PartitionType partitionType : partitionDefinition.getPartitionTypeList()) {
Set<String> depencySet;
if (partitionType instanceof VariablePartitionType) {
depencySet = ExpressionValidator.getDependencySet(((VariablePartitionType) partitionType).getVariable());
if (depencySet.isEmpty() || depencySet.contains(queryEventSource.getSourceId())) {
executorList.add(new VariablePartitionExecutor(ExecutorParser.parseExpression(((VariablePartitionType) partitionType).getVariable(), tempQueryEventSourceList, queryEventSource.getSourceId(), true, siddhiContext)));
}
} else {
depencySet = ConditionValidator.getDependencySet(((RangePartitionType) partitionType).getCondition());
if (depencySet.isEmpty() || depencySet.contains(queryEventSource.getSourceId())) {
executorList.add(new RangePartitionExecutor(ExecutorParser.parseCondition(((RangePartitionType) partitionType).getCondition(), tempQueryEventSourceList, queryEventSource.getSourceId(), eventTableMap, true, siddhiContext), ((RangePartitionType) partitionType).getPartitionKey()));
}
}
}
}
}
}
示例8: constructQuery
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
@Override
public QueryPartComposite constructQuery() {
QueryPartComposite queryPartComposite = StreamParser.parsePatternStream(query.getInputStream(), patternStateList, queryEventSourceList, streamTableDefinitionMap, eventTableMap, siddhiContext);
QuerySelector querySelector = constructQuerySelector(outputRateManager);
queryPartComposite.setQuerySelector(querySelector);
StateParser.populateMemoryOptimizationParameters(patternStateList, query.getSelector(), queryPartComposite.getHandlerProcessorList());
return queryPartComposite;
}
示例9: constructQuery
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
public QueryPartComposite constructQuery() {
QueryPartComposite queryPartComposite = StreamParser.parseSingleStream(query.getInputStream(), queryEventSource, queryEventSourceList, streamTableDefinitionMap, eventTableMap, siddhiContext);
QuerySelector querySelector = constructQuerySelector(outputRateManager);
queryPartComposite.setQuerySelector(querySelector);
return queryPartComposite;
}
示例10: init
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
protected void init() {
queryEventSourceList = query.getInputStream().constructQueryEventSourceList(streamTableDefinitionMap, new ArrayList<QueryEventSource>());
updateQueryEventSourceList(queryEventSourceList);
validateOutput(queryEventSourceList, query);
populateSelection(queryEventSourceList, query);
QuerySelector querySelector = constructQuerySelector(outputRateManager);
outputStreamDefinition = querySelector.getOutputStreamDefinition();
if (outputRateManager instanceof WrappedSnapshotOutputRateManager) {
((WrappedSnapshotOutputRateManager) outputRateManager).setAggregateAttributePositionList(querySelector.getAggregateAttributePositionList());
((WrappedSnapshotOutputRateManager) outputRateManager).setAttributeSize(querySelector.getAttributeSize());
}
}
示例11: constructQuery
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
@Override
public QueryPartComposite constructQuery() {
QueryPartComposite queryPartComposite = StreamParser.parseJoinStream(query.getInputStream(), leftQueryEventSource, rightQueryEventSource, queryEventSourceList, streamTableDefinitionMap, eventTableMap, siddhiContext);
QuerySelector querySelector = constructQuerySelector(outputRateManager);
queryPartComposite.setQuerySelector(querySelector);
return queryPartComposite;
}
示例12: constructQuery
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
@Override
public QueryPartComposite constructQuery() {
QueryPartComposite queryPartComposite = StreamParser.parseSequenceStream(query.getInputStream(), sequenceStateList, queryEventSourceList, streamTableDefinitionMap, eventTableMap, siddhiContext);
QuerySelector querySelector = constructQuerySelector(outputRateManager);
queryPartComposite.setQuerySelector(querySelector);
StateParser.populateMemoryOptimizationParameters(sequenceStateList, query.getSelector(), queryPartComposite.getHandlerProcessorList());
return queryPartComposite;
}
示例13: clone
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
public QueryRuntime clone(String key, ConcurrentMap<String, StreamJunction> localStreamJunctionMap) {
LockWrapper lockWrapper = null;
if (synchronised) {
lockWrapper = new LockWrapper("");
lockWrapper.setLock(new ReentrantLock());
}
StreamRuntime clonedStreamRuntime = this.streamRuntime.clone(key);
QuerySelector clonedSelector = this.selector.clone(key);
OutputRateLimiter clonedOutputRateLimiter = outputRateLimiter.clone(key);
clonedOutputRateLimiter.init(siddhiAppContext, lockWrapper, queryId);
QueryRuntime queryRuntime = new QueryRuntime(query, siddhiAppContext, clonedStreamRuntime, clonedSelector,
clonedOutputRateLimiter, outputCallback, this.metaComplexEvent,
synchronised, this.queryId + key);
QueryParserHelper.initStreamRuntime(clonedStreamRuntime, metaComplexEvent, lockWrapper, queryId);
queryRuntime.setToLocalStream(toLocalStream);
if (!toLocalStream) {
queryRuntime.outputRateLimiter.setOutputCallback(outputCallback);
queryRuntime.outputCallback = this.outputCallback;
} else {
OutputCallback clonedQueryOutputCallback = OutputParser.constructOutputCallback(query.getOutputStream(),
key,
localStreamJunctionMap,
outputStreamDefinition,
siddhiAppContext,
queryId);
queryRuntime.outputRateLimiter.setOutputCallback(clonedQueryOutputCallback);
queryRuntime.outputCallback = clonedQueryOutputCallback;
}
return queryRuntime;
}
示例14: clone
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
@Override
public StreamRuntime clone(String key) {
ProcessStreamReceiver clonedProcessStreamReceiver = this.processStreamReceiver.clone(key);
EntryValveProcessor entryValveProcessor = null;
SchedulingProcessor schedulingProcessor;
Processor clonedProcessorChain = null;
if (processorChain != null) {
if (!(processorChain instanceof QuerySelector || processorChain instanceof OutputRateLimiter)) {
clonedProcessorChain = processorChain.cloneProcessor(key);
if (clonedProcessorChain instanceof EntryValveProcessor) {
entryValveProcessor = (EntryValveProcessor) clonedProcessorChain;
}
}
Processor processor = processorChain.getNextProcessor();
while (processor != null) {
if (!(processor instanceof QuerySelector || processor instanceof OutputRateLimiter)) {
Processor clonedProcessor = processor.cloneProcessor(key);
clonedProcessorChain.setToLast(clonedProcessor);
if (clonedProcessor instanceof EntryValveProcessor) {
entryValveProcessor = (EntryValveProcessor) clonedProcessor;
} else if (clonedProcessor instanceof SchedulingProcessor) {
schedulingProcessor = (SchedulingProcessor) clonedProcessor;
schedulingProcessor.setScheduler(((SchedulingProcessor) processor).getScheduler().clone(
key, entryValveProcessor));
}
}
processor = processor.getNextProcessor();
}
}
return new SingleStreamRuntime(clonedProcessStreamReceiver, clonedProcessorChain, metaComplexEvent);
}
示例15: setToLast
import org.wso2.siddhi.core.query.selector.QuerySelector; //导入依赖的package包/类
/**
* Set as the last element of the processor chain.
*
* @param processor Last processor in the chain
*/
@Override
public void setToLast(Processor processor) {
if (nextProcessor == null) {
this.nextProcessor = processor;
} else {
this.nextProcessor.setToLast(processor);
}
if (processor instanceof QuerySelector) {
selector = (QuerySelector) processor;
}
}