hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject hadoop git commit: Fix NPE in LazyPersistFileScrubber. Contributed by Inigo Goiri.
Date Fri, 26 May 2017 20:43:34 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 b89d59e21 -> a20789f29


Fix NPE in LazyPersistFileScrubber. Contributed by Inigo Goiri.

(cherry picked from commit 303c8dc9b6c853c0939ea9ba14388897cc258071)

Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/a20789f2
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/a20789f2
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/a20789f2

Branch: refs/heads/branch-2.8
Commit: a20789f299d99d90614877523ff83838feac8467
Parents: b89d59e
Author: Inigo Goiri <elgoiri@gmail.com>
Authored: Fri May 26 13:15:44 2017 -0700
Committer: Konstantin V Shvachko <shv@apache.org>
Committed: Fri May 26 13:42:55 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hdfs/server/namenode/FSNamesystem.java  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a20789f2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index e41bb8f..efd20c3 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -3895,9 +3895,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
         while (it.hasNext()) {
           Block b = it.next();
           BlockInfo blockInfo = blockManager.getStoredBlock(b);
-          BlockCollection bc = getBlockCollection(blockInfo);
-          if (bc.getStoragePolicyID() == lpPolicy.getId()) {
-            filesToDelete.add(bc);
+          if (blockInfo == null) {
+            LOG.info("Cannot find block info for block " + b);
+          } else {
+            BlockCollection bc = getBlockCollection(blockInfo);
+            if (bc.getStoragePolicyID() == lpPolicy.getId()) {
+              filesToDelete.add(bc);
+            }
           }
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message