abstract class AccumulatorV2[IN, OUT] extends Serializable
The base class for accumulators, that can accumulate inputs of type IN, and produce output of
type OUT.
OUT should be a type that can be read atomically (e.g., Int, Long), or thread-safely
(e.g., synchronized collections) because it will be read from other threads.
- Source
 - AccumulatorV2.scala
 
- Alphabetic
 - By Inheritance
 
- AccumulatorV2
 - Serializable
 - Serializable
 - AnyRef
 - Any
 
- Hide All
 - Show All
 
- Public
 - All
 
Instance Constructors
-  new AccumulatorV2()
 
Abstract Value Members
- 
      
      
      
        
      
    
      
        abstract 
        def
      
      
        add(v: IN): Unit
      
      
      
Takes the inputs and accumulates.
 - 
      
      
      
        
      
    
      
        abstract 
        def
      
      
        copy(): AccumulatorV2[IN, OUT]
      
      
      
Creates a new copy of this accumulator.
 - 
      
      
      
        
      
    
      
        abstract 
        def
      
      
        isZero: Boolean
      
      
      
Returns if this accumulator is zero value or not.
Returns if this accumulator is zero value or not. e.g. for a counter accumulator, 0 is zero value; for a list accumulator, Nil is zero value.
 - 
      
      
      
        
      
    
      
        abstract 
        def
      
      
        merge(other: AccumulatorV2[IN, OUT]): Unit
      
      
      
Merges another same-type accumulator into this one and update its state, i.e.
Merges another same-type accumulator into this one and update its state, i.e. this should be merge-in-place.
 - 
      
      
      
        
      
    
      
        abstract 
        def
      
      
        reset(): Unit
      
      
      
Resets this accumulator, which is zero value.
Resets this accumulator, which is zero value. i.e. call
isZeromust return true. - 
      
      
      
        
      
    
      
        abstract 
        def
      
      
        value: OUT
      
      
      
Defines the current value of this accumulator
 
Concrete Value Members
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        !=(arg0: Any): Boolean
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        ##(): Int
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        ==(arg0: Any): Boolean
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        asInstanceOf[T0]: T0
      
      
      
- Definition Classes
 - Any
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        clone(): AnyRef
      
      
      
- Attributes
 - protected[lang]
 - Definition Classes
 - AnyRef
 - Annotations
 - @throws( ... ) @native() @IntrinsicCandidate()
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        copyAndReset(): AccumulatorV2[IN, OUT]
      
      
      
Creates a new copy of this accumulator, which is zero value.
Creates a new copy of this accumulator, which is zero value. i.e. call
isZeroon the copy must return true. - 
      
      
      
        
      
    
      
        final 
        def
      
      
        eq(arg0: AnyRef): Boolean
      
      
      
- Definition Classes
 - AnyRef
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        equals(arg0: Any): Boolean
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        getClass(): Class[_]
      
      
      
- Definition Classes
 - AnyRef → Any
 - Annotations
 - @native() @IntrinsicCandidate()
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        hashCode(): Int
      
      
      
- Definition Classes
 - AnyRef → Any
 - Annotations
 - @native() @IntrinsicCandidate()
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        id: Long
      
      
      
Returns the id of this accumulator, can only be called after registration.
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        isInstanceOf[T0]: Boolean
      
      
      
- Definition Classes
 - Any
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        isRegistered: Boolean
      
      
      
Returns true if this accumulator has been registered.
Returns true if this accumulator has been registered.
- Note
 All accumulators must be registered before use, or it will throw exception.
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        name: Option[String]
      
      
      
Returns the name of this accumulator, can only be called after registration.
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        ne(arg0: AnyRef): Boolean
      
      
      
- Definition Classes
 - AnyRef
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        notify(): Unit
      
      
      
- Definition Classes
 - AnyRef
 - Annotations
 - @native() @IntrinsicCandidate()
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        notifyAll(): Unit
      
      
      
- Definition Classes
 - AnyRef
 - Annotations
 - @native() @IntrinsicCandidate()
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        synchronized[T0](arg0: ⇒ T0): T0
      
      
      
- Definition Classes
 - AnyRef
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        toString(): String
      
      
      
- Definition Classes
 - AccumulatorV2 → AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(arg0: Long, arg1: Int): Unit
      
      
      
- Definition Classes
 - AnyRef
 - Annotations
 - @throws( ... )
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(arg0: Long): Unit
      
      
      
- Definition Classes
 - AnyRef
 - Annotations
 - @throws( ... ) @native()
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(): Unit
      
      
      
- Definition Classes
 - AnyRef
 - Annotations
 - @throws( ... )
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        withBufferSerialized(): AccumulatorV2[IN, OUT]
      
      
      
- Attributes
 - protected
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        writeReplace(): Any
      
      
      
- Attributes
 - protected
 
 
Deprecated Value Members
- 
      
      
      
        
      
    
      
        
        def
      
      
        finalize(): Unit
      
      
      
- Attributes
 - protected[lang]
 - Definition Classes
 - AnyRef
 - Annotations
 - @throws( classOf[java.lang.Throwable] ) @Deprecated
 - Deprecated