public class MapperRowCounter extends AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>>
Constructor and Description |
---|
MapperRowCounter() |
Modifier and Type | Method and Description |
---|---|
void |
add(Long v)
Takes the inputs and accumulates.
|
MapperRowCounter |
copy()
Creates a new copy of this accumulator.
|
MapperRowCounter |
copyAndReset()
Creates a new copy of this accumulator, which is zero value.
|
boolean |
isZero()
Returns false if this accumulator has had any values added to it or the sum is non-zero.
|
void |
merge(AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>> other)
Merges another same-type accumulator into this one and update its state, i.e.
|
void |
reset()
Resets this accumulator, which is zero value.
|
void |
setPartitionId(Integer id) |
java.util.List<scala.Tuple2<Integer,Long>> |
value()
Defines the current value of this accumulator
|
id, isRegistered, name, toString
public void add(Long v)
AccumulatorV2
add
in class AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>>
v
- (undocumented)public MapperRowCounter copy()
AccumulatorV2
copy
in class AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>>
public MapperRowCounter copyAndReset()
AccumulatorV2
isZero
on the copy
must return true.copyAndReset
in class AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>>
public boolean isZero()
isZero
in class AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>>
public void merge(AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>> other)
AccumulatorV2
merge
in class AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>>
other
- (undocumented)public void reset()
AccumulatorV2
isZero
must
return true.reset
in class AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>>
public void setPartitionId(Integer id)
public java.util.List<scala.Tuple2<Integer,Long>> value()
AccumulatorV2
value
in class AccumulatorV2<Long,java.util.List<scala.Tuple2<Integer,Long>>>