diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 391005caa10..308b61f91ed 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -647,6 +647,9 @@ Release 2.7.0 - UNRELEASED HDFS-7795. Show warning if not all favored nodes were chosen by namenode (kihwal) + HDFS-7780. Update use of Iterator to Iterable in DataXceiverServer and + SnapshotDiffInfo. (Ray Chiang via aajisaka) + OPTIMIZATIONS HDFS-7454. Reduce memory footprint for AclEntries in NameNode. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java index 9bf95eb825d..caf6eaaa920 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java @@ -252,9 +252,9 @@ class DataXceiverServer implements Runnable { // be set true before calling this method. synchronized void restartNotifyPeers() { assert (datanode.shouldRun == true && datanode.shutdownForUpgrade); - for (Peer p : peers.keySet()) { + for (Thread t : peers.values()) { // interrupt each and every DataXceiver thread. - peers.get(p).interrupt(); + t.interrupt(); } } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotDiffInfo.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotDiffInfo.java index 197b8ae49bb..a576c571d08 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotDiffInfo.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotDiffInfo.java @@ -187,12 +187,13 @@ class SnapshotDiffInfo { */ public SnapshotDiffReport generateReport() { List diffReportList = new ArrayList(); - for (INode node : diffMap.keySet()) { - diffReportList.add(new DiffReportEntry(DiffType.MODIFY, diffMap - .get(node), null)); + for (Map.Entry drEntry : diffMap.entrySet()) { + INode node = drEntry.getKey(); + byte[][] path = drEntry.getValue(); + diffReportList.add(new DiffReportEntry(DiffType.MODIFY, path, null)); if (node.isDirectory()) { List subList = generateReport(dirDiffMap.get(node), - diffMap.get(node), isFromEarlier(), renameMap); + path, isFromEarlier(), renameMap); diffReportList.addAll(subList); } }