hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7531) Improve the concurrent access on FsVolumeList
Date Wed, 17 Dec 2014 18:43:14 GMT

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

   * Read access to this atomic reference array is not synchronized.
   * This list is replaced on modification holding "this" lock.
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.

   * Returns a unmodifiable list view of all the volumes.
   * Note that this list is unmodifiable.
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


> 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
> This JIRA proposes to use {{AtomicReference}} to encapture {{volumes}} to provide better
concurrent access.

This message was sent by Atlassian JIRA

View raw message