hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hong Tang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-6381) WritableUtils::*VLong utilities should be available for byte arrays
Date Wed, 18 Nov 2009 05:50:39 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-6381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779312#action_12779312
] 

Hong Tang commented on HADOOP-6381:
-----------------------------------

I am concerned about the code duplication this brings.

Is decodeVLong(buf, off) == readVLong(new DataInputStream(new ByteArrayInputStream(buf, off,
buf.length - off)))?
And encodeVLong(buf, off, l) could be implemented as follows (with an additional constructor
added to BoundedByteArrayOutputStream)
{
  BoundedByteArrayOutputStream bbaos = new BoundedByteArrayOutputStream(buf, off);
  writeVLong(new DataOutputStream(bbaos), l); 
  return bbaos.size() - off;
}

> WritableUtils::*VLong utilities should be available for byte arrays
> -------------------------------------------------------------------
>
>                 Key: HADOOP-6381
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6381
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>            Reporter: Chris Douglas
>            Priority: Minor
>         Attachments: C6381-0.patch, C6381-1.patch, C6381-2.patch
>
>
> Particularly when working with raw bytes in Writables, it is often useful to have versions
of the vint utility functions for byte arrays.

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


Mime
View raw message