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

Eli Collins commented on HADOOP-6287:
-------------------------------------

@Steve - currently the code always catches NumberFormatExceptions and returns 
the default value. The above patch truncates it. The right thing to do is 
support ranges.

@Arun - is the "KB" in getStorage the way to interpret the value if no unit is 
specified or a gurantee that the return value will be in KB (regardless of what 
units the user specified) or both?

@Nigel - yes "gb" etc can be lower case. Currently no spaces between number and 
unit are accepted, that's reasonable though. 

bq. For time we could have Configuration#getMilliseconds(). If no units are 
spec'd or "ms" is spec'd then it would return the same value as getLong(), but 
if it ended in in "s", "m", or "h" or it had colons then it could be treated 
differently. Example values might be "10ms", "2.5h", "2:30:00", "1d".

@Doug - The above sounds good. I also think a typed approach similar to what 
Philip pointed out in HADOOP-6288 makes sense, not sure how many legs we want 
the current code to grow. One of the things Ada did right was encourage the use 
of variables typed with units so not everything was stored in an integer. 

> Support units for configuration knobs
> -------------------------------------
>
>                 Key: HADOOP-6287
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6287
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: conf
>            Reporter: Arun C Murthy
>            Assignee: Eli Collins
>         Attachments: hadoop-6287-1.patch
>
>
> We should add support for units in our Configuration system so that we can 
> specify values to be *1GB* or *1MB* rather than forcing every component which 
> consumes such values to be aware of these.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to