Class PipelineDescriptor

java.lang.Object
org.elasticsearch.index.codec.tsdb.pipeline.PipelineDescriptor

public final class PipelineDescriptor extends Object
Persisted descriptor of a pipeline configuration, tracking stage IDs, block size, and data type.

PipelineDescriptor is the contract between encoder and decoder. The writeTo(org.apache.lucene.store.DataOutput)/readFrom(org.apache.lucene.store.DataInput) methods are used by FieldDescriptor to create self-describing formats. Format evolution is handled by the version byte in FieldDescriptor.

Wire format: [VInt stageCount] [byte blockShift] [byte dataType] [byte[] stageIds]. Scalars come before the variable-length stage array so the decoder can configure block size and data type before iterating stage IDs.

Example: a delta>gcd>bitPack pipeline on longs with blockSize=128 (blockShift=7) serializes as [03] [07] [00] [01 03 A1].

  • Field Details

    • MAX_PIPELINE_LENGTH

      public static final int MAX_PIPELINE_LENGTH
      Maximum number of stages in a pipeline.
      See Also:
  • Constructor Details

    • PipelineDescriptor

      public PipelineDescriptor(byte[] stageIds, int blockSize)
      Creates a descriptor for a long (integral) pipeline.
      Parameters:
      stageIds - the ordered stage identifiers
      blockSize - the number of values per block (must be a power of 2)
    • PipelineDescriptor

      public PipelineDescriptor(byte[] stageIds, int blockSize, PipelineDescriptor.DataType dataType)
      Creates a descriptor with the specified data type.
      Parameters:
      stageIds - the ordered stage identifiers
      blockSize - the number of values per block (must be a power of 2)
      dataType - the numeric data type this pipeline operates on
  • Method Details

    • pipelineLength

      public int pipelineLength()
      Returns the number of stages in this pipeline.
      Returns:
      the pipeline length
    • stageIdAt

      public byte stageIdAt(int position)
      Returns the stage identifier at the given position.
      Parameters:
      position - the zero-based stage index
      Returns:
      the byte identifier at that position
    • blockSize

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

      public PipelineDescriptor.DataType dataType()
      Returns the data type this pipeline operates on.
      Returns:
      the data type
    • withBlockSize

      public PipelineDescriptor withBlockSize(int blockSize)
      Returns a new descriptor with the specified block size, or this instance if unchanged.
      Parameters:
      blockSize - the desired block size (must be a power of 2)
      Returns:
      a descriptor with the given block size
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object