public class FloatDimensionIndexer extends Object implements DimensionIndexer<Float,Float,Float>
| Modifier and Type | Field and Description |
|---|---|
static Comparator<Float> |
FLOAT_COMPARATOR |
| Constructor and Description |
|---|
FloatDimensionIndexer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkUnsortedEncodedKeyComponentsEqual(Float lhs,
Float rhs)
Check if two row value arrays from Row keys are equal.
|
int |
compareUnsortedEncodedKeyComponents(Float lhs,
Float rhs)
Compares the row values for this DimensionIndexer's dimension from a Row key.
|
Object |
convertUnsortedEncodedKeyComponentToActualList(Float key)
Given a row value array from a Row key, as described in the documentation for
DimensionIndexer.compareUnsortedEncodedKeyComponents(EncodedKeyComponentType, EncodedKeyComponentType), convert the unsorted encoded values to a list of actual values. |
ColumnValueSelector |
convertUnsortedValuesToSorted(ColumnValueSelector selectorWithUnsortedValues)
Converts dictionary-encoded row values from unspecified (random) encoding order, to sorted encoding.
|
long |
estimateEncodedKeyComponentSize(Float key)
Gives the estimated size in bytes for the given key
|
void |
fillBitmapsFromUnsortedEncodedKeyComponent(Float key,
int rowNum,
MutableBitmap[] bitmapIndexes,
BitmapFactory factory)
Helper function for building bitmap indexes for integer-encoded dimensions.
|
int |
getCardinality()
Get the cardinality of this dimension's values.
|
Float |
getMaxValue()
Get the maximum dimension value seen by this indexer.
|
Float |
getMinValue()
Get the minimum dimension value seen by this indexer.
|
CloseableIndexed<Float> |
getSortedIndexedValues()
Returns an indexed structure of this dimension's sorted actual values.
|
int |
getUnsortedEncodedKeyComponentHashCode(Float key)
Given a row value array from a Row key, generate a hashcode.
|
Float |
getUnsortedEncodedValueFromSorted(Float sortedIntermediateValue)
Given an encoded value that was ordered by associated actual value, return the equivalent
encoded value ordered by time of ingestion.
|
ColumnValueSelector<?> |
makeColumnValueSelector(IncrementalIndexRowHolder currEntry,
IncrementalIndex.DimensionDesc desc)
Return an object used to read values from this indexer's column.
|
DimensionSelector |
makeDimensionSelector(DimensionSpec spec,
IncrementalIndexRowHolder currEntry,
IncrementalIndex.DimensionDesc desc)
Return an object used to read values from this indexer's column as Strings.
|
Float |
processRowValsToUnsortedEncodedKeyComponent(Object dimValues,
boolean reportParseExceptions)
Given a single row value or list of row values (for multi-valued dimensions), update any internal data structures
with the ingested values and return the row values as an array to be used within a Row key.
|
void |
setSparseIndexed()
This method will be called while building an
IncrementalIndex whenever a known dimension column (either
through an explicit schema on the ingestion spec, or auto-discovered while processing rows) is absent in any row
that is processed, to allow an indexer to account for any missing rows if necessary. |
public static final Comparator<Float> FLOAT_COMPARATOR
public Float processRowValsToUnsortedEncodedKeyComponent(@Nullable Object dimValues, boolean reportParseExceptions)
DimensionIndexerprocessRowValsToUnsortedEncodedKeyComponent in interface DimensionIndexer<Float,Float,Float>dimValues - Single row val to processpublic void setSparseIndexed()
DimensionIndexerIncrementalIndex whenever a known dimension column (either
through an explicit schema on the ingestion spec, or auto-discovered while processing rows) is absent in any row
that is processed, to allow an indexer to account for any missing rows if necessary. Useful so that a string
DimensionSelector built on top of an IncrementalIndex may accurately report
DimensionDictionarySelector.nameLookupPossibleInAdvance() by allowing it to track if it has any implicit null valued
rows.
At index persist/merge time all missing columns for a row will be explicitly replaced with the value appropriate
null or default value.setSparseIndexed in interface DimensionIndexer<Float,Float,Float>public long estimateEncodedKeyComponentSize(Float key)
DimensionIndexerestimateEncodedKeyComponentSize in interface DimensionIndexer<Float,Float,Float>key - dimension value array from a TimeAndDims keypublic Float getUnsortedEncodedValueFromSorted(Float sortedIntermediateValue)
DimensionIndexergetUnsortedEncodedValueFromSorted in interface DimensionIndexer<Float,Float,Float>sortedIntermediateValue - value to convertpublic CloseableIndexed<Float> getSortedIndexedValues()
DimensionIndexergetSortedIndexedValues in interface DimensionIndexer<Float,Float,Float>public Float getMinValue()
DimensionIndexergetMinValue in interface DimensionIndexer<Float,Float,Float>public Float getMaxValue()
DimensionIndexergetMaxValue in interface DimensionIndexer<Float,Float,Float>public int getCardinality()
DimensionIndexergetCardinality in interface DimensionIndexer<Float,Float,Float>public DimensionSelector makeDimensionSelector(DimensionSpec spec, IncrementalIndexRowHolder currEntry, IncrementalIndex.DimensionDesc desc)
DimensionIndexermakeDimensionSelector in interface DimensionIndexer<Float,Float,Float>spec - Specifies the output name of a dimension and any extraction functions to be applied.currEntry - Provides access to the current Row object in the Cursordesc - Descriptor object for this dimension within an IncrementalIndexpublic ColumnValueSelector<?> makeColumnValueSelector(IncrementalIndexRowHolder currEntry, IncrementalIndex.DimensionDesc desc)
DimensionIndexermakeColumnValueSelector in interface DimensionIndexer<Float,Float,Float>currEntry - Provides access to the current Row object in the Cursordesc - Descriptor object for this dimension within an IncrementalIndexpublic int compareUnsortedEncodedKeyComponents(@Nullable Float lhs, @Nullable Float rhs)
DimensionIndexerDimensionHandler.getEncodedValueSelectorComparator(), otherwise incorrect ordering/merging of rows
can occur during ingestion, causing issues such as imperfect rollup.compareUnsortedEncodedKeyComponents in interface DimensionIndexer<Float,Float,Float>lhs - dimension value array from a Row keyrhs - dimension value array from a Row keypublic boolean checkUnsortedEncodedKeyComponentsEqual(@Nullable Float lhs, @Nullable Float rhs)
DimensionIndexercheckUnsortedEncodedKeyComponentsEqual in interface DimensionIndexer<Float,Float,Float>lhs - dimension value array from a Row keyrhs - dimension value array from a Row keypublic int getUnsortedEncodedKeyComponentHashCode(@Nullable Float key)
DimensionIndexergetUnsortedEncodedKeyComponentHashCode in interface DimensionIndexer<Float,Float,Float>key - dimension value array from a Row keypublic Object convertUnsortedEncodedKeyComponentToActualList(Float key)
DimensionIndexerDimensionIndexer.compareUnsortedEncodedKeyComponents(EncodedKeyComponentType, EncodedKeyComponentType), convert the unsorted encoded values to a list of actual values.
If the key has one element, this method should return a single Object instead of a list.convertUnsortedEncodedKeyComponentToActualList in interface DimensionIndexer<Float,Float,Float>key - dimension value array from a Row keypublic ColumnValueSelector convertUnsortedValuesToSorted(ColumnValueSelector selectorWithUnsortedValues)
DimensionIndexerDimensionMerger.convertSortedSegmentRowValuesToMergedRowValues(int, org.apache.druid.segment.ColumnValueSelector). The latter method requires sorted encoding
values on the input, because DimensionMerger.writeMergedValueDictionary(java.util.List<org.apache.druid.segment.IndexableAdapter>) takes sorted lookups as it's input.convertUnsortedValuesToSorted in interface DimensionIndexer<Float,Float,Float>public void fillBitmapsFromUnsortedEncodedKeyComponent(Float key, int rowNum, MutableBitmap[] bitmapIndexes, BitmapFactory factory)
DimensionIndexerfillBitmapsFromUnsortedEncodedKeyComponent in interface DimensionIndexer<Float,Float,Float>key - dimension value array from a Row keyrowNum - current row numberbitmapIndexes - array of bitmaps, indexed by integer dimension valuefactory - bitmap factoryCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.