Package org.apache.lucene.search
Class FilterManager
- java.lang.Object
-
- org.apache.lucene.search.FilterManager
-
@Deprecated public class FilterManager extends Object
Deprecated.used by remote package which is deprecated as well. You should useCachingWrapperFilter
if you wish to cacheFilter
s.Filter caching singleton. It can be used to save filters locally for reuse. This class makes it possible to cache Filters even when using RMI, as it keeps the cache on the searcher side of the RMI connection. Also could be used as a persistent storage for any filter as long as the filter provides a proper hashCode(), as that is used as the key in the cache. The cache is periodically cleaned up from a separate thread to ensure the cache doesn't exceed the maximum size.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FilterManager.FilterCleaner
Deprecated.Keeps the cache from getting too big.protected class
FilterManager.FilterItem
Deprecated.Holds the filter and the last time the filter was used, to make LRU-based cache cleaning possible.
-
Field Summary
Fields Modifier and Type Field Description protected Map<Integer,FilterManager.FilterItem>
cache
Deprecated.The cache itselfprotected int
cacheCleanSize
Deprecated.Maximum allowed cache sizeprotected long
cleanSleepTime
Deprecated.Cache cleaning frequencyprotected static int
DEFAULT_CACHE_CLEAN_SIZE
Deprecated.The default maximum number of Filters in the cacheprotected static long
DEFAULT_CACHE_SLEEP_TIME
Deprecated.The default frequency of cache cleanupprotected FilterManager.FilterCleaner
filterCleaner
Deprecated.Cache cleaner that runs in a separate threadprotected static FilterManager
manager
Deprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protected
FilterManager()
Deprecated.Sets up the FilterManager singleton.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Filter
getFilter(Filter filter)
Deprecated.Returns the cached version of the filter.static FilterManager
getInstance()
Deprecated.void
setCacheSize(int cacheCleanSize)
Deprecated.Sets the max size that cache should reach before it is cleaned upvoid
setCleanThreadSleepTime(long cleanSleepTime)
Deprecated.Sets the cache cleaning frequency in milliseconds.
-
-
-
Field Detail
-
manager
protected static FilterManager manager
Deprecated.
-
DEFAULT_CACHE_CLEAN_SIZE
protected static final int DEFAULT_CACHE_CLEAN_SIZE
Deprecated.The default maximum number of Filters in the cache- See Also:
- Constant Field Values
-
DEFAULT_CACHE_SLEEP_TIME
protected static final long DEFAULT_CACHE_SLEEP_TIME
Deprecated.The default frequency of cache cleanup- See Also:
- Constant Field Values
-
cache
protected Map<Integer,FilterManager.FilterItem> cache
Deprecated.The cache itself
-
cacheCleanSize
protected int cacheCleanSize
Deprecated.Maximum allowed cache size
-
cleanSleepTime
protected long cleanSleepTime
Deprecated.Cache cleaning frequency
-
filterCleaner
protected FilterManager.FilterCleaner filterCleaner
Deprecated.Cache cleaner that runs in a separate thread
-
-
Method Detail
-
getInstance
public static FilterManager getInstance()
Deprecated.
-
setCacheSize
public void setCacheSize(int cacheCleanSize)
Deprecated.Sets the max size that cache should reach before it is cleaned up- Parameters:
cacheCleanSize
- maximum allowed cache size
-
setCleanThreadSleepTime
public void setCleanThreadSleepTime(long cleanSleepTime)
Deprecated.Sets the cache cleaning frequency in milliseconds.- Parameters:
cleanSleepTime
- cleaning frequency in milliseconds
-
getFilter
public Filter getFilter(Filter filter)
Deprecated.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.- Parameters:
filter
- The input filter- Returns:
- The cached version of the filter
-
-