hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1074678 - in /hadoop/hdfs/branches/HDFS-1052: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Date Fri, 25 Feb 2011 19:37:24 GMT
Author: suresh
Date: Fri Feb 25 19:37:24 2011
New Revision: 1074678

URL: http://svn.apache.org/viewvc?rev=1074678&view=rev
Log:
HDFS-1653. Federation: Block received message from datanode sends invalid DatanodeRegistration.
Contributed by Tanping Wang.


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=1074678&r1=1074677&r2=1074678&view=diff
==============================================================================
--- hadoop/hdfs/branches/HDFS-1052/CHANGES.txt (original)
+++ hadoop/hdfs/branches/HDFS-1052/CHANGES.txt Fri Feb 25 19:37:24 2011
@@ -28,6 +28,9 @@ Trunk (unreleased changes)
     HDFS-1637. Federation: FSDataset in Datanode should be created after 
     initial handshake with namenode. (boryas and jitendra)
 
+    HDFS-1653. Federation: Block received message from datanode sends invalid 
+    DatanodeRegistration. (Tanping via suresh)
+
   IMPROVEMENTS
 
     HDFS-1510. Added test-patch.properties required by test-patch.sh (nigel)

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=1074678&r1=1074677&r2=1074678&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
Fri Feb 25 19:37:24 2011
@@ -445,11 +445,12 @@ public class DataNode extends Configured
   // calls specific to BP
   protected void notifyNamenodeReceivedBlock(ExtendedBlock block, String delHint) {
     BPOfferService bpos = bpMapping.get(block.getPoolId());
-    if(bpos != null)
+    if(bpos != null) {
       bpos.notifyNamenodeReceivedBlock(block, delHint); 
-    else
+    } else {
       LOG.warn("Cannot find BPOfferService for reporting block received for bpid="
           + block.getPoolId());
+    }
   }
 
   /**
@@ -623,7 +624,7 @@ public class DataNode extends Configured
         if(delHintArray == null || delHintArray.length != blockArray.length ) {
           LOG.warn("Panic: block array & delHintArray are not the same" );
         }
-        bpNamenode.blockReceived(dnRegistration, blockPoolId, blockArray,
+        bpNamenode.blockReceived(bpRegistration, blockPoolId, blockArray,
             delHintArray);
         synchronized(receivedBlockList) {
           synchronized(delHints){
@@ -647,8 +648,8 @@ public class DataNode extends Configured
             block==null?"Block is null":"delHint is null");
       }
       
-      if (block.getPoolId().equals(blockPoolId)) {
-        LOG.warn("BlockPool is mismaptch " + block.getBlockId() + 
+      if (!block.getPoolId().equals(blockPoolId)) {
+        LOG.warn("BlockPool mismatch " + block.getPoolId() + 
             " vs. " + blockPoolId);
         return;
       }
@@ -1074,6 +1075,7 @@ public class DataNode extends Configured
 
     // get all the NNs configured
     nameNodeThreads = getAllNamenodes(conf);
+    this.namenode = namenode;
   }
   
   /**
@@ -1323,12 +1325,14 @@ public class DataNode extends Configured
     }
     
     // shutdown BPOS thread TODO:FEDERATION - review if this is enough
-    for(BPOfferService bpos : nameNodeThreads) {
-      if(bpos != null && bpos.bpThread!=null) {
-        try {
-          bpos.bpThread.interrupt();
-          bpos.bpThread.join();
-        } catch (InterruptedException ie) {}
+    if (nameNodeThreads != null) {
+      for(BPOfferService bpos : nameNodeThreads) {
+        if(bpos != null && bpos.bpThread!=null) {
+          try {
+            bpos.bpThread.interrupt();
+            bpos.bpThread.join();
+          } catch (InterruptedException ie) {}
+        }
       }
     }
     



Mime
View raw message