From c5bce7be4795917fed9ff9f6dd5f8cdd83a3c510 Mon Sep 17 00:00:00 2001 From: Christopher Douglas Date: Fri, 16 Oct 2009 22:41:54 +0000 Subject: [PATCH] HADOOP-6293. Fix FsShell -text to work on filesystems other than the default. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@826120 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 5 ++++- src/java/org/apache/hadoop/fs/FsShell.java | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 7ca53e6d64..19685a3813 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -30,7 +30,10 @@ Trunk (unreleased changes) OPTIMIZATIONS BUG FIXES - + + HADOOP-6293. Fix FsShell -text to work on filesystems other than the + default. (cdouglas) + Release 0.21.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/src/java/org/apache/hadoop/fs/FsShell.java b/src/java/org/apache/hadoop/fs/FsShell.java index 9676c7b494..6f7d6b059e 100644 --- a/src/java/org/apache/hadoop/fs/FsShell.java +++ b/src/java/org/apache/hadoop/fs/FsShell.java @@ -367,11 +367,13 @@ private class TextRecordInputStream extends InputStream { DataOutputBuffer outbuf; public TextRecordInputStream(FileStatus f) throws IOException { - r = new SequenceFile.Reader(fs, f.getPath(), getConf()); - key = ReflectionUtils.newInstance(r.getKeyClass().asSubclass(WritableComparable.class), - getConf()); - val = ReflectionUtils.newInstance(r.getValueClass().asSubclass(Writable.class), - getConf()); + final Path fpath = f.getPath(); + final Configuration lconf = getConf(); + r = new SequenceFile.Reader(fpath.getFileSystem(lconf), fpath, lconf); + key = ReflectionUtils.newInstance( + r.getKeyClass().asSubclass(WritableComparable.class), lconf); + val = ReflectionUtils.newInstance( + r.getValueClass().asSubclass(Writable.class), lconf); inbuf = new DataInputBuffer(); outbuf = new DataOutputBuffer(); }