Interface BlockLoader.OptionalLengthReader

All Known Implementing Classes:
AbstractTSDBDocValuesProducer.TSDBBinaryDocValues
Enclosing interface:
BlockLoader

public static interface BlockLoader.OptionalLengthReader
An interface for readers that attempt to load BytesRef length values directly without loading BytesRefs.

Implementations may return null if they are unable to load the requested values, for example due to unsupported underlying data. This allows callers to optimistically try optimized loading strategies first, and fall back if necessary.

  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.lucene.index.NumericDocValues
    Converts the length of each binary value associated with documents into a NumericDocValues representation.
    default org.apache.lucene.search.DocIdSetIterator
    tryLengthIterator(int length)
    Creates a DocIdSetIterator that matches documents based on the specified length value.
    tryReadLength(BlockLoader.BlockFactory factory, BlockLoader.Docs docs, int offset, boolean nullsFiltered)
    Attempts to read the values of all documents in docs Returns null if unable to load the values.
  • Method Details

    • tryReadLength

      @Nullable BlockLoader.Block tryReadLength(BlockLoader.BlockFactory factory, BlockLoader.Docs docs, int offset, boolean nullsFiltered) throws IOException
      Attempts to read the values of all documents in docs Returns null if unable to load the values.
      Parameters:
      nullsFiltered - if true, then target docs are guaranteed to have a value for the field. see BlockLoader.ColumnAtATimeReader.read(BlockFactory, Docs, int, boolean)
      Throws:
      IOException
    • toLengthValues

      org.apache.lucene.index.NumericDocValues toLengthValues()
      Converts the length of each binary value associated with documents into a NumericDocValues representation. The NumericDocValues returned provides access to the length of each binary value for each document and this can be accesed via NumericDocValues.longValue().
      Returns:
      a NumericDocValues instance containing the length values, or null if unable to load the values due to unsupported underlying data or other constraints.
    • tryLengthIterator

      default org.apache.lucene.search.DocIdSetIterator tryLengthIterator(int length) throws IOException
      Creates a DocIdSetIterator that matches documents based on the specified length value. The returned iterator will iterate over all documents whose length value equals the given length.
      Parameters:
      length - the length value to match against the documents.
      Returns:
      a DocIdSetIterator to iterate over documents matching the specified length value.
      Throws:
      IOException - if an I/O error occurs while reading the length values.