public class ExitableDirectoryReader extends FilterDirectoryReader
ExitableDirectoryReader
wraps a real index DirectoryReader
and
allows for a QueryTimeout
implementation object to be checked periodically
to see if the thread should exit or not. If QueryTimeout.shouldExit()
returns true, an ExitableDirectoryReader.ExitingReaderException
is thrown.TimeLimitingCollector
Modifier and Type | Class and Description |
---|---|
static class |
ExitableDirectoryReader.ExitableFilterAtomicReader
Wrapper class for another FilterAtomicReader.
|
static class |
ExitableDirectoryReader.ExitableSubReaderWrapper
Wrapper class for a SubReaderWrapper that is used by the ExitableDirectoryReader.
|
static class |
ExitableDirectoryReader.ExitableTerms
Wrapper class for another Terms implementation that is used by ExitableFields.
|
static class |
ExitableDirectoryReader.ExitableTermsEnum
Wrapper class for TermsEnum that is used by ExitableTerms for implementing an
exitable enumeration of terms.
|
static class |
ExitableDirectoryReader.ExitingReaderException
Exception that is thrown to prematurely terminate a term enumeration.
|
FilterDirectoryReader.SubReaderWrapper
IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener
in
directory
subReadersSorter
Constructor and Description |
---|
ExitableDirectoryReader(DirectoryReader in,
QueryTimeout queryTimeout)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected DirectoryReader |
doWrapDirectoryReader(DirectoryReader in)
Called by the doOpenIfChanged() methods to return a new wrapped DirectoryReader.
|
IndexReader.CacheHelper |
getReaderCacheHelper()
Optional method: Return a
IndexReader.CacheHelper that can be used to cache
based on the content of this reader. |
String |
toString() |
static DirectoryReader |
wrap(DirectoryReader in,
QueryTimeout queryTimeout)
Wraps a provided DirectoryReader.
|
doClose, doOpenIfChanged, doOpenIfChanged, doOpenIfChanged, getDelegate, getIndexCommit, getVersion, isCurrent, unwrap
directory, indexExists, listCommits, open, open, open, open, open, openIfChanged, openIfChanged, openIfChanged, openIfChanged
docFreq, document, getDocCount, getSequentialSubReaders, getSumDocFreq, getSumTotalTermFreq, getTermVectors, maxDoc, numDocs, readerBase, readerIndex, totalTermFreq
getContext
close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, tryIncRef
public ExitableDirectoryReader(DirectoryReader in, QueryTimeout queryTimeout) throws IOException
in
- DirectoryReader that this ExitableDirectoryReader wraps around to make it Exitable.queryTimeout
- The object to periodically check if the query should time out.IOException
protected DirectoryReader doWrapDirectoryReader(DirectoryReader in) throws IOException
FilterDirectoryReader
doWrapDirectoryReader
in class FilterDirectoryReader
in
- the DirectoryReader to wrapIOException
public static DirectoryReader wrap(DirectoryReader in, QueryTimeout queryTimeout) throws IOException
DirectoryReader.openIfChanged(DirectoryReader)
)
and so on.IOException
public IndexReader.CacheHelper getReaderCacheHelper()
IndexReader
IndexReader.CacheHelper
that can be used to cache
based on the content of this reader. Two readers that have different data
or different sets of deleted documents will be considered different.
A return value of null
indicates that this reader is not suited
for caching, which is typically the case for short-lived wrappers that
alter the content of the wrapped reader.
getReaderCacheHelper
in class IndexReader
public String toString()
toString
in class CompositeReader
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.