hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1538787 - in /hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs: CHANGES_HDFS-2832.txt src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java
Date Mon, 04 Nov 2013 21:47:51 GMT
Author: arp
Date: Mon Nov  4 21:47:51 2013
New Revision: 1538787

URL: http://svn.apache.org/r1538787
Log:
HDFS-5455. NN should update storageMap on first heartbeat.

Modified:
    hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt
    hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java

Modified: hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt?rev=1538787&r1=1538786&r2=1538787&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt
(original)
+++ hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt
Mon Nov  4 21:47:51 2013
@@ -68,3 +68,5 @@ IMPROVEMENTS:
     HDFS-5448. Fix break caused by previous checkin for HDFS-5448. (Arpit
     Agarwal)
 
+    HDFS-5455. NN should update storageMap on first heartbeat. (Arpit Agarwal)
+

Modified: hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java?rev=1538787&r1=1538786&r2=1538787&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java
(original)
+++ hadoop/common/branches/HDFS-2832/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java
Mon Nov  4 21:47:51 2013
@@ -350,18 +350,16 @@ public class DatanodeDescriptor extends 
     this.volumeFailures = volFailures;
     for (StorageReport report : reports) {
       DatanodeStorageInfo storage = storageMap.get(report.getStorageID());
-      if (storage != null) {
-        storage.receivedHeartbeat(report);
-        totalCapacity += report.getCapacity();
-        totalRemaining += report.getRemaining();
-        totalBlockPoolUsed += report.getBlockPoolUsed();
-        totalDfsUsed += report.getDfsUsed();
-      } else {
-        // This warning is generally benign during cluster initialization
-        // when the heartbeat is received before the initial block reports
-        // from each storage.
-        LOG.warn("Unrecognized storage ID " + report.getStorageID());
+      if (storage == null) {
+        // This is seen during cluster initialization when the heartbeat
+        // is received before the initial block reports from each storage.
+        storage = updateStorage(new DatanodeStorage(report.getStorageID()));
       }
+      storage.receivedHeartbeat(report);
+      totalCapacity += report.getCapacity();
+      totalRemaining += report.getRemaining();
+      totalBlockPoolUsed += report.getBlockPoolUsed();
+      totalDfsUsed += report.getDfsUsed();
     }
     rollBlocksScheduled(getLastUpdate());
 
@@ -651,6 +649,8 @@ public class DatanodeDescriptor extends 
     synchronized (storageMap) {
       DatanodeStorageInfo storage = storageMap.get(s.getStorageID());
       if (storage == null) {
+        LOG.info("Adding new storage ID " + s.getStorageID() +
+                 " for DN " + getXferAddr());
         storage = new DatanodeStorageInfo(this, s);
         storageMap.put(s.getStorageID(), storage);
       } else {



Mime
View raw message