hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjs...@apache.org
Subject [36/50] [abbrv] hadoop git commit: HDFS-7780. Update use of Iterator to Iterable in DataXceiverServer and SnapshotDiffInfo. Contributed by Ray Chiang.
Date Wed, 18 Feb 2015 21:19:34 GMT
HDFS-7780. Update use of Iterator to Iterable in DataXceiverServer and SnapshotDiffInfo. Contributed
by Ray Chiang.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6dc8812a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6dc8812a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6dc8812a

Branch: refs/heads/YARN-2928
Commit: 6dc8812a95bf369ec1f2e3d8a9473033172736cd
Parents: 409113d
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Tue Feb 17 14:47:53 2015 -0800
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Tue Feb 17 14:47:53 2015 -0800

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                 | 3 +++
 .../hadoop/hdfs/server/datanode/DataXceiverServer.java      | 4 ++--
 .../hdfs/server/namenode/snapshot/SnapshotDiffInfo.java     | 9 +++++----
 3 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6dc8812a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 391005c..308b61f 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.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6dc8812a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java
----------------------------------------------------------------------
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 9bf95eb..caf6eaa 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();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6dc8812a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotDiffInfo.java
----------------------------------------------------------------------
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 197b8ae..a576c57 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<DiffReportEntry> diffReportList = new ArrayList<DiffReportEntry>();
-    for (INode node : diffMap.keySet()) {
-      diffReportList.add(new DiffReportEntry(DiffType.MODIFY, diffMap
-          .get(node), null));
+    for (Map.Entry<INode,byte[][]> drEntry : diffMap.entrySet()) {
+      INode node = drEntry.getKey();
+      byte[][] path = drEntry.getValue();
+      diffReportList.add(new DiffReportEntry(DiffType.MODIFY, path, null));
       if (node.isDirectory()) {
         List<DiffReportEntry> subList = generateReport(dirDiffMap.get(node),
-            diffMap.get(node), isFromEarlier(), renameMap);
+            path, isFromEarlier(), renameMap);
         diffReportList.addAll(subList);
       }
     }


Mime
View raw message