public class LegacyAccumulatorWrapper<R,T> extends AccumulatorV2<T,R>
Constructor and Description |
---|
LegacyAccumulatorWrapper(R initialValue,
AccumulableParam<R,T> param) |
Modifier and Type | Method and Description |
---|---|
void |
add(T v)
Takes the inputs and accumulates.
|
LegacyAccumulatorWrapper<R,T> |
copy()
Creates a new copy of this accumulator.
|
boolean |
isZero()
Returns if this accumulator is zero value or not.
|
void |
merge(AccumulatorV2<T,R> other)
Merges another same-type accumulator into this one and update its state, i.e.
|
void |
reset()
Resets this accumulator, which is zero value.
|
R |
value()
Defines the current value of this accumulator
|
copyAndReset, id, isRegistered, name, toString
public LegacyAccumulatorWrapper(R initialValue, AccumulableParam<R,T> param)
public boolean isZero()
AccumulatorV2
isZero
in class AccumulatorV2<T,R>
public LegacyAccumulatorWrapper<R,T> copy()
AccumulatorV2
copy
in class AccumulatorV2<T,R>
public void reset()
AccumulatorV2
isZero
must
return true.reset
in class AccumulatorV2<T,R>
public void add(T v)
AccumulatorV2
add
in class AccumulatorV2<T,R>
v
- (undocumented)public void merge(AccumulatorV2<T,R> other)
AccumulatorV2
merge
in class AccumulatorV2<T,R>
other
- (undocumented)public R value()
AccumulatorV2
value
in class AccumulatorV2<T,R>