hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-4211) Do init-sizing of the StringBuilder making a ServerName.
Date Wed, 17 Aug 2011 08:12:27 GMT

    [ https://issues.apache.org/jira/browse/HBASE-4211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13086191#comment-13086191
] 

Hudson commented on HBASE-4211:
-------------------------------

Integrated in HBase-TRUNK #2122 (See [https://builds.apache.org/job/HBase-TRUNK/2122/])
    HBASE-4211 Do init-sizing of the StringBuilder making a ServerName

stack : 
Files : 
* /hbase/trunk/CHANGES.txt
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/ServerName.java


> Do init-sizing of the StringBuilder making a ServerName.
> --------------------------------------------------------
>
>                 Key: HBASE-4211
>                 URL: https://issues.apache.org/jira/browse/HBASE-4211
>             Project: HBase
>          Issue Type: Bug
>            Reporter: stack
>            Assignee: Benoit Sigoure
>            Priority: Minor
>             Fix For: 0.92.0
>
>
> Simple patch from BenoƮt.
> ---
>  .../java/org/apache/hadoop/hbase/ServerName.java   |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> diff --git a/src/main/java/org/apache/hadoop/hbase/ServerName.java b/src/main/java/org/apache/hadoop/hbase/ServerName.java
> index 6b03832..4ddb5b7 100644
> --- a/src/main/java/org/apache/hadoop/hbase/ServerName.java
> +++ b/src/main/java/org/apache/hadoop/hbase/ServerName.java
> @@ -128,7 +128,8 @@ public class ServerName implements Comparable<ServerName> {
>    * startcode formatted as <code>&lt;hostname> ',' &lt;port> ','
&lt;startcode></code>
>    */
>   public static String getServerName(String hostName, int port, long startcode) {
> -    StringBuilder name = new StringBuilder(hostName);
> +    final StringBuilder name = new StringBuilder(hostName.length() + 1 + 5 + 1 + 13);
> +    name.append(hostName);
>     name.append(SERVERNAME_SEPARATOR);
>     name.append(port);
>     name.append(SERVERNAME_SEPARATOR);
> --
> 1.7.6.434.g1d2b3

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message