org.apache.lucene.index
Class DocValues.SourceCache.DirectSourceCache

java.lang.Object
  extended by org.apache.lucene.index.DocValues.SourceCache
      extended by org.apache.lucene.index.DocValues.SourceCache.DirectSourceCache
Enclosing class:
DocValues.SourceCache

public static final class DocValues.SourceCache.DirectSourceCache
extends DocValues.SourceCache

Simple per DocValues instance cache implementation that holds a DocValues.Source a member variable.

If a DocValues.SourceCache.DirectSourceCache instance is closed or invalidated the cached reference are simply set to null


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.index.DocValues.SourceCache
DocValues.SourceCache.DirectSourceCache
 
Constructor Summary
DocValues.SourceCache.DirectSourceCache()
          Sole constructor.
 
Method Summary
 void invalidate(DocValues values)
          Atomically invalidates the cached DocValues.Source instances if any and empties the cache.
 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 org.apache.lucene.index.DocValues.SourceCache
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocValues.SourceCache.DirectSourceCache

public DocValues.SourceCache.DirectSourceCache()
Sole constructor.

Method Detail

load

public DocValues.Source load(DocValues values)
                      throws IOException
Description copied from class: DocValues.SourceCache
Atomically loads a 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

Specified by:
load in class DocValues.SourceCache
Throws:
IOException

invalidate

public void invalidate(DocValues values)
Description copied from class: DocValues.SourceCache
Atomically invalidates the cached DocValues.Source instances if any and empties the cache.

Specified by:
invalidate in class DocValues.SourceCache


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.