org.apache.lucene.codecs.uniformsplit

## 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>, Accountable
  Direct Known Subclasses:
    STUniformSplitTermsReader

      public class UniformSplitTermsReader
      extends FieldsProducer

  A block-based terms index and dictionary based on the Uniform Split technique.
  See Also:
    `UniformSplitTermsWriter`
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected IndexInput` | `blockInput`
    `protected IndexInput` | `dictionaryInput`
    `protected Map<String,UniformSplitTerms>` | `fieldToTermsMap`
    `protected PostingsReaderBase` | `postingsReader`
    `protected Collection<String>` | `sortedFieldNames`
    `protected int` | `version`

    - ### Fields inherited from class org.apache.lucene.index.Fields

      `EMPTY_ARRAY`

    - ### Fields inherited from interface org.apache.lucene.util.Accountable

      `NULL_ACCOUNTABLE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `UniformSplitTermsReader(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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkIntegrity()`
    `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)`
    `protected long` | `getTermsRamBytesUsed()`
    `Iterator<String>` | `iterator()`
    `long` | `ramBytesUsed()`
    `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 given `IndexInput` at the beginning of the fields metadata.
    `int` | `size()`
    `Terms` | `terms(String field)`

    - ### 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 org.apache.lucene.util.Accountable

      `getChildResources`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### postingsReader

          protected final PostingsReaderBase postingsReader

    - #### version

          protected final int version

    - #### blockInput

          protected final IndexInput blockInput

    - #### dictionaryInput

          protected final IndexInput dictionaryInput

    - #### fieldToTermsMap

          protected final Map<String,UniformSplitTerms> fieldToTermsMap

    - #### sortedFieldNames

          protected final Collection<String> sortedFieldNames

  - ### Constructor Detail

    - #### 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

      Throws:
        `IOException`
      See Also:
        `UniformSplitTermsReader(PostingsReaderBase, SegmentReadState, BlockDecoder, boolean)`

  - ### Method Detail

    - #### 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 calling `seekFieldsMetadata(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

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `FieldsProducer`
      Throws:
        `IOException`

    - #### checkIntegrity

          public void checkIntegrity()
                              throws IOException

      Specified by:
        `checkIntegrity` in class `FieldsProducer`
      Throws:
        `IOException`

    - #### iterator

          public Iterator<String> iterator()

      Specified by:
        `iterator` in interface `Iterable<String>`
      Specified by:
        `iterator` in class `Fields`

    - #### terms

          public Terms terms(String field)

      Specified by:
        `terms` in class `Fields`

    - #### size

          public int size()

      Specified by:
        `size` in class `Fields`

    - #### ramBytesUsed

          public long ramBytesUsed()

    - #### getTermsRamBytesUsed

          protected long getTermsRamBytesUsed()

    - #### seekFieldsMetadata

          protected void seekFieldsMetadata(IndexInput indexInput)
                                     throws IOException

      Positions the given `IndexInput` at the beginning of the fields metadata.
      Throws:
        `IOException`

Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.