public void setLimit(long limit) {
        if (limit < 0) {
            throw new SiddhiAppCreationException("'limit' cannot have negative value, but found '" + limit + "'",
                    selector, siddhiQueryContext.getSiddhiAppContext());
        }
        this.limit = limit;
    }
Processor implementation representing selector portion of the Siddhi query.
modules/siddhi-core/src/main/java/io/siddhi/core/query/selector/QuerySelector.java