diff options
author | Shixiong Zhu <shixiong@databricks.com> | 2016-09-14 13:33:51 -0700 |
---|---|---|
committer | Josh Rosen <joshrosen@databricks.com> | 2016-09-14 13:33:51 -0700 |
commit | e33bfaed3b160fbc617c878067af17477a0044f5 (patch) | |
tree | 369215b3c286b9d9f2694ebec7f75bbcf7fdfba4 /core/src/test/scala | |
parent | ff6e4cbdc80e2ad84c5d70ee07f323fad9374e3e (diff) | |
download | spark-e33bfaed3b160fbc617c878067af17477a0044f5.tar.gz spark-e33bfaed3b160fbc617c878067af17477a0044f5.tar.bz2 spark-e33bfaed3b160fbc617c878067af17477a0044f5.zip |
[SPARK-17463][CORE] Make CollectionAccumulator and SetAccumulator's value can be read thread-safely
## What changes were proposed in this pull request?
Make CollectionAccumulator and SetAccumulator's value can be read thread-safely to fix the ConcurrentModificationException reported in [JIRA](https://issues.apache.org/jira/browse/SPARK-17463).
## How was this patch tested?
Existing tests.
Author: Shixiong Zhu <shixiong@databricks.com>
Closes #15063 from zsxwing/SPARK-17463.
Diffstat (limited to 'core/src/test/scala')
-rw-r--r-- | core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala b/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala index 85ca9d39d4..c89be22a34 100644 --- a/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.util import java.util.Properties +import scala.collection.JavaConverters._ import scala.collection.Map import org.json4s.jackson.JsonMethods._ @@ -415,7 +416,7 @@ class JsonProtocolSuite extends SparkFunSuite { }) testAccumValue(Some(RESULT_SIZE), 3L, JInt(3)) testAccumValue(Some(shuffleRead.REMOTE_BLOCKS_FETCHED), 2, JInt(2)) - testAccumValue(Some(UPDATED_BLOCK_STATUSES), blocks, blocksJson) + testAccumValue(Some(UPDATED_BLOCK_STATUSES), blocks.asJava, blocksJson) // For anything else, we just cast the value to a string testAccumValue(Some("anything"), blocks, JString(blocks.toString)) testAccumValue(Some("anything"), 123, JString("123")) |