Class AbstractTSDBDocValuesProducer

java.lang.Object
org.apache.lucene.codecs.DocValuesProducer
org.elasticsearch.index.codec.tsdb.AbstractTSDBDocValuesProducer
All Implemented Interfaces:
Closeable, AutoCloseable

public abstract class AbstractTSDBDocValuesProducer extends org.apache.lucene.codecs.DocValuesProducer
Abstract base class for TSDB doc values producers. Contains all shared wire-format reading logic. Subclasses provide the numeric block decoding strategy.
  • Field Details

    • numericBlockSize

      protected final int numericBlockSize
  • Constructor Details

  • Method Details

    • createNumericFieldReader

      protected abstract NumericFieldReader createNumericFieldReader(AbstractTSDBDocValuesProducer.NumericEntry entry, int numericBlockSize)
      Creates a numeric field reader for the given entry.

      Each codec version provides its own decoding strategy. The returned reader has two levels: NumericFieldReader.readField(org.apache.lucene.store.IndexInput, org.elasticsearch.index.codec.tsdb.AbstractTSDBDocValuesProducer.NumericEntry, int) reads the full field metadata during segment init, and NumericFieldReader.decoder() provides a per-block decoder for iteration.

      Parameters:
      entry - the numeric entry for this field
      numericBlockSize - the number of values per numeric block
      Returns:
      a reader for this field
      See Also:
    • createMergeInstance

      protected abstract AbstractTSDBDocValuesProducer createMergeInstance()
      Creates a copy of this producer for merge operations.

      The returned instance shares the underlying IndexInput (via clone) but maintains independent read state, allowing concurrent iteration during merges.

      Returns:
      a merge-safe copy of this producer
    • getMergeInstance

      public org.apache.lucene.codecs.DocValuesProducer getMergeInstance()
      Overrides:
      getMergeInstance in class org.apache.lucene.codecs.DocValuesProducer
    • getNumeric

      public org.apache.lucene.index.NumericDocValues getNumeric(org.apache.lucene.index.FieldInfo field) throws IOException
      Specified by:
      getNumeric in class org.apache.lucene.codecs.DocValuesProducer
      Throws:
      IOException
    • getBinary

      public org.apache.lucene.index.BinaryDocValues getBinary(org.apache.lucene.index.FieldInfo field) throws IOException
      Specified by:
      getBinary in class org.apache.lucene.codecs.DocValuesProducer
      Throws:
      IOException
    • getSorted

      public org.apache.lucene.index.SortedDocValues getSorted(org.apache.lucene.index.FieldInfo field) throws IOException
      Specified by:
      getSorted in class org.apache.lucene.codecs.DocValuesProducer
      Throws:
      IOException
    • getSortedNumeric

      public org.apache.lucene.index.SortedNumericDocValues getSortedNumeric(org.apache.lucene.index.FieldInfo field) throws IOException
      Specified by:
      getSortedNumeric in class org.apache.lucene.codecs.DocValuesProducer
      Throws:
      IOException
    • getSortedSet

      public org.apache.lucene.index.SortedSetDocValues getSortedSet(org.apache.lucene.index.FieldInfo field) throws IOException
      Specified by:
      getSortedSet in class org.apache.lucene.codecs.DocValuesProducer
      Throws:
      IOException
    • getSkipper

      public org.apache.lucene.index.DocValuesSkipper getSkipper(org.apache.lucene.index.FieldInfo field) throws IOException
      Specified by:
      getSkipper in class org.apache.lucene.codecs.DocValuesProducer
      Throws:
      IOException
    • checkIntegrity

      public void checkIntegrity() throws IOException
      Specified by:
      checkIntegrity in class org.apache.lucene.codecs.DocValuesProducer
      Throws:
      IOException
    • close

      public void close() throws IOException
      Throws:
      IOException
    • primarySortFieldNumber

      public static int primarySortFieldNumber(org.apache.lucene.index.SegmentInfo segmentInfo, org.apache.lucene.index.FieldInfos fieldInfos)
      Returns the field number of the primary sort field for the given segment, if the field is sorted in ascending order. Returns -1 if not found.