accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-1959) Value constructors taking ByteBuffers need refinement
Date Mon, 16 Dec 2013 18:43:09 GMT


ASF subversion and git services commented on ACCUMULO-1959:

Commit f06b067063c92c1ae46f0c02dc24ff40564741b6 in branch refs/heads/1.6.0-SNAPSHOT from [~bhavanki]
[;h=f06b067 ]

ACCUMULO-1959 Deprecate Value(ByteBuffer,boolean)

The Value constructor that takes a ByteBuffer and a copy flag does
an unnecessary double copy when the flag is true. This change
deprecates the constructor in favor of the one without the flag
(which always performs a copy).

Signed-off-by: Josh Elser <>

> Value constructors taking ByteBuffers need refinement
> -----------------------------------------------------
>                 Key: ACCUMULO-1959
>                 URL:
>             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

View raw message