org.hibernate.search.indexes.impl

## Class SharingBufferReaderProvider.PerDirectoryLatestReader

- java.lang.Object
- - 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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `SharingBufferReaderProvider.ReaderUsagePair` | `current` Reference to the most current IndexReader for a DirectoryProvider; guarded by lockOnReplaceCurrent;

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PerDirectoryLatestReader(Directory directory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DirectoryReader` | `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

    - #### PerDirectoryLatestReader

          public PerDirectoryLatestReader(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 DirectoryReader 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-2017 Red Hat, Inc. All Rights Reserved