Liking cljdoc? Tell your friends :D

sparkplug.accumulator

Functions for working with Accumulator objects which can aggregate values across executors.

Functions for working with Accumulator objects which can aggregate values
across executors.

add!

(add! acc v)

Add an element to the accumulated value.

Add an element to the accumulated value.
sourceraw docstring

avg

(avg acc)

Return the average of all the values added to the accumulator. The accumulator must hold either long or double values.

Return the average of all the values added to the accumulator. The
accumulator must hold either long or double values.
sourceraw docstring

collection-accumulator

(collection-accumulator spark-context)
(collection-accumulator spark-context acc-name)

Create and register a collection accumulator, which starts with empty list and accumulates inputs by adding them into the list.

Create and register a collection accumulator, which starts with empty list
and accumulates inputs by adding them into the list.
sourceraw docstring

count

(count acc)

Return the number of values added to the accumulator. The accumulator must hold either long or double values.

Return the number of values added to the accumulator. The accumulator must
hold either long or double values.
sourceraw docstring

double-accumulator

(double-accumulator spark-context)
(double-accumulator spark-context acc-name)

Create and register a double accumulator, which starts with 0.0 and accumulates inputs by summing them.

Create and register a double accumulator, which starts with 0.0 and
accumulates inputs by summing them.
sourceraw docstring

empty?

(empty? acc)

True if the accumulator has not had any values added to it.

True if the accumulator has not had any values added to it.
sourceraw docstring

long-accumulator

(long-accumulator spark-context)
(long-accumulator spark-context acc-name)

Create and register a long accumulator, which starts with 0 and accumulates inputs by summing them.

Create and register a long accumulator, which starts with 0 and accumulates
inputs by summing them.
sourceraw docstring

merge!

(merge! a b)

Merge an accumulator b into a. Both accumulators must have the same type.

Merge an accumulator `b` into `a`. Both accumulators must have the same
type.
sourceraw docstring

name

(name acc)

Return the name of the accumulator, if any.

Return the name of the accumulator, if any.
sourceraw docstring

reset!

(reset! acc)

Reset the accumulator to its empty or zero value.

Reset the accumulator to its empty or zero value.
sourceraw docstring

sum

(sum acc)

Return the sum of all the values added to the accumulator. The accumulator must hold either long or double values.

Return the sum of all the values added to the accumulator. The accumulator
must hold either long or double values.
sourceraw docstring

value

(value acc)

Return the current value of the accumulator. This can only be called by the driver.

Return the current value of the accumulator. This can only be called by the
driver.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close