rbalamohan commented on a change in pull request #2977:
URL: https://github.com/apache/hive/pull/2977#discussion_r793440743



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -391,6 +395,15 @@ public void setConf(Configuration conf) {
     } else {
       LOG.debug("Initialized ObjectStore");
     }
+
+    if (tablelocks == null) {
+      synchronized (ObjectStore.class) {
+        if (tablelocks == null) {
+          int numTableLocks = MetastoreConf.getIntVar(conf, 
ConfVars.METASTORE_NUM_STRIPED_TABLE_LOCKS);
+          tablelocks = Striped.lock(numTableLocks);

Review comment:
       Is this different from ReentrantLock? (PaddingLock extends ReentrantLock 
and adds padding for cache line). But not heavily benchmarked. E.g 
https://github.com/google/guava/issues/3195
   
   Changing to ReenetrantLock may be easier to read?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to