James,

Please pay attention to the following query configuration method
Query#setLocal(true). It allows to return records located on only local
node.
Following code block iterates through cache entries located on each server
node:

ignite.compute(ignite.cluster().forServers()).broadcast(new IgniteRunnable() {
    @Override public void run() {
        Ignite local = Ignition.localIgnite();

        System.out.println("Ignite node:"+local.cluster().localNode().id());

        IgniteCache cache = local.cache("cache");

        QueryCursor query = cache.query(new ScanQuery().setLocal(true));

        Iterator it = query.iterator();
        while (it.hasNext()){
            //iterate through local entities
        }
    }
});


пт, 5 окт. 2018 г. в 22:45, James Dodson <[email protected]>:

> Thanks Val.
> Is there a way I can verify this behavior - a way to query one node in
> particular to see what data is on each node?
>
> On Fri, Oct 5, 2018 at 2:04 PM vkulichenko <[email protected]>
> wrote:
>
>> James,
>>
>> That would be enough - everything with the same affinity key will be
>> stored
>> on the same node. That's assuming, of course, that both caches have equal
>> affinity configuration (same affinity function, same number of partitions,
>> etc.).
>>
>> -Val
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>

-- 

Regards

Pavel Vinokurov

Reply via email to