ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Kukushkin <kukushkinale...@gmail.com>
Subject Re: Cache Size Monitor -- without making a remote call??
Date Fri, 08 Sep 2017 15:42:33 GMT

I feel maybe there is a misunderstanding of how partitions assignment works
in Ignite. In brief, Ignite has public AffinityFunction
interface, which is responsible for assigning partitions to nodes. Default
implementation uses Rendezvous hashing
<https://en.wikipedia.org/wiki/Rendezvous_hashing>, which minimises number
or re-assignments as nodes join/leave the cluster to reduce traffic. You
can develop your own AffinityFunction
implementation where AffinityFunction#assignPartitions()
would assign nodes to each partition.

Thus, unless you provide your own AffinityFunction
every node in your cluster will be "primary". Still if you want "isPrimary"
method I think you could use CacheMetrics.getOffHeapPrimaryEntriesCount()
!= 0 or IgniteCache.localSize(CachePeekMode.PRIMARY) != 0.

View raw message