File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/test Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .sql .catalyst .test
1919
20- import org .apache .spark .sql .catalyst .CatalystConf
21-
2220import scala .collection .immutable
23- import scala .collection .mutable
21+ import scala .collection .JavaConversions ._
22+
23+ import org .apache .spark .sql .catalyst .CatalystConf
2424
2525/** A CatalystConf that can be used for local testing. */
2626class SimpleCatalystConf (caseSensitive : Boolean ) extends CatalystConf {
27- val map = mutable.Map [String , String ]()
27+ val settings = java.util.Collections .synchronizedMap(
28+ new java.util.HashMap [String , String ]())
2829
2930 override def caseSensitiveAnalysis : Boolean = caseSensitive
3031
3132 override def setConf (key : String , value : String ) : Unit = {
32- map .put(key, value)
33+ settings .put(key, value)
3334 }
35+
3436 override def getConf (key : String ) : String = {
35- map .get(key).get
37+ settings .get(key)
3638 }
39+
3740 override def getConf (key : String , defaultValue : String ) : String = {
38- map.getOrElse (key, defaultValue)
41+ Option (settings.get (key)).getOrElse( defaultValue)
3942 }
40- override def getAllConfs : immutable.Map [String , String ] = {
41- map.toMap
43+
44+ override def getAllConfs : immutable.Map [String , String ] = settings.synchronized {
45+ settings.toMap
4246 }
4347}
You can’t perform that action at this time.
0 commit comments