From 3a38db1ea96f0b1045f78fb5aa093be302c1ab42 Mon Sep 17 00:00:00 2001 From: Ilya Ganelin Date: Fri, 9 Jan 2015 13:30:55 -0500 Subject: [PATCH] Verified documentation update by building via jekyll --- docs/programming-guide.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/programming-guide.md b/docs/programming-guide.md index f216b22362b5b..0ade46886ffd5 100644 --- a/docs/programming-guide.md +++ b/docs/programming-guide.md @@ -1316,31 +1316,31 @@ For accumulator updates performed inside actions only, Spark guarantees t will only be applied once, i.e. restarted tasks will not update the value. In transformations, users should be aware of that each task's update may be applied more than once if tasks or job stages are re-executed. -In addition, accumulators do not maintain lineage for the operations that use them. Consequently, accumulators updates are not guaranteed to be executed when made within a lazy transformation like `map()`. Unless something has triggered the evaluation of the lazy transformation that updates the value of the accumlator, subsequent operations will not themselves trigger that evaluation and the value of the accumulator will remain unchanged. The below code fragment demonstrates this issue: +In addition, accumulators do not maintain lineage for the operations that use them. Consequently, accumulator updates are not guaranteed to be executed when made within a lazy transformation like `map()`. Unless something has triggered the evaluation of the lazy transformation that updates the value of the accumlator, subsequent operations will not themselves trigger that evaluation and the value of the accumulator will remain unchanged. The below code fragment demonstrates this issue:
{% highlight scala %} - val acc = sc.accumulator(0) - data.map(x => acc += x; f(x)) - // Here, acc is still 0 because no actions have cause the `map` to be computed. +val acc = sc.accumulator(0) +data.map(x => acc += x; f(x)) +// Here, acc is still 0 because no actions have cause the `map` to be computed. {% endhighlight %}
{% highlight java %} - Accumulator accum = sc.accumulator(0); - data.map(x -> accum.add(x); f(x);); - // Here, acc is still 0 because no actions have cause the `map` to be computed. +Accumulator accum = sc.accumulator(0); +data.map(x -> accum.add(x); f(x);); +// Here, accum is still 0 because no actions have cause the `map` to be computed. {% endhighlight %}
{% highlight python %} - accum = sc.accumulator(0) - data.map(lambda x => acc.add(x); f(x)) - # Here, acc is still 0 because no actions have cause the `map` to be computed. +accum = sc.accumulator(0) +data.map(lambda x => acc.add(x); f(x)) +# Here, acc is still 0 because no actions have cause the `map` to be computed. {% endhighlight %}