[
https://issues.apache.org/jira/browse/HDFS-7531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14250291#comment-14250291
]
Colin Patrick McCabe commented on HDFS-7531:
--------------------------------------------
Oops, just found two minor comment issues when I was going to commit this.
{code}
/**
* Read access to this atomic reference array is not synchronized.
* This list is replaced on modification holding "this" lock.
*/
{code}
Can you remove this comment? It is no longer accurate because we don't hold
the "this" lock when replacing the atomic reference. I don't think we need the
first part, either... it's assumed that objects in {{AtomicReference}} are
accessed locklessly unless otherwise noted.
{code}
/**
* Returns a unmodifiable list view of all the volumes.
* Note that this list is unmodifiable.
*/
{code}
This comment is a bit redundant. If it's an "unmodifiable list" then we don't
need to also note that it is unmodifiable. Let's get rid of the second line,
and change unmodifiable to "immutable" since that's more idiomatic
thanks
> Improve the concurrent access on FsVolumeList
> ---------------------------------------------
>
> Key: HDFS-7531
> URL: https://issues.apache.org/jira/browse/HDFS-7531
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: datanode
> Affects Versions: 2.6.0
> Reporter: Lei (Eddy) Xu
> Assignee: Lei (Eddy) Xu
> Attachments: HDFS-7531.000.patch, HDFS-7531.001.patch
>
>
> {{FsVolumeList}} uses {{synchronized}} to protect the update on
> {{FsVolumeList#volumes}}, while various operations (e.g., {{checkDirs()}},
> {{getAvailable()}}) iterate {{volumes}} without protection.
> This JIRA proposes to use {{AtomicReference}} to encapture {{volumes}} to
> provide better concurrent access.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)