Module org.elasticsearch.server
Class AbstractTSDBDocValuesConsumer
java.lang.Object
org.apache.lucene.codecs.DocValuesConsumer
org.elasticsearch.index.codec.tsdb.XDocValuesConsumer
org.elasticsearch.index.codec.tsdb.AbstractTSDBDocValuesConsumer
- All Implemented Interfaces:
Closeable,AutoCloseable
Abstract base class for TSDB doc values consumers. Owns the shared wire-format logic
for writing numeric, binary, sorted, sorted-numeric, and sorted-set doc values.
Concrete subclasses provide the numeric encoding strategy via
createNumericFieldWriter(NumericWriteContext).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteType tag written to meta for binary doc values fields.protected final TSDBDocValuesFormatConfigstatic final intIndex block shift sentinel indicating ordinal range encoding.static final intIndex block shift sentinel indicating a single ordinal (no index needed).static final byteType tag written to meta for numeric doc values fields.protected final intstatic final byteType tag written to meta for sorted doc values fields.static final byteType tag written to meta for sorted-numeric doc values fields.static final byteType tag written to meta for sorted-set doc values fields. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTSDBDocValuesConsumer(org.apache.lucene.index.SegmentWriteState state, boolean enableOptimizedMerge, String dataCodec, String dataExtension, String metaCodec, String metaExtension, TSDBDocValuesFormatConfig formatConfig, DocOffsetsCodec.Encoder docOffsetsEncoder, SortedFieldObserverFactory sortedFieldObserverFactory) Construct a new consumer that writes doc values in the TSDB wire format. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBinaryField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) voidaddNumericField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) voidaddSortedField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) voidaddSortedNumericField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) voidaddSortedSetField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) voidclose()protected abstract NumericFieldWriterCreates a numeric field writer for this segment.voidmergeBinaryField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) voidmergeNumericField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) voidmergeSortedField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) voidmergeSortedNumericField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) voidmergeSortedSetField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) Methods inherited from class org.elasticsearch.index.codec.tsdb.XDocValuesConsumer
mergeBinaryField, mergeNumericField, mergeSortedField, mergeSortedNumericField, mergeSortedSetFieldMethods inherited from class org.apache.lucene.codecs.DocValuesConsumer
createOrdinalMapForSortedDV, createOrdinalMapForSortedSetDV, getMergedBinaryDocValues, getMergedNumericDocValues, getMergedSortedNumericDocValues, getMergedSortedSetDocValues, getMergedSortedSetDocValues, isSingleValued, merge, mergeSortedValues, selectLeavesToMerge, singletonView
-
Field Details
-
NUMERIC
public static final byte NUMERICType tag written to meta for numeric doc values fields.- See Also:
-
BINARY
public static final byte BINARYType tag written to meta for binary doc values fields.- See Also:
-
SORTED
public static final byte SORTEDType tag written to meta for sorted doc values fields.- See Also:
-
SORTED_SET
public static final byte SORTED_SETType tag written to meta for sorted-set doc values fields.- See Also:
-
SORTED_NUMERIC
public static final byte SORTED_NUMERICType tag written to meta for sorted-numeric doc values fields.- See Also:
-
INDEX_SINGLE_ORDINAL
public static final int INDEX_SINGLE_ORDINALIndex block shift sentinel indicating a single ordinal (no index needed).- See Also:
-
INDEX_ORDINAL_RANGE
public static final int INDEX_ORDINAL_RANGEIndex block shift sentinel indicating ordinal range encoding.- See Also:
-
numericBlockSize
protected final int numericBlockSize -
formatConfig
-
-
Constructor Details
-
AbstractTSDBDocValuesConsumer
protected AbstractTSDBDocValuesConsumer(org.apache.lucene.index.SegmentWriteState state, boolean enableOptimizedMerge, String dataCodec, String dataExtension, String metaCodec, String metaExtension, TSDBDocValuesFormatConfig formatConfig, DocOffsetsCodec.Encoder docOffsetsEncoder, SortedFieldObserverFactory sortedFieldObserverFactory) throws IOException Construct a new consumer that writes doc values in the TSDB wire format.- Parameters:
state- segment write stateenableOptimizedMerge- whether optimized merge is enableddataCodec- codec name for the data file headerdataExtension- file extension for the data filemetaCodec- codec name for the meta file headermetaExtension- file extension for the meta fileformatConfig- format-specific configuration for this codec versiondocOffsetsEncoder- encoder for doc offsets in compressed binary blockssortedFieldObserverFactory- factory for creating observers during sorted field writes- Throws:
IOException
-
-
Method Details
-
createNumericFieldWriter
Creates a numeric field writer for this segment.Each codec version provides its own encoding strategy. The returned writer owns the full numeric field lifecycle: stats, ordinal detection, codec-specific metadata, block encoding, offsets, and DISI.
- Parameters:
ctx- the shared write context for this segment- Returns:
- a writer for numeric fields
- See Also:
-
addNumericField
public void addNumericField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) throws IOException - Specified by:
addNumericFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
mergeNumericField
public void mergeNumericField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) throws IOException - Overrides:
mergeNumericFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
mergeBinaryField
public void mergeBinaryField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) throws IOException - Overrides:
mergeBinaryFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
addBinaryField
public void addBinaryField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) throws IOException - Specified by:
addBinaryFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
addSortedField
public void addSortedField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) throws IOException - Specified by:
addSortedFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
mergeSortedField
public void mergeSortedField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) throws IOException - Overrides:
mergeSortedFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
addSortedNumericField
public void addSortedNumericField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) throws IOException - Specified by:
addSortedNumericFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
mergeSortedNumericField
public void mergeSortedNumericField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) throws IOException - Overrides:
mergeSortedNumericFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
mergeSortedSetField
public void mergeSortedSetField(org.apache.lucene.index.FieldInfo mergeFieldInfo, org.apache.lucene.index.MergeState mergeState) throws IOException - Overrides:
mergeSortedSetFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
addSortedSetField
public void addSortedSetField(org.apache.lucene.index.FieldInfo field, org.apache.lucene.codecs.DocValuesProducer valuesProducer) throws IOException - Specified by:
addSortedSetFieldin classorg.apache.lucene.codecs.DocValuesConsumer- Throws:
IOException
-
close
- Throws:
IOException
-