You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Brock Noland (JIRA)" <ji...@apache.org> on 2011/06/19 18:37:47 UTC

[jira] [Updated] (HADOOP-310) Additional constructor requested in BytesWritable

     [ https://issues.apache.org/jira/browse/HADOOP-310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brock Noland updated HADOOP-310:
--------------------------------

    Attachment: bytes-writable-zero-copy-interface-0.patch

I think the offset would be ideal, but the extra constructor and a set() method which does the same is a good incremental change. That patch is attached.


> Additional constructor requested in BytesWritable
> -------------------------------------------------
>
>                 Key: HADOOP-310
>                 URL: https://issues.apache.org/jira/browse/HADOOP-310
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: io
>            Reporter: p sutter
>            Assignee: Owen O'Malley
>            Priority: Minor
>         Attachments: bytes-writable-zero-copy-interface-0.patch
>
>
> It would be grand if BytesWritable.java had an additional constructor as below. This allows me to use the BytesWritable class without doing a buffer copy, since we have a less-than-fully-utilized byte array holding our key.
> Thanks!
>  
>  /**
>    * Create a BytesWritable using the byte array as the initial value.
>    * @param bytes This array becomes the backing storage for the object.
>    */
>   public BytesWritable(byte[] bytes, int size) {
>     this.bytes = bytes;
>     this.size = size;
>   }
>   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira