{"id":93,"date":"2011-05-03T03:45:49","date_gmt":"2011-05-02T19:45:49","guid":{"rendered":"http:\/\/sinofool.net\/blog\/archives\/93"},"modified":"2011-12-12T15:07:21","modified_gmt":"2011-12-12T07:07:21","slug":"hadoop-reduce-%e6%85%a2","status":"publish","type":"post","link":"https:\/\/sinofool.net\/blog\/archives\/93","title":{"rendered":"Hadoop reduce \u6162"},"content":{"rendered":"<p>\u53c8\u4e00\u6b21\u4ece\u535a\u5ba2\u6d41\u91cf\u6765\u6e90\u4e0a\u770b\u5230\u4e00\u7ec4\u6709\u610f\u601d\u7684\u8bcd\uff1ahadoop reduce \u6162\u3002<br \/>\n\u6211\u8bd5\u7740\u641c\u4e86\u4e00\u4e0b\uff0c\u7ed3\u679c\u6ca1\u627e\u5230\u81ea\u5df1\u7684\u6587\u7ae0\u6392\u5728\u54ea\u3002<\/p>\n<p>\u8a00\u5f52\u6b63\u4f20\uff0c\u6162\u771f\u662f\u4e2a\u5927\u95ee\u9898\uff01<\/p>\n<p>\u9996\u5148\u662f\u6280\u672f\u95ee\u9898\uff0c\u4e5f\u662f\u6700\u5bb9\u6613\u89e3\u51b3\u7684\u95ee\u9898\uff0c\u8c03\u53c2\u6570\u3002<br \/>\n\u6211\u770b\u5230\u6709\u4eba\u5728\u7f51\u4e0a\u95ee\uff0c\u8bf4WordCount\u90fd\u6162\uff0c\u90a3\u5c31\u662f\u73af\u5883\u95ee\u9898\u4e86\u3002\u8c03HeapSize\uff0c\u8c03GC\u53c2\u6570\uff0c\u8c03TaskSlot\uff0c\u518d\u4e0d\u884c\u52a0\u52a0\u673a\u5668\u3002\u603b\u662f\u80fd\u89e3\u51b3\u7684\u3002<\/p>\n<p>\u5176\u5b9e\u6211\u66f4\u60f3\u8bf4\u975e\u6280\u672f\u95ee\u9898\uff0c\u5f88\u591a\u4eba\u8bef\u628ahadoop\u5996\u9b54\u5316\u4e86\uff0c\u4ec0\u4e48\u90fd\u5f80\u4e0a\u5957\uff0c\u4e00\u5b9a\u4f1a\u6162\u3002<br \/>\n\u6240\u8c13\u5feb\u6162\u662f\u8981\u5bf9\u6bd4\u7684\uff0c\u8981\u4e48\u662f\u8ddf\u65e7\u7cfb\u7edf\u6bd4\uff0c\u8981\u4e48\u662f\u8ddf\u5fc3\u7406\u9884\u671f\u6bd4\u3002<br \/>\n\u5982\u679c\u4f60\u6709\u65e7\u7cfb\u7edf\uff0c\u4e5f\u662f\u5206\u5e03\u5f0f\uff0c\u4e5f\u662f\u5927\u6570\u636e\u91cf\uff0c\u5199\u7684\u5e76\u4e0d\u592a\u5dee\uff0c\u90a3hadoop\u662f\u4e00\u5b9a\u6162\u7684\u3002Hadoop\u80fd\u591f\u5e26\u6765\u7684\u66f4\u591a\u662f\u5f00\u53d1\u6548\u7387\u7684\u63d0\u9ad8\u3002<br \/>\n\u5982\u679c\u6ca1\u6709\u65e7\u7cfb\u7edf\uff0c\u6bd4\u5fc3\u7406\u9884\u671f\u6162\uff0c\u90a3\u5c31\u5fc5\u987b\u5148\u62f7\u95ee\u4e00\u4e0b\u81ea\u5df1\u51ed\u4ec0\u4e48\u9884\u671f\u5b83\u5feb\u3002<br \/>\n\u8fd8\u6709\u5c31\u662f\uff0creduce\u5929\u751f\u5c31\u6bd4map\u6162\uff0c\u8fd9\u4e2a\u4e0d\u80fd\u6bd4\u3002<\/p>\n<p>\u6211\u4eec\u9047\u5230\u8fc7\u5f88\u591a\u632b\u6298\uff1a<br \/>\n\u5728reduce\u7684\u65f6\u5019\u505a\u77e9\u9635\u8fd0\u7b97\uff0c\u80af\u5b9a\u5feb\u4e0d\u8d77\u6765\u3002<br \/>\n\u5728reduce\u8f93\u5165\u548cmap\u4e00\u6837\u7684\u6570\u636e\u91cf\uff0c\u56e0\u4e3areduce\u4e2a\u6570\u5c11\uff0c\u80af\u5b9a\u5feb\u4e0d\u8d77\u6765\u3002<br \/>\n\u5728map\u8f93\u51fa\u67d0\u4e2a\u7279\u6b8a\u7684key\uff0c\u6570\u636e\u91cf\u4e0d\u5e73\u8861\uff0c\u90a3\u67d0\u4e2areducer\u80af\u5b9a\u5feb\u4e0d\u8d77\u6765\u3002<br \/>\n\u5728\u7e41\u5fd9\u7684\u673a\u5668\u4e0a\u8fd0\u884c\uff0c\u4e5f\u4e00\u5b9a\u5feb\u4e0d\u8d77\u6765\u3002<\/p>\n<p>\u5728\u9047\u5230\u95ee\u9898\u65f6\uff0c\u6211\u4f1a\u53bb\u8c03\u67e5\uff1a<br \/>\nReduce\u8981\u4ece\u7f51\u7edc\u8bfb\u53d6\u591a\u5c11\u6570\u636e\u3002<br \/>\n\u6392\u5e8f\u80fd\u4e0d\u80fd\u5728\u5185\u5b58\u5b8c\u6210\u3002<br \/>\nReduce\u6709\u6ca1\u6709\u5360\u5f88\u591a\u5185\u5b58\u3002<\/p>\n<p>Hadoop\u73b0\u5728\u7684\u540d\u6c14\u5927\uff0c\u80fd\u529b\u76f8\u5bf9\u6ca1\u6709\u90a3\u4e48\u591a\u3002\u76f2\u76ee\u9009\u62e9\u6709\u98ce\u9669\uff0c\u987b\u8c28\u614e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c8\u4e00\u6b21\u4ece\u535a\u5ba2\u6d41\u91cf\u6765\u6e90\u4e0a\u770b\u5230\u4e00\u7ec4\u6709\u610f\u601d\u7684\u8bcd\uff1ahadoop reduce \u6162\u3002 \u6211\u8bd5\u7740\u641c\u4e86\u4e00\u4e0b\uff0c\u7ed3\u679c\u6ca1\u627e\u5230\u81ea\u5df1\u7684\u6587\u7ae0\u6392\u5728\u54ea\u3002 \u8a00\u5f52\u6b63\u4f20\uff0c\u6162\u771f\u662f\u4e2a\u5927\u95ee\u9898\uff01 \u9996\u5148\u662f\u6280\u672f\u95ee\u9898\uff0c\u4e5f\u662f\u6700\u5bb9\u6613\u89e3\u51b3\u7684\u95ee\u9898\uff0c\u8c03\u53c2\u6570\u3002 \u6211\u770b\u5230\u6709\u4eba\u5728\u7f51\u4e0a\u95ee\uff0c\u8bf4WordCount\u90fd\u6162\uff0c\u90a3\u5c31\u662f\u73af\u5883\u95ee\u9898\u4e86\u3002\u8c03HeapSize\uff0c\u8c03GC\u53c2\u6570\uff0c\u8c03TaskSlot\uff0c\u518d\u4e0d\u884c\u52a0\u52a0\u673a\u5668\u3002\u603b\u662f\u80fd\u89e3\u51b3\u7684\u3002 \u5176\u5b9e\u6211\u66f4\u60f3\u8bf4\u975e\u6280\u672f\u95ee\u9898\uff0c\u5f88\u591a\u4eba\u8bef\u628ahadoop\u5996\u9b54\u5316\u4e86\uff0c\u4ec0\u4e48\u90fd\u5f80\u4e0a\u5957\uff0c\u4e00\u5b9a\u4f1a\u6162\u3002 \u6240\u8c13\u5feb\u6162\u662f\u8981\u5bf9\u6bd4\u7684\uff0c\u8981\u4e48\u662f\u8ddf\u65e7\u7cfb\u7edf\u6bd4\uff0c\u8981\u4e48\u662f\u8ddf\u5fc3\u7406\u9884\u671f\u6bd4\u3002 \u5982\u679c\u4f60\u6709\u65e7\u7cfb\u7edf\uff0c\u4e5f\u662f\u5206\u5e03\u5f0f\uff0c\u4e5f\u662f\u5927\u6570\u636e\u91cf\uff0c\u5199\u7684\u5e76\u4e0d\u592a\u5dee\uff0c\u90a3hadoop\u662f\u4e00\u5b9a\u6162\u7684\u3002Hadoop\u80fd\u591f\u5e26\u6765\u7684\u66f4\u591a\u662f\u5f00\u53d1\u6548\u7387\u7684\u63d0\u9ad8\u3002 \u5982\u679c\u6ca1\u6709\u65e7\u7cfb\u7edf\uff0c\u6bd4\u5fc3\u7406\u9884\u671f\u6162\uff0c\u90a3\u5c31\u5fc5\u987b\u5148\u62f7\u95ee\u4e00\u4e0b\u81ea\u5df1\u51ed\u4ec0\u4e48\u9884\u671f\u5b83\u5feb\u3002 \u8fd8\u6709\u5c31\u662f\uff0creduce\u5929\u751f\u5c31\u6bd4map\u6162\uff0c\u8fd9\u4e2a\u4e0d\u80fd\u6bd4\u3002 \u6211\u4eec\u9047\u5230\u8fc7\u5f88\u591a\u632b\u6298\uff1a \u5728reduce\u7684\u65f6\u5019\u505a\u77e9\u9635\u8fd0\u7b97\uff0c\u80af\u5b9a\u5feb\u4e0d\u8d77\u6765\u3002 \u5728reduce\u8f93\u5165\u548cmap\u4e00\u6837\u7684\u6570\u636e\u91cf\uff0c\u56e0\u4e3areduce\u4e2a\u6570\u5c11\uff0c\u80af\u5b9a\u5feb\u4e0d\u8d77\u6765\u3002 \u5728map\u8f93\u51fa\u67d0\u4e2a\u7279\u6b8a\u7684key\uff0c\u6570\u636e\u91cf\u4e0d\u5e73\u8861\uff0c\u90a3\u67d0\u4e2areducer\u80af\u5b9a\u5feb\u4e0d\u8d77\u6765\u3002 \u5728\u7e41\u5fd9\u7684\u673a\u5668\u4e0a\u8fd0\u884c\uff0c\u4e5f\u4e00\u5b9a\u5feb\u4e0d\u8d77\u6765\u3002 \u5728\u9047\u5230\u95ee\u9898\u65f6\uff0c\u6211\u4f1a\u53bb\u8c03\u67e5\uff1a Reduce\u8981\u4ece\u7f51\u7edc\u8bfb\u53d6\u591a\u5c11\u6570\u636e\u3002 \u6392\u5e8f\u80fd\u4e0d\u80fd\u5728\u5185\u5b58\u5b8c\u6210\u3002 Reduce\u6709\u6ca1\u6709\u5360\u5f88\u591a\u5185\u5b58\u3002 Hadoop\u73b0\u5728\u7684\u540d\u6c14\u5927\uff0c\u80fd\u529b\u76f8\u5bf9\u6ca1\u6709\u90a3\u4e48\u591a\u3002\u76f2\u76ee\u9009\u62e9\u6709\u98ce\u9669\uff0c\u987b\u8c28\u614e\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[9,5],"tags":[24],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-hadoop","category-tech","tag-hadoop"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":1,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}