[ 
https://issues.apache.org/jira/browse/HDFS-10924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15561397#comment-15561397
 ] 

Chris Douglas commented on HDFS-10924:
--------------------------------------

bq. Personally feels the following change would be more readable: [snip]
This follows 
[guidance|https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#nanoTime--]
 for {{System.nanoTime}}.

The HDFS {{InstrumentedLock}} class contains nearly identical functionality. If 
Common will introduce other instrumented locks, then this should replace what's 
in HDFS.

{{AutoCloseableReadLock}} and {{AutoCloseableReadLock}} are redundant with the 
base impl, mod {{isLocked}} (which returns {{isWriteLocked}} for 
{{AutoCloseableReadLock}}). As in {{o.a.h.hdfs.InstrumentedLock}}, this should 
not build around {{AutoCloseableLock}} as the base API, but the classes in 
{{java.util.concurrent.locks}}. Specifically, an {{InstrumentedReadWriteLock}} 
should return instrumented locks for {{readLock()}} and {{writeLock()}}. It's 
up to the caller to wrap what's returned in an {{AutoCloseableLock}}, if 
desired.

> Add a new instrumented read-write lock
> --------------------------------------
>
>                 Key: HDFS-10924
>                 URL: https://issues.apache.org/jira/browse/HDFS-10924
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode
>            Reporter: Jingcheng Du
>            Assignee: Jingcheng Du
>         Attachments: HDFS-10924-2.patch, HDFS-10924-3.patch, 
> HDFS-10924-4.patch, HDFS-10924.patch
>
>
> Add a new instrumented read-write lock in hadoop common, so that the 
> HDFS-9668 can use this to improve the locking in FsDatasetImpl



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to