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

Haohui Mai commented on HDFS-7531:
----------------------------------

Looks good to me. Just a minor nit:

{code}
-    List<byte[]> blocksVolumeIds = new 
ArrayList<byte[]>(volumes.volumes.size());
+    List<byte[]> blocksVolumeIds = new ArrayList<byte[]>(curVolumes.size());
{code}

It can be simplified as 

{code}
+    List<byte[]> blocksVolumeIds = new ArrayList<>(curVolumes.size());
{code}

Since we're on Java 7.


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

Reply via email to