Filter caching singleton. It can be used to save filters locally for reuse. 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.
More...
#include <FilterManager.h>
Filter caching singleton. It can be used to save filters locally for reuse. 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.
◆ FilterManager()
Lucene::FilterManager::FilterManager |
( |
| ) |
|
◆ ~FilterManager()
virtual Lucene::FilterManager::~FilterManager |
( |
| ) |
|
|
virtual |
◆ _getClassName()
static String Lucene::FilterManager::_getClassName |
( |
| ) |
|
|
inlinestatic |
◆ getClassName()
virtual String Lucene::FilterManager::getClassName |
( |
| ) |
|
|
inlinevirtual |
◆ getFilter()
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
-
- Returns
- The cached version of the filter
◆ getInstance()
◆ initialize()
virtual void Lucene::FilterManager::initialize |
( |
| ) |
|
|
virtual |
Called directly after instantiation to create objects that depend on this object being fully constructed.
Reimplemented from Lucene::LuceneObject.
◆ setCacheSize()
void Lucene::FilterManager::setCacheSize |
( |
int32_t |
cacheCleanSize | ) |
|
Sets the max size that cache should reach before it is cleaned up.
- Parameters
-
cacheCleanSize | maximum allowed cache size |
◆ setCleanThreadSleepTime()
void Lucene::FilterManager::setCleanThreadSleepTime |
( |
int64_t |
cleanSleepTime | ) |
|
Sets the cache cleaning frequency in milliseconds.
- Parameters
-
cleanSleepTime | cleaning frequency in milliseconds |
◆ shared_from_this()
boost::shared_ptr< FilterManager > Lucene::FilterManager::shared_from_this |
( |
| ) |
|
|
inline |
◆ cache
MapIntFilterItem Lucene::FilterManager::cache |
|
protected |
◆ cacheCleanSize
int32_t Lucene::FilterManager::cacheCleanSize |
|
protected |
Maximum allowed cache size.
◆ cleanSleepTime
int64_t Lucene::FilterManager::cleanSleepTime |
|
protected |
Cache cleaning frequency.
◆ DEFAULT_CACHE_CLEAN_SIZE
const int32_t Lucene::FilterManager::DEFAULT_CACHE_CLEAN_SIZE |
|
staticprotected |
The default maximum number of Filters in the cache.
◆ DEFAULT_CACHE_SLEEP_TIME
const int64_t Lucene::FilterManager::DEFAULT_CACHE_SLEEP_TIME |
|
staticprotected |
The default frequency of cache cleanup.
◆ filterCleaner
Cache cleaner that runs in a separate thread.
The documentation for this class was generated from the following file: