Module org.elasticsearch.server
Interface NumericFieldWriter
public interface NumericFieldWriter
Writes numeric doc values for a single field during segment writing.
Each codec version provides its own implementation via
AbstractTSDBDocValuesConsumer.createNumericFieldWriter(org.elasticsearch.index.codec.tsdb.NumericWriteContext). The two levels are:
- Per-field:
writeField(org.apache.lucene.index.FieldInfo, org.elasticsearch.index.codec.tsdb.TsdbDocValuesProducer, long, org.elasticsearch.index.codec.tsdb.NumericFieldWriter.OffsetsConsumer, org.elasticsearch.index.codec.tsdb.SortedFieldObserver)writes the full numeric field including stats, ordinal detection, codec-specific metadata, block data, offsets, and DISI - Per-block:
NumericFieldWriter.Encoder.encodeBlock(long[], int, org.apache.lucene.store.IndexOutput)andNumericFieldWriter.Encoder.encodeOrdinals(long[], org.apache.lucene.store.IndexOutput, int)encode individual blocks during the write loop
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacePer-block encoder for numeric values and ordinals.static interfaceAccepts per-doc value counts for sorted-numeric offset tracking. -
Method Summary
Modifier and TypeMethodDescriptionencoder()Returns an encoder for per-block numeric value encoding.long[]writeField(org.apache.lucene.index.FieldInfo field, TsdbDocValuesProducer valuesSource, long maxOrd, NumericFieldWriter.OffsetsConsumer offsetsConsumer, SortedFieldObserver sortedFieldObserver) Writes the full numeric field: entry metadata, block data, and DISI.
-
Method Details
-
writeField
long[] writeField(org.apache.lucene.index.FieldInfo field, TsdbDocValuesProducer valuesSource, long maxOrd, NumericFieldWriter.OffsetsConsumer offsetsConsumer, SortedFieldObserver sortedFieldObserver) throws IOException Writes the full numeric field: entry metadata, block data, and DISI.- Parameters:
field- the field being writtenvaluesSource- the source of doc valuesmaxOrd- the maximum ordinal value, or -1 if not using ordinalsoffsetsConsumer- consumer for per-doc value counts (sorted-numeric offsets), or nullsortedFieldObserver- observer notified of (docId, ord) pairs during the doc pass, or null- Returns:
- array of [numDocsWithValue, numValues]
- Throws:
IOException
-
encoder
NumericFieldWriter.Encoder encoder()Returns an encoder for per-block numeric value encoding.- Returns:
- a new encoder instance
-