[
https://issues.apache.org/jira/browse/ACCUMULO-2817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14326997#comment-14326997
]
Josh Elser commented on ACCUMULO-2817:
--------------------------------------
1. I think some simple Guava {{Precondition}} check on the validity of the
offset and len WRT the array itself is fine
2. For 2.0 (which we don't have a branch for yet), I think so. But for 1.7,
we'd have to go the route that Keith suggested (put the new method on the
implementation, not on the interface). I don't think semver would let us do an
abstract class for 1.7 either, but I'm not entirely 100%..
> Add offset and limit arguments to byte array Encoder.decode method
> ------------------------------------------------------------------
>
> Key: ACCUMULO-2817
> URL: https://issues.apache.org/jira/browse/ACCUMULO-2817
> Project: Accumulo
> Issue Type: Improvement
> Components: client
> Reporter: Josh Elser
> Assignee: Matt Dailey
> Labels: newbie
> Fix For: 1.7.0
>
> Attachments: ACCUMULO-2817.patch
>
>
> Similar to ACCUMULO-2445, but presently the encoder only works on complete
> byte arrays. This forces an extra copy of the data when it is located in an
> array that contains other information (e.g. a composite key).
> It would be nice to be able to provide offset and length arguments to
> {{Encoder.decode}} so that users can avoid the additional arraycopy.
> Changing to a ByteBuffer instead of byte array argument would also be
> acceptable, but more churn on the API that, unless it's happening globally, I
> would rather avoid. It would also incur the penalty for that extra Object,
> which while minimal alone, could be significant if decoding every value in a
> table, for example.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)