ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tolga Kavukcu <kavukcu.to...@gmail.com>
Subject Re: Running a query in only current nodes partitions
Date Mon, 04 Apr 2016 12:11:18 GMT
Hi Denis,

Thanks for the answer.

Better if i provide more detail to get a point . Lets say i have cache1 and

- I would like to run a query on cache1. Than i should check if key exists
or not in cache2 than i will execute some logic.

I need to make sure that keys are owned by queried node so that i could
check properly if key exists in cache or not .(This can be achieved by
ScanQuery by setting partition and setLocal=true)

So if i use sql query my query would be like ;

SqlQuery sql = new SqlQuery(Person.class, "salary > ?");

I only apply one rule over one field.

But! there is no setPartition() method in SqlQuery. Please correct me if am

Thats why i use ScanQuery to itearte over cache and apply my rule.

I will try multi-thread approach, it could speed up think. Also i would be
happy if you can suggest a faster alternative way.


On Mon, Apr 4, 2016 at 2:29 PM, Denis Magda <dmagda@gridgain.com> wrote:

> Hi Tolga,
> Do you really need to iterate over *all the keys* when data has to be
> update? If so then you can parallelize ScanQueries when multiple local
> Threads will be iterating over specific partitions on each node.
> Please refer to this example for more details
> https://github.com/gridgain/gridgain-advanced-examples/blob/master/src/main/java/org/gridgain/examples/datagrid/query/ScanQueryExample.java
> If you don't need to iterate over every key then how would your query look
> like if you use SQL query to get a subset of the keys?
> --
> Denis
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Running-a-query-in-only-current-nodes-partitions-tp3878p3890.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.



View raw message