public class StreamingMergeSortedGrouper<KeyType> extends Object implements Grouper<KeyType>
Grouper.BufferComparator, Grouper.Entry<T>, Grouper.KeySerde<T>, Grouper.KeySerdeFactory<T>
Modifier and Type | Method and Description |
---|---|
AggregateResult |
aggregate(KeyType key)
Aggregate the current row with the provided key.
|
AggregateResult |
aggregate(KeyType key,
int notUsed)
Aggregate the current row with the provided key.
|
void |
close()
Close the grouper and release associated resources.
|
void |
finish()
Signal that no more inputs are added.
|
void |
init()
Initialize the grouper.
|
boolean |
isInitialized()
Check this grouper is initialized or not.
|
CloseableIterator<Grouper.Entry<KeyType>> |
iterator()
Return a sorted iterator.
|
CloseableIterator<Grouper.Entry<KeyType>> |
iterator(boolean sorted)
Return a sorted iterator.
|
static <KeyType> int |
requiredBufferCapacity(Grouper.KeySerde<KeyType> keySerde,
AggregatorFactory[] aggregatorFactories)
Returns the minimum buffer capacity required for this grouper.
|
void |
reset()
Reset the grouper to its initial state.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hashFunction
public static <KeyType> int requiredBufferCapacity(Grouper.KeySerde<KeyType> keySerde, AggregatorFactory[] aggregatorFactories)
public void init()
Grouper
Grouper.aggregate(Object)
and Grouper.aggregate(Object, int)
.public boolean isInitialized()
Grouper
isInitialized
in interface Grouper<KeyType>
public AggregateResult aggregate(KeyType key, int notUsed)
Grouper
aggregate
in interface Grouper<KeyType>
key
- key objectnotUsed
- result of Grouper.hashFunction()
on the keypublic AggregateResult aggregate(KeyType key)
Grouper
public void reset()
Grouper
public void close()
Grouper
public void finish()
aggregate(Object)
is called for the last input.public CloseableIterator<Grouper.Entry<KeyType>> iterator()
public CloseableIterator<Grouper.Entry<KeyType>> iterator(boolean sorted)
Copyright © 2011–2018. All rights reserved.