|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.search.Filter
net.conquiris.lucene.search.GuavaCachingFilter
public final class GuavaCachingFilter
A wrapping filter based on Guava Cache. Uses a caching mode equivalent to Lucene's
DeletesMode.RECACHE.
| Method Summary | ||
|---|---|---|
static
|
cachingFactory(CacheLoader<K,V> loader,
int primarySize,
long primaryDuration,
TimeUnit primaryUnit,
int secondarySize,
long secondaryDuration,
TimeUnit secondaryUnit)
Caching factory method. |
|
boolean |
equals(Object o)
|
|
DocIdSet |
getDocIdSet(IndexReader reader)
|
|
int |
hashCode()
|
|
static GuavaCachingFilter |
of(Filter filter)
Factory method with a maximum size of 100 elements and a expiration time of 10 minutes. |
|
static GuavaCachingFilter |
of(Filter filter,
int size,
long duration,
TimeUnit unit)
Factory method. |
|
CacheStats |
stats()
Returns a current snapshot of this cache's cumulative statistics. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static <K,V extends Filter> LoadingCache<K,Filter> cachingFactory(CacheLoader<K,V> loader,
int primarySize,
long primaryDuration,
TimeUnit primaryUnit,
int secondarySize,
long secondaryDuration,
TimeUnit secondaryUnit)
loader - Filter loader. Its result will be wrapped in a caching filter.primarySize - the maximum size of the primary cache.primaryDuration - the length of time after an entry is last accessed that it should be
automatically removed from the primary cache.primaryUnit - the unit that primaryDuration is expressed insecondarySize - the maximum size of the secondary cache.secondaryDuration - the length of time after an entry is last accessed that it should be
automatically removed from the secondary cache.secondaryUnit - the unit that secondaryDuration is expressed in
IllegalArgumentException - if any of the sizes is negative
IllegalArgumentException - if any of the durations is negative
public static GuavaCachingFilter of(Filter filter,
int size,
long duration,
TimeUnit unit)
filter - Filter to cache results of.size - the maximum size of the cache.duration - the length of time after an entry is last accessed that it should be
automatically removed.unit - the unit that duration is expressed in
IllegalArgumentException - if size is negative
IllegalArgumentException - if duration is negativepublic static GuavaCachingFilter of(Filter filter)
filter - Filter to cache results of
public DocIdSet getDocIdSet(IndexReader reader)
throws IOException
getDocIdSet in class FilterIOExceptionpublic CacheStats stats()
public String toString()
toString in class Objectpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||