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
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.

Mime
View raw message