Hadoop 统计单词字数的例子
hadoop 的核心还是 Map-Reduce过程和 hadoop分布式文件系统 第一步:定义Map过程 /** * *Description: * *@authorcharles.wang *@createdMar12,20121:41:57PM * */ publicclassMyMapextendsMapper<Object,Text,Text,IntWritable>{ privatestaticfinalIntWritableone=newIntWritable(1); privateTextword; publicvoidmap(Objectkey,Textvalue,Contextcontext) throwsIOException,InterruptedException{ Stringline=value.toString(); StringTokenizertokenizer=newStringTokenizer(line); while(tokenizer.hasMoreTokens()){ word=newText(); word.set(...


