[ 
https://issues.apache.org/jira/browse/HADOOP-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518932
 ] 

Tom White commented on HADOOP-1231:
-----------------------------------

>This looks good. The only thing I noticed is that in cases where you don't 
>have more detailed type information, you put in the 
>default <WritableComparable,Writable,WritableComparable,Writable>, which isn't 
>necessary.

If I use raw types instead of parameterized types then I get compile warnings. 
E.g.

{noformat}
class MyMapper implements Mapper
{noformat}

gives a warning on the call to OutputCollector#collect:

{noformat}
    [javac] 
/Users/tom/Documents/workspace/hadoop-trunk/src/test/org/apache/hadoop/mapred/TestMiniMRLocalFS.java:222:
 warning: [unchecked] unchecked call to collect(K,V) as a member of the raw 
type org.apache.hadoop.mapred.OutputCollector
    [javac]       out.collect((WritableComparable) value, key);
{noformat}

With type information the warning goes:

{noformat
class MyMapper implements Mapper<WritableComparable, Writable, 
WritableComparable, Writable>
{noformat}



> Add generics to Mapper and Reducer interfaces
> ---------------------------------------------
>
>                 Key: HADOOP-1231
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1231
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: mapred
>            Reporter: Owen O'Malley
>            Assignee: Tom White
>             Fix For: 0.15.0
>
>         Attachments: HADOOP-1231-1.patch, HADOOP-1231.patch, 
> HADOOP-1231.patch, MapReduceTypes.html
>
>
> By making the input and output types of the Mapper and Reducers generic, we 
> can get the information from the classes and not require the user to set them 
> in the configuration.

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