Module org.elasticsearch.server
Class NumericBlockEncoder
java.lang.Object
org.elasticsearch.index.codec.tsdb.pipeline.numeric.NumericBlockEncoder
Per-field block encoder owning a mutable
EncodingContext.
A single instance encodes all blocks for one field. The context holds
per-block mutable state (stage bitmap, metadata buffer, value count) that is
cleared via EncodingContext.clear() at the start of each block and
reused for the next. This zero-allocation-per-block design avoids GC pressure
on the encode hot path, but makes the instance NOT thread-safe: concurrent
callers must each obtain their own instance via
NumericEncoder.newBlockEncoder().
-
Method Summary
-
Method Details
-
encode
public void encode(long[] values, int valueCount, org.apache.lucene.store.DataOutput out) 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 to- Throws:
IOException- if an I/O error occurs
-
blockSize
public int blockSize()Returns the number of values per block.- Returns:
- the number of values per block
-