crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Wills (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CRUNCH-546) Avoid CellUtil.cloneXXX in HFileUtils and HFileInputFormat
Date Sun, 19 Jul 2015 16:13:04 GMT

    [ https://issues.apache.org/jira/browse/CRUNCH-546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632856#comment-14632856
] 

Josh Wills commented on CRUNCH-546:
-----------------------------------

Looks good to me.

> Avoid CellUtil.cloneXXX in HFileUtils and HFileInputFormat
> ----------------------------------------------------------
>
>                 Key: CRUNCH-546
>                 URL: https://issues.apache.org/jira/browse/CRUNCH-546
>             Project: Crunch
>          Issue Type: Improvement
>            Reporter: Gabriel Reid
>            Assignee: Gabriel Reid
>         Attachments: CRUNCH-546.patch
>
>
> HFileUtils and HFileInputFormat currently make use of the CellUtil.cloneXXX in a number
of places when comparing row, family, and qualifier values with a constant.
> The clone methods are relatively costly, as they require allocating a new byte array
and copying all data over into the new array on every call. 
> {{Bytes.equals}}, {{Bytes.compareTo}}, and {{ByteBuffer.wrap}} also accept a byte array
and offset and length parameters, which allows accessing portions of KeyValues without copying
them out into a separate byte array when using them for comparison. We should replace the
uses of CellUtil.cloneXXX with the alternate calls to the above methods where possible.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message