[
https://issues.apache.org/jira/browse/HADOOP-8415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jan van der Lugt updated HADOOP-8415:
-------------------------------------
Description: In the org.apache.hadoop.conf.Configuration class, methods
exist to set Integers, Longs, Booleans, Floats and Strings, but methods for
Doubles are absent. Are they not there for a reason or should they be added? In
the latter case, the attached patch contains the missing functions. (was: In
the org.apache.hadoop.conf.Configuration class, methods exist to set Integers,
Longs, Booleans, Floats and Strings, but methods for Doubles are absent. Are
they not there for a reason or should they be added? In the latter case, these
are the missing functions:
/**
* Get the value of the <code>name</code> property as a <code>double</code>.
* If no such property exists, the provided default value is returned,
* or if the specified value is not a valid <code>double</code>,
* then an error is thrown.
*
* @param name property name.
* @param defaultValue default value.
* @throws NumberFormatException when the value is invalid
* @return property value as a <code>double</code>,
* or <code>defaultValue</code>.
*/
public double getDouble(String name, double defaultValue) {
String valueString = getTrimmed(name);
if (valueString == null)
return defaultValue;
return Double.parseDouble(valueString);
}
/**
* Set the value of the <code>name</code> property to a <code>double</code>.
*
* @param name property name.
* @param value property value.
*/
public void setDouble(String name, double value) {
set(name,Double.toString(value));
})
> getDouble() and setDouble() in org.apache.hadoop.conf.Configuration
> -------------------------------------------------------------------
>
> Key: HADOOP-8415
> URL: https://issues.apache.org/jira/browse/HADOOP-8415
> Project: Hadoop Common
> Issue Type: Improvement
> Components: conf
> Affects Versions: 1.0.2
> Reporter: Jan van der Lugt
> Priority: Minor
> Attachments: HADOOP-8415.patch
>
> Original Estimate: 0.25h
> Remaining Estimate: 0.25h
>
> In the org.apache.hadoop.conf.Configuration class, methods exist to set
> Integers, Longs, Booleans, Floats and Strings, but methods for Doubles are
> absent. Are they not there for a reason or should they be added? In the
> latter case, the attached patch contains the missing functions.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira