jruby/docs BETA
Navigation
org.apache.lucene.index 131
C AutomatonTermsEnum
C BaseCompositeReader
C BaseTermsEnum
C BinaryDocValues
C ByteVectorValues
C CheckIndex
C CodecReader
C CompositeReader
C CompositeReaderContext
C ConcurrentMergeScheduler
C CorruptIndexException
C DirectoryReader
C DocIDMerger
C DocValues
E DocValuesSkipIndexType
C DocValuesSkipper
E DocValuesType
C DocsWithFieldSet
C EmptyDocValuesProducer
C ExitableDirectoryReader
C FieldInfo
C FieldInfos
C FieldInvertState
C Fields
C FilterBinaryDocValues
C FilterCodecReader
C FilterDirectoryReader
C FilterLeafReader
C FilterMergePolicy
C FilterNumericDocValues
C FilterSortedDocValues
C FilterSortedNumericDocValues
C FilterSortedSetDocValues
C FilteredTermsEnum
C FloatVectorValues
C FreqAndNormBuffer
C Impacts
C ImpactsEnum
I ImpactsSource
C IndexCommit
C IndexDeletionPolicy
C IndexFileNames
C IndexFormatTooNewException
C IndexFormatTooOldException
C IndexNotFoundException
E IndexOptions
C IndexReader
C IndexReaderContext
I IndexSorter
C IndexUpgrader
C IndexWriter
C IndexWriterConfig
I IndexWriterEventListener
I IndexableField
I IndexableFieldType
C KeepLastNCommitsDeletionPolicy
C KeepOnlyLastCommitDeletionPolicy
C KnnVectorValues
C LeafReader
C LeafReaderContext
C LiveIndexWriterConfig
C LogByteSizeMergePolicy
C LogDocMergePolicy
C LogMergePolicy
C MappedMultiFields
C MergePolicy
C MergeRateLimiter
C MergeScheduler
C MergeState
E MergeTrigger
C MultiBits
C MultiDocValues
C MultiFields
C MultiLeafReader
C MultiPostingsEnum
C MultiReader
C MultiTerms
C MultiTermsEnum
C NoDeletionPolicy
C NoMergePolicy
C NoMergeScheduler
C NumericDocValues
C OneMergeWrappingMergePolicy
C OrdTermState
C OrdinalMap
C ParallelCompositeReader
C ParallelLeafReader
C PersistentSnapshotDeletionPolicy
C PointValues
C PostingsEnum
C PrefixCodedTerms
I QueryTimeout
C QueryTimeoutImpl
C ReaderManager
C ReaderUtil
C SegmentCommitInfo
C SegmentInfo
C SegmentInfos
C SegmentOrder
C SegmentReadState
C SegmentReader
C SegmentWriteState
C SerialMergeScheduler
C SimpleMergedSegmentWarmer
C SingleTermsEnum
C SlowCodecReaderWrapper
C SlowImpactsEnum
C SnapshotDeletionPolicy
C SoftDeletesDirectoryReaderWrapper
C SoftDeletesRetentionMergePolicy
C SortFieldProvider
C SortedDocValues
C SortedNumericDocValues
C SortedSetDocValues
C Sorter
C SortingCodecReader
C StandardDirectoryReader
C StoredFieldVisitor
C StoredFields
C Term
C TermState
C TermStates
C TermVectors
C Terms
C TermsEnum
C TieredMergePolicy
I TwoPhaseCommit
C TwoPhaseCommitTool
C UpgradeIndexMergePolicy
E VectorEncoding
E VectorSimilarityFunction
ReaderManager — members 4+
C new(writer)
C new(writer, apply_all_deletes, write_all_deletes)
C new(dir)
C new(reader)
from ReferenceManager
M acquire() G
C add_listener(listener)
C close()
M maybe_refresh() boolean
C maybe_refresh_blocking()
C release(reference)
C remove_listener(listener)

org.apache.lucene.index.ReaderManager

class final extends ReferenceManager<DirectoryReader> 4 members

Utility class to safely share DirectoryReader instances across multiple threads, while periodically reopening. This class ensures each reader is closed only once all threads have finished using it.

Constructors

new

new ( IndexWriter writer )
Java: <init>(org.apache.lucene.index.IndexWriter writer)

Creates and returns a new ReaderManager from the given IndexWriter.

nametypedescription
writerorg.apache.lucene.index.IndexWriterthe IndexWriter to open the IndexReader from.

Throws

IOException If there is a low-level I/O error

new

new ( IndexWriter writer, boolean apply_all_deletes, boolean write_all_deletes )
Java: <init>(org.apache.lucene.index.IndexWriter writer, boolean applyAllDeletes, boolean writeAllDeletes)

Expert: creates and returns a new ReaderManager from the given IndexWriter, controlling whether past deletions should be applied.

nametypedescription
writerorg.apache.lucene.index.IndexWriterthe IndexWriter to open the IndexReader from.
apply_all_deletesbooleanIf true, all buffered deletes will be applied (made visible) in the IndexSearcher / DirectoryReader. If false, the deletes may or may not be applied, but remain buffered (in IndexWriter) so that they will be applied in the future. Applying deletes can be costly, so if your app can tolerate deleted documents being returned you might gain some performance by passing false . See DirectoryReader#openIfChanged(DirectoryReader, IndexWriter, boolean).
write_all_deletesbooleanIf true, new deletes will be forcefully written to index files.

Throws

IOException If there is a low-level I/O error

new

new ( Directory dir )
Java: <init>(org.apache.lucene.store.Directory dir)

Creates and returns a new ReaderManager from the given Directory.

nametypedescription
dirorg.apache.lucene.store.Directorythe directory to open the DirectoryReader on.

Throws

IOException If there is a low-level I/O error

new

new ( DirectoryReader reader )
Java: <init>(org.apache.lucene.index.DirectoryReader reader)

Creates and returns a new ReaderManager from the given already-opened DirectoryReader, stealing the incoming reference.

nametypedescription
readerorg.apache.lucene.index.DirectoryReaderthe directoryReader to use for future reopens

Throws

IOException If there is a low-level I/O error

Inherited

from ReferenceManager

acquire

G acquire ( )
Java: acquire()

Obtain the current reference. You must match every call to acquire with one call to #release; it's best to do so in a finally clause, and set the reference to null to prevent accidental usage after it has been released.

Throws

AlreadyClosedException if the reference manager has been closed.

add_listener

add_listener ( ReferenceManager.RefreshListener listener )
Java: addListener(org.apache.lucene.search.ReferenceManager.RefreshListener listener)

Adds a listener, to be notified when a reference is refreshed/swapped.

close

close ( )
Java: close()

Closes this ReferenceManager to prevent future acquiring. A reference manager should be closed if the reference to the managed resource should be disposed or the application using the ReferenceManager is shutting down. The managed resource might not be released immediately, if the ReferenceManager user is holding on to a previously acquired reference. The resource will be released once when the last reference is released. Those references can still be used as if the manager was still active.

Applications should not acquire new references from this manager once this method has been called. Acquiring a resource on a closed ReferenceManager will throw an AlreadyClosedException.

Throws

IOException if the underlying reader of the current reference could not be closed

maybe_refresh

boolean maybe_refresh ( )
Java: maybeRefresh()

You must call this (or #maybeRefreshBlocking()), periodically, if you want that #acquire() will return refreshed instances.

Threads: it's fine for more than one thread to call this at once. Only the first thread will attempt the refresh; subsequent threads will see that another thread is already handling refresh and will return immediately. Note that this means if another thread is already refreshing then subsequent threads will return right away without waiting for the refresh to complete.

If this method returns true it means the calling thread either refreshed or that there were no changes to refresh. If it returns false it means another thread is currently refreshing.

Throws

IOException if refreshing the resource causes an IOException
AlreadyClosedException if the reference manager has been closed.

maybe_refresh_blocking

maybe_refresh_blocking ( )
Java: maybeRefreshBlocking()

You must call this (or #maybeRefresh()), periodically, if you want that #acquire() will return refreshed instances.

Threads: unlike #maybeRefresh(), if another thread is currently refreshing, this method blocks until that thread completes. It is useful if you want to guarantee that the next call to #acquire() will return a refreshed instance. Otherwise, consider using the non-blocking #maybeRefresh().

Throws

IOException if refreshing the resource causes an IOException
AlreadyClosedException if the reference manager has been closed.

release

release ( G reference )
Java: release(G reference)

Release the reference previously obtained via #acquire().

NOTE: it's safe to call this after #close().

Throws

IOException if the release operation on the given resource throws an IOException

remove_listener

remove_listener ( ReferenceManager.RefreshListener listener )
Java: removeListener(org.apache.lucene.search.ReferenceManager.RefreshListener listener)

Remove a listener added with #addListener(RefreshListener).

this work for additional information regarding copyright ownership.