hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Akira AJISAKA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7780) Update use of Iterator to Iterable
Date Fri, 13 Feb 2015 02:28:11 GMT

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

Akira AJISAKA commented on HDFS-7780:
-------------------------------------

Thanks [~rchiang] for the report and the patch. Some comments: 
1. You can use {{peers.values()}} to simplify the code 
{code}
-    for (Peer p : peers.keySet()) {
+    for (Map.Entry<Peer,Thread> pEntry : peers.entrySet()) {
       // interrupt each and every DataXceiver thread.
-      peers.get(p).interrupt();
+      pEntry.getValue().interrupt();
{code}
as follows:
{code}
    for (Thread t : peers.values()) {
      t.interrupt();
    }
{code}
2. The value is actually the relative path of the parent, so it would be better to use 'path'
instead of 'nDiff'.
{code}
+      byte[][] nDiff = drEntry.getValue();
{code}
3. (minor) This lines can be consolidate into one.
{code}
+      diffReportList.add(new DiffReportEntry(DiffType.MODIFY, nDiff,
+          null));
{code}

> Update use of Iterator to Iterable
> ----------------------------------
>
>                 Key: HDFS-7780
>                 URL: https://issues.apache.org/jira/browse/HDFS-7780
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Ray Chiang
>            Assignee: Ray Chiang
>            Priority: Minor
>         Attachments: HDFS-7780.001.patch
>
>
> Found these using the IntelliJ Findbugs-IDEA plugin, which uses findbugs3.



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

Mime
View raw message