Class UniformSplitTermsReader
java.lang.Object
org.apache.lucene.index.Fields
org.apache.lucene.codecs.FieldsProducer
org.apache.lucene.codecs.uniformsplit.UniformSplitTermsReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<String>
- Direct Known Subclasses:
STUniformSplitTermsReader
A block-based terms index and dictionary based on the Uniform Split technique.
- See Also:
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final IndexInput
protected final IndexInput
protected final Map<String,
UniformSplitTerms> protected final PostingsReaderBase
protected final Collection<String>
protected final int
Fields inherited from class org.apache.lucene.index.Fields
EMPTY_ARRAY
-
Constructor Summary
ModifierConstructorDescriptionUniformSplitTermsReader
(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder, boolean dictionaryOnHeap) protected
UniformSplitTermsReader
(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder, boolean dictionaryOnHeap, FieldMetadata.Serializer fieldMetadataReader, String codecName, int versionStart, int versionCurrent, String termsBlocksExtension, String dictionaryExtension) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
protected IndexDictionary.BrowserSupplier
createDictionaryBrowserSupplier
(SegmentReadState state, IndexInput dictionaryInput, FieldMetadata fieldMetadata, BlockDecoder blockDecoder, boolean dictionaryOnHeap) protected void
fillFieldMap
(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder, boolean dictionaryOnHeap, IndexInput dictionaryInput, IndexInput blockInput, Collection<FieldMetadata> fieldMetadataCollection, FieldInfos fieldInfos) iterator()
protected Collection<FieldMetadata>
readEncodedFieldsMetadata
(int numFields, DataInput metadataInput, BlockDecoder blockDecoder, FieldInfos fieldInfos, FieldMetadata.Serializer fieldMetadataReader, int maxNumDocs) protected Collection<FieldMetadata>
readFieldsMetadata
(IndexInput indexInput, BlockDecoder blockDecoder, FieldInfos fieldInfos, FieldMetadata.Serializer fieldMetadataReader, int maxNumDocs) protected Collection<FieldMetadata>
readUnencodedFieldsMetadata
(int numFields, DataInput metadataInput, FieldInfos fieldInfos, FieldMetadata.Serializer fieldMetadataReader, int maxNumDocs) protected void
seekFieldsMetadata
(IndexInput indexInput) Positions the givenIndexInput
at the beginning of the fields metadata.int
size()
Methods inherited from class org.apache.lucene.codecs.FieldsProducer
getMergeInstance
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
postingsReader
-
version
protected final int version -
blockInput
-
dictionaryInput
-
fieldToTermsMap
-
sortedFieldNames
-
-
Constructor Details
-
UniformSplitTermsReader
public UniformSplitTermsReader(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder, boolean dictionaryOnHeap) throws IOException - Parameters:
blockDecoder
- Optional block decoder, may be null if none. It can be used for decompression or decryption.dictionaryOnHeap
- Whether to force loading the terms dictionary on-heap. By default it is kept off-heap without impact on performance. If block encoding/decoding is used, then the dictionary is always loaded on-heap whatever this parameter value is.- Throws:
IOException
-
UniformSplitTermsReader
protected UniformSplitTermsReader(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder, boolean dictionaryOnHeap, FieldMetadata.Serializer fieldMetadataReader, String codecName, int versionStart, int versionCurrent, String termsBlocksExtension, String dictionaryExtension) throws IOException
-
-
Method Details
-
fillFieldMap
protected void fillFieldMap(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder, boolean dictionaryOnHeap, IndexInput dictionaryInput, IndexInput blockInput, Collection<FieldMetadata> fieldMetadataCollection, FieldInfos fieldInfos) throws IOException - Throws:
IOException
-
createDictionaryBrowserSupplier
protected IndexDictionary.BrowserSupplier createDictionaryBrowserSupplier(SegmentReadState state, IndexInput dictionaryInput, FieldMetadata fieldMetadata, BlockDecoder blockDecoder, boolean dictionaryOnHeap) throws IOException - Throws:
IOException
-
readFieldsMetadata
protected Collection<FieldMetadata> readFieldsMetadata(IndexInput indexInput, BlockDecoder blockDecoder, FieldInfos fieldInfos, FieldMetadata.Serializer fieldMetadataReader, int maxNumDocs) throws IOException - Parameters:
indexInput
-IndexInput
must be positioned to the fields metadata details by callingseekFieldsMetadata(IndexInput)
before this call.blockDecoder
- Optional block decoder, may be null if none.- Throws:
IOException
-
readEncodedFieldsMetadata
protected Collection<FieldMetadata> readEncodedFieldsMetadata(int numFields, DataInput metadataInput, BlockDecoder blockDecoder, FieldInfos fieldInfos, FieldMetadata.Serializer fieldMetadataReader, int maxNumDocs) throws IOException - Throws:
IOException
-
readUnencodedFieldsMetadata
protected Collection<FieldMetadata> readUnencodedFieldsMetadata(int numFields, DataInput metadataInput, FieldInfos fieldInfos, FieldMetadata.Serializer fieldMetadataReader, int maxNumDocs) throws IOException - Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classFieldsProducer
- Throws:
IOException
-
checkIntegrity
- Specified by:
checkIntegrity
in classFieldsProducer
- Throws:
IOException
-
iterator
-
terms
-
size
public int size() -
seekFieldsMetadata
Positions the givenIndexInput
at the beginning of the fields metadata.- Throws:
IOException
-