From 810ae618fd2b308bc65a3264a90233658010380e Mon Sep 17 00:00:00 2001 From: Harsh J Date: Sat, 12 May 2012 06:03:39 +0000 Subject: [PATCH] HADOOP-8395. Text shell command unnecessarily demands that a SequenceFile's key class be WritableComparable (harsh) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1337449 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/fs/shell/Display.java | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 28603461f7..018bef311a 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -133,6 +133,9 @@ Trunk (unreleased changes) HADOOP-8375. test-patch should stop immediately once it has found compilation errors (bobby) + HADOOP-8395. Text shell command unnecessarily demands that a + SequenceFile's key class be WritableComparable (harsh) + OPTIMIZATIONS HADOOP-7761. Improve the performance of raw comparisons. (todd) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Display.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Display.java index 8a05a55310..59358632a7 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Display.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Display.java @@ -34,7 +34,6 @@ import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.Writable; -import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.io.compress.CompressionCodec; import org.apache.hadoop.io.compress.CompressionCodecFactory; import org.apache.hadoop.util.ReflectionUtils; @@ -136,7 +135,7 @@ protected InputStream getInputStream(PathData item) throws IOException { protected class TextRecordInputStream extends InputStream { SequenceFile.Reader r; - WritableComparable key; + Writable key; Writable val; DataInputBuffer inbuf; @@ -148,7 +147,7 @@ public TextRecordInputStream(FileStatus f) throws IOException { r = new SequenceFile.Reader(lconf, SequenceFile.Reader.file(fpath)); key = ReflectionUtils.newInstance( - r.getKeyClass().asSubclass(WritableComparable.class), lconf); + r.getKeyClass().asSubclass(Writable.class), lconf); val = ReflectionUtils.newInstance( r.getValueClass().asSubclass(Writable.class), lconf); inbuf = new DataInputBuffer();