public boolean isFromLocalStream() {
        if (query.getInputStream() instanceof SingleInputStream) {
            return ((SingleInputStream) query.getInputStream()).isInnerStream();
        } else if (query.getInputStream() instanceof JoinInputStream) {
            return ((SingleInputStream) ((JoinInputStream) query.getInputStream()).getLeftInputStream())
                    .isInnerStream() || ((SingleInputStream) ((JoinInputStream) query.getInputStream())
                    .getRightInputStream()).isInnerStream();
        } else if (query.getInputStream() instanceof StateInputStream) {
            for (String streamId : query.getInputStream().getAllStreamIds()) {
                if (streamId.startsWith("#")) {
                    return true;
                }
            }
        }
        return false;
    }
Query Runtime represent holder object for a single Siddhi query and holds all runtime objects related to that query.
modules/siddhi-core/src/main/java/io/siddhi/core/query/QueryRuntimeImpl.java