java.lang.Object
org.elasticsearch.index.codec.tsdb.pipeline.numeric.NumericEncodePipeline

public final class NumericEncodePipeline extends Object
Immutable encoding pipeline: transform stages followed by a terminal payload stage.

Transform stages run in forward order, modifying values in-place to reduce dynamic range. The payload stage serializes the result. Each stage decides per-block whether to apply itself, recorded in a position bitmap for decoding.

Instances are immutable and thread-safe. Mutable per-block state lives in EncodingContext, which must be provided by the caller.

  • Method Details

    • fromConfig

      public static NumericEncodePipeline fromConfig(PipelineConfig config)
      Builds an encode pipeline from a pipeline configuration.
      Parameters:
      config - the pipeline configuration
      Returns:
      the encode pipeline
      Throws:
      IllegalStateException - if the pipeline has no payload stage
    • encode

      public void encode(long[] values, int valueCount, org.apache.lucene.store.DataOutput out, EncodingContext context) throws IOException
      Encodes a block of values through the pipeline.
      Parameters:
      values - the values to encode (modified in-place by transform stages)
      valueCount - the number of valid values
      out - the data output to write the encoded block to
      context - the mutable per-block encoding context
      Throws:
      IOException - if an I/O error occurs
    • descriptor

      public PipelineDescriptor descriptor()
      Returns the pipeline descriptor for persistence via FieldDescriptor.
      Returns:
      the pipeline descriptor
    • blockSize

      public int blockSize()
      Returns the number of values per block.
      Returns:
      the number of values per block
    • size

      public int size()
      Returns the total number of stages (transforms + payload).
      Returns:
      the total number of stages