diff options
author | Josh Rosen <joshrosen@eecs.berkeley.edu> | 2013-01-20 15:12:54 -0800 |
---|---|---|
committer | Josh Rosen <joshrosen@eecs.berkeley.edu> | 2013-01-21 22:32:57 -0800 |
commit | c75ae3622eeed068c44b1f823ef4d87d01a720fd (patch) | |
tree | 9a985de52fc913bbbe87945e34e8a39ffcebab40 /python/pyspark/context.py | |
parent | 7d3e359f2c463681cf0128da2c6692beb13dade9 (diff) | |
download | spark-c75ae3622eeed068c44b1f823ef4d87d01a720fd.tar.gz spark-c75ae3622eeed068c44b1f823ef4d87d01a720fd.tar.bz2 spark-c75ae3622eeed068c44b1f823ef4d87d01a720fd.zip |
Make AccumulatorParam an abstract base class.
Diffstat (limited to 'python/pyspark/context.py')
-rw-r--r-- | python/pyspark/context.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/python/pyspark/context.py b/python/pyspark/context.py index dcbed37270..a17e7a4ad1 100644 --- a/python/pyspark/context.py +++ b/python/pyspark/context.py @@ -148,16 +148,11 @@ class SparkContext(object): def accumulator(self, value, accum_param=None): """ - Create an C{Accumulator} with the given initial value, using a given - AccumulatorParam helper object to define how to add values of the data - type if provided. Default AccumulatorParams are used for integers and - floating-point numbers if you do not provide one. For other types, the - AccumulatorParam must implement two methods: - - C{zero(value)}: provide a "zero value" for the type, compatible in - dimensions with the provided C{value} (e.g., a zero vector). - - C{addInPlace(val1, val2)}: add two values of the accumulator's data - type, returning a new value; for efficiency, can also update C{val1} - in place and return it. + Create an L{Accumulator} with the given initial value, using a given + L{AccumulatorParam} helper object to define how to add values of the + data type if provided. Default AccumulatorParams are used for integers + and floating-point numbers if you do not provide one. For other types, + a custom AccumulatorParam can be used. """ if accum_param == None: if isinstance(value, int): |