use of org.wso2.carbon.idp.mgt.util.IdPManagementConstants.ID in project siddhi by wso2.
the class PartitionRuntime method addQuery.
public QueryRuntime addQuery(QueryRuntime metaQueryRuntime) {
Query query = metaQueryRuntime.getQuery();
if (query.getOutputStream() instanceof InsertIntoStream && metaQueryRuntime.getOutputCallback() instanceof InsertIntoStreamCallback) {
InsertIntoStreamCallback insertIntoStreamCallback = (InsertIntoStreamCallback) metaQueryRuntime.getOutputCallback();
StreamDefinition streamDefinition = insertIntoStreamCallback.getOutputStreamDefinition();
String id = streamDefinition.getId();
if (((InsertIntoStream) query.getOutputStream()).isInnerStream()) {
metaQueryRuntime.setToLocalStream(true);
localStreamDefinitionMap.putIfAbsent(id, streamDefinition);
DefinitionParserHelper.validateOutputStream(streamDefinition, localStreamDefinitionMap.get(id));
StreamJunction outputStreamJunction = localStreamJunctionMap.get(id);
if (outputStreamJunction == null) {
outputStreamJunction = new StreamJunction(streamDefinition, siddhiAppContext.getExecutorService(), siddhiAppContext.getBufferSize(), siddhiAppContext);
localStreamJunctionMap.putIfAbsent(id, outputStreamJunction);
}
insertIntoStreamCallback.init(localStreamJunctionMap.get(id));
} else {
streamDefinitionMap.putIfAbsent(id, streamDefinition);
DefinitionParserHelper.validateOutputStream(streamDefinition, streamDefinitionMap.get(id));
StreamJunction outputStreamJunction = streamJunctionMap.get(id);
if (outputStreamJunction == null) {
outputStreamJunction = new StreamJunction(streamDefinition, siddhiAppContext.getExecutorService(), siddhiAppContext.getBufferSize(), siddhiAppContext);
streamJunctionMap.putIfAbsent(id, outputStreamJunction);
}
insertIntoStreamCallback.init(streamJunctionMap.get(id));
}
}
metaQueryRuntimeMap.put(metaQueryRuntime.getQueryId(), metaQueryRuntime);
return metaQueryRuntime;
}
use of org.wso2.carbon.idp.mgt.util.IdPManagementConstants.ID in project siddhi by wso2.
the class InputManager method constructInputHandler.
public InputHandler constructInputHandler(String streamId) {
InputHandler inputHandler = new InputHandler(streamId, inputHandlerMap.size(), inputEntryValve);
StreamJunction streamJunction = streamJunctionMap.get(streamId);
if (streamJunction == null) {
throw new DefinitionNotExistException("Stream with stream ID " + streamId + " has not been defined");
}
inputDistributor.addInputProcessor(streamJunctionMap.get(streamId).constructPublisher());
inputHandlerMap.put(streamId, inputHandler);
return inputHandler;
}
use of org.wso2.carbon.idp.mgt.util.IdPManagementConstants.ID in project siddhi by wso2.
the class QuerySelector method clone.
public QuerySelector clone(String key) {
QuerySelector clonedQuerySelector = new QuerySelector(id + key, selector, currentOn, expiredOn, siddhiAppContext);
List<AttributeProcessor> clonedAttributeProcessorList = new ArrayList<AttributeProcessor>();
for (AttributeProcessor attributeProcessor : attributeProcessorList) {
clonedAttributeProcessorList.add(attributeProcessor.cloneProcessor(key));
}
clonedQuerySelector.attributeProcessorList = clonedAttributeProcessorList;
clonedQuerySelector.isGroupBy = isGroupBy;
clonedQuerySelector.containsAggregator = containsAggregator;
clonedQuerySelector.groupByKeyGenerator = groupByKeyGenerator;
clonedQuerySelector.havingConditionExecutor = havingConditionExecutor;
clonedQuerySelector.eventPopulator = eventPopulator;
clonedQuerySelector.batchingEnabled = batchingEnabled;
clonedQuerySelector.isOrderBy = isOrderBy;
clonedQuerySelector.orderByEventComparator = orderByEventComparator;
clonedQuerySelector.limit = limit;
return clonedQuerySelector;
}
use of org.wso2.carbon.idp.mgt.util.IdPManagementConstants.ID in project siddhi by wso2.
the class ExpressionBuilder method buildStreamVariableExecutor.
private void buildStreamVariableExecutor(Variable variable, int streamEventChainIndex, ExpressionVisitor expressionVisitor, Attribute.Type type) {
String id = variable.getAttributeName();
if (variable.getStreamId() != null) {
id = variable.getStreamId() + "." + id;
}
expressionVisitor.beginVisitStreamVariable(id, variable.getStreamId(), variable.getAttributeName(), type);
if (!variableExpressionExecutorMap.containsKey(id)) {
ExpressionExecutor variableExpressionExecutor = ExpressionParser.parseExpression(variable, matchingMetaInfoHolder.getMetaStateEvent(), streamEventChainIndex, tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
variableExpressionExecutorMap.put(id, variableExpressionExecutor);
}
expressionVisitor.endVisitStreamVariable(id, variable.getStreamId(), variable.getAttributeName(), type);
}
use of org.wso2.carbon.idp.mgt.util.IdPManagementConstants.ID in project siddhi by wso2.
the class OutputParser method constructOutputCallback.
public static OutputCallback constructOutputCallback(OutputStream outStream, String key, ConcurrentMap<String, StreamJunction> streamJunctionMap, StreamDefinition outputStreamDefinition, SiddhiAppContext siddhiAppContext, String queryName) {
String id = outStream.getId();
// Construct CallBack
if (outStream instanceof InsertIntoStream) {
StreamJunction outputStreamJunction = streamJunctionMap.get(id + key);
if (outputStreamJunction == null) {
outputStreamJunction = new StreamJunction(outputStreamDefinition, siddhiAppContext.getExecutorService(), siddhiAppContext.getBufferSize(), siddhiAppContext);
streamJunctionMap.putIfAbsent(id + key, outputStreamJunction);
}
InsertIntoStreamCallback insertIntoStreamCallback = new InsertIntoStreamCallback(outputStreamDefinition, queryName);
insertIntoStreamCallback.init(streamJunctionMap.get(id + key));
return insertIntoStreamCallback;
} else {
throw new SiddhiAppCreationException(outStream.getClass().getName() + " not supported", outStream.getQueryContextStartIndex(), outStream.getQueryContextEndIndex());
}
}
Aggregations