Package org.apache.lucene.index
Class ExitableDirectoryReader.ExitableTermsEnum
java.lang.Object
org.apache.lucene.index.TermsEnum
org.apache.lucene.index.FilterLeafReader.FilterTermsEnum
org.apache.lucene.index.ExitableDirectoryReader.ExitableTermsEnum
- All Implemented Interfaces:
BytesRefIterator
- Enclosing class:
- ExitableDirectoryReader
public static class ExitableDirectoryReader.ExitableTermsEnum
extends FilterLeafReader.FilterTermsEnum
Wrapper class for TermsEnum that is used by ExitableTerms for implementing an exitable
enumeration of terms.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.TermsEnum
TermsEnum.SeekStatus
-
Field Summary
FieldsFields inherited from class org.apache.lucene.index.FilterLeafReader.FilterTermsEnum
in
-
Constructor Summary
ConstructorsConstructorDescriptionExitableTermsEnum
(TermsEnum termsEnum, QueryTimeout queryTimeout) Constructor * -
Method Summary
Modifier and TypeMethodDescriptionprivate void
ThrowsExitableDirectoryReader.ExitingReaderException
ifQueryTimeout.shouldExit()
returns true, or ifThread.interrupted()
returns true.next()
Increments the iteration to the nextBytesRef
in the iterator.Methods inherited from class org.apache.lucene.index.FilterLeafReader.FilterTermsEnum
attributes, docFreq, impacts, ord, postings, seekCeil, seekExact, seekExact, seekExact, term, termState, totalTermFreq
-
Field Details
-
NUM_CALLS_PER_TIMEOUT_CHECK
private static final int NUM_CALLS_PER_TIMEOUT_CHECK- See Also:
-
calls
private int calls -
queryTimeout
-
-
Constructor Details
-
ExitableTermsEnum
Constructor *
-
-
Method Details
-
checkTimeoutWithSampling
private void checkTimeoutWithSampling()ThrowsExitableDirectoryReader.ExitingReaderException
ifQueryTimeout.shouldExit()
returns true, or ifThread.interrupted()
returns true. -
next
Description copied from interface:BytesRefIterator
Increments the iteration to the nextBytesRef
in the iterator. Returns the resultingBytesRef
ornull
if the end of the iterator is reached. The returned BytesRef may be re-used across calls to next. After this method returns null, do not call it again: the results are undefined.- Specified by:
next
in interfaceBytesRefIterator
- Overrides:
next
in classFilterLeafReader.FilterTermsEnum
- Returns:
- the next
BytesRef
in the iterator ornull
if the end of the iterator is reached. - Throws:
IOException
- If there is a low-level I/O error.
-