ignite-user mailing list archives

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

Basicly i have a simple cache with almost 5m~ entries across 4 nodes. And i
use fair affinity function as affinity function.

I also use fair affinity function to send data to nodes from external
sources.  My flow can be summarised as.

- Run 4 node cluster with a partitioned cache
- Run another host as a client.
- Use affinity function within client host to send data to owner node.
- Preprocess data and put to cache.


I have this flow because i need previous value of key to decide next value.
So data should be processed within owner node.

My problem is that i have to query only local data with a time interval to
decide is value should be changed. So i also need previous value of keys
after processing query result. So i need to be sure query result key is
exists in local node

I have a solution but i has poor performance.

First i run

primaryPartitions(instance.ignite.cluster().localNode());  // Returns
array of current node's partition numbers

after loop over this array and run scan query

ScanQuery<String, ClassNameOfObject> scanQuery = new ScanQuery<>();
scanQuery.setLocal(true);
scanQuery.setFilter(filter);
scanQuery.setPartition(partition);

.

If anyone can provide a better solution i would be very happy.

Thanks

*Tolga KAVUKÇU*

Mime
View raw message