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

ASF subversion and git services commented on ACCUMULO-1959:
-----------------------------------------------------------

Commit 37c9a76017eac42577fbbc4c217f2af76ea84779 in branch 
refs/heads/1.6.0-SNAPSHOT from [~vines]
[ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=37c9a76 ]

ACCUMULO-1959 - supressing deprecation warning


> Value constructors taking ByteBuffers need refinement
> -----------------------------------------------------
>
>                 Key: ACCUMULO-1959
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-1959
>             Project: Accumulo
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Bill Havanki
>            Assignee: Bill Havanki
>            Priority: Minor
>             Fix For: 1.6.0
>
>         Attachments: ACCUMULO-1959.patch
>
>
> This ticket pertains to the following Value constructors.
> {noformat}
> public Value(ByteBuffer bytes)
> public Value(ByteBuffer bytes, boolean copy)
> {noformat}
> Their appearance suggests that the second one can either copy bytes from the 
> buffer or reference them directly, and the first one works similarly but has 
> some default copying behavior.
> However, both constructors use {{ByteBufferUtil.toBytes()}} on the ByteBuffer 
> object, which always performs a copy. Therefore, it doesn't make sense (to me 
> at least) to support a copy flag in the second constructor. In the current 
> implementation, the bytes are copied twice if the copy flag is true.
> The implementation should be reworked to avoid unnecessary copies, and 
> perhaps simplify the API.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to