hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-11308) Reuse NameStringPair#Builder instances in loops
Date Sun, 08 Jun 2014 04:12:01 GMT

     [ https://issues.apache.org/jira/browse/HBASE-11308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

stack updated HBASE-11308:
--------------------------

    Priority: Trivial  (was: Minor)

Agree. That issue should have been marked trivial too.

> Reuse NameStringPair#Builder instances in loops
> -----------------------------------------------
>
>                 Key: HBASE-11308
>                 URL: https://issues.apache.org/jira/browse/HBASE-11308
>             Project: HBase
>          Issue Type: Task
>            Reporter: Ted Yu
>            Priority: Trivial
>
> The following code is from HColumnDescriptor#convert() but the pattern can be found in
other classes, such as HBaseAdmin:
> {code}
>     for (Map.Entry<String, String> e : this.configuration.entrySet()) {
>       NameStringPair.Builder aBuilder = NameStringPair.newBuilder();
>       aBuilder.setName(e.getKey());
>       aBuilder.setValue(e.getValue());
>       builder.addConfiguration(aBuilder.build());
>     }
> {code}
> NameStringPair.Builder instance can be reused across iterations of the loop.
> This would save creation of short-lived objects.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message