Understanding Infinispan Eviction, Expiration and File store?

ぐ巨炮叔叔 提交于 2019-12-11 05:19:43

问题


Consider a Infinispan cache ( version 5.3.0.Final) Which having following properties,

  1. Have file store
  2. Passivation is set to true.

I have following problems when understanding the cache behavior.

  1. Is there two threads for eviction and expiration ?
  2. When expiration thread runs, what happens to entries which are in file, but has expired ? Do those load back to memory and removed ?
  3. What is time duration for these threads to run ?
  4. Does the file store file is append-only file ?
  5. Does file has a index in this Infinispan version ?
  6. What exactly stored in file in this Infinispan version ? Is it key-value or just value ?

回答1:


I won't speak about such an old version, but it's likely the same.

  1. The naming is a bit messy, TBH. There's threadpool with id org.infinispan.executors.eviction with single thread by default, which hosts ScheduledTask that processes expiration. Eviction is triggered only when you add something to the data container, and it is processed by the thread that added the new item.

  2. Depends on cache store implementation - cachestore SPI has method purgeExpired() which forces removal of expired entries from the store. Nothing needs to be loaded into memory.

  3. By default it's 1 minute. Search for wakeUpInterval (or wake-up-interval) in configuration.

  4. No, none of the classical file stores. SoftIndexFileStore uses similar technique.

  5. FileCacheStore has just several 'buckets' and is based on key hashCode, SingleFileCacheStore (or KarstenFileCacheStore, depends on your version) has in-memory index.

  6. Both keys and values.



来源:https://stackoverflow.com/questions/28983060/understanding-infinispan-eviction-expiration-and-file-store

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!