maropu commented on a change in pull request #32865:
URL: https://github.com/apache/spark/pull/32865#discussion_r649630875
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -53,28 +54,60 @@ import org.apache.spark.util.Utils
object SQLConf {
- private[sql] val sqlConfEntries =
- new ConcurrentHashMap[String, ConfigEntry[_]]()
+ private[this] val sqlConfEntriesUpdateLock = new Object
- val staticConfKeys: java.util.Set[String] =
- java.util.Collections.synchronizedSet(new java.util.HashSet[String]())
+ @volatile
+ private[this] var sqlConfEntries: util.Map[String, ConfigEntry[_]] =
util.Collections.emptyMap()
- private def register(entry: ConfigEntry[_]): Unit =
sqlConfEntries.merge(entry.key, entry,
- (existingConfigEntry, newConfigEntry) => {
- require(existingConfigEntry == null,
- s"Duplicate SQLConfigEntry. ${newConfigEntry.key} has been registered")
- newConfigEntry
- }
- )
+ private[this] val staticConfKeysUpdateLock = new Object
Review comment:
Q: we need the two separate locks for the static/non-static configs?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]