Class NotSharedIndexReaderProvider
java.lang.Object
org.hibernate.search.backend.lucene.lowlevel.reader.impl.NotSharedIndexReaderProvider
- All Implemented Interfaces:
IndexReaderProvider
A simplistic index reader holder that opens a new index reader
from the directory every time an index reader is requested.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Closes and drops any cached resources (index readers in particular).org.apache.lucene.index.DirectoryReaderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.backend.lucene.lowlevel.reader.impl.IndexReaderProvider
getCurrentForTests
-
Constructor Details
-
NotSharedIndexReaderProvider
-
-
Method Details
-
clear
public void clear()Description copied from interface:IndexReaderProviderCloses and drops any cached resources (index readers in particular).Should be used when stopping the index, to clean up upon error, or simply to force the creation of a new reader (refresh) on the next call to
IndexReaderProvider.getOrCreate().- Specified by:
clearin interfaceIndexReaderProvider
-
getOrCreate
- Specified by:
getOrCreatein interfaceIndexReaderProvider- Returns:
- A ready-to-use index reader, with its reference count already increased.
Callers are responsible for calling
IndexReader.decRef()when they are done with the index reader. Callers must not callIndexReader.close(), as the index reader may be shared. - Throws:
IOException
-