Chris,

I feel maybe there is a misunderstanding of how partitions assignment works
in Ignite. In brief, Ignite has public AffinityFunction
<https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/cache/affinity/AffinityFunction.html>
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
<https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/cache/affinity/AffinityFunction.html>
implementation where AffinityFunction#assignPartitions()
would assign nodes to each partition.

Thus, unless you provide your own AffinityFunction
<https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/cache/affinity/AffinityFunction.html>,
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.

Reply via email to