accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Turner (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-2817) Add offset and limit arguments to byte array Encoder.decode method
Date Wed, 18 Feb 2015 15:47:12 GMT


Keith Turner commented on ACCUMULO-2817:

All of the new methods should have {{@since 1.7.0}} tags. 

Ideally the new {{decode(byte[] b, int offset, int len)}} method would be added to the {{Lexicode}}
interface.  However adding a method to that interface would break any existing code outside
of Accumulo that extended the interface.  Java 8 provides a way around this w/ [Default Methods|],
but can not use that currently.   What about creating two tickets for the future?  One to
switch Accumulo to Java 8 and one to add a method to the interface that depends on the JAva
8 issue.

Once the {{decode(byte[] b, int offset, int len)}} is in the interface, then {{ListLexicoder.decode()}}
and {{PairLexicoder.decode()}} could possibly be optimized to call the new {{decode()}} method
and avoid copies.   That could be another follow on issue.

> Add offset and limit arguments to byte array Encoder.decode method
> ------------------------------------------------------------------
>                 Key: ACCUMULO-2817
>                 URL:
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 1.7.0
>            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

View raw message