public interface GroupByColumnSelectorStrategy extends ColumnSelectorStrategy
Modifier and Type | Field and Description |
---|---|
static int |
GROUP_BY_MISSING_VALUE |
Modifier and Type | Method and Description |
---|---|
boolean |
checkRowIndexAndAddValueToGroupingKey(int keyBufferPosition,
Object rowObj,
int rowValIdx,
ByteBuffer keyBuffer)
If rowValIdx is less than the size of rowObj (haven't handled all of the row values):
First, read the value at rowValIdx from a rowObj and write that value to the keyBuffer at keyBufferPosition.
|
int |
getGroupingKeySize()
Return the size, in bytes, of this dimension's values in the grouping key.
|
Object |
getOnlyValue(ColumnValueSelector selector)
Retrieve a single object using the
ColumnValueSelector . |
void |
initColumnValues(ColumnValueSelector selector,
int columnIndex,
Object[] valuess)
Retrieve a row object from the
ColumnValueSelector and put it in valuess at columnIndex. |
void |
initGroupingKeyColumnValue(int keyBufferPosition,
int columnIndex,
Object rowObj,
ByteBuffer keyBuffer,
int[] stack)
Read the first value within a row values object (e.
|
void |
processValueFromGroupingKey(GroupByColumnSelectorPlus selectorPlus,
ByteBuffer key,
Map<String,Object> resultMap)
Read a value from a grouping key and add it to the group by query result map, using the output name specified
in a DimensionSpec.
|
void |
writeToKeyBuffer(int keyBufferPosition,
Object obj,
ByteBuffer keyBuffer)
Write a given object to the keyBuffer at keyBufferPosition.
|
static final int GROUP_BY_MISSING_VALUE
int getGroupingKeySize()
void processValueFromGroupingKey(GroupByColumnSelectorPlus selectorPlus, ByteBuffer key, Map<String,Object> resultMap)
selectorPlus
- dimension info containing the key offset, value selector, and dimension specresultMap
- result map for the group by query being servedkey
- grouping keyvoid initColumnValues(ColumnValueSelector selector, int columnIndex, Object[] valuess)
ColumnValueSelector
and put it in valuess at columnIndex.selector
- Value selector for a column.columnIndex
- Index of the column within the row values arrayvaluess
- Row values array, one index per columnvoid initGroupingKeyColumnValue(int keyBufferPosition, int columnIndex, Object rowObj, ByteBuffer keyBuffer, int[] stack)
IndexedInts
, as the value in
a dictionary-encoded string column) and write that value to the keyBuffer at keyBufferPosition. If the row size is
0 (e. g. IndexedInts.size()
), write GROUP_BY_MISSING_VALUE
instead.
If the size of the row is > 0, write 1 to stack[] at columnIndex, otherwise write 0.keyBufferPosition
- Starting offset for this column's value within the grouping key.columnIndex
- Index of the column within the row values arrayrowObj
- Row value object for this columnkeyBuffer
- grouping keystack
- array containing the current within-row value index for each columnboolean checkRowIndexAndAddValueToGroupingKey(int keyBufferPosition, Object rowObj, int rowValIdx, ByteBuffer keyBuffer)
keyBufferPosition
- Starting offset for this column's value within the grouping key.rowObj
- Row value object for this column (e.g., IndexedInts)rowValIdx
- Index of the current value being grouped on within the rowkeyBuffer
- grouping keyObject getOnlyValue(ColumnValueSelector selector)
ColumnValueSelector
. The reading column must have a single value.selector
- Value selector for a columnvoid writeToKeyBuffer(int keyBufferPosition, Object obj, ByteBuffer keyBuffer)
keyBufferPosition
- starting offset for this column's value within the grouping keyobj
- row value object retrieved from getOnlyValue(ColumnValueSelector)
keyBuffer
- grouping keyCopyright © 2011–2018. All rights reserved.