org.hibernate.search.indexes.impl
Class SharingBufferReaderProvider.PerDirectoryLatestReader

java.lang.Object
  extended by org.hibernate.search.indexes.impl.SharingBufferReaderProvider.PerDirectoryLatestReader
Enclosing class:
SharingBufferReaderProvider

protected final class SharingBufferReaderProvider.PerDirectoryLatestReader
extends Object

An instance for each DirectoryProvider, establishing the association between "current" ReaderUsagePair for a DirectoryProvider and it's lock.


Field Summary
 SharingBufferReaderProvider.ReaderUsagePair current
          Reference to the most current IndexReader for a DirectoryProvider; guarded by lockOnReplaceCurrent;
 
Constructor Summary
SharingBufferReaderProvider.PerDirectoryLatestReader(org.apache.lucene.store.Directory directory)
           
 
Method Summary
 org.apache.lucene.index.IndexReader refreshAndGet()
          Gets an updated IndexReader for the current Directory; the index status will be checked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

public SharingBufferReaderProvider.ReaderUsagePair current
Reference to the most current IndexReader for a DirectoryProvider; guarded by lockOnReplaceCurrent;

Constructor Detail

SharingBufferReaderProvider.PerDirectoryLatestReader

public SharingBufferReaderProvider.PerDirectoryLatestReader(org.apache.lucene.store.Directory directory)
                                                     throws IOException
Parameters:
directory - The Directory for which we manage the IndexReader.
Throws:
IOException - when the index initialization fails.
Method Detail

refreshAndGet

public org.apache.lucene.index.IndexReader refreshAndGet()
Gets an updated IndexReader for the current Directory; the index status will be checked.

Returns:
the current IndexReader if it's in sync with underlying index, a new one otherwise.


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved