Module org.apache.lucene.codecs
Class STBlockReader
java.lang.Object
org.apache.lucene.index.TermsEnum
org.apache.lucene.index.BaseTermsEnum
org.apache.lucene.codecs.uniformsplit.BlockReader
org.apache.lucene.codecs.uniformsplit.sharedterms.STBlockReader
- All Implemented Interfaces:
Accountable,BytesRefIterator
- Direct Known Subclasses:
STMergingBlockReader
Reads terms blocks with the Shared Terms format.
- See Also:
-
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.codecs.uniformsplit.BlockReader
blockDecoder, blockFirstLineStart, blockHeader, blockHeaderReader, blockInput, blockLine, blockLineReader, blockReadBuffer, blockStartFP, dictionaryBrowser, dictionaryBrowserSupplier, fieldMetadata, forcedTerm, lineIndexInBlock, postingsReader, scratchBlockBytes, scratchBlockLine, scratchTermState, termState, termStateForced, termStateSerializer, termStatesReadBufferFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsConstructorDescriptionSTBlockReader(IndexDictionary.BrowserSupplier dictionaryBrowserSupplier, IndexInput blockInput, PostingsReaderBase postingsReader, FieldMetadata fieldMetadata, BlockDecoder blockDecoder, FieldInfos fieldInfos) -
Method Summary
Modifier and TypeMethodDescriptionprotected STBlockLine.Serializerprotected booleanisBeyondLastTerm(BytesRef searchedTerm, long blockStartFP) Indicates whether the searched term is beyond the last term of the field.next()Increments the iteration to the nextBytesRefin the iterator.protected BytesRefnextTerm()Moves to the next term line and reads it, whichever are the corresponding fields.protected BlockTermStateReads theBlockTermStateon the current line for this reader's field.Seeks to the specified term, if it exists, or to the next (ceiling) term.(package private) TermsEnum.SeekStatusseekCeilIgnoreField(BytesRef searchedTerm) booleanAttempts to seek to the exact term, returning true if the term is found.private booleanMethods inherited from class org.apache.lucene.codecs.uniformsplit.BlockReader
clearTermState, compareToMiddleAndJump, createBlockHeaderSerializer, createDeltaBaseTermStateSerializer, decodeBlockBytesIfNeeded, docFreq, getOrCreateDictionaryBrowser, impacts, initializeBlockReadLazily, initializeHeader, isCurrentTerm, newCorruptIndexException, ord, postings, ramBytesUsed, readHeader, readLineInBlock, readTermStateIfNotRead, seekExact, seekExact, seekInBlock, seekInBlock, term, termState, totalTermFreqMethods inherited from class org.apache.lucene.index.BaseTermsEnum
attributesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
fieldInfos
-
-
Constructor Details
-
STBlockReader
public STBlockReader(IndexDictionary.BrowserSupplier dictionaryBrowserSupplier, IndexInput blockInput, PostingsReaderBase postingsReader, FieldMetadata fieldMetadata, BlockDecoder blockDecoder, FieldInfos fieldInfos) throws IOException - Throws:
IOException
-
-
Method Details
-
next
Description copied from interface:BytesRefIteratorIncrements the iteration to the nextBytesRefin the iterator. Returns the resultingBytesRefornullif 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:
nextin interfaceBytesRefIterator- Overrides:
nextin classBlockReader- Returns:
- the next
BytesRefin the iterator ornullif the end of the iterator is reached. - Throws:
IOException- If there is a low-level I/O error.
-
termOccursInField
- Throws:
IOException
-
nextTerm
Moves to the next term line and reads it, whichever are the corresponding fields. The term details are not read yet. They will be read only when needed withBlockReader.readTermStateIfNotRead().- Overrides:
nextTermin classBlockReader- Returns:
- The read term bytes.
- Throws:
IOException
-
seekCeil
Description copied from class:TermsEnumSeeks to the specified term, if it exists, or to the next (ceiling) term. Returns SeekStatus to indicate whether exact term was found, a different term was found, or EOF was hit. The target term may be before or after the current term. If this returns SeekStatus.END, the enum is unpositioned.- Overrides:
seekCeilin classBlockReader- Throws:
IOException
-
seekCeilIgnoreField
- Throws:
IOException
-
seekExact
Description copied from class:TermsEnumAttempts to seek to the exact term, returning true if the term is found. If this returns false, the enum is unpositioned. For some codecs, seekExact may be substantially faster thanTermsEnum.seekCeil(org.apache.lucene.util.BytesRef).- Overrides:
seekExactin classBlockReader- Returns:
- true if the term is found; return false if the enum is unpositioned.
- Throws:
IOException
-
isBeyondLastTerm
Description copied from class:BlockReaderIndicates whether the searched term is beyond the last term of the field.- Overrides:
isBeyondLastTermin classBlockReader- Parameters:
blockStartFP- The current block start file pointer.
-
createBlockLineSerializer
- Overrides:
createBlockLineSerializerin classBlockReader
-
readTermState
Reads theBlockTermStateon the current line for this reader's field.- Overrides:
readTermStatein classBlockReader- Returns:
- The
BlockTermState; or null if the term does not occur for the field. - Throws:
IOException
-