Module org.elasticsearch.server
Class NumericEncodePipeline
java.lang.Object
org.elasticsearch.index.codec.tsdb.pipeline.numeric.NumericEncodePipeline
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 Summary
Modifier and TypeMethodDescriptionintReturns the number of values per block.Returns the pipeline descriptor for persistence viaFieldDescriptor.voidencode(long[] values, int valueCount, org.apache.lucene.store.DataOutput out, EncodingContext context) Encodes a block of values through the pipeline.static NumericEncodePipelinefromConfig(PipelineConfig config) Builds an encode pipeline from a pipeline configuration.intsize()Returns the total number of stages (transforms + payload).
-
Method Details
-
fromConfig
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 valuesout- the data output to write the encoded block tocontext- the mutable per-block encoding context- Throws:
IOException- if an I/O error occurs
-
descriptor
Returns the pipeline descriptor for persistence viaFieldDescriptor.- 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
-