public Partition addQuery(Query query) {

        if (query == null) {
            throw new SiddhiAppValidationException("Query should not be null");
        }
        String name = null;
        Element element = AnnotationHelper.getAnnotationElement(SiddhiConstants.ANNOTATION_INFO, SiddhiConstants
                .ANNOTATION_ELEMENT_NAME, query.getAnnotations());
        if (element != null) {
            name = element.getValue();
        }
        if (name != null && queryNameList.contains(name)) {
            throw new SiddhiAppValidationException("Cannot add Query as another Execution Element already uses " +
                    "its name=" + name + " within the same Partition",
                    element.getQueryContextStartIndex(), element.getQueryContextEndIndex());
        }
        queryNameList.add(name);
        this.queryList.add(query);
        return this;
    }
{@linkplain io.siddhi.query.api.execution.partition.Partition} class is used to represent the definition of
a partition for a Siddhi instance.
modules/siddhi-query-api/src/main/java/io/siddhi/query/api/execution/partition/Partition.java