You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Tom White (JIRA)" <ji...@apache.org> on 2007/08/10 09:27:43 UTC
[jira] Issue Comment Edited: (HADOOP-1231) Add generics to Mapper
and Reducer interfaces
[ https://issues.apache.org/jira/browse/HADOOP-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518932 ]
tomwhite edited comment on HADOOP-1231 at 8/10/07 12:25 AM:
-------------------------------------------------------------
>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}
was (Author: tomwhite):
>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.