5/7/2019 Map Reduce Map reduce.

Slides:



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

MapReduce Online Created by: Rajesh Gadipuuri Modified by: Ying Lu.
Distributed Computations
CS 345A Data Mining MapReduce. Single-node architecture Memory Disk CPU Machine Learning, Statistics “Classical” Data Mining.
Map Reduce Allan Jefferson Armando Gonçalves Rocir Leite Filipe??
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 Google, Inc. Presented by Prasad Raghavendra.
Distributed Computations MapReduce
L22: SC Report, Map Reduce November 23, Map Reduce What is MapReduce? Example computing environment How it works Fault Tolerance Debugging Performance.
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
Map Reduce Architecture
Take An Internal Look at Hadoop Hairong Kuang Grid Team, Yahoo! Inc
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.
Hadoop Ida Mele. Parallel programming Parallel programming is used to improve performance and efficiency In a parallel program, the processing is broken.
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.
Advanced Software Engineering Cloud Computing and Big Data Prof. Harold Liu.
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 and Hadoop S. Sudarshan, IIT Bombay
Map Reduce for data-intensive computing (Some of the content is adapted from the original authors’ talk at OSDI 04)
Parallel Programming Models Basic question: what is the “right” way to write parallel programs –And deal with the complexity of finding parallelism, coarsening.
MapReduce: Simplified Data Processing on Large Clusters Jeffrey Dean and Sanjay Ghemawat.
MapReduce and Hadoop 1 Wu-Jun Li Department of Computer Science and Engineering Shanghai Jiao Tong University Lecture 2: MapReduce and Hadoop Mining Massive.
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: Hadoop Implementation. Outline MapReduce overview Applications of MapReduce Hadoop overview.
Large-scale file systems and Map-Reduce Single-node architecture Memory Disk CPU Google example: 20+ billion web pages x 20KB = 400+ Terabyte 1 computer.
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.
Pregel: A System for Large-Scale Graph Processing Grzegorz Malewicz, Matthew H. Austern, Aart J. C. Bik, James C. Dehnert, Ilan Horn, Naty Leiser, and.
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.
MapReduce Kristof Bamps Wouter Deroey. Outline Problem overview MapReduce o overview o implementation o refinements o conclusion.
CS 345A Data Mining MapReduce. Single-node architecture Memory Disk CPU Machine Learning, Statistics “Classical” Data Mining.
MapReduce and the New Software Stack CHAPTER 2 1.
CS425: Algorithms for Web Scale Data Most of the slides are from the Mining of Massive Datasets book. These slides have been modified for CS425. The original.
By Jeff Dean & Sanjay Ghemawat Google Inc. OSDI 2004 Presented by : Mohit Deopujari.
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.
 Much of the course will be devoted to large scale computing for data mining  Challenges:  How to distribute computation?  Distributed/parallel.
MapReduce: Simplified Data Processing on Large Cluster Authors: Jeffrey Dean and Sanjay Ghemawat Presented by: Yang Liu, University of Michigan EECS 582.
MapReduce: Simplied Data Processing on Large Clusters Written By: Jeffrey Dean and Sanjay Ghemawat Presented By: Manoher Shatha & Naveen Kumar Ratkal.
Part II NoSQL Database (MapReduce) Yuan Xue
Lecture 3 – MapReduce: Implementation CSE 490h – Introduction to Distributed Computing, Spring 2009 Except as otherwise noted, the content of this presentation.
Lecture 4. MapReduce Instructor: Weidong Shi (Larry), PhD
Large-scale file systems and Map-Reduce
MapReduce Computing Paradigm Basics Fall 2013 Elke A. Rundensteiner
MapReduce Simplied Data Processing on Large Clusters
COS 418: Distributed Systems Lecture 1 Mike Freedman
CS6604 Digital Libraries IDEAL Webpages Presented by
湖南大学-信息科学与工程学院-计算机与科学系
February 26th – Map/Reduce
Cse 344 May 4th – Map/Reduce.
Map-Reduce and the New Software Stack
Map-Reduce framework -By Jagadish Rouniyar.
CS 345A Data Mining MapReduce This presentation has been altered.
Cloud Computing MapReduce, Batch Processing
Introduction to MapReduce
Big Data Analysis MapReduce.
COS 518: Distributed Systems Lecture 11 Mike Freedman
MapReduce: Simplified Data Processing on Large Clusters
Lecture 29: Distributed Systems
Distributed Systems and Concurrency: Map Reduce
Presentation transcript:

5/7/2019 Map Reduce Map reduce

Word Count Example We have a large file of words, one word to a line 5/7/2019 Map Reduce Word Count Example We have a large file of words, one word to a line Count the number of times each distinct word appears in the file Sample application: analyze web server logs to find popular URLs

5/7/2019 Map Reduce Word Count (2) Case 1: Entire file fits in memory

Word Count (2) Case 1: Entire file fits in memory 5/7/2019 Map Reduce Word Count (2) Case 1: Entire file fits in memory Case 2: File too large for mem, but all <word, count> pairs fit in mem

Word Count (2) sort datafile | uniq –c 5/7/2019 Map Reduce Word Count (2) Case 1: Entire file fits in memory Case 2: File too large for mem, but all <word, count> pairs fit in mem Case 3: File on disk, too many distinct words to fit in memory sort datafile | uniq –c

5/7/2019 Map Reduce Word Count (3) A large corpus of documents, sharded across many disks in many machines Machines, disks, networks can fail Motivation for Google’s MapReduce

5/7/2019 Map Reduce Input: A set of files C N B C F O X …

Map: Generate Word Count Per File 5/7/2019 Map Reduce Map: Generate Word Count Per File C N B C F O X … C:1 N:2 B:2 C:1 F:1 O:1 X:1

Partition (Optional) C N B C F O X … C:1 N:2 B:2 C:1 F:1 O:1 X:1 C:1 5/7/2019 Map Reduce Partition (Optional) C N B C F O X … C:1 N:2 B:2 C:1 F:1 O:1 X:1 C:1 B:2 F:1 N:2 O:1 X:1 C:1

Reduce C N B C F O X … C:1 N:2 B:2 C:1 F:1 O:1 X:1 C:1 B:2 F:1 N:2 O:1 5/7/2019 Map Reduce Reduce C N B C F O X … C:1 N:2 B:2 C:1 F:1 O:1 X:1 C:1 B:2 F:1 N:2 O:1 X:1 C:1 C:2 B:2 F:1 N:2 O:1 X:1

MapReduce Input: a set of key/value pairs User supplies two functions: 5/7/2019 Map Reduce MapReduce Input: a set of key/value pairs User supplies two functions: map(k,v)  list(k1,v1) reduce(k1, list(v1))  v2 (k1,v1) is an intermediate key/value pair Output is the set of (k1,v2) pairs

Word Count using MapReduce 5/7/2019 Map Reduce Word Count using MapReduce map(key, value): // key: document name; value: text of document for each word w in value: emit(w, 1) reduce(key, values): // key: a word; value: an iterator over counts result = 0 for each count v in values: result += v emit(result)

Map and Reduce vs MapReduce 5/7/2019 Map Reduce Map and Reduce vs MapReduce The map and reduce operations in MapReduce are inspired by similar operations in functional programming

Map Given a function f : (A) => B A collection a: A[] 5/7/2019 Map Reduce Map Given a function f : (A) => B A collection a: A[] Generates a collection b: B[], where B[i] = f( A[i] ) Parallel.For, Paralle.ForEach Where each loop iteration is independent A f B

Reduce Given a function f: (A, B) => B A collection a: A[] 5/7/2019 Map Reduce Reduce Given a function f: (A, B) => B A collection a: A[] An initial value b0: B Generate a final value b: B Where b = f(A[n-1], … f(A[1], f(A[0], b0)) ) A f b b0

Relationship to SQL Implementing word count in SQL 5/7/2019 Map Reduce Relationship to SQL Implementing word count in SQL SELECT word Count(*) as wordCount FROM files GROUP BY word; // where files is a (distributed) // relation <name, posn, word>

Signs of a Good Abstraction 5/7/2019 Map Reduce Signs of a Good Abstraction Hides important details But not too much Simple for lay programmers to use Not necessarily general But not very restricted Can be application/domain specific Allows efficient implementations Automatic optimizations Manual optimizations (by experts)

Distributed Execution Overview 5/7/2019 Map Reduce Distributed Execution Overview User Program Worker Master fork assign map reduce Split 0 Split 1 Split 2 Input Data local write Output File 0 File 1 write read remote read, sort

Data flow Input, final output are stored on a distributed file system 5/7/2019 Map Reduce Data flow Input, final output are stored on a distributed file system Scheduler tries to schedule map tasks “close” to physical storage location of input data Intermediate results are stored on local FS of map and reduce workers Output is often input to another map reduce task

Coordination Master data structures 5/7/2019 Map Reduce Coordination Master data structures Task status: (idle, in-progress, completed) Idle tasks get scheduled as workers become available When a map task completes, it sends the master the location and sizes of its R intermediate files, one for each reducer Master pushes this info to reducers Master pings workers periodically to detect failures

Failures Map worker failure Reduce worker failure Master failure 5/7/2019 Map Reduce Failures Map worker failure Map tasks completed or in-progress at worker are reset to idle Reduce workers are notified when task is rescheduled on another worker Reduce worker failure Only in-progress tasks are reset to idle Master failure MapReduce task is aborted and client is notified

How many Map and Reduce jobs? 5/7/2019 Map Reduce How many Map and Reduce jobs? M map tasks, R reduce tasks Rule of thumb: Make M and R much larger than the number of nodes in cluster One DFS chunk per map is common Improves dynamic load balancing and speeds recovery from worker failure Usually R is smaller than M, because output is spread across R files

5/7/2019 Map Reduce Combiners Often a map task will produce many pairs of the form (k,v1), (k,v2), … for the same key k E.g., popular words in Word Count Can save network time by pre-aggregating at mapper combine(k1, list(v1))  v2 Usually same as reduce function Works only if reduce function is commutative and associative

5/7/2019 Map Reduce Partition Function Inputs to map tasks are created by contiguous splits of input file For reduce, we need to ensure that records with the same intermediate key end up at the same worker System uses a default partition function e.g., hash(key) mod R Sometimes useful to override E.g., hash(hostname(URL)) mod R ensures URLs from a host end up in the same output file

5/7/2019 Map Reduce Avoiding Stragglers A slow running task (straggler) can prolong overall execution Overloaded machines Slow disk Kill stragglers Fork redundant tasks and take the first

5/7/2019 Map Reduce Example: Sorting

Example: Database Join 5/7/2019 Map Reduce Example: Database Join

Can Mappers Push instead of Reducers Pulling Data ? 5/7/2019 Map Reduce Can Mappers Push instead of Reducers Pulling Data ?