I think scan query implementation can be more complex than just sending
closures to all nodes. e.g. it should handle topology changes. IMO it is
not good idea to use compute instead of queries.

On Thu, Feb 4, 2016 at 10:55 AM, Dmitriy Setrakyan <dsetrak...@apache.org>
wrote:

> On Wed, Feb 3, 2016 at 10:28 PM, Valentin Kulichenko <
> valentin.kuliche...@gmail.com> wrote:
>
> > Dmitry,
> >
> > The main difference in my view is that you lose pagination when sending
> > results from servers to client. What if one wants to iterate through all
> > entries in cache?
> >
>
> I see. Perhaps we should fix the pagination for compute instead of adding
> transformers for queries?
>
>
> >
> > On Wed, Feb 3, 2016 at 9:47 PM, Dmitriy Setrakyan <dsetrak...@apache.org
> >
> > wrote:
> >
> > > Valentin,
> > >
> > > Wouldn’t the same effect be achieved by broadcasting a closure to the
> > > cluster and executing scan-query on every node locally?
> > >
> > > D.
> > >
> > > On Wed, Feb 3, 2016 at 9:17 PM, Valentin Kulichenko <
> > > valentin.kuliche...@gmail.com> wrote:
> > >
> > > > Igniters,
> > > >
> > > > I keep getting requests from our users to add optional transformers
> to
> > > SCAN
> > > > queries. This will allow to iterate through cache, but do not
> transfer
> > > > whole key-value pairs across networks (e.g., get only keys). The
> > feature
> > > > looks useful and I created a ticket [1].
> > > >
> > > > I am struggling with the design now. The problem is that I wanted to
> > > extend
> > > > existing ScanQuery object for this, but this seems to be impossible
> > > because
> > > > it already extends Query<Cache.Entry<K, V>> and thus can iterate only
> > > > through entries.
> > > >
> > > > The only option I see now is to create a separate query type,
> > copy-paste
> > > > everything from ScanQuery and add *mandatory* transformer. Something
> > like
> > > > this:
> > > >
> > > > ScanTransformQuery<K, V, R> extends Query<R> {
> > > >     IgniteBiPredicate<K, V> filter;
> > > >     IgniteClosure<Cache.Entry<K, V>, R> transformer;
> > > >     int part;
> > > >     ...
> > > > }
> > > >
> > > > Thoughts? Does anyone has other ideas?
> > > >
> > > > [1] https://issues.apache.org/jira/browse/IGNITE-2546
> > > >
> > > > -Val
> > > >
> > >
> >
>

Reply via email to