public abstract class AbstractLocalSplitResultAggregator<R> extends Object implements IResultHandler<R,R>
getResult()
.
Note: This implementation assumes that there is one element of the result for
each key in the original request. It places the Split
-wise results
into a total ordering over the Split
s and then delegates to a
concrete implementation to build the aggregated results out of the ordered
pairs of (Split
, partial-result).
Constructor and Description |
---|
AbstractLocalSplitResultAggregator(int size) |
Modifier and Type | Method and Description |
---|---|
void |
aggregate(R result,
Split split)
Method is invoked for each result and is responsible for combining
the results in whatever manner is meaningful for the procedure.
|
R |
getResult()
Return the aggregated results as an implementation dependent object.
|
protected abstract R |
newResult(int size,
SplitValuePair<Split,R>[] a)
Build the aggregated result by aggregate the individual results in the
given order.
|
public AbstractLocalSplitResultAggregator(int size)
size
- The #of elements in the request (which is the same as the
cardinality of the aggregated result).public void aggregate(R result, Split split)
IResultHandler
aggregate
in interface IResultHandler<R,R>
result
- The result from applying the procedure to a single index
partition.split
- The Split
that generated that result.public R getResult()
IResultHandler
getResult
in interface IResultHandler<R,R>
protected abstract R newResult(int size, SplitValuePair<Split,R>[] a)
size
- The number of keys in the original request.a
- An array of SplitValuePair
s that is ordered on
Split.fromIndex
.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.