File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
sql/core/src/main/scala/org/apache/spark/sql Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ import scala.collection.JavaConverters._
2626 * queried either by passing SET commands into Spark SQL's DSL
2727 * functions (sql(), hql(), etc.), or by programmatically using setters and
2828 * getters of this class. This class is thread-safe.
29+ *
30+ * SQLConf is thread-safe (internally synchronized so safe to be used in multiple threads).
2931 */
3032trait SQLConf {
3133
@@ -71,11 +73,9 @@ trait SQLConf {
7173 Option (settings.get(key)).getOrElse(defaultValue)
7274 }
7375
74- def getAll : Array [(String , String )] = settings.asScala.toArray
76+ def getAll : Array [(String , String )] = settings.synchronized { settings. asScala.toArray }
7577
76- def getOption (key : String ): Option [String ] = {
77- Option (settings.get(key))
78- }
78+ def getOption (key : String ): Option [String ] = Option (settings.get(key))
7979
8080 def contains (key : String ): Boolean = settings.containsKey(key)
8181
You can’t perform that action at this time.
0 commit comments