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

Tsz Wo (Nicholas), SZE commented on HADOOP-9252:
------------------------------------------------

Chris, thanks for checking the tests.  Before the patch, the methods 
humanReadableInt and limitDecimalTo2 are very similar but they have minor 
difference such as one uses upper case 'M' and the other uses lower cases 'm'.  
Let's decide the best format here and then change the individual tests 
accordingly (and in separated JIRAs.)

In the patch, I choose uppercase letter for the prefix K, M, G, T, P, E since 
it seems a standard according to http://en.wikipedia.org/wiki/Binary_prefix .  
Then, I put a space between the number and the prefix; otherwise, values like 
"2.091MB" seem not very readable.  I don't really have a strong preference 
about the space.  What do you think?
                
> StringUtils.limitDecimalTo2(..) is unnecessarily synchronized
> -------------------------------------------------------------
>
>                 Key: HADOOP-9252
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9252
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>            Priority: Minor
>         Attachments: c9252_20130127.patch, c9252_20130128.patch
>
>
> limitDecimalTo2(double) currently uses decimalFormat, which is a static 
> field, so that it is synchronized.  Synchronization is unnecessary since it 
> can simply uses String.format(..).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to