aboutsummaryrefslogtreecommitdiff
path: root/docs/programming-guide.md
diff options
context:
space:
mode:
authorSean Owen <sowen@cloudera.com>2016-06-12 11:44:33 -0700
committerReynold Xin <rxin@databricks.com>2016-06-12 11:44:33 -0700
commitf51dfe616b24b4234199c98ea857a586a93a889f (patch)
tree2803e1675f1948670ebc3f042789f4b401aa2b3e /docs/programming-guide.md
parent50248dcfff3ba79b73323f3a804c1e19a8be6097 (diff)
downloadspark-f51dfe616b24b4234199c98ea857a586a93a889f.tar.gz
spark-f51dfe616b24b4234199c98ea857a586a93a889f.tar.bz2
spark-f51dfe616b24b4234199c98ea857a586a93a889f.zip
[SPARK-15086][CORE][STREAMING] Deprecate old Java accumulator API
## What changes were proposed in this pull request? - Deprecate old Java accumulator API; should use Scala now - Update Java tests and examples - Don't bother testing old accumulator API in Java 8 (too) - (fix a misspelling too) ## How was this patch tested? Jenkins tests Author: Sean Owen <sowen@cloudera.com> Closes #13606 from srowen/SPARK-15086.
Diffstat (limited to 'docs/programming-guide.md')
-rw-r--r--docs/programming-guide.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/programming-guide.md b/docs/programming-guide.md
index 70fd627c6f..3f081a0e8f 100644
--- a/docs/programming-guide.md
+++ b/docs/programming-guide.md
@@ -1394,7 +1394,7 @@ Note that, when programmers define their own type of AccumulatorV2, the resultin
<div data-lang="java" markdown="1">
{% highlight java %}
-Accumulator<Integer> accum = sc.accumulator(0);
+LongAccumulator accum = sc.sc().longAccumulator();
sc.parallelize(Arrays.asList(1, 2, 3, 4)).foreach(x -> accum.add(x));
// ...
@@ -1485,7 +1485,7 @@ data.map { x => accum += x; x }
<div data-lang="java" markdown="1">
{% highlight java %}
-Accumulator<Integer> accum = sc.accumulator(0);
+LongAccumulator accum = sc.sc().longAccumulator();
data.map(x -> { accum.add(x); return f(x); });
// Here, accum is still 0 because no actions have caused the `map` to be computed.
{% endhighlight %}