public class StringDimensionIndexer extends Object implements DimensionIndexer<Integer,int[],String>
| Constructor and Description |
|---|
StringDimensionIndexer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkUnsortedEncodedArraysEqual(int[] lhs,
int[] rhs)
Check if two row value arrays from TimeAndDims keys are equal.
|
int |
compareUnsortedEncodedArrays(int[] lhs,
int[] rhs)
Compares the row values for this DimensionIndexer's dimension from a TimeAndDims key.
|
Object |
convertUnsortedEncodedArrayToActualArrayOrList(int[] key,
boolean asList)
Given a row value array from a TimeAndDims key, as described in the documentatiion for compareUnsortedEncodedArrays(),
convert the unsorted encoded values to a list or array of actual values.
|
int[] |
convertUnsortedEncodedArrayToSortedEncodedArray(int[] key)
Given a row value array from a TimeAndDims key, as described in the documentatiion for compareUnsortedEncodedArrays(),
convert the unsorted encoded values to an array of sorted encoded values (i.e., sorted by their corresponding actual values)
|
void |
fillBitmapsFromUnsortedEncodedArray(int[] key,
int rowNum,
com.metamx.collections.bitmap.MutableBitmap[] bitmapIndexes,
com.metamx.collections.bitmap.BitmapFactory factory)
Helper function for building bitmap indexes for integer-encoded dimensions.
|
int |
getCardinality()
Get the cardinality of this dimension's values.
|
String |
getMaxValue()
Get the maximum dimension value seen by this indexer.
|
String |
getMinValue()
Get the minimum dimension value seen by this indexer.
|
Integer |
getSortedEncodedValueFromUnsorted(Integer unsortedIntermediateValue)
Given an encoded value that was ordered by time of ingestion, return the equivalent
encoded value ordered by associated actual value.
|
Indexed<String> |
getSortedIndexedValues()
Returns an indexed structure of this dimension's sorted actual values.
|
int |
getUnsortedEncodedArrayHashCode(int[] key)
Given a row value array from a TimeAndDims key, generate a hashcode.
|
Integer |
getUnsortedEncodedValueFromSorted(Integer sortedIntermediateValue)
Given an encoded value that was ordered by associated actual value, return the equivalent
encoded value ordered by time of ingestion.
|
Object |
makeColumnValueSelector(DimensionSpec spec,
IncrementalIndexStorageAdapter.EntryHolder currEntry,
IncrementalIndex.DimensionDesc desc)
Return an object used to read rows from a StorageAdapter's Cursor.
|
ValueMatcher |
makeIndexingValueMatcher(Comparable matchValue,
IncrementalIndexStorageAdapter.EntryHolder holder,
int dimIndex)
Return a ValueMatcher that accepts an EntryHolder containing the current TimeAndDims key and the array index of this
indexer's dimension within the TimeAndDims key.
|
ValueMatcher |
makeIndexingValueMatcher(DruidPredicateFactory predicateFactory,
IncrementalIndexStorageAdapter.EntryHolder holder,
int dimIndex)
Return a ValueMatcher that accepts an EntryHolder containing the current TimeAndDims key and the array index of this
indexer's dimension within the TimeAndDims key.
|
int[] |
processRowValsToUnsortedEncodedArray(Object dimValues)
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 TimeAndDims key.
|
public int[] processRowValsToUnsortedEncodedArray(Object dimValues)
DimensionIndexerprocessRowValsToUnsortedEncodedArray in interface DimensionIndexer<Integer,int[],String>dimValues - Single row val to processpublic Integer getSortedEncodedValueFromUnsorted(Integer unsortedIntermediateValue)
DimensionIndexergetSortedEncodedValueFromUnsorted in interface DimensionIndexer<Integer,int[],String>unsortedIntermediateValue - value to convertpublic Integer getUnsortedEncodedValueFromSorted(Integer sortedIntermediateValue)
DimensionIndexergetUnsortedEncodedValueFromSorted in interface DimensionIndexer<Integer,int[],String>sortedIntermediateValue - value to convertpublic Indexed<String> getSortedIndexedValues()
DimensionIndexergetSortedIndexedValues in interface DimensionIndexer<Integer,int[],String>public String getMinValue()
DimensionIndexergetMinValue in interface DimensionIndexer<Integer,int[],String>public String getMaxValue()
DimensionIndexergetMaxValue in interface DimensionIndexer<Integer,int[],String>public int getCardinality()
DimensionIndexergetCardinality in interface DimensionIndexer<Integer,int[],String>public int compareUnsortedEncodedArrays(int[] lhs,
int[] rhs)
DimensionIndexercompareUnsortedEncodedArrays in interface DimensionIndexer<Integer,int[],String>lhs - dimension value array from a TimeAndDims keyrhs - dimension value array from a TimeAndDims keypublic boolean checkUnsortedEncodedArraysEqual(int[] lhs,
int[] rhs)
DimensionIndexercheckUnsortedEncodedArraysEqual in interface DimensionIndexer<Integer,int[],String>lhs - dimension value array from a TimeAndDims keyrhs - dimension value array from a TimeAndDims keypublic int getUnsortedEncodedArrayHashCode(int[] key)
DimensionIndexergetUnsortedEncodedArrayHashCode in interface DimensionIndexer<Integer,int[],String>key - dimension value array from a TimeAndDims keypublic Object makeColumnValueSelector(DimensionSpec spec, IncrementalIndexStorageAdapter.EntryHolder currEntry, IncrementalIndex.DimensionDesc desc)
DimensionIndexermakeColumnValueSelector in interface DimensionIndexer<Integer,int[],String>spec - Specifies the output name of a dimension and any extraction functions to be applied.currEntry - Provides access to the current TimeAndDims object in the Cursordesc - Descriptor object for this dimension within an IncrementalIndexpublic Object convertUnsortedEncodedArrayToActualArrayOrList(int[] key, boolean asList)
DimensionIndexerconvertUnsortedEncodedArrayToActualArrayOrList in interface DimensionIndexer<Integer,int[],String>key - dimension value array from a TimeAndDims keyasList - if true, return an array; if false, return a listpublic int[] convertUnsortedEncodedArrayToSortedEncodedArray(int[] key)
DimensionIndexerconvertUnsortedEncodedArrayToSortedEncodedArray in interface DimensionIndexer<Integer,int[],String>key - dimension value array from a TimeAndDims keypublic void fillBitmapsFromUnsortedEncodedArray(int[] key,
int rowNum,
com.metamx.collections.bitmap.MutableBitmap[] bitmapIndexes,
com.metamx.collections.bitmap.BitmapFactory factory)
DimensionIndexerfillBitmapsFromUnsortedEncodedArray in interface DimensionIndexer<Integer,int[],String>key - dimension value array from a TimeAndDims keyrowNum - current row numberbitmapIndexes - array of bitmaps, indexed by integer dimension valuefactory - bitmap factorypublic ValueMatcher makeIndexingValueMatcher(Comparable matchValue, IncrementalIndexStorageAdapter.EntryHolder holder, int dimIndex)
DimensionIndexermakeIndexingValueMatcher in interface DimensionIndexer<Integer,int[],String>matchValue - value to match onholder - holds the current TimeAndDims key during row iterationdimIndex - the array index of this indexer's dimension within the TimeAndDims keypublic ValueMatcher makeIndexingValueMatcher(DruidPredicateFactory predicateFactory, IncrementalIndexStorageAdapter.EntryHolder holder, int dimIndex)
DimensionIndexermakeIndexingValueMatcher in interface DimensionIndexer<Integer,int[],String>predicateFactory - Factory object that can generate predicates for each supported dimension typeholder - holds the current TimeAndDims key during row iterationdimIndex - the array index of this indexer's dimension within the TimeAndDims keyCopyright © 2011–2016. All rights reserved.