hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom White (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-1231) Add generics to Mapper and Reducer interfaces
Date Fri, 10 Aug 2007 07:25:43 GMT

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

class MyMapper implements Mapper

gives a warning on the call to OutputCollector#collect:

    [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);

With type information the warning goes:

class MyMapper implements Mapper<WritableComparable, Writable, WritableComparable, Writable>

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

View raw message