From 7313955d04c90aee2e742d44039b8d4265c72dd5 Mon Sep 17 00:00:00 2001 From: Christopher Douglas Date: Tue, 20 Oct 2009 23:39:49 +0000 Subject: [PATCH] HADOOP-6097. Fix Path conversion in makeQualified and reset LineReader byte count at the start of each block in Hadoop archives. Contributed by Ben Slusky, Tom White, and Mahadev Konar git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@827837 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 12 ++++++++++++ .../org/apache/hadoop/fs/HarFileSystem.java | 18 ++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index fd2c766cc7..bba620899d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1122,6 +1122,18 @@ Release 0.21.0 - Unreleased HADOOP-6286. Fix bugs in related to URI handling in glob methods in FileContext. (Boris Shkolnik via suresh) +Release 0.20.2 - Unreleased + + HADOOP-6231. Allow caching of filesystem instances to be disabled on a + per-instance basis. (tomwhite) + + HADOOP-5759. Fix for IllegalArgumentException when CombineFileInputFormat + is used as job InputFormat. (Amareshwari Sriramadasu via dhruba) + + HADOOP-6097. Fix Path conversion in makeQualified and reset LineReader byte + count at the start of each block in Hadoop archives. (Ben Slusky, Tom + White, and Mahadev Konar via cdouglas) + Release 0.20.1 - 2009-09-01 INCOMPATIBLE CHANGES diff --git a/src/java/org/apache/hadoop/fs/HarFileSystem.java b/src/java/org/apache/hadoop/fs/HarFileSystem.java index 46bf50f933..d9175eedbb 100644 --- a/src/java/org/apache/hadoop/fs/HarFileSystem.java +++ b/src/java/org/apache/hadoop/fs/HarFileSystem.java @@ -302,19 +302,8 @@ public Path makeQualified(Path path) { } URI tmpURI = fsPath.toUri(); - fsPath = new Path(tmpURI.getPath()); //change this to Har uri - URI tmp = null; - try { - tmp = new URI(uri.getScheme(), harAuth, fsPath.toString(), - tmpURI.getQuery(), tmpURI.getFragment()); - } catch(URISyntaxException ue) { - LOG.error("Error in URI ", ue); - } - if (tmp != null) { - return new Path(tmp.toString()); - } - return null; + return new Path(uri.getScheme(), harAuth, tmpURI.getPath()); } /** @@ -426,12 +415,13 @@ private String fileStatusInIndex(Path harPath) throws IOException { // do nothing just a read. } FSDataInputStream aIn = fs.open(archiveIndex); - LineReader aLin = new LineReader(aIn, getConf()); + LineReader aLin; String retStr = null; // now start reading the real index file - read = 0; for (Store s: stores) { + read = 0; aIn.seek(s.begin); + aLin = new LineReader(aIn, getConf()); while (read + s.begin < s.end) { int tmp = aLin.readLine(line); read += tmp;