hadoop-mapreduce-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Douglas (JIRA)" <j...@apache.org>
Subject [jira] Created: (MAPREDUCE-960) Unnecessary copy in mapreduce.lib.input.KeyValueLineRecordReader
Date Tue, 08 Sep 2009 00:47:57 GMT
Unnecessary copy in mapreduce.lib.input.KeyValueLineRecordReader

                 Key: MAPREDUCE-960
                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-960
             Project: Hadoop Map/Reduce
          Issue Type: Improvement
            Reporter: Chris Douglas
            Assignee: Chris Douglas

KeyValueLineRecordReader effects the copy from the line to the key/value by creating separate
      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);
Since set triggers another copy and Text has a set taking {{byte[], off, len}}, the intermediate
copy can be avoided

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message