I used JdbmCacheStore for one of my cache. In my code, I call cache.size() to get the number of elements in the cache. But, I saw the following WARN messages in the log:
WARN org.infinispan.loaders.jdbm.JdbmCacheStore - size() should never be called; except for tests
Look inside the code of JdbmCachStore, the size() is not really implemented.
What is the correct way to get the size of the cache?
Hmmm, I'm not sure that cache.size() call and that warning are related, because cache.size() is computed based only on the elements residing in memory.
That warning could come from loading all, or partially the elements in the JDBM store and size being called by that. Dunno where that would happen in your env though.
So, at first glance, you shouldn't worry about it, but if you can find out, with a breakpoint or something, how that warning appears, we might be able to help further to see if it's something to worry about or not.
|Retrieving data ...|