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

Harsh J commented on YARN-4263:
-------------------------------

Thank you for the fix and tests! Some comments:

- Could you remove the whitespaces in the test addition? Also, did you check if 
the tests fail reliably without the change added along, just to eliminate away 
any format changes?
- Lets switch to using {{org.apache.hadoop.util.StringUtils.formatPercent}} 
method instead of adding a duplicate inside YARN.
- Am also wondering if we should do a single decimal place instead of two, just 
to be compatible with the usual 40.0/60.0/0.0/100.0 outputs.

> Capacity scheduler 60%-40% formatting floating point issue
> ----------------------------------------------------------
>
>                 Key: YARN-4263
>                 URL: https://issues.apache.org/jira/browse/YARN-4263
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 2.7.1
>            Reporter: Adrian Kalaszi
>            Priority: Trivial
>              Labels: easyfix
>         Attachments: YARN-4263.001.patch
>
>
> If capacity scheduler is set with two queues to 60% and 40% capacity, due to 
> a java float floating representation issue
> {code}
> > hadoop queue -list
> ======================
> Queue Name : default 
> Queue State : running 
> Scheduling Info : Capacity: 40.0, MaximumCapacity: 100.0, CurrentCapacity: 
> 0.0 
> ======================
> Queue Name : large 
> Queue State : running 
> Scheduling Info : Capacity: 60.000004, MaximumCapacity: 100.0, 
> CurrentCapacity: 0.0 
> {code}
> Because 
> {code} System.err.println((0.6f) * 100); {code}
> results in 60.000004.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to