hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1080331 - in /hadoop/hdfs/branches/HDFS-1052: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Date Thu, 10 Mar 2011 19:56:07 GMT
Author: suresh
Date: Thu Mar 10 19:56:06 2011
New Revision: 1080331

URL: http://svn.apache.org/viewvc?rev=1080331&view=rev
Log:
HDFS-1745. Federation: Fix fault injection test failures. Contributed by Suresh Srinvias.

Modified:
    hadoop/hdfs/branches/HDFS-1052/CHANGES.txt
    hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java

Modified: hadoop/hdfs/branches/HDFS-1052/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/HDFS-1052/CHANGES.txt?rev=1080331&r1=1080330&r2=1080331&view=diff
==============================================================================
--- hadoop/hdfs/branches/HDFS-1052/CHANGES.txt (original)
+++ hadoop/hdfs/branches/HDFS-1052/CHANGES.txt Thu Mar 10 19:56:06 2011
@@ -231,6 +231,7 @@ Trunk (unreleased changes)
     HDFS-1744. Federation: Add new layout version to offline image viewer
     and edits viewer. (suresh)
 
+    HDFS-1745. Federation: Fix fault injection test failures. (suresh)
 
   IMPROVEMENTS
 

Modified: hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java?rev=1080331&r1=1080330&r2=1080331&view=diff
==============================================================================
--- hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
(original)
+++ hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Thu Mar 10 19:56:06 2011
@@ -342,7 +342,7 @@ public class DataNode extends Configured
   private InetSocketAddress selfAddr;
   
   private static volatile DataNode datanodeObject = null;
-  private final String hostName; // Host name of this datanode
+  private volatile String hostName; // Host name of this datanode
   
   private static String dnThreadName;
   int socketTimeout;
@@ -1089,13 +1089,14 @@ public class DataNode extends Configured
                 
       while(shouldRun && shouldServiceRun) {
         try {
-          // reset name to machineName. Mainly for web interface. Same for all DB
-          bpRegistration.name = hostName + ":" + bpRegistration.getPort();
+          // Use returned registration from namenode with updated machine name.
           bpRegistration = bpNamenode.registerDatanode(bpRegistration);
 
           LOG.info("bpReg after =" + bpRegistration.storageInfo + 
               ";sid=" + bpRegistration.storageID + ";name="+bpRegistration.getName());
 
+          NetUtils.getHostname();
+          hostName = bpRegistration.getHost();
           break;
         } catch(SocketTimeoutException e) {  // namenode is busy
           LOG.info("Problem connecting to server: " + nnAddr);
@@ -1722,8 +1723,9 @@ public class DataNode extends Configured
   static UpgradeManagerDatanode getUpgradeManagerDatanode(String bpid) {
     DataNode dn = getDataNode();
     BPOfferService bpos = dn.blockPoolManager.get(bpid);
-    if(bpos==null)
+    if(bpos==null) {
       return null;
+    }
     return bpos.getUpgradeManager();
   }
 
@@ -2621,4 +2623,11 @@ public class DataNode extends Configured
     }
     return true;
   }
+  
+  /** Methods used by fault injection tests */
+  public DatanodeID getDatanodeId() {
+    LOG.info("SURESH machienname " + getMachineName());
+    return new DatanodeID(getMachineName(), getStorageId(),
+        infoServer.getPort(), getIpcPort());
+  }
 }



Mime
View raw message