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.
raw docstring

add!clj

(add! acc v)

Add an element to the accumulated value.

Add an element to the accumulated value.
sourceraw docstring

avgclj

(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-accumulatorclj

(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

countclj

(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-accumulatorclj

(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?clj

(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-accumulatorclj

(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!clj

(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

nameclj

(name acc)

Return the name of the accumulator, if any.

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

reset!clj

(reset! acc)

Reset the accumulator to its empty or zero value.

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

sumclj

(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

valueclj

(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