This commit is contained in:
kimchy 2010-02-18 13:56:14 +02:00
parent 23cfdeea11
commit 72599ad003
3 changed files with 7 additions and 3 deletions

View File

@ -21,6 +21,8 @@ package org.elasticsearch.index.cache.filter.soft;
import com.google.common.collect.MapMaker;
import com.google.inject.Inject;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.Filter;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.cache.filter.support.AbstractConcurrentMapFilterCache;
import org.elasticsearch.index.settings.IndexSettings;
@ -38,7 +40,7 @@ public class SoftFilterCache extends AbstractConcurrentMapFilterCache {
super(index, indexSettings, threadPool);
}
@Override protected ConcurrentMap buildMap() {
@Override protected ConcurrentMap<Filter, DocIdSet> buildMap() {
return new MapMaker().softValues().makeMap();
}
}

View File

@ -80,7 +80,7 @@ public abstract class AbstractConcurrentMapFilterCache extends AbstractIndexComp
}
}
protected abstract ConcurrentMap buildMap();
protected abstract ConcurrentMap<Filter, DocIdSet> buildMap();
private class SoftFilterCacheFilterWrapper extends Filter {

View File

@ -21,6 +21,8 @@ package org.elasticsearch.index.cache.filter.weak;
import com.google.common.collect.MapMaker;
import com.google.inject.Inject;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.Filter;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.cache.filter.support.AbstractConcurrentMapFilterCache;
import org.elasticsearch.index.settings.IndexSettings;
@ -38,7 +40,7 @@ public class WeakFilterCache extends AbstractConcurrentMapFilterCache {
super(index, indexSettings, threadPool);
}
@Override protected ConcurrentMap buildMap() {
@Override protected ConcurrentMap<Filter, DocIdSet> buildMap() {
return new MapMaker().weakValues().makeMap();
}
}