SlideShare una empresa de Scribd logo
1 de 28
MapReduce 아키텍트를 꿈꾸는 사람들cafe.naver.com/architect1 현수명  soomong.net #soomong
MapReduce? Map + Reduce Execution Overview
MapReduce? mechanism for processing large data developed within Google  from a functional language <key,value> pair
Execution Overview 	Google
Execution Overview Hadoop
Map <Only value> Map takes as input a function and a sequence of values.  It then applies the function  to each value in the sequence func Map (func,values) applied values values
Map <Only value> f(x)=x*x Map (func,values) (1,4,9) (1,2,3) Clojure (map (fn [x] (x*x)) [1 2 3])
Reduce <Only value> A reduce combines all the elements of a sequence  using a binary operation func Reduce (func,values) applied value values
Reduce <Only value> + Reduce (func,values) (14) (1,4,9) Clojure (reduce + [1 4 9])
Map <key,value> f(x)=x*x Map (func,values) (keyA,1) (keyB,4) (keyA,9) (1,2,3)
Reduce <key,value> + Reduce (func,(key,value)) (keyA,10) (keyB,4) (keyA,1) (keyB,4) (keyA,9)
Map + Reduce (1,2,3…99998,99999,100000) f(x)=x*x f(x)=x*x f(x)=x*x Map (func,values) Map (func,values) Map (func,values) + + Reduce (func,values) Reduce (func,values) Reduce (func,values) (keyA,107) (keyB,29) (…,…,…) (…) (result) (keyA,1) (keyB,4) (keyA,9) (1,2,3) (4,5,6) (99998,99999,…) (keyA,16) (keyB,25) (keyA,81) + …
Execution Example “Stay Hungry Stay Foolish  Don’t settle” Word Counter Stay 2 Hungry 1 Foolish 1 Don’t 1 Settle 1
Map map(String key, String value):  // key: document name  // value: document contents  for each word w in value:  EmitIntermediate(w, "1");
Reduce reduce(String key, Iterator values):  // key: a word  	// values: a list of counts  int result = 0;  	for each v in values:  		result +=ParseInt(v); 	Emit(AsString(result));
Stay Hungry Stay Foolish Don’t settle Stay Hungry Stay Foolish Don’t settle (1) Shards the input files
Stay Hungry Stay Foolish Don’t settle (2) Master pick idle workers 	assign a map or reduce task
<Stay,1> <Hungry,1> <Stay,1> <Foolish,1> Stay Hungry Stay Foolish Don’t settle <Don’t,1> <settle,1> (3) Map worker reads input shard, do Map func -> intermediate <key,value>
<Stay,1> <Hungry,1> <Stay,1> <Foolish,1> <Don’t,1> <settle,1> (4) Write intermediate <key,value> on local disk
<Stay,1> <Hungry,1> <Stay,1> <Foolish,1> <Foolish,1> <Hungry,1> <Stay,(1,1)> <Don’t,1> <settle,1> <Don’t,1> <settle,1> (5) Reduce worker reads intermediate data sort by key
<Foolish,1> <Hungry,1> <Stay,(1,1)> <Foolish,1> <Hungry,1> <Stay,2> <Don’t,1> <settle,1> <Don’t,1> <settle,1> (6) Reduce worker do reduce func 	-> wrtie output
<Foolish,1> <Hungry,1> <Stay,2> <Don’t,1> <settle,1> <Foolish,1> <Hungry,1> <Stay,2> <Don’t,1> <settle,1> (7) All map tasks and reduce tasks have been completed 	master wakes up the user program -> return Result
Map map = function () {     for (var key in this) {         emit(key, {count:1});     }
Reduce reduce = function (key, emits) {     total = 0;     for (vari in emits) {         total += emits[i].count;     }     return {count:total};
Execution mr = db.foo.mapReduce (map,reduce,{out:"mongoDBmapReduce"}) {         "result" : "mongoDBmapReduce",         "timeMillis" : 11,         "counts" : {                 "input" : 4,                 "emit" : 8,                 "output" : 5         },         "ok" : 1, }
Reference Google MapReduce http://code.google.com/intl/ko-KR/edu/parallel/mapreduce-tutorial.html MongoDBMapReduce http://kylebanker.com/blog/2009/12/mongodb-map-reduce-basics/ HadoopMapReduce http://hadoop.apache.org/common/docs/current/mapred_tutorial.html
감사합니다

Más contenido relacionado

La actualidad más candente

Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)
Ahmed Khateeb
 
Tao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume renderingTao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume rendering
Fayan TAO
 
Week 10 part 1 pe 6282 Block Diagrams
Week  10 part 1 pe 6282   Block DiagramsWeek  10 part 1 pe 6282   Block Diagrams
Week 10 part 1 pe 6282 Block Diagrams
Charlton Inao
 

La actualidad más candente (20)

Write a program to perform translation.
 Write a program to perform translation. Write a program to perform translation.
Write a program to perform translation.
 
program on Function overloading in java
program on  Function overloading in javaprogram on  Function overloading in java
program on Function overloading in java
 
Programming the cloud with Skywriting
Programming the cloud with SkywritingProgramming the cloud with Skywriting
Programming the cloud with Skywriting
 
C graphics programs file
C graphics programs fileC graphics programs file
C graphics programs file
 
Oral-2
Oral-2Oral-2
Oral-2
 
Adding where to your ruby apps
Adding where to your ruby appsAdding where to your ruby apps
Adding where to your ruby apps
 
Write a program to perform translation
Write a program to perform translationWrite a program to perform translation
Write a program to perform translation
 
Essence of the iterator pattern
Essence of the iterator patternEssence of the iterator pattern
Essence of the iterator pattern
 
Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)
 
analog clock C#
analog clock C#analog clock C#
analog clock C#
 
Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++
 
Concept of c
Concept of cConcept of c
Concept of c
 
Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
Module 2 topic 2 notes
Module 2 topic 2 notesModule 2 topic 2 notes
Module 2 topic 2 notes
 
Tao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume renderingTao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume rendering
 
Week 10 part 1 pe 6282 Block Diagrams
Week  10 part 1 pe 6282   Block DiagramsWeek  10 part 1 pe 6282   Block Diagrams
Week 10 part 1 pe 6282 Block Diagrams
 
Map and Reduce
Map and ReduceMap and Reduce
Map and Reduce
 
Amortized complexity
Amortized complexityAmortized complexity
Amortized complexity
 
Functional Programming for Fun and Profit
Functional Programming for Fun and ProfitFunctional Programming for Fun and Profit
Functional Programming for Fun and Profit
 

Destacado

Destacado (17)

The Art of Computer Programming 1.2.5
The Art of Computer Programming 1.2.5The Art of Computer Programming 1.2.5
The Art of Computer Programming 1.2.5
 
Hybrid app
Hybrid appHybrid app
Hybrid app
 
이산수학 Ch.5
이산수학 Ch.5이산수학 Ch.5
이산수학 Ch.5
 
Clojure Chapter.6
Clojure Chapter.6Clojure Chapter.6
Clojure Chapter.6
 
HTML5 & CSS3 - Video,Audio
HTML5 & CSS3 - Video,AudioHTML5 & CSS3 - Video,Audio
HTML5 & CSS3 - Video,Audio
 
xUnitTestPattern/chapter8
xUnitTestPattern/chapter8xUnitTestPattern/chapter8
xUnitTestPattern/chapter8
 
[페차쿠차] 배움의 기술
[페차쿠차] 배움의 기술[페차쿠차] 배움의 기술
[페차쿠차] 배움의 기술
 
The Art of Computer Programming 2.3.2 Tree
The Art of Computer Programming 2.3.2 TreeThe Art of Computer Programming 2.3.2 Tree
The Art of Computer Programming 2.3.2 Tree
 
The Art of Computer Programming 2.4 다중연결구조
The Art of Computer Programming 2.4 다중연결구조The Art of Computer Programming 2.4 다중연결구조
The Art of Computer Programming 2.4 다중연결구조
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
프로그램은 왜 실패하는가?
프로그램은 왜 실패하는가?프로그램은 왜 실패하는가?
프로그램은 왜 실패하는가?
 
Dependency Breaking Techniques
Dependency Breaking TechniquesDependency Breaking Techniques
Dependency Breaking Techniques
 
실전 윈도우 디버깅. Ch3. 디버거 해부
실전 윈도우 디버깅. Ch3. 디버거 해부실전 윈도우 디버깅. Ch3. 디버거 해부
실전 윈도우 디버깅. Ch3. 디버거 해부
 
프로그래머의 길,멘토에게 묻다 2장
프로그래머의 길,멘토에게 묻다 2장프로그래머의 길,멘토에게 묻다 2장
프로그래머의 길,멘토에게 묻다 2장
 
5장 그래프의 비밀 (Programming Game AI by Example)
5장 그래프의 비밀 (Programming Game AI by Example)5장 그래프의 비밀 (Programming Game AI by Example)
5장 그래프의 비밀 (Programming Game AI by Example)
 
예제로 보는 Pattern 연상법
예제로 보는 Pattern 연상법예제로 보는 Pattern 연상법
예제로 보는 Pattern 연상법
 
Scalable Web Architecture and Distributed Systems
Scalable Web Architecture and Distributed SystemsScalable Web Architecture and Distributed Systems
Scalable Web Architecture and Distributed Systems
 

Similar a MapReduce

Mapreduce: Theory and implementation
Mapreduce: Theory and implementationMapreduce: Theory and implementation
Mapreduce: Theory and implementation
Sri Prasanna
 
Map reduce (from Google)
Map reduce (from Google)Map reduce (from Google)
Map reduce (from Google)
Sri Prasanna
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
alish sha
 
Distributed Computing Seminar - Lecture 2: MapReduce Theory and Implementation
Distributed Computing Seminar - Lecture 2: MapReduce Theory and ImplementationDistributed Computing Seminar - Lecture 2: MapReduce Theory and Implementation
Distributed Computing Seminar - Lecture 2: MapReduce Theory and Implementation
tugrulh
 
オープンデータを使ったモバイルアプリ開発(応用編)
オープンデータを使ったモバイルアプリ開発(応用編)オープンデータを使ったモバイルアプリ開発(応用編)
オープンデータを使ったモバイルアプリ開発(応用編)
Takayuki Goto
 

Similar a MapReduce (20)

MapReduce
MapReduceMapReduce
MapReduce
 
Map Reduce
Map ReduceMap Reduce
Map Reduce
 
Mapreduce: Theory and implementation
Mapreduce: Theory and implementationMapreduce: Theory and implementation
Mapreduce: Theory and implementation
 
MapReduce
MapReduceMapReduce
MapReduce
 
The google MapReduce
The google MapReduceThe google MapReduce
The google MapReduce
 
Multinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache SparkMultinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache Spark
 
Alpine Spark Implementation - Technical
Alpine Spark Implementation - TechnicalAlpine Spark Implementation - Technical
Alpine Spark Implementation - Technical
 
MapReduce wordcount program
MapReduce wordcount program MapReduce wordcount program
MapReduce wordcount program
 
Map reduce (from Google)
Map reduce (from Google)Map reduce (from Google)
Map reduce (from Google)
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
 
Big data shim
Big data shimBig data shim
Big data shim
 
Lec2 Mapred
Lec2 MapredLec2 Mapred
Lec2 Mapred
 
Distributed Computing Seminar - Lecture 2: MapReduce Theory and Implementation
Distributed Computing Seminar - Lecture 2: MapReduce Theory and ImplementationDistributed Computing Seminar - Lecture 2: MapReduce Theory and Implementation
Distributed Computing Seminar - Lecture 2: MapReduce Theory and Implementation
 
Hadoop Map Reduce
Hadoop Map ReduceHadoop Map Reduce
Hadoop Map Reduce
 
Map reduce in Hadoop BIG DATA ANALYTICS
Map reduce in Hadoop BIG DATA ANALYTICSMap reduce in Hadoop BIG DATA ANALYTICS
Map reduce in Hadoop BIG DATA ANALYTICS
 
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQRealtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
 
オープンデータを使ったモバイルアプリ開発(応用編)
オープンデータを使ったモバイルアプリ開発(応用編)オープンデータを使ったモバイルアプリ開発(応用編)
オープンデータを使ったモバイルアプリ開発(応用編)
 
iot.pptx
iot.pptxiot.pptx
iot.pptx
 
Mapfilterreducepresentation
MapfilterreducepresentationMapfilterreducepresentation
Mapfilterreducepresentation
 
Unit3 MapReduce
Unit3 MapReduceUnit3 MapReduce
Unit3 MapReduce
 

Más de hyun soomyung (6)

아꿈사 매니저소개
아꿈사 매니저소개아꿈사 매니저소개
아꿈사 매니저소개
 
MongoDB
MongoDBMongoDB
MongoDB
 
Design Pattern - Multithread Ch10
Design Pattern - Multithread Ch10Design Pattern - Multithread Ch10
Design Pattern - Multithread Ch10
 
The Art of Computer Programming 1.3.2 MIXAL
The Art of Computer Programming 1.3.2 MIXALThe Art of Computer Programming 1.3.2 MIXAL
The Art of Computer Programming 1.3.2 MIXAL
 
스터디그룹 패턴 (A PATTERN LANGUAGE FOR STUDY GROUPS)
스터디그룹 패턴 (A PATTERN LANGUAGE FOR STUDY GROUPS)스터디그룹 패턴 (A PATTERN LANGUAGE FOR STUDY GROUPS)
스터디그룹 패턴 (A PATTERN LANGUAGE FOR STUDY GROUPS)
 
Erlang
ErlangErlang
Erlang
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

MapReduce

  • 1. MapReduce 아키텍트를 꿈꾸는 사람들cafe.naver.com/architect1 현수명 soomong.net #soomong
  • 2. MapReduce? Map + Reduce Execution Overview
  • 3. MapReduce? mechanism for processing large data developed within Google from a functional language <key,value> pair
  • 4.
  • 7. Map <Only value> Map takes as input a function and a sequence of values. It then applies the function to each value in the sequence func Map (func,values) applied values values
  • 8. Map <Only value> f(x)=x*x Map (func,values) (1,4,9) (1,2,3) Clojure (map (fn [x] (x*x)) [1 2 3])
  • 9. Reduce <Only value> A reduce combines all the elements of a sequence using a binary operation func Reduce (func,values) applied value values
  • 10. Reduce <Only value> + Reduce (func,values) (14) (1,4,9) Clojure (reduce + [1 4 9])
  • 11. Map <key,value> f(x)=x*x Map (func,values) (keyA,1) (keyB,4) (keyA,9) (1,2,3)
  • 12. Reduce <key,value> + Reduce (func,(key,value)) (keyA,10) (keyB,4) (keyA,1) (keyB,4) (keyA,9)
  • 13. Map + Reduce (1,2,3…99998,99999,100000) f(x)=x*x f(x)=x*x f(x)=x*x Map (func,values) Map (func,values) Map (func,values) + + Reduce (func,values) Reduce (func,values) Reduce (func,values) (keyA,107) (keyB,29) (…,…,…) (…) (result) (keyA,1) (keyB,4) (keyA,9) (1,2,3) (4,5,6) (99998,99999,…) (keyA,16) (keyB,25) (keyA,81) + …
  • 14. Execution Example “Stay Hungry Stay Foolish Don’t settle” Word Counter Stay 2 Hungry 1 Foolish 1 Don’t 1 Settle 1
  • 15. Map map(String key, String value): // key: document name // value: document contents for each word w in value: EmitIntermediate(w, "1");
  • 16. Reduce reduce(String key, Iterator values): // key: a word // values: a list of counts int result = 0; for each v in values: result +=ParseInt(v); Emit(AsString(result));
  • 17. Stay Hungry Stay Foolish Don’t settle Stay Hungry Stay Foolish Don’t settle (1) Shards the input files
  • 18. Stay Hungry Stay Foolish Don’t settle (2) Master pick idle workers assign a map or reduce task
  • 19. <Stay,1> <Hungry,1> <Stay,1> <Foolish,1> Stay Hungry Stay Foolish Don’t settle <Don’t,1> <settle,1> (3) Map worker reads input shard, do Map func -> intermediate <key,value>
  • 20. <Stay,1> <Hungry,1> <Stay,1> <Foolish,1> <Don’t,1> <settle,1> (4) Write intermediate <key,value> on local disk
  • 21. <Stay,1> <Hungry,1> <Stay,1> <Foolish,1> <Foolish,1> <Hungry,1> <Stay,(1,1)> <Don’t,1> <settle,1> <Don’t,1> <settle,1> (5) Reduce worker reads intermediate data sort by key
  • 22. <Foolish,1> <Hungry,1> <Stay,(1,1)> <Foolish,1> <Hungry,1> <Stay,2> <Don’t,1> <settle,1> <Don’t,1> <settle,1> (6) Reduce worker do reduce func -> wrtie output
  • 23. <Foolish,1> <Hungry,1> <Stay,2> <Don’t,1> <settle,1> <Foolish,1> <Hungry,1> <Stay,2> <Don’t,1> <settle,1> (7) All map tasks and reduce tasks have been completed master wakes up the user program -> return Result
  • 24. Map map = function () { for (var key in this) { emit(key, {count:1}); }
  • 25. Reduce reduce = function (key, emits) { total = 0; for (vari in emits) { total += emits[i].count; } return {count:total};
  • 26. Execution mr = db.foo.mapReduce (map,reduce,{out:"mongoDBmapReduce"}) { "result" : "mongoDBmapReduce", "timeMillis" : 11, "counts" : { "input" : 4, "emit" : 8, "output" : 5 }, "ok" : 1, }
  • 27. Reference Google MapReduce http://code.google.com/intl/ko-KR/edu/parallel/mapreduce-tutorial.html MongoDBMapReduce http://kylebanker.com/blog/2009/12/mongodb-map-reduce-basics/ HadoopMapReduce http://hadoop.apache.org/common/docs/current/mapred_tutorial.html