public class StringDimensionIndexer extends Object implements DimensionIndexer<Integer,int[],String>
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.base.Function<Object,String> |
STRING_TRANSFORMER |
static Comparator<String> |
UNENCODED_COMPARATOR |
ARRAY, LIST| Constructor and Description |
|---|
StringDimensionIndexer(DimensionSchema.MultiValueHandling multiValueHandling) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkUnsortedEncodedKeyComponentsEqual(int[] lhs,
int[] rhs)
Check if two row value arrays from TimeAndDims keys are equal.
|
int |
compareUnsortedEncodedKeyComponents(int[] lhs,
int[] rhs)
Compares the row values for this DimensionIndexer's dimension from a TimeAndDims key.
|
Object |
convertUnsortedEncodedKeyComponentToActualArrayOrList(int[] key,
boolean asList)
Given a row value array from a TimeAndDims key, as described in the documentation for
compareUnsortedEncodedKeyComponents(), convert the unsorted encoded values to a list or array of actual values.
|
int[] |
convertUnsortedEncodedKeyComponentToSortedEncodedKeyComponent(int[] key)
Given a row value array from a TimeAndDims key, as described in the documentation for
compareUnsortedEncodedKeyComponents(), convert the unsorted encoded values to an array of sorted encoded values
(i.e., sorted by their corresponding actual values)
|
void |
fillBitmapsFromUnsortedEncodedKeyComponent(int[] 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.
|
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 |
getUnsortedEncodedKeyComponentHashCode(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.
|
ValueType |
getValueType() |
DimensionSelector |
makeDimensionSelector(DimensionSpec spec,
IncrementalIndexStorageAdapter.EntryHolder currEntry,
IncrementalIndex.DimensionDesc desc)
Return an object used to read values from this indexer's column as Strings.
|
FloatColumnSelector |
makeFloatColumnSelector(IncrementalIndexStorageAdapter.EntryHolder currEntry,
IncrementalIndex.DimensionDesc desc)
Return an object used to read values from this indexer's column as Floats.
|
LongColumnSelector |
makeLongColumnSelector(IncrementalIndexStorageAdapter.EntryHolder currEntry,
IncrementalIndex.DimensionDesc desc)
Return an object used to read values from this indexer's column as Longs.
|
ObjectColumnSelector |
makeObjectColumnSelector(DimensionSpec spec,
IncrementalIndexStorageAdapter.EntryHolder currEntry,
IncrementalIndex.DimensionDesc desc)
Return an object used to read values from this indexer's column as Objects.
|
int[] |
processRowValsToUnsortedEncodedKeyComponent(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 static final com.google.common.base.Function<Object,String> STRING_TRANSFORMER
public static final Comparator<String> UNENCODED_COMPARATOR
public StringDimensionIndexer(DimensionSchema.MultiValueHandling multiValueHandling)
public ValueType getValueType()
getValueType in interface DimensionIndexer<Integer,int[],String>public int[] processRowValsToUnsortedEncodedKeyComponent(Object dimValues)
DimensionIndexerprocessRowValsToUnsortedEncodedKeyComponent 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 compareUnsortedEncodedKeyComponents(int[] lhs,
int[] rhs)
DimensionIndexercompareUnsortedEncodedKeyComponents in interface DimensionIndexer<Integer,int[],String>lhs - dimension value array from a TimeAndDims keyrhs - dimension value array from a TimeAndDims keypublic boolean checkUnsortedEncodedKeyComponentsEqual(int[] lhs,
int[] rhs)
DimensionIndexercheckUnsortedEncodedKeyComponentsEqual in interface DimensionIndexer<Integer,int[],String>lhs - dimension value array from a TimeAndDims keyrhs - dimension value array from a TimeAndDims keypublic int getUnsortedEncodedKeyComponentHashCode(int[] key)
DimensionIndexergetUnsortedEncodedKeyComponentHashCode in interface DimensionIndexer<Integer,int[],String>key - dimension value array from a TimeAndDims keypublic DimensionSelector makeDimensionSelector(DimensionSpec spec, IncrementalIndexStorageAdapter.EntryHolder currEntry, IncrementalIndex.DimensionDesc desc)
DimensionIndexermakeDimensionSelector 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 LongColumnSelector makeLongColumnSelector(IncrementalIndexStorageAdapter.EntryHolder currEntry, IncrementalIndex.DimensionDesc desc)
DimensionIndexermakeLongColumnSelector in interface DimensionIndexer<Integer,int[],String>currEntry - Provides access to the current TimeAndDims object in the Cursordesc - Descriptor object for this dimension within an IncrementalIndexpublic FloatColumnSelector makeFloatColumnSelector(IncrementalIndexStorageAdapter.EntryHolder currEntry, IncrementalIndex.DimensionDesc desc)
DimensionIndexermakeFloatColumnSelector in interface DimensionIndexer<Integer,int[],String>currEntry - Provides access to the current TimeAndDims object in the Cursordesc - Descriptor object for this dimension within an IncrementalIndexpublic ObjectColumnSelector makeObjectColumnSelector(DimensionSpec spec, IncrementalIndexStorageAdapter.EntryHolder currEntry, IncrementalIndex.DimensionDesc desc)
DimensionIndexermakeObjectColumnSelector 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 convertUnsortedEncodedKeyComponentToActualArrayOrList(int[] key, boolean asList)
DimensionIndexerconvertUnsortedEncodedKeyComponentToActualArrayOrList 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[] convertUnsortedEncodedKeyComponentToSortedEncodedKeyComponent(int[] key)
DimensionIndexerconvertUnsortedEncodedKeyComponentToSortedEncodedKeyComponent in interface DimensionIndexer<Integer,int[],String>key - dimension value array from a TimeAndDims keypublic void fillBitmapsFromUnsortedEncodedKeyComponent(int[] key,
int rowNum,
MutableBitmap[] bitmapIndexes,
BitmapFactory factory)
DimensionIndexerfillBitmapsFromUnsortedEncodedKeyComponent 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 factoryCopyright © 2011–2017. All rights reserved.