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.
  • Field Details

    • reader

      public final IndexReader reader
    • usageCounter

      protected final 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)
  • Method Details

    • 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