MR PAGERANK思路

map( key: [url, pagerank], value: outlink_list )
for each outlink in outlink_list
emit( key: outlink, value: pagerank/size(outlink_list) ) emit( key: url, value: outlink_list ) reducer( key: url, value: list_pr_or_urls )
outlink_list = []
pagerank = 0 for each pr_or_urls in list_pr_or_urls
if is_list( pr_or_urls )
outlink_list = pr_or_urls
else
pagerank += pr_or_urls pagerank = 1 - DAMPING_FACTOR + ( DAMPING_FACTOR * pagerank ) emit( key: [url, pagerank], value: outlink_list )
上一篇:排序数组中查找元素的第一个和最后一个位置 Find First And Last Position of Element in Sorted Array


下一篇:【shell】通过if [ $? != 0 ]判断上次程序是否执行成功