tanvipenumudy commented on code in PR #3424:
URL: https://github.com/apache/ozone/pull/3424#discussion_r879049217


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneManagerLock.java:
##########
@@ -202,6 +196,26 @@ private boolean lock(Resource resource, String 
resourceName,
     }
   }
 
+  private void updateLockMetrics(Resource resource, String resourceName,
+                         Consumer<String> lockFn, String lockType) {
+    long startWaitingTimeNanos = Time.monotonicNowNanos();
+    lockFn.accept(resourceName);
+
+    /**
+     *  read/write lock hold count helps in metrics updation only once in case
+     *  of reentrant locks.
+     */
+    if (lockType.equals(READ_LOCK) &&

Review Comment:
   Thank you for the suggestion, I have made the required changes to 
incorporate the switch case.



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