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

Andrzej Bialecki  commented on HADOOP-1197:
-------------------------------------------

These methods were added to support caching of transient Objects created within 
the scope of a single task - especially Objects that are costly to instantiate, 
and which follow a "singleton" pattern within the scope of the current task. 
Examples: plugin registry, which requires reading and parsing a lot of config 
files; individual plugin instances; processing chains composed of several 
plugins, etc.

These Objects are not Writable, nor does it make sense to make them Writable - 
the only purpose of this pattern is to avoid repetitive instantiation of 
Configurable objects with the same Configuration instance.

If we remove this functionality from Hadoop, then a dozen Nutch subsystems 
would break, since they rely on this feature. Nutch could implement its own 
object cache, but then a lot of APIs would have to be changed to take not only 
a Configuration instance but also an object cache singleton ..

Perhaps a clarification in the javadoc would be sufficient?

> The misleading Configuration.set(String, Object) should be removed
> ------------------------------------------------------------------
>
>                 Key: HADOOP-1197
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1197
>             Project: Hadoop
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 0.12.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>            Priority: Minor
>             Fix For: 0.13.0
>
>
> I think that the confusing methods in Configuration:
>   set(String, Object)
>   getObject(String)
>   get(String, Object)
> should be deprecated. Users expect them to work and in a distributed 
> environment, there is almost no way to make them work correctly. If some user 
> really needs the functionality, we should implement it right and require that 
> the objects be Writable and serialize them into the Configuration.
> Thoughts?

-- 
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