Author: omalley
Date: Wed Aug 13 14:46:23 2008
New Revision: 685689
URL: http://svn.apache.org/viewvc?rev=685689&view=rev
Log:
HADOOP-3946. Fix TestMapRed after hadoop-3664. (tomwhite via omalley)
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/SequenceFileInputFormat.java
Modified: hadoop/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=685689&r1=685688&r2=685689&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Aug 13 14:46:23 2008
@@ -298,6 +298,8 @@
HADOOP-3773. Change Pipes to set the default map output key and value
types correctly. (Koji Noguchi via omalley)
+ HADOOP-3946. Fix TestMapRed after hadoop-3664. (tomwhite via omalley)
+
Release 0.18.0 - Unreleased
INCOMPATIBLE CHANGES
Modified:
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/SequenceFileInputFormat.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/SequenceFileInputFormat.java?rev=685689&r1=685688&r2=685689&view=diff
==============================================================================
---
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/SequenceFileInputFormat.java
(original)
+++
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/SequenceFileInputFormat.java
Wed Aug 13 14:46:23 2008
@@ -21,6 +21,7 @@
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 @@
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;