瀏覽代碼

HADOOP-4099. Fix null pointer when using HFTP from an 0.18 server.
(dhruba via omalley)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@694902 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 16 年之前
父節點
當前提交
508a20283d
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 4 1
      CHANGES.txt
  2. 4 1
      src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java

+ 4 - 1
CHANGES.txt

@@ -540,9 +540,12 @@ Trunk (unreleased changes)
     HADOOP-3831. Very slow reading clients sometimes failed while reading.
     (rangadi)
 
-		HADOOP-4155. Use JobTracker's start time while initializing JobHistory's
+    HADOOP-4155. Use JobTracker's start time while initializing JobHistory's
     JobTracker Unique String. (lohit) 
 
+    HADOOP-4099. Fix null pointer when using HFTP from an 0.18 server.
+    (dhruba via omalley)
+
 Release 0.18.1 - 2008-09-17
 
   IMPROVEMENTS

+ 4 - 1
src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java

@@ -162,7 +162,10 @@ public class HftpFileSystem extends FileSystem {
       long atime = 0;
       try {
         modif = df.parse(attrs.getValue("modified")).getTime();
-        atime = df.parse(attrs.getValue("accesstime")).getTime();
+        String astr = attrs.getValue("accesstime");
+        if (astr != null) {
+          atime = df.parse(astr).getTime();
+        }
       } catch (ParseException e) { throw new SAXException(e); }
       FileStatus fs = "file".equals(qname)
         ? new FileStatus(