1
0
فهرست منبع

HDFS-686. NullPointerException is thrown while merging edit log and image. Contributed by Hairong Kuang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20@824957 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 16 سال پیش
والد
کامیت
cf41db9ca4
2فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 3 0
      CHANGES.txt
  2. 2 2
      src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

+ 3 - 0
CHANGES.txt

@@ -17,6 +17,9 @@ Release 0.20.2 - Unreleased
     values of new configuration variables when deprecated variables are
     disabled. (Sreekanth Ramakrishnan via yhemanth)
 
+    HDFS-686. NullPointerException is thrown while merging edit log and image.
+    (hairong)
+
 Release 0.20.1 - 2009-09-01
 
   INCOMPATIBLE CHANGES

+ 2 - 2
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -759,7 +759,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
     if (length < 0) {
       throw new IOException("Negative length is not supported. File: " + src );
     }
-    final LocatedBlocks ret = getBlockLocationsInternal(src, dir.getFileINode(src),
+    final LocatedBlocks ret = getBlockLocationsInternal(src, 
         offset, length, Integer.MAX_VALUE, doAccessTime);  
     if (auditLog.isInfoEnabled()) {
       logAuditEvent(UserGroupInformation.getCurrentUGI(),
@@ -770,12 +770,12 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
   }
 
   private synchronized LocatedBlocks getBlockLocationsInternal(String src,
-                                                       INodeFile inode,
                                                        long offset, 
                                                        long length,
                                                        int nrBlocksToReturn,
                                                        boolean doAccessTime) 
                                                        throws IOException {
+    INodeFile inode = dir.getFileINode(src);
     if(inode == null) {
       return null;
     }