Class LongSumAggregator
- java.lang.Object
-
- org.apache.flink.api.common.aggregators.LongSumAggregator
-
- All Implemented Interfaces:
Serializable,Aggregator<LongValue>
@PublicEvolving public class LongSumAggregator extends Object implements Aggregator<LongValue>
AnAggregatorthat sums up long values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LongSumAggregator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaggregate(long value)Adds the given value to the current aggregate.voidaggregate(LongValue element)Aggregates the given element.LongValuegetAggregate()Gets the aggregator's current aggregate.voidreset()Resets the internal state of the aggregator.
-
-
-
Method Detail
-
getAggregate
public LongValue getAggregate()
Description copied from interface:AggregatorGets the aggregator's current aggregate.- Specified by:
getAggregatein interfaceAggregator<LongValue>- Returns:
- The aggregator's current aggregate.
-
aggregate
public void aggregate(LongValue element)
Description copied from interface:AggregatorAggregates the given element. In the case of a sum aggregator, this method adds the given value to the sum.- Specified by:
aggregatein interfaceAggregator<LongValue>- Parameters:
element- The element to aggregate.
-
aggregate
public void aggregate(long value)
Adds the given value to the current aggregate.- Parameters:
value- The value to add to the aggregate.
-
reset
public void reset()
Description copied from interface:AggregatorResets the internal state of the aggregator. This must bring the aggregator into the same state as if it was newly initialized.- Specified by:
resetin interfaceAggregator<LongValue>
-
-