Java Code Examples for io.siddhi.query.api.definition.StreamDefinition#getQueryContextEndIndex()

The following examples show how to use io.siddhi.query.api.definition.StreamDefinition#getQueryContextEndIndex() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SiddhiApp.java    From siddhi with Apache License 2.0 5 votes vote down vote up
public SiddhiApp defineStream(StreamDefinition streamDefinition) {
    if (streamDefinition == null) {
        throw new SiddhiAppValidationException("Stream Definition should not be null");
    } else if (streamDefinition.getId() == null) {
        throw new SiddhiAppValidationException("Stream Id should not be null for Stream Definition",
                streamDefinition.getQueryContextStartIndex(), streamDefinition.getQueryContextEndIndex());
    }
    checkDuplicateDefinition(streamDefinition);
    this.streamDefinitionMap.put(streamDefinition.getId(), streamDefinition);
    return this;
}
 
Example 2
Source File: DefinitionParserHelper.java    From siddhi with Apache License 2.0 5 votes vote down vote up
public static void validateOutputStream(StreamDefinition outputStreamDefinition,
                                        AbstractDefinition existingStream) {
    if (!existingStream.equalsIgnoreAnnotations(outputStreamDefinition)) {
        throw new DuplicateDefinitionException("Different definition same as output '" +
                outputStreamDefinition + "' already exist as '" + existingStream + "'",
                outputStreamDefinition.getQueryContextStartIndex(),
                outputStreamDefinition.getQueryContextEndIndex());
    }
}