[ 
https://issues.apache.org/jira/browse/HADOOP-1230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618261#action_12618261
 ] 

Alejandro Abdelnur commented on HADOOP-1230:
--------------------------------------------

Nice.

Two questions and one comment:

*Q1:* Why the string version of the {{Context.getCounter()}} method needs an 
{{int id}} ? The equivalent method in the {{Reporter}} does not which it means 
that we could do without this id. Having it, IMO, is error prone, what would 
happen if I give the same group/name with a different id?

*Q2:* Would I be able to have a subclass of the {{Context}} that supports 
multiple outputs (ie via the {{MultipleOutputs}}) class? Will I be able to tell 
the runner to use that class wrapping the original {{Context}}?

*C1:* Have you considered instead having a single {{Context}} having an 
{{InContext}} and an {{OutContext}} where the IN contains incoming stuff (key, 
values, splits, jobconf, etc.) and the OUT is used for the output stuff 
(collect). Then the OUT would most likely be the same for both the {{Map}} and 
{{Reduce}} and the the IN would have different subclasses for the {{Mapper}} 
and {{Reducer}}.

> Replace parameters with context objects in Mapper, Reducer, Partitioner, 
> InputFormat, and OutputFormat classes
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-1230
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1230
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: mapred
>            Reporter: Owen O'Malley
>            Assignee: Owen O'Malley
>         Attachments: context-objs-2.patch, context-objs-3.patch, 
> context-objs.patch
>
>
> This is a big change, but it will future-proof our API's. To maintain 
> backwards compatibility, I'd suggest that we move over to a new package name 
> (org.apache.hadoop.mapreduce) and deprecate the old interfaces and package. 
> Basically, it will replace:
> package org.apache.hadoop.mapred;
> public interface Mapper extends JobConfigurable, Closeable {
>   void map(WritableComparable key, Writable value, OutputCollector output, 
> Reporter reporter) throws IOException;
> }
> with:
> package org.apache.hadoop.mapreduce;
> public interface Mapper extends Closable {
>   void map(MapContext context) throws IOException;
> }
> where MapContext has the methods like getKey(), getValue(), collect(Key, 
> Value), progress(), etc.

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