accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Drew Farris (JIRA)" <>
Subject [jira] [Updated] (ACCUMULO-2832) Improve DefaultFormatter for reuse and object creation
Date Thu, 12 Jun 2014 23:19:02 GMT


Drew Farris updated ACCUMULO-2832:

    Assignee: Jacob Meisler

> Improve DefaultFormatter for reuse and object creation
> ------------------------------------------------------
>                 Key: ACCUMULO-2832
>                 URL:
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: shell
>            Reporter: Josh Elser
>            Assignee: Jacob Meisler
>            Priority: Trivial
>              Labels: newbie
> The DefaultFormatter is the class that is used to convert an {{Entry<Key,Value>}}
to the line of text displayed in the shell. Most notably, it encodes non-printable ASCII data
as hex.
> For users who want to implement their own Formatter, they do not have access to the same
formatting methods that the DefaultFormatter uses because of the visibility modifiers on the
methods. These methods should be available for use by other classes. Letting classes extend
the DefaultFormatter would be even better.
> Additionally, in the DefaultFormatter, in the method {{public static String formatEntry(Entry<Key,Value>,
DateFormat)}}, a StringBuilder is used to reduce the number of intermediate String objects
that are created for each concatenation; however, the methods to get each component of the
Key will create a new {{Text}} object each time.
> Method invocations like
> {code}
> key.getRow()
> {code}
> Should be replaced with:
> {code}
> Text buffer = new Text();
> key.getRow(buffer);
> {code}
> Where a single {{Text}} object is reused for the entire method.

This message was sent by Atlassian JIRA

View raw message