Modifier and Type | Method and Description |
---|---|
Grouper.BufferComparator |
bufferComparator()
Return an object that knows how to compare two serialized keys.
|
Grouper.BufferComparator |
bufferComparatorWithAggregators(AggregatorFactory[] aggregatorFactories,
int[] aggregatorOffsets)
When pushing down limits, it may also be necessary to compare aggregated values along with the key
using the bufferComparator.
|
T |
fromByteBuffer(ByteBuffer buffer,
int position)
Deserialize a key from a buffer.
|
List<String> |
getDictionary()
Return the dictionary of this KeySerde.
|
Class<T> |
keyClazz()
Class of the keys.
|
int |
keySize()
Size of the keys returned by
toByteBuffer(Object) (which must be a fixed size) |
void |
reset()
Reset the keySerde to its initial state.
|
ByteBuffer |
toByteBuffer(T key)
Serialize a key.
|
int keySize()
toByteBuffer(Object)
(which must be a fixed size)List<String> getDictionary()
ByteBuffer toByteBuffer(T key)
#aggregate(Comparable)
method. The buffer will not
be retained after the aggregate method returns, so reusing buffers is OK.
This method may return null, which indicates that some internal resource limit has been reached and
no more keys can be generated. In this situation you can call reset()
and try again, although
beware the caveats on that method.
key
- key objectT fromByteBuffer(ByteBuffer buffer, int position)
Grouper.iterator(boolean)
method.buffer
- buffer containing the keyposition
- key start position in the bufferGrouper.BufferComparator bufferComparator()
Grouper.iterator(boolean)
method if sorting is enabled.Grouper.BufferComparator bufferComparatorWithAggregators(AggregatorFactory[] aggregatorFactories, int[] aggregatorOffsets)
aggregatorFactories
- Array of aggregators from a GroupByQueryaggregatorOffsets
- Offsets for each aggregator in aggregatorFactories pointing to their location
within the grouping key + aggs buffer.void reset()
fromByteBuffer(ByteBuffer, int)
and bufferComparator()
may no longer work properly on previously-serialized keys.Copyright © 2011–2018. All rights reserved.