You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Vladimir Ozerov <vo...@gridgain.com> on 2015/03/17 13:03:31 UTC

Continuous query API.

HI,

I'm looking at our continuous queries API and looks pretty weird for me.
Earlier we operated on stateful "ContinuousQuery" object with clear
lifecycle: we can start it and we can close it.

Now we operate on cursor which is either empty or contains results from
initial query. And when we close the cursor, continuous query is
unregistered.

It seems to me that we mixed two completely different concepts - continuous
query and regular query - in a single API making it very dirty.

Why query and continuous query lifecycle is merged into one? They are
completely different.
Why I cannot close intial query to release SQL/Lucene resources without
closing continuous query?

I think we should think about another API where these two diiferent
entities (continuous query and query have nothing in common except of
"query" in their names) will be separated. E.g.:

IgniteCache {
    ContinuousQueryHandle continuousQuery(ContinuousQuery);
}

ContinuousQueryHandle {
    QueryCursor initialQueryCursor();

    close();
}

Thoughts?