[
https://issues.apache.org/jira/browse/HADOOP-3702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628240#action_12628240
]
Alejandro Abdelnur commented on HADOOP-3702:
--------------------------------------------
Thanks Enis,
On the use of generics in the {{addMapper/setReducer}} which one of the 3
options is the most appropriate? I would be inclined to think that the third
one. My reasoning is that on the input the mapper/reducer must handle at least
a subclass of the key/value classes, and on the output the mapper/reducer
define what the key/value classes are.
*Option 1*
{code}
public static <K1, V1, K2, V2> void addMapper(boolean isMap, JobConf jobConf,
Class<? extends Mapper<? extends K1,? extends V1,?
extends K2,? extends V2>> klass,
Class<K1> inputKeyClass, Class<V1> inputValueClass,
Class<K2> outputKeyClass, Class<V2> outputValueClass,
boolean byValue, JobConf mapperConf) {
{code}
*Option 2*
{code}
public static <K1, V1, K2, V2> void addMapper(boolean isMap, JobConf jobConf,
Class<? extends Mapper<K1, V1, K2, V2>> klass,
Class<? extends K1> inputKeyClass, Class<? extends
V1> inputValueClass,
Class<? extends K2> outputKeyClass, Class<? extends
V2> outputValueClass,
boolean byValue, JobConf mapperConf) {
{code}
*Option 3*
{code}
public static <K1, V1, K2, V2> void addMapper(boolean isMap, JobConf jobConf,
Class<? extends Mapper<K1, V1, K2, V2>> klass,
Class<? extends K1> inputKeyClass, Class<? extends
V1> inputValueClass,
Class<K2> outputKeyClass, Class<V2> outputValueClass,
boolean byValue, JobConf mapperConf) {
{code}
> add support for chaining Maps in a single Map and after a Reduce [M*/RM*]
> -------------------------------------------------------------------------
>
> Key: HADOOP-3702
> URL: https://issues.apache.org/jira/browse/HADOOP-3702
> Project: Hadoop Core
> Issue Type: New Feature
> Components: mapred
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Alejandro Abdelnur
> Fix For: 0.19.0
>
> Attachments: Hadoop-3702.patch, patch3702.txt, patch3702.txt,
> patch3702.txt, patch3702.txt, patch3702.txt, patch3702.txt, patch3702.txt,
> patch3702.txt, patch3702.txt, patch3702.txt, patch3702.txt, patch3702.txt
>
>
> On the same input, we usually need to run multiple Maps one after the other
> without no Reduce. We also have to run multiple Maps after the Reduce.
> If all pre-Reduce Maps are chained together and run as a single Map a
> significant amount of Disk I/O will be avoided.
> Similarly all post-Reduce Maps can be chained together and run in the Reduce
> phase after the Reduce.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.