91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

MapReduce字數統計案例,希望大家交流,最好自己寫完后在對比交流,歡迎前來交流

資源截圖

代碼片段和文件信息

package?mytest;

import?java.io.IOException;

import?org.apache.hadoop.io.IntWritable;
import?org.apache.hadoop.io.LongWritable;
import?org.apache.hadoop.io.Text;
import?org.apache.hadoop.mapreduce.Mapper;

public?class?myMapper?extends?Mapper?{

@Override
protected?void?map(LongWritable?key?Text?value?Mapper.Context?context)
throws?IOException?InterruptedException?{
String[]?str?=?value.toString().split(“?“);
// for(String?ss:str)?{
// context.write(new?Text(ss)?new?IntWritable(1));
// }
Text?ss?=?new?Text();
ss.set(“loglevel::“+str[1]);
context.write(ss?new?IntWritable(1));
ss.clear();
ss.set(“logresource::“+str[2]);
context.write(ss?new?IntWritable(1));
}
}

評論

共有 條評論