CentOS6.8下Hadoop2.7.2怎么运行自带的wordcount程序
在集成开发环境中写好了WordCount 程序,程序源代码如下:
TokenizerMapper 类:
public static class TokenizerMapper extends
Mapper{
private final static IntWritable count = new IntWritable(1);
private Text word = new Text();
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
StringTokenizer st = new StringTokenizer(value.toString()); while (st.hasMoreTokens()) {
word.set(st.nextToken());
context.write(word, count);
}
CentOS6.8下Hadoop2.7.2怎么运行自带的wordcount程序
在集成开发环境中写好了WordCount 程序,程序源代码如下:TokenizerMapper 类:public static class TokenizerMapper extendsMapper