hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r636812 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSDataset.java
Date Thu, 13 Mar 2008 17:47:45 GMT
Author: dhruba
Date: Thu Mar 13 10:47:42 2008
New Revision: 636812

URL: http://svn.apache.org/viewvc?rev=636812&view=rev
Log:
HADOOP-2972. Fix for a NPE in FSDataset.invalidate.
(Mahadev Konar via dhruba)


Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=636812&r1=636811&r2=636812&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Mar 13 10:47:42 2008
@@ -193,6 +193,9 @@
     HADOOP-2995. Fixes StreamBaseRecordReader's getProgress to return a 
     floating point number. (Dave Brosius via ddas)
 
+    HADOOP-2972. Fix for a NPE in FSDataset.invalidate.
+    (Mahadev Konar via dhruba)
+
 Release 0.16.1 - 2008-03-13
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java?rev=636812&r1=636811&r2=636812&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java Thu Mar 13 10:47:42 2008
@@ -855,7 +855,15 @@
       FSVolume v;
       synchronized (this) {
         f = getFile(invalidBlks[i]);
-        v = volumeMap.get(invalidBlks[i]).getVolume();
+        DatanodeBlockInfo dinfo = volumeMap.get(invalidBlks[i]);
+        if (dinfo == null) {
+          DataNode.LOG.warn("Unexpected error trying to delete block "
+                           + invalidBlks[i] + 
+                           ". BlockInfo not found in volumeMap.");
+          error = true;
+          continue;
+        }
+        v = dinfo.getVolume();
         if (f == null) {
           DataNode.LOG.warn("Unexpected error trying to delete block "
                             + invalidBlks[i] + 



Mime
View raw message