You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by to...@apache.org on 2008/06/06 10:55:53 UTC
svn commit: r663865 - in /hadoop/core/trunk: CHANGES.txt
src/java/org/apache/hadoop/fs/HarFileSystem.java
Author: tomwhite
Date: Fri Jun 6 01:55:53 2008
New Revision: 663865
URL: http://svn.apache.org/viewvc?rev=663865&view=rev
Log:
HADOOP-3496. Fix failure in TestHarFileSystem.testArchives due to change in HADOOP-3095.
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/java/org/apache/hadoop/fs/HarFileSystem.java
Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=663865&r1=663864&r2=663865&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Jun 6 01:55:53 2008
@@ -486,6 +486,9 @@
HADOOP-3240. Fix a testcase to not create files in the current directory.
Instead the file is created in the test directory (Mahadev Konar via ddas)
+ HADOOP-3496. Fix failure in TestHarFileSystem.testArchives due to change
+ in HADOOP-3095. (tomwhite)
+
Release 0.17.0 - 2008-05-18
INCOMPATIBLE CHANGES
Modified: hadoop/core/trunk/src/java/org/apache/hadoop/fs/HarFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/fs/HarFileSystem.java?rev=663865&r1=663864&r2=663865&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/fs/HarFileSystem.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/fs/HarFileSystem.java Fri Jun 6 01:55:53 2008
@@ -318,29 +318,32 @@
/**
* get block locations from the underlying fs
- * @param f the input path for the blocks
+ * @param file the input filestatus to get block locations
* @param start the start in the file
* @param len the length in the file
* @return block locations for this segment of file
* @throws IOException
*/
@Override
- public BlockLocation[] getFileBlockLocations(Path f, long start,
+ public BlockLocation[] getFileBlockLocations(FileStatus file, long start,
long len) throws IOException {
// need to look up the file in the underlying fs
// look up the index
// make sure this is a prt of this har filesystem
- Path p = makeQualified(f);
+ Path p = makeQualified(file.getPath());
Path harPath = getPathInHar(p);
String line = fileStatusInIndex(harPath);
if (line == null) {
- throw new FileNotFoundException("File " + f + " not found");
+ throw new FileNotFoundException("File " + file.getPath() + " not found");
}
HarStatus harStatus = new HarStatus(line);
- if (harStatus.isDir())
+ if (harStatus.isDir()) {
return new BlockLocation[0];
- return fs.getFileBlockLocations(new Path(archivePath, harStatus.getPartName()),
+ }
+ FileStatus fsFile = fs.getFileStatus(new Path(archivePath,
+ harStatus.getPartName()));
+ return fs.getFileBlockLocations(fsFile,
harStatus.getStartIndex(), harStatus.getLength());
}