Module org.apache.lucene.core
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
Fields Modifier and Type Field Description private int
calls
private static int
NUM_CALLS_PER_TIMEOUT_CHECK
private QueryTimeout
queryTimeout
-
Fields inherited from class org.apache.lucene.index.FilterLeafReader.FilterTermsEnum
in
-
-
Constructor Summary
Constructors Constructor Description ExitableTermsEnum(TermsEnum termsEnum, QueryTimeout queryTimeout)
Constructor *
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkTimeoutWithSampling()
ThrowsExitableDirectoryReader.ExitingReaderException
ifQueryTimeout.shouldExit()
returns true, or ifThread.interrupted()
returns true.BytesRef
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 Detail
-
NUM_CALLS_PER_TIMEOUT_CHECK
private static final int NUM_CALLS_PER_TIMEOUT_CHECK
- See Also:
- Constant Field Values
-
calls
private int calls
-
queryTimeout
private final QueryTimeout queryTimeout
-
-
Constructor Detail
-
ExitableTermsEnum
public ExitableTermsEnum(TermsEnum termsEnum, QueryTimeout queryTimeout)
Constructor *
-
-
Method Detail
-
checkTimeoutWithSampling
private void checkTimeoutWithSampling()
ThrowsExitableDirectoryReader.ExitingReaderException
ifQueryTimeout.shouldExit()
returns true, or ifThread.interrupted()
returns true.
-
next
public BytesRef next() throws java.io.IOException
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:
java.io.IOException
- If there is a low-level I/O error.
-
-