Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
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 TypeMethodDescriptionorg.apache.lucene.index.NumericDocValuesConverts the length of each binary value associated with documents into aNumericDocValuesrepresentation.default org.apache.lucene.search.DocIdSetIteratortryLengthIterator(int length) Creates aDocIdSetIteratorthat 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 indocsReturnsnullif 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 indocsReturnsnullif unable to load the values.- Parameters:
nullsFiltered- iftrue, then target docs are guaranteed to have a value for the field. seeBlockLoader.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 aNumericDocValuesrepresentation. TheNumericDocValuesreturned provides access to the length of each binary value for each document and this can be accesed viaNumericDocValues.longValue().- Returns:
- a
NumericDocValuesinstance containing the length values, ornullif unable to load the values due to unsupported underlying data or other constraints.
-
tryLengthIterator
Creates aDocIdSetIteratorthat 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
DocIdSetIteratorto iterate over documents matching the specified length value. - Throws:
IOException- if an I/O error occurs while reading the length values.
-