public class HashVectorGrouper extends Object implements VectorGrouper
VectorGrouper backed by a growable MemoryOpenHashTable. Growability is
implemented in this class because MemoryOpenHashTable is not innately growable.| Constructor and Description |
|---|
HashVectorGrouper(com.google.common.base.Supplier<ByteBuffer> bufferSupplier,
int keySize,
AggregatorAdapters aggregators,
int bufferGrouperMaxSize,
float maxLoadFactor,
int configuredInitialNumBuckets) |
| Modifier and Type | Method and Description |
|---|---|
AggregateResult |
aggregateVector(org.apache.datasketches.memory.Memory keySpace,
int startRow,
int endRow)
Aggregate the current vector of rows from "startRow" to "endRow" using the provided keys.
|
void |
close()
Close the grouper and release associated resources.
|
void |
initVectorized(int maxVectorSize)
Initialize the grouper.
|
CloseableIterator<Grouper.Entry<org.apache.datasketches.memory.Memory>> |
iterator()
Iterate through entry buckets.
|
void |
reset()
Reset the grouper to its initial state.
|
public HashVectorGrouper(com.google.common.base.Supplier<ByteBuffer> bufferSupplier, int keySize, AggregatorAdapters aggregators, int bufferGrouperMaxSize, float maxLoadFactor, int configuredInitialNumBuckets)
public void initVectorized(int maxVectorSize)
VectorGrouperVectorGrouper.aggregateVector(org.apache.datasketches.memory.Memory, int, int).initVectorized in interface VectorGrouperpublic AggregateResult aggregateVector(org.apache.datasketches.memory.Memory keySpace, int startRow, int endRow)
VectorGrouperaggregateVector in interface VectorGrouperkeySpace - array holding keys, chunked into ints. First (endRow - startRow) keys must be valid.startRow - row to start at (inclusive).endRow - row to end at (exclusive).public void reset()
VectorGrouperreset in interface VectorGrouperpublic CloseableIterator<Grouper.Entry<org.apache.datasketches.memory.Memory>> iterator()
VectorGrouperMemory object in native byte order.
After you are done with the iterator returned by this method, you should either call VectorGrouper.close() (if you are
done with the VectorGrouper) or VectorGrouper.reset() (if you want to reuse it).
Callers must process and discard the returned Grouper.Entrys immediately, because objects may be reused.
iterator in interface VectorGrouperpublic void close()
VectorGrouperclose in interface Closeableclose in interface AutoCloseableclose in interface VectorGrouperCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.