org.apache.spark
Interface AccumulableParam<R,T>

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
AccumulatorParam<T>
All Known Implementing Classes:
AccumulatorParam.DoubleAccumulatorParam$, AccumulatorParam.FloatAccumulatorParam$, AccumulatorParam.IntAccumulatorParam$, AccumulatorParam.LongAccumulatorParam$, SparkContext.DoubleAccumulatorParam$, SparkContext.FloatAccumulatorParam$, SparkContext.IntAccumulatorParam$, SparkContext.LongAccumulatorParam$, Vector.VectorAccumParam$

public interface AccumulableParam<R,T>
extends java.io.Serializable

Helper object defining how to accumulate values of a particular type. An implicit AccumulableParam needs to be available when you create Accumulables of a specific type.


Method Summary
 R addAccumulator(R r, T t)
          Add additional data to the accumulator value.
 R addInPlace(R r1, R r2)
          Merge two accumulated values together.
 R zero(R initialValue)
          Return the "zero" (identity) value for an accumulator type, given its initial value.
 

Method Detail

addAccumulator

R addAccumulator(R r,
                 T t)
Add additional data to the accumulator value. Is allowed to modify and return r for efficiency (to avoid allocating objects).

Parameters:
r - the current value of the accumulator
t - the data to be added to the accumulator
Returns:
the new value of the accumulator

addInPlace

R addInPlace(R r1,
             R r2)
Merge two accumulated values together. Is allowed to modify and return the first value for efficiency (to avoid allocating objects).

Parameters:
r1 - one set of accumulated data
r2 - another set of accumulated data
Returns:
both data sets merged together

zero

R zero(R initialValue)
Return the "zero" (identity) value for an accumulator type, given its initial value. For example, if R was a vector of N dimensions, this would return a vector of N zeroes.

Parameters:
initialValue - (undocumented)
Returns:
(undocumented)