aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorWeichenXu <WeichenXu123@outlook.com>2016-05-18 11:48:46 +0100
committerSean Owen <sowen@cloudera.com>2016-05-18 11:48:46 +0100
commit2f9047b5eb969e0198b8a73e392642ca852ba786 (patch)
tree152fe58ada0fa73a5a5e151b4d0ce188c65be0b5 /core
parent33814f887aea339c99e14ce7f14ca6fcc6875015 (diff)
downloadspark-2f9047b5eb969e0198b8a73e392642ca852ba786.tar.gz
spark-2f9047b5eb969e0198b8a73e392642ca852ba786.tar.bz2
spark-2f9047b5eb969e0198b8a73e392642ca852ba786.zip
[SPARK-15322][MLLIB][CORE][SQL] update deprecate accumulator usage into accumulatorV2 in spark project
## What changes were proposed in this pull request? I use Intellj-IDEA to search usage of deprecate SparkContext.accumulator in the whole spark project, and update the code.(except those test code for accumulator method itself) ## How was this patch tested? Exisiting unit tests Author: WeichenXu <WeichenXu123@outlook.com> Closes #13112 from WeichenXu123/update_accuV2_in_mllib.
Diffstat (limited to 'core')
-rw-r--r--core/src/test/scala/org/apache/spark/rdd/AsyncRDDActionsSuite.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/test/scala/org/apache/spark/rdd/AsyncRDDActionsSuite.scala b/core/src/test/scala/org/apache/spark/rdd/AsyncRDDActionsSuite.scala
index 8cb0a295b0..58664e77d2 100644
--- a/core/src/test/scala/org/apache/spark/rdd/AsyncRDDActionsSuite.scala
+++ b/core/src/test/scala/org/apache/spark/rdd/AsyncRDDActionsSuite.scala
@@ -65,9 +65,9 @@ class AsyncRDDActionsSuite extends SparkFunSuite with BeforeAndAfterAll with Tim
test("foreachAsync") {
zeroPartRdd.foreachAsync(i => Unit).get()
- val accum = sc.accumulator(0)
+ val accum = sc.longAccumulator
sc.parallelize(1 to 1000, 3).foreachAsync { i =>
- accum += 1
+ accum.add(1)
}.get()
assert(accum.value === 1000)
}
@@ -75,9 +75,9 @@ class AsyncRDDActionsSuite extends SparkFunSuite with BeforeAndAfterAll with Tim
test("foreachPartitionAsync") {
zeroPartRdd.foreachPartitionAsync(iter => Unit).get()
- val accum = sc.accumulator(0)
+ val accum = sc.longAccumulator
sc.parallelize(1 to 1000, 9).foreachPartitionAsync { iter =>
- accum += 1
+ accum.add(1)
}.get()
assert(accum.value === 9)
}