EncodedType
- class of a single encoded valueEncodedKeyComponentType
- A row key contains a component for each dimension, this param specifies the
class of this dimension's key component. A column type that supports multivalue rows
should use an array type (Strings would use int[]). Column types without multivalue
row support should use single objects (e.g., Long, Float).ActualType
- class of a single actual valuepublic interface DimensionHandler<EncodedType extends Comparable<EncodedType>,EncodedKeyComponentType,ActualType extends Comparable<ActualType>>
IncrementalIndex
and IndexMerger
and allowing for abstracted
development of additional dimension types.
A DimensionHandler is a stateless object, and thus thread-safe; its methods should be pure functions.
The EncodedType and ActualType are Comparable because columns used as dimensions must have sortable values.Modifier and Type | Method and Description |
---|---|
String |
getDimensionName()
Get the name of the column associated with this handler.
|
DimensionSchema |
getDimensionSchema(ColumnCapabilities capabilities) |
default DimensionSpec |
getDimensionSpec()
Create a
DimensionSpec for this handler |
Comparator<ColumnValueSelector> |
getEncodedValueSelectorComparator()
Returns a comparator that knows how to compare
ColumnValueSelector of the assumed dimension type,
corresponding to this DimensionHandler. |
int |
getLengthOfEncodedKeyComponent(EncodedKeyComponentType 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.
|
default DimensionSchema.MultiValueHandling |
getMultivalueHandling()
Get
DimensionSchema.MultiValueHandling for the column associated with this handler. |
DimensionIndexer<EncodedType,EncodedKeyComponentType,ActualType> |
makeIndexer(boolean useMaxMemoryEstimates)
Creates a new DimensionIndexer, a per-dimension object responsible for processing ingested rows in-memory, used
by the IncrementalIndex.
|
DimensionMergerV9 |
makeMerger(IndexSpec indexSpec,
SegmentWriteOutMedium segmentWriteOutMedium,
ColumnCapabilities capabilities,
ProgressIndicator progress,
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 of
SettableColumnValueSelector , that corresponds
to the type of this DimensionHandler. |
String getDimensionName()
default DimensionSpec getDimensionSpec()
DimensionSpec
for this handlerDimensionSchema getDimensionSchema(ColumnCapabilities capabilities)
@Nullable default DimensionSchema.MultiValueHandling getMultivalueHandling()
DimensionSchema.MultiValueHandling
for the column associated with this handler.
Only string columns can have DimensionSchema.MultiValueHandling
currently.DimensionIndexer<EncodedType,EncodedKeyComponentType,ActualType> makeIndexer(boolean useMaxMemoryEstimates)
DimensionIndexer
interface for more information.useMaxMemoryEstimates
- true if the created DimensionIndexer should use
maximum values to estimate on-heap memoryDimensionMergerV9 makeMerger(IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, ColumnCapabilities capabilities, ProgressIndicator progress, Closer closer)
DimensionMergerV9
interface for more information.indexSpec
- 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 processint getLengthOfEncodedKeyComponent(EncodedKeyComponentType dimVals)
dimVals
- Values for this dimension from a rowComparator<ColumnValueSelector> getEncodedValueSelectorComparator()
ColumnValueSelector
of the assumed dimension type,
corresponding to this DimensionHandler. E. g. StringDimensionHandler
returns a comparator, that compares
ColumnValueSelector
s as DimensionSelector
s.
The comparison rules used by this method should match the rules used by
DimensionIndexer.compareUnsortedEncodedKeyComponents(EncodedKeyComponentType, EncodedKeyComponentType)
, otherwise incorrect ordering/merging of rows
can occur during ingestion, causing issues such as imperfect rollup.SettableColumnValueSelector makeNewSettableEncodedValueSelector()
SettableColumnValueSelector
, that corresponds
to the type of this DimensionHandler. E. g. LongDimensionHandler
returns SettableLongColumnValueSelector
, etc.Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.