Module org.elasticsearch.server
Class PipelineDescriptor
java.lang.Object
org.elasticsearch.index.codec.tsdb.pipeline.PipelineDescriptor
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].
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe numeric data type stored in encoded blocks. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of stages in a pipeline. -
Constructor Summary
ConstructorsConstructorDescriptionPipelineDescriptor(byte[] stageIds, int blockSize) Creates a descriptor for a long (integral) pipeline.PipelineDescriptor(byte[] stageIds, int blockSize, PipelineDescriptor.DataType dataType) Creates a descriptor with the specified data type. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the block size (number of values per block).dataType()Returns the data type this pipeline operates on.booleaninthashCode()intReturns the number of stages in this pipeline.bytestageIdAt(int position) Returns the stage identifier at the given position.toString()withBlockSize(int blockSize) Returns a new descriptor with the specified block size, or this instance if unchanged.
-
Field Details
-
MAX_PIPELINE_LENGTH
public static final int MAX_PIPELINE_LENGTHMaximum 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 identifiersblockSize- the number of values per block (must be a power of 2)
-
PipelineDescriptor
Creates a descriptor with the specified data type.- Parameters:
stageIds- the ordered stage identifiersblockSize- 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
Returns the data type this pipeline operates on.- Returns:
- the data type
-
withBlockSize
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
-
hashCode
public int hashCode() -
toString
-