public class BufferHashGrouper<KeyType> extends AbstractBufferHashGrouper<KeyType>
Grouper.BufferComparator, Grouper.Entry<T>, Grouper.KeySerde<T>, Grouper.KeySerdeFactory<T>aggregatorOffsets, aggregators, bucketSize, bufferGrouperMaxSize, bufferSupplier, HASH_SIZE, hashTable, hashTableBuffer, initialBuckets, keySerde, keySize, log, maxLoadFactor| Constructor and Description | 
|---|
BufferHashGrouper(com.google.common.base.Supplier<ByteBuffer> bufferSupplier,
                 Grouper.KeySerde<KeyType> keySerde,
                 ColumnSelectorFactory columnSelectorFactory,
                 AggregatorFactory[] aggregatorFactories,
                 int bufferGrouperMaxSize,
                 float maxLoadFactor,
                 int initialBuckets,
                 boolean useDefaultSorting)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
afterAggregateHook(int bucketOffset)
Called after a row is aggregated. 
 | 
boolean | 
canSkipAggregate(boolean bucketWasUsed,
                int bucketOffset)
Called to check if it's possible to skip aggregation for a row. 
 | 
void | 
init()
Initialize the grouper. 
 | 
boolean | 
isInitialized()
Check this grouper is initialized or not. 
 | 
CloseableIterator<Grouper.Entry<KeyType>> | 
iterator(boolean sorted)
Iterate through entries. 
 | 
void | 
newBucketHook(int bucketOffset)
Called when a new bucket is used for an entry in the hash table. 
 | 
void | 
reset()
Reset the grouper to its initial state. 
 | 
aggregate, bucketEntryForOffset, close, getBuckets, getGrowthCount, getMaxSize, getSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaggregate, hashFunctionpublic BufferHashGrouper(com.google.common.base.Supplier<ByteBuffer> bufferSupplier, Grouper.KeySerde<KeyType> keySerde, ColumnSelectorFactory columnSelectorFactory, AggregatorFactory[] aggregatorFactories, int bufferGrouperMaxSize, float maxLoadFactor, int initialBuckets, boolean useDefaultSorting)
public void init()
GrouperGrouper.aggregate(Object) and Grouper.aggregate(Object, int).public boolean isInitialized()
Grouperpublic void newBucketHook(int bucketOffset)
AbstractBufferHashGroupernewBucketHook in class AbstractBufferHashGrouper<KeyType>bucketOffset - offset of the new bucket, within the buffer returned by hashTable.getTableBuffer()public boolean canSkipAggregate(boolean bucketWasUsed,
                                int bucketOffset)
AbstractBufferHashGroupercanSkipAggregate in class AbstractBufferHashGrouper<KeyType>bucketWasUsed - Was the row a new entry in the hash table?bucketOffset - Offset of the bucket containing this row's entry in the hash table,
                     within the buffer returned by hashTable.getTableBuffer()public void afterAggregateHook(int bucketOffset)
AbstractBufferHashGrouperafterAggregateHook in class AbstractBufferHashGrouper<KeyType>bucketOffset - Offset of the bucket containing the row that was aggregated,
                     within the buffer returned by hashTable.getTableBuffer()public void reset()
Grouperpublic CloseableIterator<Grouper.Entry<KeyType>> iterator(boolean sorted)
Grouper
 Some implementations allow writes even after this method is called.  After you are done with the iterator
 returned by this method, you should either call Grouper.close() (if you are done with the Grouper) or
 Grouper.reset() (if you want to reuse it).  Some implementations allow calling Grouper.iterator(boolean) again if
 you want another iterator. But, this method must not be called by multiple threads concurrently.
 
 If "sorted" is true then the iterator will return sorted results. It will use KeyType's natural ordering on
 deserialized objects, and will use the KeySerde#comparator() on serialized objects. Woe be unto you
 if these comparators are not equivalent.
 
 Callers must process and discard the returned Grouper.Entrys immediately because some implementations can reuse the
 key objects.
sorted - return sorted resultsCopyright © 2011–2018. All rights reserved.