hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r539600 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/LocatedBlock.java src/java/org/apache/hadoop/dfs/NamenodeFsck.java
Date Fri, 18 May 2007 20:59:21 GMT
Author: cutting
Date: Fri May 18 13:59:20 2007
New Revision: 539600

URL: http://svn.apache.org/viewvc?view=rev&rev=539600
Log:
HADOOP-1359.  Fix a potential NullPointerException in HDFS.  Contributed by Hairong.

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

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=539600&r1=539599&r2=539600
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Fri May 18 13:59:20 2007
@@ -27,6 +27,9 @@
   8. HADOOP-234.  Add pipes facility, which permits writing MapReduce
      programs in C++.
 
+  9. HADOOP-1359.  Fix a potential NullPointerException in HDFS.
+     (Hairong Kuang via cutting)
+
 
 Branch 0.13 (unreleased changes)
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/LocatedBlock.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/LocatedBlock.java?view=diff&rev=539600&r1=539599&r2=539600
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/LocatedBlock.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/LocatedBlock.java Fri May 18 13:59:20
2007
@@ -51,7 +51,11 @@
    */
   public LocatedBlock(Block b, DatanodeInfo[] locs) {
     this.b = b;
-    this.locs = locs;
+    if (locs==null) {
+      this.locs = new DatanodeInfo[0];
+    } else {
+      this.locs = locs;
+    }
   }
 
   /**

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NamenodeFsck.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NamenodeFsck.java?view=diff&rev=539600&r1=539599&r2=539600
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NamenodeFsck.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NamenodeFsck.java Fri May 18 13:59:20
2007
@@ -188,7 +188,7 @@
                     locs.length + " replica(s).");
       }
       report.append(i + ". " + id + " len=" + block.getNumBytes());
-      if (locs == null || locs.length == 0) {
+      if ( locs.length == 0) {
         report.append(" MISSING!");
         res.addMissing(block.getBlockName(), block.getNumBytes());
         missing++;



Mime
View raw message