Package org.apache.druid.segment
Class FloatDimensionHandler
- java.lang.Object
-
- org.apache.druid.segment.FloatDimensionHandler
-
- All Implemented Interfaces:
DimensionHandler<Float,Float,Float>
public class FloatDimensionHandler extends Object implements DimensionHandler<Float,Float,Float>
-
-
Constructor Summary
Constructors Constructor Description FloatDimensionHandler(String dimensionName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDimensionName()
Get the name of the column associated with this handler.DimensionSchema
getDimensionSchema(ColumnCapabilities capabilities)
DimensionSpec
getDimensionSpec()
Create aDimensionSpec
for this handlerComparator<ColumnValueSelector>
getEncodedValueSelectorComparator()
Returns a comparator that knows how to compareColumnValueSelector
of the assumed dimension type, corresponding to this DimensionHandler.int
getLengthOfEncodedKeyComponent(Float 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<Float,Float,Float>
makeIndexer(boolean useMaxMemoryEstimates)
Creates a new DimensionIndexer, a per-dimension object responsible for processing ingested rows in-memory, used by the IncrementalIndex.DimensionMergerV9
makeMerger(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.SettableColumnValueSelector
makeNewSettableEncodedValueSelector()
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
-
FloatDimensionHandler
public FloatDimensionHandler(String dimensionName)
-
-
Method Detail
-
getDimensionName
public String getDimensionName()
Description copied from interface:DimensionHandler
Get 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:
getDimensionName
in interfaceDimensionHandler<Float,Float,Float>
- Returns:
- Dimension name
-
getDimensionSpec
public DimensionSpec getDimensionSpec()
Description copied from interface:DimensionHandler
Create aDimensionSpec
for this handler- Specified by:
getDimensionSpec
in interfaceDimensionHandler<Float,Float,Float>
-
getDimensionSchema
public DimensionSchema getDimensionSchema(ColumnCapabilities capabilities)
- Specified by:
getDimensionSchema
in interfaceDimensionHandler<Float,Float,Float>
-
makeIndexer
public DimensionIndexer<Float,Float,Float> makeIndexer(boolean useMaxMemoryEstimates)
Description copied from interface:DimensionHandler
Creates a new DimensionIndexer, a per-dimension object responsible for processing ingested rows in-memory, used by the IncrementalIndex. SeeDimensionIndexer
interface for more information.- Specified by:
makeIndexer
in interfaceDimensionHandler<Float,Float,Float>
- 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:DimensionHandler
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. For use with IndexMergerV9 only. SeeDimensionMergerV9
interface for more information.- Specified by:
makeMerger
in interfaceDimensionHandler<Float,Float,Float>
- 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(Float dimVals)
Description copied from interface:DimensionHandler
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. 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:
getLengthOfEncodedKeyComponent
in interfaceDimensionHandler<Float,Float,Float>
- Parameters:
dimVals
- Values for this dimension from a row- Returns:
- Size of dimVals
-
getEncodedValueSelectorComparator
public Comparator<ColumnValueSelector> getEncodedValueSelectorComparator()
Description copied from interface:DimensionHandler
Returns a comparator that knows how to compareColumnValueSelector
of the assumed dimension type, corresponding to this DimensionHandler. E. g.StringDimensionHandler
returns a comparator, that comparesColumnValueSelector
s asDimensionSelector
s. 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:
getEncodedValueSelectorComparator
in interfaceDimensionHandler<Float,Float,Float>
-
makeNewSettableEncodedValueSelector
public SettableColumnValueSelector makeNewSettableEncodedValueSelector()
Description copied from interface:DimensionHandler
Creates and returns a new object of some implementation ofSettableColumnValueSelector
, that corresponds to the type of this DimensionHandler. E. g.LongDimensionHandler
returnsSettableLongColumnValueSelector
, etc.- Specified by:
makeNewSettableEncodedValueSelector
in interfaceDimensionHandler<Float,Float,Float>
-
-