hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r508581 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSDataset.java
Date Fri, 16 Feb 2007 21:13:59 GMT
Author: cutting
Date: Fri Feb 16 13:13:59 2007
New Revision: 508581

URL: http://svn.apache.org/viewvc?view=rev&rev=508581
Log:
HADOOP-973.  Improve some error messages in namenode, to help debug a NullPointerException.
 Contributed by Dhruba.

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

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=508581&r1=508580&r2=508581
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Fri Feb 16 13:13:59 2007
@@ -49,6 +49,10 @@
 14. HADOOP-476.  Rewrite contrib/streaming command-line processing,
     improving parameter validation.  (Sanjay Dahiya via cutting)
 
+15. HADOOP-973.  Improve error messages in Namenode.  This should help
+    to track down a problem that was appearing as a
+    NullPointerException.  (Dhruba Borthakur via cutting) 
+
 
 Branch 0.11 (unreleased)
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java?view=diff&rev=508581&r1=508580&r2=508581
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDataset.java Fri Feb 16 13:13:59
2007
@@ -515,8 +515,24 @@
         File f;
         synchronized (this) {
           f = getFile(invalidBlks[i]);
+          if (f == null) {
+            throw new IOException("Unexpected error trying to delete block "
+                                  + invalidBlks[i] + 
+                                  ". Block not found in blockMap.");
+          }
           FSVolume v = volumeMap.get(invalidBlks[i]);
-          v.clearPath(f.getParentFile());
+          if (v == null) {
+            throw new IOException("Unexpected error trying to delete block "
+                                  + invalidBlks[i] + 
+                                  ". No volume for this block.");
+          }
+          File parent = f.getParentFile();
+          if (parent == null) {
+            throw new IOException("Unexpected error trying to delete block "
+                                  + invalidBlks[i] + 
+                                  ". Parent not found for file " + f + ".");
+          }
+          v.clearPath(parent);
           blockMap.remove(invalidBlks[i]);
           volumeMap.remove(invalidBlks[i]);
         }



Mime
View raw message