正在加载图片...
Case study include " mapreduce/mapreduce. h" Map / User's map function class Wordcounter public Mapper pub1± virtual void Map(const MapInput& input)I const string& text input value (i const int n text size 0i for (int i =0; 1 / skip past leading whitespace while ((i< n)&& isspace(text[1])) 1+ // Find word end int start =1i while ((1 n)&&!isspace(text[i])) if (start 1) Emit(text substr(start,i-start),"1") REGISTER MAPPER (WordCounter )i 41Case Study 41 • Map
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有