Package org.apache.druid.segment
Class NestedDataColumnHandlerV4
- java.lang.Object
-
- org.apache.druid.segment.NestedDataColumnHandlerV4
-
- All Implemented Interfaces:
DimensionHandler<StructuredData,StructuredData,StructuredData>
public class NestedDataColumnHandlerV4 extends Object implements DimensionHandler<StructuredData,StructuredData,StructuredData>
-
-
Constructor Summary
Constructors Constructor Description NestedDataColumnHandlerV4(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDimensionName()Get the name of the column associated with this handler.DimensionSchemagetDimensionSchema(ColumnCapabilities capabilities)DimensionSpecgetDimensionSpec()Create aDimensionSpecfor this handlerComparator<ColumnValueSelector>getEncodedValueSelectorComparator()Returns a comparator that knows how to compareColumnValueSelectorof the assumed dimension type, corresponding to this DimensionHandler.intgetLengthOfEncodedKeyComponent(StructuredData dimVals)Given an key component representing a single set of row value(s) for this dimension as an Object, return the length of the key component after appropriate type-casting.DimensionIndexer<StructuredData,StructuredData,StructuredData>makeIndexer(boolean useMaxMemoryEstimates)Creates a new DimensionIndexer, a per-dimension object responsible for processing ingested rows in-memory, used by the IncrementalIndex.DimensionMergerV9makeMerger(String outputName, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, ColumnCapabilities capabilities, ProgressIndicator progress, File segmentBaseDir, Closer closer)Creates a new DimensionMergerV9, a per-dimension object responsible for merging indexes/row data across segments and building the on-disk representation of a dimension.SettableColumnValueSelectormakeNewSettableEncodedValueSelector()Creates and returns a new object of some implementation ofSettableColumnValueSelector, that corresponds to the type of this DimensionHandler.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.DimensionHandler
getMultivalueHandling, makeMerger
-
-
-
-
Constructor Detail
-
NestedDataColumnHandlerV4
public NestedDataColumnHandlerV4(String name)
-
-
Method Detail
-
getDimensionName
public String getDimensionName()
Description copied from interface:DimensionHandlerGet the name of the column associated with this handler. This string would be the output name of the column during ingestion, and the name of an input column when querying.- Specified by:
getDimensionNamein interfaceDimensionHandler<StructuredData,StructuredData,StructuredData>- Returns:
- Dimension name
-
getDimensionSpec
public DimensionSpec getDimensionSpec()
Description copied from interface:DimensionHandlerCreate aDimensionSpecfor this handler- Specified by:
getDimensionSpecin interfaceDimensionHandler<StructuredData,StructuredData,StructuredData>
-
getDimensionSchema
public DimensionSchema getDimensionSchema(ColumnCapabilities capabilities)
- Specified by:
getDimensionSchemain interfaceDimensionHandler<StructuredData,StructuredData,StructuredData>
-
makeIndexer
public DimensionIndexer<StructuredData,StructuredData,StructuredData> makeIndexer(boolean useMaxMemoryEstimates)
Description copied from interface:DimensionHandlerCreates a new DimensionIndexer, a per-dimension object responsible for processing ingested rows in-memory, used by the IncrementalIndex. SeeDimensionIndexerinterface for more information.- Specified by:
makeIndexerin interfaceDimensionHandler<StructuredData,StructuredData,StructuredData>- Parameters:
useMaxMemoryEstimates- true if the created DimensionIndexer should use maximum values to estimate on-heap memory- Returns:
- A new DimensionIndexer object.
-
makeMerger
public DimensionMergerV9 makeMerger(String outputName, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, ColumnCapabilities capabilities, ProgressIndicator progress, File segmentBaseDir, Closer closer)
Description copied from interface:DimensionHandlerCreates a new DimensionMergerV9, a per-dimension object responsible for merging indexes/row data across segments and building the on-disk representation of a dimension. For use with IndexMergerV9 only. SeeDimensionMergerV9interface for more information.- Specified by:
makeMergerin interfaceDimensionHandler<StructuredData,StructuredData,StructuredData>- Parameters:
outputName- Output "file" name for the column to use for serializers, to control where it is stored in the segments internal filesindexSpec- Specification object for the index mergesegmentWriteOutMedium- this SegmentWriteOutMedium object could be used internally in the created merger, if neededcapabilities- The ColumnCapabilities of the dimension represented by this DimensionHandlerprogress- ProgressIndicator used by the merging processsegmentBaseDir- segment write out path; temporary files may be created here, though should delete after merge is finished OR be registered with the Closer parametercloser- Closer tied to segment completion. Anything which is not cleaned up inside of the merger after merge is complete should be registered with this closer. For example, resources which are required for final serialization of the column- Returns:
- A new DimensionMergerV9 object.
-
getLengthOfEncodedKeyComponent
public int getLengthOfEncodedKeyComponent(StructuredData dimVals)
Description copied from interface:DimensionHandlerGiven an key component representing a single set of row value(s) for this dimension as an Object, return the length of the key component after appropriate type-casting. For example, a dictionary encoded String dimension would receive an int[] as input to this method, while a Long numeric dimension would receive a single Long object (no multivalue support)- Specified by:
getLengthOfEncodedKeyComponentin interfaceDimensionHandler<StructuredData,StructuredData,StructuredData>- Parameters:
dimVals- Values for this dimension from a row- Returns:
- Size of dimVals
-
getEncodedValueSelectorComparator
public Comparator<ColumnValueSelector> getEncodedValueSelectorComparator()
Description copied from interface:DimensionHandlerReturns a comparator that knows how to compareColumnValueSelectorof the assumed dimension type, corresponding to this DimensionHandler. E. g.StringDimensionHandlerreturns a comparator, that comparesColumnValueSelectors asDimensionSelectors. The comparison rules used by this method should match the rules used byDimensionIndexer.compareUnsortedEncodedKeyComponents(EncodedKeyComponentType, EncodedKeyComponentType), otherwise incorrect ordering/merging of rows can occur during ingestion, causing issues such as imperfect rollup.- Specified by:
getEncodedValueSelectorComparatorin interfaceDimensionHandler<StructuredData,StructuredData,StructuredData>
-
makeNewSettableEncodedValueSelector
public SettableColumnValueSelector makeNewSettableEncodedValueSelector()
Description copied from interface:DimensionHandlerCreates and returns a new object of some implementation ofSettableColumnValueSelector, that corresponds to the type of this DimensionHandler. E. g.LongDimensionHandlerreturnsSettableLongColumnValueSelector, etc.- Specified by:
makeNewSettableEncodedValueSelectorin interfaceDimensionHandler<StructuredData,StructuredData,StructuredData>
-
-