浏览代码

HADOOP-5292. Fix NPE in KFS::getBlockLocations. (Sriram Rao via lohit)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@746889 13f79535-47bb-0310-9956-ffa450edef68
Lohit Vijaya Renu 16 年之前
父节点
当前提交
adb8df8dfe
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 2 0
      CHANGES.txt
  2. 3 0
      src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java

+ 2 - 0
CHANGES.txt

@@ -635,6 +635,8 @@ Release 0.20.0 - Unreleased
 
     HADOOP-4963. Fixes a logging to do with getting the location of
     map output file. (Amareshwari Sriramadasu via ddas)
+    
+    HADOOP-5292. Fix NPE in KFS::getBlockLocations. (Sriram Rao via lohit)    
 
 Release 0.19.1 - Unreleased
 

+ 3 - 0
src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java

@@ -297,6 +297,9 @@ public class KosmosFileSystem extends FileSystem {
       }
       String srep = makeAbsolute(file.getPath()).toUri().getPath();
       String[][] hints = kfsImpl.getDataLocation(srep, start, len);
+      if (hints == null) {
+        return null;
+      }
       BlockLocation[] result = new BlockLocation[hints.length];
       long blockSize = getDefaultBlockSize();
       long length = len;