org.apache.storm.streams.operations.aggregators

## Class LongSum

- java.lang.Object
- - org.apache.storm.streams.operations.aggregators.LongSum

- All Implemented Interfaces:
    Serializable, CombinerAggregator<Number,Long,Long>, Operation

      public class LongSum
      extends Object
      implements CombinerAggregator<Number,Long,Long>

  Computes the long sum of the input values.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LongSum()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Long` | `apply(Long aggregate, Number value)` Updates the accumulator by applying the current accumulator with the value.
    `Long` | `init()` The initial value of the accumulator to start with.
    `Long` | `merge(Long accum1, Long accum2)` Merges two accumulators and returns the merged accumulator.
    `Long` | `result(Long accum)` Produces a result value out of the accumulator.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.storm.streams.operations.CombinerAggregator

      `of`

- - ### Constructor Detail

    - #### LongSum

          public LongSum()

  - ### Method Detail

    - #### init

          public Long init()

      Description copied from interface: `CombinerAggregator`

      The initial value of the accumulator to start with.

      Specified by:
        `init` in interface `CombinerAggregator<Number,Long,Long>`
      Returns:
        the initial value of the accumulator

    - #### apply

          public Long apply(Long aggregate,
                            Number value)

      Description copied from interface: `CombinerAggregator`

      Updates the accumulator by applying the current accumulator with the value.

      Specified by:
        `apply` in interface `CombinerAggregator<Number,Long,Long>`
      Parameters:
        `aggregate` - the current accumulator
        `value` - the value
      Returns:
        the updated accumulator

    - #### merge

          public Long merge(Long accum1,
                            Long accum2)

      Description copied from interface: `CombinerAggregator`

      Merges two accumulators and returns the merged accumulator.

      Specified by:
        `merge` in interface `CombinerAggregator<Number,Long,Long>`
      Parameters:
        `accum1` - the first accumulator
        `accum2` - the second accumulator
      Returns:
        the merged accumulator

    - #### result

          public Long result(Long accum)

      Description copied from interface: `CombinerAggregator`

      Produces a result value out of the accumulator.

      Specified by:
        `result` in interface `CombinerAggregator<Number,Long,Long>`
      Parameters:
        `accum` - the accumulator
      Returns:
        the result

Copyright © 2021 The Apache Software Foundation. All rights reserved.