Question

I am using ehcache with terracotta, and I wonder what is the meaning of the attribute maxElementsOnDisk in such cotext.

Does it mean the max elemnts allowed on the terracotta layer?

If not, what is the attribute controlling the number of elements allowed on the tarracotta layer?

If I understand correctly maxEntriesLocalHeap represents the number of entries allowed on the local heap tier, and it can overflow to terracotta layer which can overflow to disk (please correct me if I am wrong) but I am not sure what is the name of the element controlling each element.

BTW, in my use case I will never want entries to be written to disk, If there is no more room in the local heap or terracotta layer the entry should be evicted.

Yosi

Was it helpful?

Solution

There are 2 stores and related options:

  • L1: MemoryStore (local JVM of node) -> maxElementsInMemory
  • L2: DiskStore -> maxElementsOnDisk

The L2 size represents the maximum cache size. Elements can overflow from L1 to L2.

When using Terracotta, the maxElementsOnDisk value is overridden to provide the L2 size. Also, the DiskStore is never used because the elements overflow to Terracotta (L2 Store).

You can read about it in the official FAQs and a related bug report.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top