Repository: spark Updated Branches: refs/heads/master d43415075 -> 0bbe61223
Update SQLConf.scala use concurrent.ConcurrentHashMap instead of util.Collections.synchronizedMap Author: baishuo(ç½ç¡) <[email protected]> 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 Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/0bbe6122 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/0bbe6122 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/0bbe6122 Branch: refs/heads/master Commit: 0bbe61223eda3f33bbf8992d2a8f0d47813f4873 Parents: d434150 Author: baishuo(ç½ç¡) <[email protected]> Authored: Fri Jul 4 00:25:31 2014 -0700 Committer: Reynold Xin <[email protected]> Committed: Fri Jul 4 00:25:31 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/0bbe6122/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 3b5abab..95ed0f2 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 @@ -64,20 +64,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)
