Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Classes | Public Member Functions | Properties | List of all members
Lucene.Net.Search.FilterManager Class Reference

Filter caching singleton. It can be used to save filters locally for reuse. This class makes it possble to cache Filters even when using RMI, as it keeps the cache on the seaercher side of the RMI connection. More...

Classes

class  FilterCleaner
 Keeps the cache from getting too big. If we were using Java 1.5, we could use LinkedHashMap and we would not need this thread to clean out the cache.
 
class  FilterItem
 Holds the filter and the last time the filter was used, to make LRU-based cache cleaning possible. TODO: Clean this up when we switch to Java 1.5
 

Public Member Functions

virtual void SetCacheSize (int value)
 Sets the max size that cache should reach before it is cleaned up
 
virtual void SetCleanThreadSleepTime (long value)
 Sets the cache cleaning frequency in milliseconds.
 
virtual Filter GetFilter (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.
 

Properties

static FilterManager Instance [get]
 

Detailed Description

Filter caching singleton. It can be used to save filters locally for reuse. This class makes it possble to cache Filters even when using RMI, as it keeps the cache on the seaercher 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.

Definition at line 37 of file FilterManager.cs.

Member Function Documentation

virtual Filter Lucene.Net.Search.FilterManager.GetFilter ( Filter  filter)
virtual

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
filterThe input filter
Returns
The cached version of the filter

Definition at line 105 of file FilterManager.cs.

virtual void Lucene.Net.Search.FilterManager.SetCacheSize ( int  value)
virtual

Sets the max size that cache should reach before it is cleaned up

Parameters
valuemaximum allowed cache size

Definition at line 84 of file FilterManager.cs.

virtual void Lucene.Net.Search.FilterManager.SetCleanThreadSleepTime ( long  value)
virtual

Sets the cache cleaning frequency in milliseconds.

Parameters
valuecleaning frequency in millioseconds

Definition at line 91 of file FilterManager.cs.

Property Documentation

FilterManager Lucene.Net.Search.FilterManager.Instance
staticget

Definition at line 58 of file FilterManager.cs.


The documentation for this class was generated from the following file: