摘要: 0.参考资料:代码参考1:http://www.pudn.com/downloads212/sourcecode/unix_linux/detail999273.html理论参考2:http://zhangyu8374.javaeye.com/blog/86307,http://nything.javaeye.com/blog/4117871.分析假如有file0,file1,file2三个文件,这些文件中都保存了一些文本内容,比如在file0中只有一个句子,内容为"we are happy"。一般的索引都是记录在这个文件中没有一个单词的索引号。比如file0的索引可以是( 阅读全文
posted @ 2011-01-07 19:26 xwdreamer 阅读(2162) 评论(0) 推荐(0) 编辑
摘要: 0.参考资料:http://radarradar.javaeye.com/blog/289257http://blog.chinaunix.net/u3/99156/showart_2157576.html1.思路:1.1过滤MapReduce的第一操作就是要读取文件,不过我们经常会发现一个文本中会有一些我们不需要的字符,比如特殊字符。一般需要进行词频统计的都是单词或者是数字,所以那些非0-9,a-z,A-Z的字符基本都是垃圾字符,我们需要进行统计,这是我们可以通过一个正则表达式来进行过滤,当每次多去一行文字的时候,我们将所有非0-9,a-z,A-Z的垃圾字符都替换为空格,这样就清楚了垃圾字符 阅读全文
posted @ 2011-01-07 15:21 xwdreamer 阅读(5974) 评论(1) 推荐(0) 编辑
摘要: 1.参考文献http://hi.baidu.com/accpzhangbo/blog/item/52aeffc683ee6ec238db4965.html2.解析查看java.lang.System的源代码,我们可以找到System.exit(status)这个方法的说明,代码如下: /** * Terminates the currently running Java Virtual Machine. The * argument serves as a status code; by convention, a nonzero status * code indi... 阅读全文
posted @ 2011-01-07 14:16 xwdreamer 阅读(103510) 评论(4) 推荐(13) 编辑