KeyType - type of the key that will be passed inpublic interface Grouper<KeyType extends Comparable<KeyType>> extends Closeable
| Modifier and Type | Interface and Description |
|---|---|
static class |
Grouper.Entry<T> |
static interface |
Grouper.KeyComparator |
static interface |
Grouper.KeySerde<T>
Possibly-stateful object responsible for serde and comparison of keys.
|
static interface |
Grouper.KeySerdeFactory<T> |
| Modifier and Type | Method and Description |
|---|---|
boolean |
aggregate(KeyType key)
Aggregate the current row with the provided key.
|
boolean |
aggregate(KeyType key,
int keyHash)
Aggregate the current row with the provided key.
|
void |
close()
Close the grouper and release associated resources.
|
Iterator<Grouper.Entry<KeyType>> |
iterator(boolean sorted)
Iterate through entries.
|
void |
reset()
Reset the grouper to its initial state.
|
boolean aggregate(KeyType key, int keyHash)
key - key objectkeyHash - result of Groupers.hash(Object) on the keyboolean aggregate(KeyType key)
key - keyvoid reset()
void close()
close in interface AutoCloseableclose in interface CloseableIterator<Grouper.Entry<KeyType>> iterator(boolean sorted)
close() (if you are done with the Grouper), reset() (if you
want to reuse it), or iterator(boolean) again if you want another iterator.
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 Grouper.KeySerde.comparator() on serialized objects. Woe be unto you
if these comparators are not equivalent.sorted - return sorted resultsCopyright © 2011–2016. All rights reserved.