accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Havanki (JIRA)" <>
Subject [jira] [Created] (ACCUMULO-1959) Value constructors taking ByteBuffers need refinement
Date Tue, 03 Dec 2013 17:54:37 GMT
Bill Havanki created ACCUMULO-1959:

             Summary: Value constructors taking ByteBuffers need refinement
                 Key: ACCUMULO-1959
             Project: Accumulo
          Issue Type: Bug
    Affects Versions: 1.6.0, 1.7.0
            Reporter: Bill Havanki
            Priority: Minor

This ticket pertains to the following Value constructors.

public Value(ByteBuffer bytes)
public Value(ByteBuffer bytes, boolean copy)

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

This message was sent by Atlassian JIRA

View raw message