org.hibernate.search.reader
Class SharingBufferReaderProvider.ReaderUsagePair
java.lang.Object
org.hibernate.search.reader.SharingBufferReaderProvider.ReaderUsagePair
- Enclosing class:
- SharingBufferReaderProvider
protected final class SharingBufferReaderProvider.ReaderUsagePair
- extends Object
Container for the couple IndexReader,UsageCounter.
Method Summary |
void |
close()
Closes the IndexReader if no other resource is using it
in which case the reference to this container will also be removed. |
String |
toString()
|
reader
public final org.apache.lucene.index.IndexReader reader
usageCounter
protected final java.util.concurrent.atomic.AtomicInteger usageCounter
- When reaching 0 (always test on change) the reader should be really
closed and then discarded.
Starts at 2 because:
first usage token is artificial: means "current" is not to be closed (+1)
additionally when creating it will be used (+1)
close
public void close()
- Closes the
IndexReader
if no other resource is using it
in which case the reference to this container will also be removed.
toString
public String toString()
- Overrides:
toString
in class Object