Переглянути джерело

HADOOP-3946. Fix TestMapRed after hadoop-3664. (tomwhite via omalley)
Recommitting now that I've identified the problem as being environmental.


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

Owen O'Malley 17 роки тому
батько
коміт
77e6764e87

+ 2 - 0
CHANGES.txt

@@ -317,6 +317,8 @@ Trunk (unreleased changes)
     HADOOP-3889. Improve error reporting from HftpFileSystem, handling in
     DistCp. (Tsz Wo (Nicholas), SZE via cdouglas)
 
+    HADOOP-3946. Fix TestMapRed after hadoop-3664. (tomwhite via omalley)
+
 Release 0.18.0 - 2008-08-19
 
   INCOMPATIBLE CHANGES

+ 5 - 6
src/mapred/org/apache/hadoop/mapred/SequenceFileInputFormat.java

@@ -21,6 +21,7 @@ package org.apache.hadoop.mapred;
 import java.io.IOException;
 
 import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 
 import org.apache.hadoop.io.SequenceFile;
@@ -39,12 +40,10 @@ public class SequenceFileInputFormat<K, V> extends FileInputFormat<K, V> {
     for (int i = 0; i < files.length; i++) {
       FileStatus file = files[i];
       if (file.isDir()) {     // it's a MapFile
-        files[i] = new FileStatus(file.getLen(), file.isDir(), 
-            file.getReplication(), file.getBlockSize(),
-            file.getModificationTime(), file.getPermission(),
-            file.getOwner(), file.getGroup(),
-            // use the data file
-            new Path(file.getPath(), MapFile.DATA_FILE_NAME));
+        Path dataFile = new Path(file.getPath(), MapFile.DATA_FILE_NAME);
+        FileSystem fs = file.getPath().getFileSystem(job);
+        // use the data file
+        files[i] = fs.getFileStatus(dataFile);
       }
     }
     return files;