Methods Summary |
---|
public org.apache.lucene.search.Filter | getFilter(org.apache.lucene.search.Filter filter)Returns the cached version of the filter. Allows the caller to pass up
a small filter but this will keep a persistent version around and allow
the caching filter to do its job.
synchronized(cache) {
FilterItem fi = null;
fi = (FilterItem)cache.get(new Integer(filter.hashCode()));
if (fi != null) {
fi.timestamp = new Date().getTime();
return fi.filter;
}
cache.put(new Integer(filter.hashCode()), new FilterItem(filter));
return filter;
}
|
public static synchronized org.apache.lucene.search.FilterManager | getInstance()
if (manager == null) {
manager = new FilterManager();
}
return manager;
|
public void | setCacheSize(int cacheCleanSize)Sets the max size that cache should reach before it is cleaned up
this.cacheCleanSize = cacheCleanSize;
|
public void | setCleanThreadSleepTime(long cleanSleepTime)Sets the cache cleaning frequency in milliseconds.
this.cleanSleepTime = cleanSleepTime;
|