开发者社区 问答 正文

hadoop什么签名问题求解决啊 ?

图片说明
小弟刚接触hadoop不久,准备跑个HelloWord试试,结果就报错了,找不到解决方法啊,
各位大神帮帮忙吧!

展开
收起
爱吃鱼的程序员 2020-08-21 16:14:23 1156 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    Mapper后面需要写上输入类型和输出类型,就像这样:

    publicclassMapperClassextendsMapper<Object,Text,Text,IntWritable>{privateTextresult=newText();privateIntWritableone=newIntWritable(1);@Overrideprotectedvoidmap(Objectkey,Textvalue,Contextcontext)throwsIOException,InterruptedException{//获取值String[]strs=value.toString().split("");//提取出key,value设置为1for(Stringstr:strs){result.set(str);context.write(result,one);}}}
    2020-08-21 16:14:41
    赞同 1 展开评论
问答分类:
问答地址: