hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r740136 - in /hadoop/core/branches/branch-0.19: CHANGES.txt src/test/org/apache/hadoop/hdfs/NNThroughputBenchmark.java src/test/org/apache/hadoop/hdfs/server/namenode/TestHeartbeatHandling.java
Date Mon, 02 Feb 2009 22:28:52 GMT
Author: hairong
Date: Mon Feb  2 22:28:52 2009
New Revision: 740136

URL: http://svn.apache.org/viewvc?rev=740136&view=rev
Log:
Fix HADOOP-5156 in branch 0.19.

Modified:
    hadoop/core/branches/branch-0.19/CHANGES.txt
    hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/NNThroughputBenchmark.java
    hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/namenode/TestHeartbeatHandling.java

Modified: hadoop/core/branches/branch-0.19/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/CHANGES.txt?rev=740136&r1=740135&r2=740136&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.19/CHANGES.txt Mon Feb  2 22:28:52 2009
@@ -82,6 +82,9 @@
     HADOOP-5034. NameNode should send both replication and deletion requests
     to DataNode in one reply to a heartbeat. (hairong)
 
+    HADOOP-5156. TestHeartbeatHandling uses MiiDFSCluster.getNamesystem()
+    which does not exit in branch 0.19 and 0.20. (hairong)
+
 Release 0.19.0 - 2008-11-18
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/NNThroughputBenchmark.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/NNThroughputBenchmark.java?rev=740136&r1=740135&r2=740136&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/NNThroughputBenchmark.java
(original)
+++ hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/NNThroughputBenchmark.java
Mon Feb  2 22:28:52 2009
@@ -726,10 +726,13 @@
      */
     void sendHeartbeat() throws IOException {
       // register datanode
-      DatanodeCommand cmd = nameNode.sendHeartbeat(
+      DatanodeCommand[] cmds = nameNode.sendHeartbeat(
           dnRegistration, DF_CAPACITY, DF_USED, DF_CAPACITY - DF_USED, 0, 0);
-      if(cmd != null)
-        LOG.debug("sendHeartbeat Name-node reply: " + cmd.getAction());
+      if(cmds != null) {
+        for (DatanodeCommand cmd : cmds ) {
+          LOG.debug("sendHeartbeat Name-node reply: " + cmd.getAction());
+        }
+      }
     }
 
     boolean addBlock(Block blk) {
@@ -757,13 +760,18 @@
      */
     int replicateBlocks() throws IOException {
       // register datanode
-      DatanodeCommand cmd = nameNode.sendHeartbeat(
+      DatanodeCommand[] cmds = nameNode.sendHeartbeat(
           dnRegistration, DF_CAPACITY, DF_USED, DF_CAPACITY - DF_USED, 0, 0);
-      if(cmd == null || cmd.getAction() != DatanodeProtocol.DNA_TRANSFER)
-        return 0;
-      // Send a copy of a block to another datanode
-      BlockCommand bcmd = (BlockCommand)cmd;
-      return transferBlocks(bcmd.getBlocks(), bcmd.getTargets());
+      if (cmds != null) {
+        for (DatanodeCommand cmd : cmds) {
+          if (cmd.getAction() == DatanodeProtocol.DNA_TRANSFER) {
+            // Send a copy of a block to another datanode
+            BlockCommand bcmd = (BlockCommand)cmd;
+            return transferBlocks(bcmd.getBlocks(), bcmd.getTargets());
+          }
+        }
+      }
+      return 0;
     }
 
     /**

Modified: hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/namenode/TestHeartbeatHandling.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/namenode/TestHeartbeatHandling.java?rev=740136&r1=740135&r2=740136&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/namenode/TestHeartbeatHandling.java
(original)
+++ hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/server/namenode/TestHeartbeatHandling.java
Mon Feb  2 22:28:52 2009
@@ -27,7 +27,7 @@
     final MiniDFSCluster cluster = new MiniDFSCluster(conf, 1, true, null);
     try {
       cluster.waitActive();
-      final FSNamesystem namesystem = cluster.getNamesystem();
+      final FSNamesystem namesystem = cluster.getNameNode().namesystem;
       final DatanodeRegistration nodeReg = cluster.getDataNodes().get(0).dnRegistration;
       DatanodeDescriptor dd = namesystem.getDatanode(nodeReg);
       



Mime
View raw message