hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1490436 - in /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src: main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java test/java/org/apache/hadoop/hdfs/server/namenode/TestMetaSave.java
Date Thu, 06 Jun 2013 20:46:56 GMT
Author: shv
Date: Thu Jun  6 20:46:56 2013
New Revision: 1490436

URL: http://svn.apache.org/r1490436
Log:
HDFS-4867. metaSave NPEs when there are invalid blocks in repl queue. Contributed by Plamen
Jeliazkov and Ravi Prakash.

Modified:
    hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
    hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetaSave.java

Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java?rev=1490436&r1=1490435&r2=1490436&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
Thu Jun  6 20:46:56 2013
@@ -349,7 +349,9 @@ public class BlockManager {
                              numReplicas.decommissionedReplicas();
        
         if (block instanceof BlockInfo) {
-          String fileName = ((BlockInfo)block).getINode().getFullPathName();
+          INodeFile inodeFile = ((BlockInfo) block).getINode();
+          String fileName = (inodeFile == null) ? "[orphaned]"
+            : inodeFile.getFullPathName();
           out.print(fileName + ": ");
         }
         // l: == live:, d: == decommissioned c: == corrupt e: == excess

Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetaSave.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetaSave.java?rev=1490436&r1=1490435&r2=1490436&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetaSave.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetaSave.java
Thu Jun  6 20:46:56 2013
@@ -17,26 +17,25 @@
  */
 package org.apache.hadoop.hdfs.server.namenode;
 
-import org.junit.Test;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import static org.junit.Assert.assertTrue;
+
 import java.io.BufferedReader;
-import java.io.FileInputStream;
 import java.io.DataInputStream;
-import java.io.InputStreamReader;
+import java.io.FileInputStream;
 import java.io.IOException;
-import java.lang.InterruptedException;
+import java.io.InputStreamReader;
 import java.util.Random;
-import static org.junit.Assert.assertTrue;
+
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-
+import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.hdfs.HdfsConfiguration;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
-import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.hdfs.DFSConfigKeys;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
 
 /**
  * This class tests the creation and validation of metasave



Mime
View raw message