K - key typeV - value typepublic class BoundedRollup<K,V extends AdditiveValue<V>> extends Object implements StreamingRollup<K,V>
min(maxNodes, nodeCount), and then order
lexicographically all such trees, the one created by this class will be
maximal, with ties broken arbitrarily.
Implementation notes: At every step only leaves are rolled up, and more precisely, those leaves which share a common parent with the property that it has the smallest value amongst all finished parent nodes which have only leaf children.
| Modifier and Type | Method and Description |
|---|---|
static <K,V extends AdditiveValue<V>> |
create(V emptyValue,
int maxNodes) |
void |
feedRow(Iterator<K> leafPath,
V v)
The rows must come in nested groups.
|
MapNode<K,V> |
finish()
Returns the tree representing the rolled-up, aggregated data.
|
String |
toString() |
public static <K,V extends AdditiveValue<V>> BoundedRollup<K,V> create(V emptyValue, int maxNodes)
public void feedRow(Iterator<K> leafPath, V v)
StreamingRollupfeedRow in interface StreamingRollup<K,V extends AdditiveValue<V>>leafPath - identifies the location of the node onto which the
value is added, starting from the root. An empty path represents the root
itself. If the node doesn't exist, it will be created.public MapNode<K,V> finish()
StreamingRollupfinish in interface StreamingRollup<K,V extends AdditiveValue<V>>Copyright © 2014. All Rights Reserved.