Map Reduce. Functional Programming Review r Functional operations do not modify data structures: They always create new ones r Original data still exists.

Slides:



Advertisements
Similar presentations
Lecture 12: MapReduce: Simplified Data Processing on Large Clusters Xiaowei Yang (Duke University)
Advertisements

Intro to Map-Reduce Feb 21, map-reduce? A programming model or abstraction. A novel way of thinking about designing a solution to certain problems…
MapReduce Online Created by: Rajesh Gadipuuri Modified by: Ying Lu.
Intro to Map-Reduce Feb 4, map-reduce? A programming model or abstraction. A novel way of thinking about designing a solution to certain problems…
Distributed Computations
MapReduce: Simplified Data Processing on Large Clusters Cloud Computing Seminar SEECS, NUST By Dr. Zahid Anwar.
CS 345A Data Mining MapReduce. Single-node architecture Memory Disk CPU Machine Learning, Statistics “Classical” Data Mining.
MapReduce Technical Workshop This presentation includes course content © University of Washington Redistributed under the Creative Commons Attribution.
An Introduction to MapReduce: Abstractions and Beyond! -by- Timothy Carlstrom Joshua Dick Gerard Dwan Eric Griffel Zachary Kleinfeld Peter Lucia Evan May.
MapReduce Dean and Ghemawat. MapReduce: Simplified Data Processing on Large Clusters. Communications of the ACM, Vol. 51, No. 1, January Shahram.
MapReduce: Simplified Data Processing on Large Clusters J. Dean and S. Ghemawat (Google) OSDI 2004 Shimin Chen DISC Reading Group.
MapReduce Simplified Data Processing on Large Clusters Google, Inc. Presented by Prasad Raghavendra.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 3: Mapreduce and Hadoop All slides © IG.
Distributed Computations MapReduce
Lecture 2 – MapReduce: Theory and Implementation CSE 490H This presentation incorporates content licensed under the Creative Commons Attribution 2.5 License.
Lecture 2 – MapReduce: Theory and Implementation CSE 490h – Introduction to Distributed Computing, Spring 2007 Except as otherwise noted, the content of.
L22: SC Report, Map Reduce November 23, Map Reduce What is MapReduce? Example computing environment How it works Fault Tolerance Debugging Performance.
Introduction to Google MapReduce WING Group Meeting 13 Oct 2006 Hendra Setiawan.
Lecture 2 – MapReduce CPE 458 – Parallel Programming, Spring 2009 Except as otherwise noted, the content of this presentation is licensed under the Creative.
MapReduce : Simplified Data Processing on Large Clusters Hongwei Wang & Sihuizi Jin & Yajing Zhang
Google Distributed System and Hadoop Lakshmi Thyagarajan.
Advanced Topics: MapReduce ECE 454 Computer Systems Programming Topics: Reductions Implemented in Distributed Frameworks Distributed Key-Value Stores Hadoop.
SIDDHARTH MEHTA PURSUING MASTERS IN COMPUTER SCIENCE (FALL 2008) INTERESTS: SYSTEMS, WEB.
MapReduce.
Introduction to Parallel Programming MapReduce Except where otherwise noted all portions of this work are Copyright (c) 2007 Google and are licensed under.
By: Jeffrey Dean & Sanjay Ghemawat Presented by: Warunika Ranaweera Supervised by: Dr. Nalin Ranasinghe.
MapReduce. Web data sets can be very large – Tens to hundreds of terabytes Cannot mine on a single server Standard architecture emerging: – Cluster of.
Google MapReduce Simplified Data Processing on Large Clusters Jeff Dean, Sanjay Ghemawat Google, Inc. Presented by Conroy Whitney 4 th year CS – Web Development.
MapReduce: Acknowledgements: Some slides form Google University (licensed under the Creative Commons Attribution 2.5 License) others from Jure Leskovik.
Jeffrey D. Ullman Stanford University. 2 Chunking Replication Distribution on Racks.
Süleyman Fatih GİRİŞ CONTENT 1. Introduction 2. Programming Model 2.1 Example 2.2 More Examples 3. Implementation 3.1 ExecutionOverview 3.2.
Map Reduce for data-intensive computing (Some of the content is adapted from the original authors’ talk at OSDI 04)
MapReduce: Simplified Data Processing on Large Clusters Jeffrey Dean and Sanjay Ghemawat.
1 The Map-Reduce Framework Compiled by Mark Silberstein, using slides from Dan Weld’s class at U. Washington, Yaniv Carmeli and some other.
MapReduce Costin Raiciu Advanced Topics in Distributed Systems, 2011.
MapReduce: Hadoop Implementation. Outline MapReduce overview Applications of MapReduce Hadoop overview.
Map Reduce: Simplified Processing on Large Clusters Jeffrey Dean and Sanjay Ghemawat Google, Inc. OSDI ’04: 6 th Symposium on Operating Systems Design.
MAP REDUCE : SIMPLIFIED DATA PROCESSING ON LARGE CLUSTERS Presented by: Simarpreet Gill.
MapReduce How to painlessly process terabytes of data.
Google’s MapReduce Connor Poske Florida State University.
MapReduce M/R slides adapted from those of Jeff Dean’s.
Mass Data Processing Technology on Large Scale Clusters Summer, 2007, Tsinghua University All course material (slides, labs, etc) is licensed under the.
MapReduce Kristof Bamps Wouter Deroey. Outline Problem overview MapReduce o overview o implementation o refinements o conclusion.
MapReduce Costin Raiciu Advanced Topics in Distributed Systems, 2012.
1 MapReduce: Theory and Implementation CSE 490h – Intro to Distributed Computing, Modified by George Lee Except as otherwise noted, the content of this.
© Spinnaker Labs, Inc. Google Cluster Computing Faculty Training Workshop Module IV: MapReduce Theory, Implementation, and Algorithms This presentation.
PPCC Spring Map Reduce1 MapReduce Prof. Chris Carothers Computer Science Department
Lecture 2 – MapReduce: Theory and Implementation CSE 490h – Introduction to Distributed Computing, Winter 2008 Except as otherwise noted, the content of.
SLIDE 1IS 240 – Spring 2013 MapReduce, HBase, and Hive University of California, Berkeley School of Information IS 257: Database Management.
MapReduce Theory, Implementation and Algorithms Hongfei Yan School of EECS, Peking University 7/2/2009 Refer to.
MapReduce and the New Software Stack CHAPTER 2 1.
By Jeff Dean & Sanjay Ghemawat Google Inc. OSDI 2004 Presented by : Mohit Deopujari.
MapReduce: Simplified Data Processing on Large Clusters Lim JunSeok.
MapReduce : Simplified Data Processing on Large Clusters P 謝光昱 P 陳志豪 Operating Systems Design and Implementation 2004 Jeffrey Dean, Sanjay.
C-Store: MapReduce Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY May. 22, 2009.
MapReduce: Simplified Data Processing on Large Clusters By Dinesh Dharme.
MapReduce: simplified data processing on large clusters Jeffrey Dean and Sanjay Ghemawat.
MapReduce: Simplied Data Processing on Large Clusters Written By: Jeffrey Dean and Sanjay Ghemawat Presented By: Manoher Shatha & Naveen Kumar Ratkal.
COMP7330/7336 Advanced Parallel and Distributed Computing MapReduce - Introduction Dr. Xiao Qin Auburn University
MapReduce: Simplified Data Processing on Large Clusters Jeff Dean, Sanjay Ghemawat Google, Inc.
Lecture 3 – MapReduce: Implementation CSE 490h – Introduction to Distributed Computing, Spring 2009 Except as otherwise noted, the content of this presentation.
Introduction to Google MapReduce
Auburn University COMP7330/7336 Advanced Parallel and Distributed Computing MapReduce - Introduction Dr. Xiao Qin Auburn.
Adapted from: Google & UWash’s Creative Common MR Deck
CS162 Operating Systems and Systems Programming Lecture 19 File Systems continued Distributed Systems April 9, 2008 Prof. Anthony D. Joseph
湖南大学-信息科学与工程学院-计算机与科学系
Map reduce use case Giuseppe Andronico INFN Sez. CT & Consorzio COMETA
Distributed System Gang Wu Spring,2018.
5/7/2019 Map Reduce Map reduce.
MapReduce: Simplified Data Processing on Large Clusters
Presentation transcript:

Map Reduce

Functional Programming Review r Functional operations do not modify data structures: They always create new ones r Original data still exists in unmodified form r Data flows are implicit in program design r Order of operations does not matter r Lists are primitive data types

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

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!

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?

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.

Fold fold f x 0 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 is combined with the next element of the list

fold left vs. fold right r Order of list elements can be significant r Fold left moves left-to-right across the list r 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 foldr f a [] = a | foldr f a (x::xs) = f(x, (foldr f a xs))

Example fun foo(l: int list) = sum(l) + mul(l) + length(l) How can we implement this?

Example (Solved) fun foo(l: int list) = sum(l) + mul(l) + length(l) fun sum(lst) = foldl (fn (x,a)=>x+a) 0 lst fun mul(lst) = foldl (fn (x,a)=>x*a) 1 lst fun length(lst) = foldl (fn (x,a)=>1+a) 0 lst

A More Complicated Fold Problem r Given a list of numbers, how can we generate a list of partial sums? e.g.: [1, 4, 8, 3, 7, 9]  [0, 1, 5, 13, 16, 23, 32]

A More Complicated Map Problem r Given a list of words, can we: reverse the letters in each word, and reverse the whole list, so it all comes out backwards? [“my”, “happy”, “cat”] -> [“tac”, “yppah”, “ym”]

map Implementation r This implementation moves left-to-right across the list, mapping elements one at a time r … But does it need to? fun map f [] = [] | map f (x::xs) = (f x) :: (map f xs)

Implicit Parallelism In map r In a purely functional setting, elements of a list being computed by map cannot see the effects of the computations on other elements r If order of application of f to elements in list is commutative, we can reorder or parallelize execution r This is the “secret” that MapReduce exploits

Why Look at Functional Programming? r Let’s assume a long list of records: imagine if... m We can parallelize map operations m We have a mechanism for bringing map results back together in the fold operation r That’s MapReduce! r Observations: m No limit to map parallelization since maps are independent m We can reorder folding if the fold function is commutative and associative

MapReduce

Motivation: Large Scale Data Processing r Want to process lots of data ( > 1 TB) r Want to parallelize across hundreds/thousands of CPUs r … Want to make this easy

MapReduce r Automatic parallelization & distribution r Fault-tolerant r Provides status and monitoring tools r Clean abstraction for programmers

Programming Model r Borrows from functional programming r Users implement interface of two functions: m map (in_key, in_value) -> (out_key, intermediate_value) list m reduce (out_key, intermediate_value list) -> out_value list

Map r Records from the data source (lines out of files, rows of a database, etc) are fed into the map function as (key,value) pairs: e.g., (filename, offset). r map() produces one or more intermediate values along with an output key from the input.

Reduce r After the map phase is over, all the intermediate values for a given output key are combined together into a list r reduce() combines those intermediate values into one or more final values for that same output key r (in practice, usually only one final value per key)

Distributed Word Count Very big data Split data count merge merged count

Partitioning Function

Example Word Count r Map public static class MapClass extends MapReduceBase implements Mapper { private final static IntWritable one = new IntWritable(1); private Text word = new Text(); public void map(WritableComparable key, Writable value, OutputCollector output, Reporter reporter) throws IOException { String line = ((Text)value).toString(); StringTokenizer itr = new StringTokenizer(line); while (itr.hasMoreTokens()) { word.set(itr.nextToken()); output.collect(word, one); }

Partitioning Function (2)  Default : hash(key) mod R r Guarantee: m Relatively well-balanced partitions m Ordering guarantee within partition

MapReduce in Parallel: Example

MapReduce r Distributed Grep m Map: if match(value,pattern) emit(value,1) m Reduce: emit(key,sum(value*)) r Distributed Word Count m Map: for all w in value do emit(w,1) m Reduce: emit(key,sum(value*))

Implementation Overview r Typical cluster m 100’s/1000s of 2-CPU x86 machines, 2-4 GB of memory m Storage is on local disks m GFS: distributed file system manages data m Job scheduling system: jobs made up of tasks, scheduler assigns tasks to machine

M R R

Execution r How is this distributed? 1. Partition input key/value pairs into chunks, run map() tasks in parallel 2. After all map()s are complete, consolidate all emitted values for each unique emitted key 3. Now partition space of output map keys, and run reduce() in parallel r If map() or reduce() fails, reexecute! r Bottleneck: reduce phase can’t start until map phase is completely finished.

Locality r Master program divvies up tasks based on location of data: tries to have map() tasks on same machine as physical file data, or at least same rack r map() task inputs are divided into 64 MB blocks: same size as Google File System chunks

Fault Tolerance r Master detects worker failures m Re-executes completed & in-progress map() tasks m Re-executes in-progress reduce() tasks r Master notices particular input key/values cause crashes in map(), and skips those values on re-execution. m Effect: Can work around bugs in third-party libraries!

Optimizations r No reduce can start until map is complete: m A single slow disk controller can rate-limit the whole process r Master redundantly executes “slow-moving” map tasks; uses results of first copy to finish

Optimizations r “Combiner” functions can run on same machine as a mapper r Causes a mini-reduce phase to occur before the real reduce phase, to save bandwidth

MapReduce Conclusions r MapReduce has proven to be a useful abstraction r Greatly simplifies large-scale computations at Google r Functional programming paradigm can be applied to large-scale applications r Fun to use: focus on problem, let library deal w/ messy details

MapReduce Conclusions r MapReduce has proven to be a useful abstraction r Greatly simplifies large-scale computations at Google r Functional programming paradigm can be applied to large-scale applications r Fun to use: focus on problem, let library deal w/ messy details