Class AccumulatorV2Wrapper<IN,​OUT>

  • Type Parameters:
    IN - the type parameter for what is being accumulated
    OUT - the type parameter for the result of the accumulation
    All Implemented Interfaces:
    Serializable, scala.Serializable

    public class AccumulatorV2Wrapper<IN,​OUT>
    extends org.apache.spark.util.AccumulatorV2<IN,​OUT>
    implements Serializable
    Wraps a LocalMAccumulator making it usable by Spark
    Author:
    David B. Bracewell
    See Also:
    Serialized Form
    • Constructor Detail

      • AccumulatorV2Wrapper

        public AccumulatorV2Wrapper​(LocalMAccumulator<IN,​OUT> accumulator)
        Instantiates a new AccumulatorV2Wrapper.
        Parameters:
        accumulator - the accumulator to wrap
    • Method Detail

      • copyAndReset

        public org.apache.spark.util.AccumulatorV2<IN,​OUT> copyAndReset()
        Overrides:
        copyAndReset in class org.apache.spark.util.AccumulatorV2<IN,​OUT>
      • add

        public void add​(IN v)
        Specified by:
        add in class org.apache.spark.util.AccumulatorV2<IN,​OUT>
      • copy

        public org.apache.spark.util.AccumulatorV2<IN,​OUT> copy()
        Specified by:
        copy in class org.apache.spark.util.AccumulatorV2<IN,​OUT>
      • isZero

        public boolean isZero()
        Specified by:
        isZero in class org.apache.spark.util.AccumulatorV2<IN,​OUT>
      • merge

        public void merge​(org.apache.spark.util.AccumulatorV2<IN,​OUT> other)
        Specified by:
        merge in class org.apache.spark.util.AccumulatorV2<IN,​OUT>
      • getWrappedName

        public Optional<String> getWrappedName()
        Gets the name of the wrapped accumulator
        Returns:
        the name of the wrapped accumulator as an optional
      • reset

        public void reset()
        Specified by:
        reset in class org.apache.spark.util.AccumulatorV2<IN,​OUT>
      • value

        public OUT value()
        Specified by:
        value in class org.apache.spark.util.AccumulatorV2<IN,​OUT>