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