[
https://issues.apache.org/jira/browse/HADOOP-4187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641315#action_12641315
]
Sharad Agarwal commented on HADOOP-4187:
----------------------------------------
bq. We make a package private mapred.ReflectionUtils that uses JobConf and
JobConfigurable.
sigh! the problem with package private is that it won't be visible to mapred.*
packages.
if we don't want to add yet another public class to mapred, we can:
Option 1: duplicate code wherever required. Its just couple of lines of code so
it may be OK to duplicate.
{code}
if (conf instanceof JobConf &&
theObject instanceof JobConfigurable) {
((JobConfigurable)theObject).configure((JobConf) conf);
}
{code}
Option 2: add a public static method to an existing public class in mapred
where it may make sense. eg. in JobConf
On side note, one thing which might already be taken into account but I am
bringing it up to be sure. This change would have potential to break user
applications.
The removing of JobConf and JobConfigurable code from util.ReflectionUtils
might break the applications as ReflectionUtils.newInstance and setConf are
public apis; user code may be banking on to it to instantiate JobConfigurable
objects.
> Create a MapReduce-specific ReflectionUtils that handles JobConf and
> JobConfigurable
> ------------------------------------------------------------------------------------
>
> Key: HADOOP-4187
> URL: https://issues.apache.org/jira/browse/HADOOP-4187
> Project: Hadoop Core
> Issue Type: Sub-task
> Reporter: Tom White
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.