]
William Burns updated ISPN-4736:
--------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
Add size() operation to Hot Rod
-------------------------------
Key: ISPN-4736
URL:
https://issues.jboss.org/browse/ISPN-4736
Project: Infinispan
Issue Type: Feature Request
Components: Remote Protocols
Reporter: Galder ZamarreƱo
Assignee: Galder ZamarreƱo
Fix For: 7.0.0.CR1, 7.0.0.Final
This jira is a spin-off of
https://github.com/infinispan/infinispan/pull/2780, resulting
from the feedback/comments provided by Will, Dan and Sanne.
Essentially, what ISPN-4470 tries to do is provide a RemoteCache.size() implementation.
The first implementation simply computed the keySet() and got its size. This is clearly
not optimal since you're bringing a load of keys to not use them at all.
The second solution used statistics of different nodes to calculate number of total keys
in the cluster, and if statistics were disabled, fallback on keySet(). The problem here is
that statistics don't take cache store contents into account but keySet() does, which
would be confusing for the user. Having such size related statistics check persistent
stores would affect performance of stats.
In the end, the best way to achieve this is by implementing a new size operation on Hot
Rod that calculates the total number of keys without actually bringing keys back to
clients. This new operation will be part of Hot Rod 2.0.