org.apache.lucene.search
public class FilterManager extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
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.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.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 cleanup
|
protected FilterManager.FilterCleaner |
filterCleaner
Cache cleaner that runs in a separate thread
|
protected static FilterManager |
manager |
Modifier | Constructor and Description |
---|---|
protected |
FilterManager()
Sets up the FilterManager singleton.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected static FilterManager manager
protected static final int DEFAULT_CACHE_CLEAN_SIZE
protected static final long DEFAULT_CACHE_SLEEP_TIME
protected java.util.Map cache
protected int cacheCleanSize
protected long cleanSleepTime
protected FilterManager.FilterCleaner filterCleaner
public static FilterManager getInstance()
public void setCacheSize(int cacheCleanSize)
cacheCleanSize
- maximum allowed cache sizepublic void setCleanThreadSleepTime(long cleanSleepTime)
cleanSleepTime
- cleaning frequency in millisecondspublic Filter getFilter(Filter filter)
filter
- The input filterCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.