[
https://issues.apache.org/jira/browse/HADOOP-7425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064633#comment-13064633
]
steven zhuang commented on HADOOP-7425:
---------------------------------------
hi Sudharsan,
I think the KeyFieldHelper has done its job, it is the setConf method of
ReflectionUtils makes the partitioner configured twice.
I wonder why the logic in ReflectionUtils.setConf first call setConf() then
call configure() on the same object? can we write it as:
if (theObject instanceof Configurable) {
((Configurable) theObject).setConf(conf);
}
else {
setJobConf(theObject, conf);
}
can we do this?
> ReflectionUtils.setConf would configure anything Configurable twice
> -------------------------------------------------------------------
>
> Key: HADOOP-7425
> URL: https://issues.apache.org/jira/browse/HADOOP-7425
> Project: Hadoop Common
> Issue Type: Bug
> Components: util
> Affects Versions: 0.21.0, 0.23.0
> Reporter: steven zhuang
> Attachments: test.tar
>
>
> In the setConf method of org.apache.hadoop.util.ReflectionUtils, any
> instance of Configurable would be configured twice.
> In 0.21.0, KeyFieldBasedPartitioner implements the Configurable interface.
> When configured twice, it get two KeyDescription and gives out wrong
> partition number.
> public static void setConf(Object theObject, Configuration conf) {
> if (conf != null) {
> if (theObject instanceof Configurable) {
> ((Configurable) theObject).setConf(conf);
> }
> setJobConf(theObject, conf);
> }
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira