accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Dailey (JIRA)" <>
Subject [jira] [Updated] (ACCUMULO-2817) Add offset and limit arguments to byte array Encoder.decode method
Date Sat, 21 Feb 2015 23:08:12 GMT


Matt Dailey updated ACCUMULO-2817:
    Attachment: ACCUMULO-2817.patch

Rebased onto master at revision {{8f6558c}}

This patch has my ideas on how abstract classes could be used.

* Removed {{decode(byte[], int, int)}} from the Encoder (and thus also Lexicoder) interfaces,
leaving them the same as on master.
* Added {{org.apache.accumulo.core.client.lexicoder.AbstractEncoder}}.  It implements {{decode(byte[])}}
(required by Encoder interface), and {{decode(byte[], int, int)}} (not part of an interface).
 It then defines {{protected abstract T decodeUnchecked(byte[] b, int offset, int len)}}.
 This does not change the Encoder or Lexicoder interfaces.
* Added {{org.apache.accumulo.core.client.lexicoder.AbstractLexicoder}}, which extends AbstractEncoder
and also implements Lexicoder.
* Refactored Lexicoders to extend AbstractLexicoder, and Encoders to extend AbstractEncoder.

I think AbstractEncoder and AbstractLexicoder should be part of the public API since they
may be useful to others, and do not cause any breaking changes.  I looked through semver,
and I don't think "any backwards incompatible changes are introduced to the public API," but
feel free to correct me.

Do I add "@since" to any public methods, or only ones implementing an Interface, or all new

> Add offset and limit arguments to byte array Encoder.decode method
> ------------------------------------------------------------------
>                 Key: ACCUMULO-2817
>                 URL:
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: client
>            Reporter: Josh Elser
>            Assignee: Matt Dailey
>              Labels: newbie
>             Fix For: 1.7.0
>         Attachments: ACCUMULO-2817.patch, 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

View raw message