You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/02/16 15:50:06 UTC

[GitHub] [hadoop] anuengineer commented on a change in pull request #2668: HDFS-15808. Add metrics for FSNamesystem read/write lock hold long time

anuengineer commented on a change in pull request #2668:
URL: https://github.com/apache/hadoop/pull/2668#discussion_r576928327



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystemLock.java
##########
@@ -182,6 +192,7 @@ public void readUnlock(String opName,
     final long readLockIntervalMs =
         TimeUnit.NANOSECONDS.toMillis(readLockIntervalNanos);
     if (needReport && readLockIntervalMs >= this.readLockReportingThresholdMs) {
+      numReadLockLongHold.addAndGet(1);

Review comment:
       nit: you could use incrementAndGet. Don't have to fix it for me to commit it, just flagging for your consideration. 
   https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicLong.html#incrementAndGet--




----------------------------------------------------------------
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: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org