duongkame commented on code in PR #4885:
URL: https://github.com/apache/ozone/pull/4885#discussion_r1316133836


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneManagerLock.java:
##########
@@ -95,34 +98,36 @@ public class OzoneManagerLock implements IOzoneManagerLock {
    * @param conf Configuration object
    */
   public OzoneManagerLock(ConfigurationSource conf) {
-    boolean fair = conf.getBoolean(OZONE_MANAGER_FAIR_LOCK,
-        OZONE_MANAGER_FAIR_LOCK_DEFAULT);
-    manager = new LockManager<>(conf, fair);
     omLockMetrics = OMLockMetrics.create();
+
+    // TODO: for now, guava Striped doesn't allow create a striped
+    //  ReadWriteLock with fair-lock yet.
+    //  https://github.com/google/guava/issues/2514.
+    //  We may have to consider implement our own striped locks.
+    //boolean fair = conf.getBoolean(OZONE_MANAGER_FAIR_LOCK,
+    //    OZONE_MANAGER_FAIR_LOCK_DEFAULT);
+
+    Map<Resource, Striped<ReadWriteLock>> stripedLockMap =
+        new EnumMap<>(Resource.class);
+    for (Resource r : Resource.values()) {
+      stripedLockMap.put(r, createStripeLock(r, conf));

Review Comment:
   Yup, we can mimic a simpler version in our own code base.



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