小编Sri*_*Sri的帖子

Avro入门

我想开始使用Avro和Map Reduce.有人可以建议一个很好的教程/示例来开始.通过互联网搜索我找不到多少.

mapreduce avro

15
推荐指数
1
解决办法
1万
查看次数

Hadoop Map减少程序

当我在基于Hadoop 0.20 API的Hadoop in Action手册中尝试Map Reduce编程示例时,我收到了错误

java.io.IOException:从map中键入不匹配的值:expected org.apache.hadoop.io.IntWritable,recieved org.apache.hadoop.io.Text

但据我检查,我正在通过一切正常.如果有人可以帮助我,这将是非常有帮助的.

这是代码.它与书中的代码相同.

@SuppressWarnings("unused")
public class CountPatents extends Configured implements Tool {
    @SuppressWarnings("deprecation")

    public static class MapClass extends MapReduceBase implements Mapper<Text, Text, Text, Text> {
        public void map(Text key, Text value,OutputCollector<Text, Text> output,Reporter reporter) throws IOException {
            output.collect(value, key);
        }
    }
public static class Reduce extends MapReduceBase implements Reducer<Text, Text, Text, IntWritable> {
    public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException {
        int count=0;
        while(values.hasNext()){
            count=count+1;

            values.next(); …
Run Code Online (Sandbox Code Playgroud)

eclipse reduce hadoop map

1
推荐指数
1
解决办法
2632
查看次数

标签 统计

avro ×1

eclipse ×1

hadoop ×1

map ×1

mapreduce ×1

reduce ×1