bodtx
bodtx

Reputation: 609

ehcache custom maxEntriesLocalHeap computation

Hi We are using ehcache 2.10. As limiting the cache size with maxBytesLocalHeap attribute can be cost effective, we use maxEntriesLocalHeap attribute.

Our problem is that our objects in the cache are complex (up to 20 000 childs per entry). As we would like to store this domain object like this and not in a flat way:

is there a way to provide a custom count method on each object that would answer to the maxEntries computation of ehcache

ex: If my entries N°1 has 1000 childs, this entry would cost 1000 and not 1 in the ehcache counter

Upvotes: 0

Views: 301

Answers (1)

Louis Jacomet
Louis Jacomet

Reputation: 14500

No Ehcache has no support for this.

And since it implicitly counts one mapping as 1, there is no entry point for overriding this behaviour.

Upvotes: 1

Related Questions