On Oct 10, 2014, at 15:25, Dan Berindei <dan.berin...@gmail.com> wrote:

> On Fri, Oct 10, 2014 at 5:20 PM, Mircea Markus <mmar...@redhat.com> wrote:
> 
> On Oct 10, 2014, at 15:18, Radim Vansa <rva...@redhat.com> wrote:
> 
> > That we should expose that as one method, not forcing people to
> > implement the sum() themselves.
> 
> Hmm, isn't the method you mention cache.size() ? :-)
> 
> Nope, because we decided to make cache.size() precise-but-slow :)

It's not possible to make it precise unless we provide snapshot isolation /MVCC 
support.
IMO the formula Tristan provides is a good enough approximation of the size of 
the data. And definitely way better than what we currently have.
(Looking at CHM.size() they offer an "accurate" size of the map by counting it 
in a loop and making sure that the size is reproducible. I don't think that's 
accurate in the general case, though, as you might count intermediate sizes in 
that loop).

Cheers,
-- 
Mircea Markus
Infinispan lead (www.infinispan.org)





_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev

Reply via email to