From a7bcb98f93a2b55126e087e18ec75f8c1da40a71 Mon Sep 17 00:00:00 2001 From: scwf Date: Sun, 17 Aug 2014 13:08:38 +0800 Subject: [PATCH] use ConcurrentHashMap in sql conf, intead synchronizedMap --- sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala | 4 ++-- .../org/apache/spark/sql/hive/execution/HiveQuerySuite.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala b/sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala index 90de11182e605..79c190ee08612 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala @@ -50,8 +50,8 @@ private[spark] object SQLConf { trait SQLConf { import SQLConf._ - @transient protected[spark] val settings = java.util.Collections.synchronizedMap( - new java.util.HashMap[String, String]()) + @transient protected[spark] val settings = + new java.util.concurrent.ConcurrentHashMap[String, String] /** ************************ Spark SQL Params/Hints ******************* */ // TODO: refactor so that these hints accessors don't pollute the name space of SQLContext? diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala index fdb2f41f5a5b6..5b107fe0dbbf8 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala @@ -473,7 +473,7 @@ class HiveQuerySuite extends HiveComparisonTest { sql(s"SET ${testKey + testKey}=${testVal + testVal}") assert(hiveconf.get(testKey + testKey, "") == testVal + testVal) - assertResult(Array(s"$testKey=$testVal", s"${testKey + testKey}=${testVal + testVal}")) { + assertResult(Array( s"${testKey + testKey}=${testVal + testVal}", s"$testKey=$testVal")) { sql(s"SET").collect().map(_.getString(0)) } @@ -501,7 +501,7 @@ class HiveQuerySuite extends HiveComparisonTest { sql(s"SET ${testKey + testKey}=${testVal + testVal}") assert(hiveconf.get(testKey + testKey, "") == testVal + testVal) - assertResult(Array(s"$testKey=$testVal", s"${testKey + testKey}=${testVal + testVal}")) { + assertResult(Array(s"${testKey + testKey}=${testVal + testVal}", s"$testKey=$testVal")) { sql("SET").collect().map(_.getString(0)) }