public class StringDimensionHandler extends Object implements DimensionHandler<Integer,int[],String>
| Modifier and Type | Field and Description |
|---|---|
static Comparator<Integer> |
ENCODED_COMPARATOR |
static com.google.common.base.Function<Object,String> |
STRING_TRANSFORMER |
static Comparator<String> |
UNENCODED_COMPARATOR |
| Constructor and Description |
|---|
StringDimensionHandler(String dimensionName) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareSortedEncodedArrays(int[] lhs,
int[] rhs)
Given two arrays representing sorted encoded row value(s), return the result of their comparison.
|
String |
getDimensionName()
Get the name of the column associated with this handler.
|
int |
getLengthFromEncodedArray(int[] dimVals)
Given an array representing a single set of row value(s) for this dimension as an Object,
return the length of the array after appropriate type-casting.
|
Object |
getRowValueArrayFromColumn(Closeable column,
int currRow)
Given a subcolumn from getSubColumn, and the index of the current row, retrieve a row as an array of values.
|
Closeable |
getSubColumn(Column column)
Given a Column, return a type-specific object that can be used to retrieve row values.
|
DimensionIndexer<Integer,int[],String> |
makeIndexer()
Creates a new DimensionIndexer, a per-dimension object responsible for processing ingested rows in-memory, used by the
IncrementalIndex.
|
DimensionMergerLegacy |
makeLegacyMerger(IndexSpec indexSpec,
File outDir,
IOPeon ioPeon,
ColumnCapabilities capabilities,
ProgressIndicator progress)
Creates a new DimensionMergerLegacy, a per-dimension object responsible for merging indexes/row data across segments
and building the on-disk representation of a dimension.
|
DimensionMergerV9 |
makeMerger(IndexSpec indexSpec,
File outDir,
IOPeon ioPeon,
ColumnCapabilities capabilities,
ProgressIndicator progress)
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.
|
void |
validateSortedEncodedArrays(int[] lhs,
int[] rhs,
Indexed<String> lhsEncodings,
Indexed<String> rhsEncodings)
Given two arrays representing sorted encoded row value(s), check that the two arrays have the same encoded values,
or if the encoded values differ, that they translate into the same actual values, using the mappings
provided by lhsEncodings and rhsEncodings (if applicable).
|
public static final com.google.common.base.Function<Object,String> STRING_TRANSFORMER
public static final Comparator<Integer> ENCODED_COMPARATOR
public static final Comparator<String> UNENCODED_COMPARATOR
public StringDimensionHandler(String dimensionName)
public String getDimensionName()
DimensionHandlergetDimensionName in interface DimensionHandler<Integer,int[],String>public int getLengthFromEncodedArray(int[] dimVals)
DimensionHandlergetLengthFromEncodedArray in interface DimensionHandler<Integer,int[],String>dimVals - Array of row valuespublic int compareSortedEncodedArrays(int[] lhs,
int[] rhs)
DimensionHandlercompareSortedEncodedArrays in interface DimensionHandler<Integer,int[],String>lhs - array of row valuesrhs - array of row valuespublic void validateSortedEncodedArrays(int[] lhs,
int[] rhs,
Indexed<String> lhsEncodings,
Indexed<String> rhsEncodings)
throws SegmentValidationException
DimensionHandlervalidateSortedEncodedArrays in interface DimensionHandler<Integer,int[],String>lhs - array of row valuesrhs - array of row valueslhsEncodings - encoding lookup from lhs's segment, null if not applicable for this dimension's typerhsEncodings - encoding lookup from rhs's segment, null if not applicable for this dimension's typeSegmentValidationExceptionpublic Closeable getSubColumn(Column column)
DimensionHandlergetSubColumn in interface DimensionHandler<Integer,int[],String>column - Column for this dimension from a QueryableIndexpublic Object getRowValueArrayFromColumn(Closeable column, int currRow)
DimensionHandlergetRowValueArrayFromColumn in interface DimensionHandler<Integer,int[],String>column - Column for this dimension from a QueryableIndexcurrRow - The index of the row to retrievepublic DimensionIndexer<Integer,int[],String> makeIndexer()
DimensionHandlerDimensionIndexer interface for more information.makeIndexer in interface DimensionHandler<Integer,int[],String>public DimensionMergerV9 makeMerger(IndexSpec indexSpec, File outDir, IOPeon ioPeon, ColumnCapabilities capabilities, ProgressIndicator progress)
DimensionHandlerDimensionMergerV9 interface for more information.makeMerger in interface DimensionHandler<Integer,int[],String>indexSpec - Specification object for the index mergeoutDir - Location to store files generated by the merging processioPeon - ioPeon object passed in by IndexMerger, manages files created by the merging processcapabilities - The ColumnCapabilities of the dimension represented by this DimensionHandlerprogress - ProgressIndicator used by the merging processpublic DimensionMergerLegacy makeLegacyMerger(IndexSpec indexSpec, File outDir, IOPeon ioPeon, ColumnCapabilities capabilities, ProgressIndicator progress)
DimensionHandlerDimensionMergerLegacy interface for more information.makeLegacyMerger in interface DimensionHandler<Integer,int[],String>indexSpec - Specification object for the index mergeoutDir - Location to store files generated by the merging processioPeon - ioPeon object passed in by IndexMerger, manages files created by the merging processcapabilities - The ColumnCapabilities of the dimension represented by this DimensionHandlerprogress - ProgressIndicator used by the merging processCopyright © 2011–2016. All rights reserved.