You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Alejandro Abdelnur (JIRA)" <ji...@apache.org> on 2009/01/09 08:24:59 UTC
[jira] Commented: (HADOOP-5000) A Configuration instance cannot be
reloaded if the configuration has InputStream resources
[ https://issues.apache.org/jira/browse/HADOOP-5000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662263#action_12662263 ]
Alejandro Abdelnur commented on HADOOP-5000:
--------------------------------------------
Either the javadocs should specify this behavior or stream resources should be read and stored in a private {{Properties}} instance that is applied to the {{Configuration}} on {{loadResources}} invocation, instead of trying to reread the stream.
And creating a new {{Configuration}} from an existing one does not fix the problem because the constructor copies the resources, not the values.
> A Configuration instance cannot be reloaded if the configuration has InputStream resources
> ------------------------------------------------------------------------------------------
>
> Key: HADOOP-5000
> URL: https://issues.apache.org/jira/browse/HADOOP-5000
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
>
> If a {{Configuration}} instance as a stream resource, on an reload of configuration values, the {{loadResource}} method will fail because the stream has been already read in the first {{loadResource}} invocation.
> For example:
> {code}
> InputStream is = ....
> Configuration conf = new Configuration();
> conf.addResource(is);
> conf.set("a", "A");
> conf.reloadConfiguration();
> conf.set("a","B");
> {code}
> This example will fail on {{conf.set("b", "B");}} because it a {{loadResources()}} will be done and the {{InputStream}} has been already consumed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.