你好我是Hadoop& amp;的新手MapReduce编程。我正在处理一堆apache日志,我们必须了解访问行为。我们现在正在查看实际的URI和引用URI。这些引用URI是一个查询字符串,我试图通过MapReduce的Mapper解析该查询字符串,因为我没有任何reducer功能,所以我没有构建一个真正的reducer。
# ip datetime method uri status code refUri userAgent
79.28.43.25 - - [25/Jan/2009:13:18:02 +0000] "GET /blog/2007/01/internet-explorer-7-in-italiano/ HTTP/1.1" 200 14487 "http://www.google.it/search?hl=it&q=aggiornamento+internet+explorer+&btnG=Cerca+con+Google&meta=&aq=f&oq=" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
现在我想将此行转换为
# ip datetime method uri status code refUri h1 q btnG meta aq oq userAgent
79.28.43.25 - - [25/Jan/2009:13:18:02 +0000] "GET /blog/2007/01/internet-explorer-7-in-italiano/ HTTP/1.1" 200 14487 "http://www.google.it/search?hl=it&q=aggiornamento+internet+explorer+&btnG=Cerca+con+Google&meta=&aq=f&oq=" "it" "aggiornamento+internet+explorer+" "Cerca+con+Google" "" "f" "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
这是一个很好的用例,只使用map hadoop作业,我们拥有的日志数量超过1 PB,我们希望它会增长。
答案 0 :(得分:2)
是。如果您只需要映射数据,则无需执行reduce步骤。确保将numReducers设置为零,以便完全跳过reduce步骤。