hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Kimball (JIRA)" <j...@apache.org>
Subject [jira] Commented: (MAPREDUCE-954) The new interface's Context objects should be interfaces
Date Thu, 17 Sep 2009 21:08:01 GMT

    [ https://issues.apache.org/jira/browse/MAPREDUCE-954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756786#action_12756786
] 

Aaron Kimball commented on MAPREDUCE-954:
-----------------------------------------

I don't see how this new state of affairs improves MRUnit. MRUnit still needs to implement
the "hack" of having a dummy Mapper class ({{MockMapContextWrapper}}) that wraps around the
Context that it creates, when from an architectural standpoint, MRUnit would like to just
feed a wholely-divorced top-level MockMapContext into the client's Mapper implementation.


Switching Mapper to include an abstract class Context instead of a concrete class Context
which is used by its {{map()}} method does not allow MRUnit to do the "right" thing; MRUnit
still takes advantage of the fact that Mapper.Context is non-static purely for purposes of
saving typing in the {{map()}} method's type signature (by absorbing the generic qualifiers)
and assumes that it can fully replace the implementation with its own.

My understanding is that the purpose of moving from {{interface Mapper}} to {{class Mapper}}
was to allow forward-evolvable APIs with default implementations. Switching back from abstract
classes to interfaces again seems like asking for trouble a few months down the line when
we need to add some default behavior.


> The new interface's Context objects should be interfaces
> --------------------------------------------------------
>
>                 Key: MAPREDUCE-954
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-954
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: client
>            Reporter: Owen O'Malley
>            Assignee: Arun C Murthy
>             Fix For: 0.21.0
>
>         Attachments: MAPREDUCE-954.patch, MAPREDUCE-954.patch, MAPREDUCE-954.patch
>
>
> When I was doing HADOOP-1230, I was persuaded to make the Context objects as classes.
I think that was a serious mistake. It caused a lot of information leakage into the public
classes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message