You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/22 07:08:32 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #28938: [SPARK-32118][SQL] Use fine-grained read write lock for each database in HiveExternalCatalog

cloud-fan commented on a change in pull request #28938:
URL: https://github.com/apache/spark/pull/28938#discussion_r509927098



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
##########
@@ -78,6 +80,9 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat
     classOf[TException].getCanonicalName,
     classOf[InvocationTargetException].getCanonicalName)
 
+  // Locks used to synchronized read or write operations per database
+  private val clientLocks = new ConcurrentHashMap[String, ReadWriteLock]()

Review comment:
       Can we use a fixed number of lock objects? e.g. `hash(db_name) % num_lock_objs`




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org