|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.DocValues.SourceCache
public abstract static class DocValues.SourceCache
Abstract base class for DocValues
DocValues.Source
cache.
DocValues.Source
instances loaded via DocValues.load()
are entirely memory resident
and need to be maintained by the caller. Each call to
DocValues.load()
will cause an entire reload of
the underlying data. Source instances obtained from
DocValues.getSource()
and DocValues.getSource()
respectively are maintained by a DocValues.SourceCache.DirectSourceCache
that is closed (
close(DocValues)
) once the IndexReader
that created the
DocValues
instance is closed.
Unless DocValues.Source
instances are managed by another entity it is
recommended to use the cached variants to obtain a source instance.
Implementation of this API must be thread-safe.
DocValues.setCache(SourceCache)
,
DocValues.getSource()
Nested Class Summary | |
---|---|
static class |
DocValues.SourceCache.DirectSourceCache
Simple per DocValues instance cache implementation that holds a
DocValues.Source a member variable. |
Constructor Summary | |
---|---|
protected |
DocValues.SourceCache()
Sole constructor. |
Method Summary | |
---|---|
void |
close(DocValues values)
Atomically closes the cache and frees all resources. |
abstract void |
invalidate(DocValues values)
Atomically invalidates the cached DocValues.Source
instances if any and empties the cache. |
abstract DocValues.Source |
load(DocValues values)
Atomically loads a DocValues.Source into the cache from the given
DocValues and returns it iff no other DocValues.Source has already
been cached. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DocValues.SourceCache()
Method Detail |
---|
public abstract DocValues.Source load(DocValues values) throws IOException
DocValues.Source
into the cache from the given
DocValues
and returns it iff no other DocValues.Source
has already
been cached. Otherwise the cached source is returned.
This method will not return null
IOException
public abstract void invalidate(DocValues values)
DocValues.Source
instances if any and empties the cache.
public void close(DocValues values)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |