Simplify Filter Cache Eviction Settings, closes #871.
This commit is contained in:
parent
90b88fe4b7
commit
568dec6b5a
|
@ -49,11 +49,11 @@ public class ResidentFilterCache extends AbstractConcurrentMapFilterCache implem
|
|||
|
||||
@Inject public ResidentFilterCache(Index index, @IndexSettings Settings indexSettings) {
|
||||
super(index, indexSettings);
|
||||
this.maxSize = componentSettings.getAsInt("max_size", 1000);
|
||||
this.expire = componentSettings.getAsTime("expire", null);
|
||||
this.maxSize = indexSettings.getAsInt("index.cache.filter.max_size", componentSettings.getAsInt("max_size", 1000));
|
||||
this.expire = indexSettings.getAsTime("index.cache.filter.expire", componentSettings.getAsTime("expire", null));
|
||||
logger.debug("using [resident] filter cache with max_size [{}], expire [{}]", maxSize, expire);
|
||||
}
|
||||
|
||||
|
||||
@Override protected ConcurrentMap<Filter, DocSet> buildFilterMap() {
|
||||
MapMaker mapMaker = new MapMaker();
|
||||
if (maxSize != -1) {
|
||||
|
|
|
@ -50,8 +50,9 @@ public class SoftFilterCache extends AbstractConcurrentMapFilterCache implements
|
|||
|
||||
@Inject public SoftFilterCache(Index index, @IndexSettings Settings indexSettings) {
|
||||
super(index, indexSettings);
|
||||
this.maxSize = componentSettings.getAsInt("max_size", -1);
|
||||
this.expire = componentSettings.getAsTime("expire", null);
|
||||
this.maxSize = indexSettings.getAsInt("index.cache.filter.max_size", componentSettings.getAsInt("max_size", -1));
|
||||
this.expire = indexSettings.getAsTime("index.cache.filter.expire", componentSettings.getAsTime("expire", null));
|
||||
logger.debug("using [soft] filter cache with max_size [{}], expire [{}]", maxSize, expire);
|
||||
}
|
||||
|
||||
@Override protected ConcurrentMap<Object, ReaderValue> buildCache() {
|
||||
|
|
|
@ -50,8 +50,9 @@ public class WeakFilterCache extends AbstractConcurrentMapFilterCache implements
|
|||
|
||||
@Inject public WeakFilterCache(Index index, @IndexSettings Settings indexSettings) {
|
||||
super(index, indexSettings);
|
||||
this.maxSize = componentSettings.getAsInt("max_size", -1);
|
||||
this.expire = componentSettings.getAsTime("expire", null);
|
||||
this.maxSize = indexSettings.getAsInt("index.cache.filter.max_size", componentSettings.getAsInt("max_size", -1));
|
||||
this.expire = indexSettings.getAsTime("index.cache.filter.expire", componentSettings.getAsTime("expire", null));
|
||||
logger.debug("using [weak] filter cache with max_size [{}], expire [{}]", maxSize, expire);
|
||||
}
|
||||
|
||||
@Override protected ConcurrentMap<Object, ReaderValue> buildCache() {
|
||||
|
|
Loading…
Reference in New Issue