hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r813116 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapreduce/lib/input/KeyValueLineRecordReader.java
Date Wed, 09 Sep 2009 21:06:50 GMT
Author: cdouglas
Date: Wed Sep  9 21:06:50 2009
New Revision: 813116

URL: http://svn.apache.org/viewvc?rev=813116&view=rev
Log:
MAPREDUCE-960. Remove an unnecessary intermediate copy and obsolete API
from KeyValueLineRecordReader.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/input/KeyValueLineRecordReader.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=813116&r1=813115&r2=813116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Wed Sep  9 21:06:50 2009
@@ -315,6 +315,9 @@
     replace it with o.a.h.fs.FileAlreadyExistsException.  (Boris Shkolnik
     via szetszwo)
 
+    MAPREDUCE-960. Remove an unnecessary intermediate copy and obsolete API
+    from KeyValueLineRecordReader. (cdouglas)
+
   BUG FIXES
 
     MAPREDUCE-878. Rename fair scheduler design doc to 

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/input/KeyValueLineRecordReader.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/input/KeyValueLineRecordReader.java?rev=813116&r1=813115&r2=813116&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/input/KeyValueLineRecordReader.java
(original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/input/KeyValueLineRecordReader.java
Wed Sep  9 21:06:50 2009
@@ -44,8 +44,6 @@
   
   private Text value;
   
-  public Class<?> getKeyClass() { return Text.class; }
-  
   public KeyValueLineRecordReader(Configuration conf)
     throws IOException {
     
@@ -75,14 +73,8 @@
       key.set(line, 0, lineLen);
       value.set("");
     } else {
-      int keyLen = pos;
-      byte[] keyBytes = new byte[keyLen];
-      System.arraycopy(line, 0, keyBytes, 0, keyLen);
-      int valLen = lineLen - keyLen - 1;
-      byte[] valBytes = new byte[valLen];
-      System.arraycopy(line, pos + 1, valBytes, 0, valLen);
-      key.set(keyBytes);
-      value.set(valBytes);
+      key.set(line, 0, pos);
+      value.set(line, pos + 1, lineLen - pos - 1);
     }
   }
   /** Read key/value pair in a line. */



Mime
View raw message