Reputation: 2894
Does Ehcache replicate the underlying Disk Store to other nodes, when replication enabled ? And when element is searched in cache, which is overflown to disk, does cache search disk for that element or it returns NULL ?
Upvotes: 0
Views: 60
Reputation: 14500
Ehcache 2.x replication is based of cache event listeners and so happens irrelevant of the tiering configured. That means that any mutation on the cache once it has been configured will be replicated. This also means that if you were to configure it on a cache already having content on disk, that would not get replicated (Note: this change may be considered invalid and cause the cache to drop disk content - I did not test it).
When you Cache.get
from a multiple tier cache, all tiers, from faster to slower, will be accessed to find the entry and will stop as soon as found.
Note also that since Ehcache 2.6.x overflow is no longer the storage model. All entries will exist in the disk tier while hot entries will also leave on heap. See another answer for more details.
Upvotes: 1