更新时间:2023-11-29 15:00:04
答案取决于您的Ehcache版本。
The answer depends on your version of Ehcache.
与Ehcache 2.6相比,存储模型不再是溢出模型,而是分层模型。
在分层存储模型中,所有数据将始终出现在最低层中。
项目将根据其热度在较高层中出现。
As of Ehcache 2.6, the storage model is no longer an overflow one but a tiered one. In the tiered storage model, all data will always be present in the lowest tier. Items will be present in the higher tiers based on their hotness.
可能的开放层源Ehcache是:
Possible tiers for open source Ehcache are:
按定义,高层比较低层具有更低的延迟,但容量较低。
By definition high tiers have lower latency but less capacity than lower tiers.
因此,对于配置了 overflowToDisk
的缓存,所有数据将始终位于磁盘层内部。它将密钥存储在内存中,并将数据存储在磁盘上。
So for a cache configured with overflowToDisk
, all the data will always be inside the disk tier. It will store the key in memory and the data on disk.
在高速缓存中查找条目时,层级从最高到最低。
在您的示例中,将按以下方式检索数据:
When looking for an entry inside the cache, the tiers are considered from highest to lowest. In your example, the data will be retrieved as follows: