Repository: spark Updated Branches: refs/heads/branch-1.0-jdbc e23656960 -> 519167524
Update SQLConf.scala use concurrent.ConcurrentHashMap instead of util.Collections.synchronizedMap Author: baishuo(ç½ç¡) <vc_j...@hotmail.com> Closes #1272 from baishuo/master and squashes the following commits: 51ec55d [baishuo(ç½ç¡)] Update SQLConf.scala 63da043 [baishuo(ç½ç¡)] Update SQLConf.scala 36b6dbd [baishuo(ç½ç¡)] Update SQLConf.scala 864faa0 [baishuo(ç½ç¡)] Update SQLConf.scala 593096b [baishuo(ç½ç¡)] Update SQLConf.scala 7304d9b [baishuo(ç½ç¡)] Update SQLConf.scala 843581c [baishuo(ç½ç¡)] Update SQLConf.scala 1d3e4a2 [baishuo(ç½ç¡)] Update SQLConf.scala 0740f28 [baishuo(ç½ç¡)] Update SQLConf.scala (cherry picked from commit 0bbe61223eda3f33bbf8992d2a8f0d47813f4873) Signed-off-by: Reynold Xin <r...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/51916752 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/51916752 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/51916752 Branch: refs/heads/branch-1.0-jdbc Commit: 519167524dea35a789afaaf16432ee7fee999d35 Parents: e236569 Author: baishuo(ç½ç¡) <vc_j...@hotmail.com> Authored: Fri Jul 4 00:25:31 2014 -0700 Committer: Reynold Xin <r...@apache.org> Committed: Fri Jul 4 00:25:38 2014 -0700 ---------------------------------------------------------------------- sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/51916752/sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala ---------------------------------------------------------------------- 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 b378252..64b9503 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 @@ -47,20 +47,17 @@ trait SQLConf { } def get(key: String): String = { - if (!settings.containsKey(key)) { - throw new NoSuchElementException(key) - } - settings.get(key) + Option(settings.get(key)).getOrElse(throw new NoSuchElementException(key)) } def get(key: String, defaultValue: String): String = { - if (!settings.containsKey(key)) defaultValue else settings.get(key) + Option(settings.get(key)).getOrElse(defaultValue) } def getAll: Array[(String, String)] = settings.asScala.toArray def getOption(key: String): Option[String] = { - if (!settings.containsKey(key)) None else Some(settings.get(key)) + Option(settings.get(key)) } def contains(key: String): Boolean = settings.containsKey(key)