第一次WordCount小游戏
在idea客户端上面进行WordCount统计
1:创建mapper类继承mapper(选hadoop类型)
public class wordcountMapper extends Mapper<LongWritable, Text,Text, IntWritable> {
}
1.2重写map方法 ctrl+o 选map
public class wordcountMapper extends Mapper<LongWritable, Text,Text, IntWritable> {
@Override
protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
}
}
1.3 mapper步骤
public class wordcountMapper extends Mapper<LongWritable, Text,Text, IntWritable> {
@Override
protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
String line = value.toString();
String[] words = line.split(" ");
for (String word : words) {
if (word.equals("")){
continue;