Infinispan Cache Number of Entries

From NovaOrdis Knowledge Base
Revision as of 17:20, 20 October 2016 by Ovidiu (talk | contribs) (Created page with " A read-only int represents the current number of raw entries maintained in the cache node being interrogated. May return null if the cache is not started. The exact semant...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


A read-only int represents the current number of raw entries maintained in the cache node being interrogated. May return null if the cache is not started.

The exact semantics of the "number-of-entries" for a distributed cache is: the raw number of entries (key/value pairs), either original or duplicates, physically present on that specific node that is being interrogated via the CLI command. The value has not bearing on the total number of distinct entries in the logical cache. For that, see clusterwide-number-of-entries. Unlike clusterwide-number-of-entries, number-of-entries seems to be synchronized across the cluster on each write.

For configuration details see "owners".

The metric is also available as the "numberOfEntries" JMX Attribute of the MBean

jboss.infinispan:type=Cache,name="<cache-name>(dist_sync)",manager="clustered",component=Statistics


Relationship Between clusterwide-number-of-entries and number-of-entries

For a distributed cache, this relationship holds true (provided that clusterwide-number-of-entries is correctly syncrhonized across the cluster and it has an updated value):


number-of-entries[1] + number-of-entries[2] + .. number-of-entries[n] = clusterwide-number-of-entries * owners
                            

where the cluster consists in 1 ... n nodes.