Module 4 - MapReduce Theory and Algorithms.ppt


文档分类:管理/人力资源 | 页数:约136页 举报非法文档有奖
1/136
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/136
文档列表 文档介绍
Google puting Faculty Training Workshop
Module IV: MapReduce Theory, Implementation, and Algorithms
This presentation includes content © University of Washington and/or Google, Inc.
Redistributed under the mons Attribution license.
All other contents:
© Spinnaker Labs, Inc.
Overview
Functional Programming Recap
MapReduce Theory & Implementation
MapReduce Algorithms
© Spinnaker Labs, Inc.
Functional Programming Review
Functional operations do not modify data structures: They always create new ones
Original data still exists in unmodified form
Data flows are implicit in program design
Order of operations does not matter
© Spinnaker Labs, Inc.
Functional Programming Review
fun foo(l: int list) =
sum(l) + mul(l) + length(l)
Order of sum() and mul(), etc does not matter – they do not modify l
© Spinnaker Labs, Inc.
Functional Updates Do Not Modify Structures
fun append(x, lst) =
let lst' = reverse lst in
reverse ( x :: lst' )
The append() function above reverses a list, adds a new element to the front, and returns all of that, reversed, which appends an item.
But it never modifies lst!
© Spinnaker Labs, Inc.
Functions Can Be Used As Arguments
fun DoDouble(f, x) = f (f x)
It does not matter what f does to its argument; DoDouble() will do it twice.
What is the type of this function?
© Spinnaker Labs, Inc.
Map
map f lst: (’a->’b) -> (’a list) -> (’b list)
Creates a new list by applying f to each element of the input list; returns output in order.
© Spinnaker Labs, Inc.
Fold
fold f x0 lst: ('a*'b->'b)->'b->('a list)->'b
Moves across a list, applying f to each element plus an accumulator. f returns the next accumulator value, which bined with the next element of the list
© Spinnaker Labs, Inc.
fold left vs. fold right
Order of list elements can be significant
Fold left moves left-to-right across the list
Fold right moves from right-to-left
SML Implementation:
fun foldl f a [] = a
| foldl f a (x::xs) = foldl f (f(x, a)) xs
fun fo

Module 4 - MapReduce Theory and Algorithms 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数136
  • 收藏数0 收藏
  • 顶次数0
  • 上传人管理资源吧
  • 文件大小0 KB
  • 时间2012-02-15