org.apache.lucene.search
public class FilterManager extends Object
Nested Class Summary | |
---|---|
protected class | FilterManager.FilterCleaner
Keeps the cache from getting too big.
|
protected class | FilterManager.FilterItem
Holds the filter and the last time the filter was used, to make LRU-based
cache cleaning possible.
|
Field Summary | |
---|---|
protected Map | cache The cache itself |
protected int | cacheCleanSize Maximum allowed cache size |
protected long | cleanSleepTime Cache cleaning frequency |
protected static int | DEFAULT_CACHE_CLEAN_SIZE The default maximum number of Filters in the cache |
protected static long | DEFAULT_CACHE_SLEEP_TIME The default frequency of cache clenup |
protected FilterManager.FilterCleaner | filterCleaner Cache cleaner that runs in a separate thread |
protected static FilterManager | manager |
Constructor Summary | |
---|---|
protected | FilterManager()
Sets up the FilterManager singleton. |
Method Summary | |
---|---|
Filter | getFilter(Filter filter)
Returns the cached version of the filter. |
static FilterManager | getInstance() |
void | setCacheSize(int cacheCleanSize)
Sets the max size that cache should reach before it is cleaned up |
void | setCleanThreadSleepTime(long cleanSleepTime)
Sets the cache cleaning frequency in milliseconds. |
Parameters: filter The input filter
Returns: The cached version of the filter
Parameters: cacheCleanSize maximum allowed cache size
Parameters: cleanSleepTime cleaning frequency in millioseconds