SlideShare a Scribd company logo
1 of 63
Download to read offline
Introduction YARN MapReduce Conclusion
Hadoop Internals
Emilio Coppa
April 29, 2014
Big Data Computing
Master of Science in Computer Science
1 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Hadoop Facts
Open-source software framework for storage and large-scale
processing of data-sets on clusters of commodity hardware.
MapReduce paradigm: “Our abstraction is inspired by the map
and reduce primitives present in Lisp and many other
functional languages” (Dean && Ghemawat – Google – 2004)
First released in 2005 by D. Cutting (Yahoo) and Mike
Cafarella (U. Michigan)
2 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Hadoop Facts (2)
2,5 millions of LOC – Java (47%), XML (36%)
681 years of effort (COCOMO)
Organized in 4 projects: Common, HDFS, YARN, MapReduce
81 contributors
3 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Hadoop Facts (3) – Top Contributors
Analyzing the top 10 of contributors...
4 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Hadoop Facts (3) – Top Contributors
Analyzing the top 10 of contributors...
1 6 HortonWorks (“We Do Hadoop”)
4 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Hadoop Facts (3) – Top Contributors
Analyzing the top 10 of contributors...
1 6 HortonWorks (“We Do Hadoop”)
2 3 Cloudera (“Ask Big Questions”)
4 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Hadoop Facts (3) – Top Contributors
Analyzing the top 10 of contributors...
1 6 HortonWorks (“We Do Hadoop”)
2 3 Cloudera (“Ask Big Questions”)
3 1 Yahoo
4 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Hadoop Facts (3) – Top Contributors
Analyzing the top 10 of contributors...
1 6 HortonWorks (“We Do Hadoop”)
2 3 Cloudera (“Ask Big Questions”)
3 1 Yahoo
Doug Cutting currently works at Cloudera.
4 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Apache Hadoop Architecture
5 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Apache Hadoop Architecture
Cluster: set of host machines (nodes). Nodes may be partitioned in
racks. This is the hardware part of the infrastructure.
5 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Apache Hadoop Architecture
YARN: Yet Another Resource Negotiator – framework responsible
for providing the computational resources (e.g., CPUs,
memory, etc.) needed for application executions.
5 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Apache Hadoop Architecture
HDFS: framework responsible for providing permanent, reliable and
distributed storage. This is typically used for storing inputs
and output (but not intermediate ones).
5 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Apache Hadoop Architecture
Storage: Other alternative storage solutions. Amazon uses the Simple
Storage Service (S3).
5 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Apache Hadoop Architecture
MapReduce: the software layer implementing the MapReduce paradigm.
Notice that YARN and HDFS can easily support other
frameworks (highly decoupled).
5 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
YARN Infrastructure:
Yet Another Resource Negotiator
6 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
YARN Infrastructure: overview
YARN handles the computational resources (CPU, memory, etc.) of
the cluster. The main actors are:
7 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
YARN Infrastructure: overview
YARN handles the computational resources (CPU, memory, etc.) of
the cluster. The main actors are:
– Job Submitter: the client who submits an application
7 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
YARN Infrastructure: overview
YARN handles the computational resources (CPU, memory, etc.) of
the cluster. The main actors are:
– Job Submitter: the client who submits an application
– Resource Manager: the master of the infrastructure
7 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
YARN Infrastructure: overview
YARN handles the computational resources (CPU, memory, etc.) of
the cluster. The main actors are:
– Job Submitter: the client who submits an application
– Resource Manager: the master of the infrastructure
– Node Manager: A slave of the infrastructure
7 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
YARN Infrastructure: Node Manager
The Node Manager (NM) is the slave.
When it starts, it announces himself to the
RM. Periodically, it sends an heartbeat to
the RM. Its resource capacity is the amount
of memory and the number of vcores.
A container is a fraction of the NM capacity:
container := (amount of memory, # vcores)
# containers
(on a NM)
yarn.nodemanager.resource.memory-mb /
yarn.scheduler.minimum-allocation-mb
8 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
YARN Infrastructure: Resource Manager
The Resource Manager (RM) is the master. It knows where the
Node Managers are located (Rack Awareness) and how many
resources (containers) they have. It runs several services, the most
important is the Resource Scheduler.
9 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
YARN Infrastructure: Application Startup
1 a client submits an application to the RM
2 the RM allocates a container
3 the RM contacts the NM
4 the NM launches the container
5 the container executes the Application Master
10 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
YARN Infrastructure: Application Master
The AM is responsible for the execution of an application. It asks
for containers to the Resource Scheduler (RM) and executes
specific programs (e.g., the main of a Java class) on the obtained
containers. The AM is framework-specific.
The RM is a single point of failure in YARN. Using AMs, YARN is
spreading over the cluster the metadata related to the running
applications.
«
RM: reduced load & fast recovery
11 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
MapReduce Framework:
Anatomy of MR Job
12 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
MapReduce: Application MR Job
Timeline of a MR Job execution:
Map Phase: executed several Map Tasks
Reduce Phase: executed several Reduce Tasks
The MRAppMaster is the director of the job.
13 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
MapReduce: what does the user give us?
A Job submitted by a user is composed by:
a configuration: if partial then use global/default values
a JAR containing:
a map() implementation
a combine implementation
a reduce() implementation
input and output information:
input directory: are they on HDFS? S3? How many files?
output directory: where? HDFS? S3?
14 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: How many Map Tasks?
One Map Task for each input split (Job Submitter):
num_splits = 0
for each input file f:
remaining = f.length
while remaining / split_size > split_slope:
num_splits += 1
remaining -= split_size
where:
split_slope = 1.1
split_size dfs.blocksize
mapreduce.job.maps is ignored in MRv2 (before it was an hint)!
15 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask launch
The MRAppMaster immediately asks for containers needed by all
MapTasks:
=⇒ num_splits container requests
A container request for a MapTask tries to exploit data locality:
a node where input split is stored
if not, a node in same rack
if not, any other node
This is just an hint to the Resource Scheduler!
After a container has been assigned, the MapTask is launched.
16 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: Execution Overview
Possible execution scenario:
2 Node Managers (capacity 2 containers)
no other running applications
8 input splits
17 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask
Execution timeline:
18 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask – Init
1 create a context (TaskAttemptContext)
2 create an instance of the user Mapper class
3 setup input (InputFormat, InputSplit, RecordReader)
4 setup output (NewOutputCollector)
5 create a mapper context (MapContext, Mapper.Context)
6 initialize input, e.g.:
create a SplitLineReader obj
create a HdfsDataInputStream obj
19 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask – Execution
Mapper.Context.nextKeyValue() will load data from the input
Mapper.Context.write() will write the output to a circular
buffer
20 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask – Spilling
Mapper.Context.write() writes to a MapOutputBuffer of size
mapreduce.task.io.sort.mb (100MB). If it is mapreduce.map.
sort.spill.percent (80%) full, then parallel spilling phase is
started.
If the circular buffer is 100% full, then map() is blocked!
21 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask – Spilling (2)
1 create a SpillRecord & create a FSOutputStream (local fs)
2 in-memory sort the chunk of the buffer (quicksort):
sort by <partitionIdx, key>
3 divide in partitions:
1 partition for each reducer (mapreduce.job.reduces)
write partitions into output file
22 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask – Spilling (partitioning)
How do we partition the <key, value> tuples?
During a Mapper.Context.write():
partitionIdx = (key.hashCode() & Integer.MAX_VALUE)
% numReducers
Stored as metadata of the tuple in circular buffer.
Use mapreduce.job.partitioner.class for a custom partitioner
23 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask – Spilling (combine)
If the user specifies a combiner then, before writing the tuples to
the file, we apply it on tuples of a partition:
1 create an instance of the user Reducer class
2 create a Reducer.Context: output on the local fs file
3 execute Reduce.run(): see Reduce Task slides
The combiner typically use the same implementation of the
reduce() function and thus can be seen as a local reducer.
24 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask – Spilling (end of execution)
At the end of the execution of the Mapper.run():
1 sort and spill the remaining unspilled tuples
2 start the shuffle phase
25 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: MapTask – Shuffle
Spill files need to be merged: this is done by a k-way merge where
k is equal to mapreduce.task.io.sort.factor (100).
These are intermediate output files of only one MapTask!
26 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Map Phase: Execution Overview
Possible execution scenario:
2 Node Managers (capacity 2 containers)
no other running applications
8 input splits
The Node Managers locally store the map outputs (reduce inputs).
27 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task Launch
The MRAppMaster waits until mapreduce.job.reduce.
slowstart.completedmaps (5%) MapTasks are completed.
Then (periodically executed):
if all maps have a container assigned then all (remaining)
reducers are scheduled
otherwise it checks percentage of completed maps:
check available cluster resources for the app
check resource needed for unassigned rescheduled maps
ramp down (unschedule/kill) or ramp up (schedule) reduce
tasks
When a reduce task is scheduled, a container request is made. This
does NOT exploit data locality.
A MapTask request has a higher priority than Reduce Task request.
28 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Execution Overview
Possible execution scenario:
2 Node Managers (capacity 2 containers each)
no other running applications
4 reducers (mapreduce.job.reduces, default: 1)
29 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task
Execution timeline:
30 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task – Init
1 init a codec (if map outputs are compressed)
2 create an instance of the combine output collector (if needed)
3 create an instance of the shuffle plugin (mapreduce.job.
reduce.shuffle.consumer.plugin.class, default:
org.apache.hadoop.mapreduce.task.reduce.Shuffle.class)
4 create a shuffle context (ShuffleConsumerPlugin.Context)
31 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task – Shuffle
The shuffle has two steps:
1 fetch map outputs from Node Managers
2 merge them
32 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task – Shuffle (fetch)
Several parallel fetchers are started (up to mapreduce.reduce.
shuffle.parallelcopies, default: 5). Each fetcher collects map
outputs from one NM (possibly many containers):
if output size less than 25% of NM memory then create an in
memory output (wait until enough memory is available)
otherwise create a disk output
33 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task – Shuffle (fetch) (2)
Fetch the outputs over HTTP and add to related merge queue.
A Reduce Task may start before the end of the Map Phase thus
you can fetch only from completed map tasks. Periodically repeat
fetch process.
34 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task – Shuffle (in memory merge)
The in memory merger:
1 perform a k-way merge
2 run the combiner (if needed)
3 result is written on a On Disk Map Output and it is queued
35 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task – Shuffle (on disk merge)
Extract from the queue, k-way merge and queue the result:
Stop when all files has been merged together: the final merge will
provide a RawKeyValueIterator instance (input of the reducer).
36 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task – Execution (init)
1 create a context (TaskAttemptContext)
2 create an instance of the user Reduce class
3 setup output (RecordWriter, TextOutputFormat)
4 create a reducer context (Reducer.Context)
37 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Reduce Task – Execution (run)
The output is typically written on HDFS file.
38 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Reduce Phase: Execution Overview
39 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
MapReduce: Application MR Job
Possible execution timeline:
That’s it!
40 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
MapReduce: Task Progress
A MapTask has two phases:
Map (66%): progress due to perc. of processed input
Sort (33%): 1 subphase for each reducer
subphase progress due to perc. of merged bytes
A ReduceTask has three phases:
Copy (33%): progress due to perc. of fetched input
Sort (33%): progress due to processed bytes in final merge
Reduce (33%): progress due to perc. of processed input
41 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
MapReduce: Speculation
MRAppMaster may launch speculative tasks:
est = (ts - start) / MAX(0.0001, Status.progress())
estEndTime = start + est
estReplacementEndTime = now() + TaskDurations.mean()
if estEndTime < now() then
return PROGRESS_IS_GOOD
elif estReplacementEndTime >= estEndTime then
return TOO_LATE_TO_SPECULATE
else then
return estEndTime - estReplacementEndTime // score
Speculate the task with highest score.
42 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
MapReduce: Application Status
The status of a MR job is tracked by the MRAppMaster using
several Finite State Machines:
Job: 14 states, 80 transitions, 19 events
Task: 14 states, 36 transitions, 9 events
Task Attempt: 13 states, 60 transitions, 17 events
A job is composed by several tasks. Each tasks may have several
task attempts. Each task attempt is executed on a container.
Instead, a Node Manager maintains the states of:
Application: 7 states, 21 transitions, 9 events
Container: 11 states, 46 transitions, 12 events
43 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
MapReduce: Job FSM (example)
44 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Configuration Parameters (recap)
Parameter Meaning
mapreduce.framework.name The runtime framework for executing
MapReduce jobs. Set to YARN.
mapreduce.job.reduces Number of reduce tasks. Default: 1
dfs.blocksize HDFS block size. Default 128MB.
yarn.resourcemanager.
scheduler.class
Scheduler class. Default: CapacityScheduler
yarn.nodemanager.
resource.memory-mb
Memory available on a NM for containers.
Default: 8192
yarn.scheduler.
minimum-allocation-mb
Min allocation for every container request.
Default: 1024
mapreduce.map. memory.mb Memory request for a MapTask. Default:
1024
mapreduce.reduce.
memory.mb
Memory request for a ReduceTask. Default:
1024
45 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Configuration Parameters (recap) (2)
Parameter Meaning
mapreduce.task.
io.sort.mb
Size of the circular buffer (map output). De-
fault: 100MB
mapreduce.map.
sort.spill.percent
Circular buffer soft limit. Once reached,
start the spilling process. Default: 0.80
mapreduce.job.
partitioner.class
The Partitioner class. Default: HashParti-
tioner.class
map.sort.class The sort class for sorting keys. Default:
org.apache.hadoop.util.QuickSort
mapreduce.reduce.shuffle
.memory.limit.percent
Maximum percentage of the in-memory limit
that a single shuffle can consume. Default:
0.25
mapreduce.reduce.shuffle
.input.buffer.percent
The % of memory to be allocated from the
maximum heap size to storing map outputs
during the shuffle. Default: 0.70
46 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra
Configuration Parameters (recap) (3)
Parameter Meaning
mapreduce.reduce.shuffle
.merge.percent
The usage % at which an in-memory merge
will be initiated. Default: 0.66
mapreduce.map.
combine.minspills
Apply combine only if you at least this num-
ber of spill files. Default: 3.
mapreduce.task.
io.sort.factor
The number of streams to merge at once
while sorting files. Default: 100 (10)
mapreduce.job.reduce.
slowstart.completedmaps
Fraction of the number of maps in the job
which should be complete before reduces are
scheduled for the job. Default: 0.05
mapreduce.reduce.
shuffle.parallelcopies
Number of parallel transfers run by reduce
during the shuffle (fetch) phase. Default: 5
mapreduce.reduce.
memory.totalbytes
Memory of a NM. Default: Run-
time.maxMemory()
47 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
Hadoop: a bad angel
Writing a MapReduce program is relatively easy. On the other
hand, writing an efficient MapReduce program is hard:
many configuration parameters:
YARN: 115 parameters
MapReduce: 195 parameters
HDFS: 173 parameters
core: 145 parameters
lack of control over the execution: how to debug?
many implementation details: what is happening?
48 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
How can we help the user?
49 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
How can we help the user?
We need profilers!
49 / 49 Emilio Coppa Hadoop Internals
Introduction YARN MapReduce Conclusion
How can we help the user?
We need profilers!
My current research is focused on this goal.
49 / 49 Emilio Coppa Hadoop Internals

More Related Content

What's hot

SOME WORKLOAD SCHEDULING ALTERNATIVES 11.07.2013
SOME WORKLOAD SCHEDULING ALTERNATIVES 11.07.2013SOME WORKLOAD SCHEDULING ALTERNATIVES 11.07.2013
SOME WORKLOAD SCHEDULING ALTERNATIVES 11.07.2013James McGalliard
 
Map reduce and Hadoop on windows
Map reduce and Hadoop on windowsMap reduce and Hadoop on windows
Map reduce and Hadoop on windowsMuhammad Shahid
 
Map reduce presentation
Map reduce presentationMap reduce presentation
Map reduce presentationateeq ateeq
 
Large Scale Data Analysis with Map/Reduce, part I
Large Scale Data Analysis with Map/Reduce, part ILarge Scale Data Analysis with Map/Reduce, part I
Large Scale Data Analysis with Map/Reduce, part IMarin Dimitrov
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to YarnApache Apex
 
Topic 6: MapReduce Applications
Topic 6: MapReduce ApplicationsTopic 6: MapReduce Applications
Topic 6: MapReduce ApplicationsZubair Nabi
 
Parallel Linear Regression in Interative Reduce and YARN
Parallel Linear Regression in Interative Reduce and YARNParallel Linear Regression in Interative Reduce and YARN
Parallel Linear Regression in Interative Reduce and YARNDataWorks Summit
 
Optimal Execution Of MapReduce Jobs In Cloud - Voices 2015
Optimal Execution Of MapReduce Jobs In Cloud - Voices 2015Optimal Execution Of MapReduce Jobs In Cloud - Voices 2015
Optimal Execution Of MapReduce Jobs In Cloud - Voices 2015Deanna Kosaraju
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to YarnOmid Vahdaty
 
Application of MapReduce in Cloud Computing
Application of MapReduce in Cloud ComputingApplication of MapReduce in Cloud Computing
Application of MapReduce in Cloud ComputingMohammad Mustaqeem
 
Mapreduce by examples
Mapreduce by examplesMapreduce by examples
Mapreduce by examplesAndrea Iacono
 
Mapreduce advanced
Mapreduce advancedMapreduce advanced
Mapreduce advancedChirag Ahuja
 
Introduction of the Design of A High-level Language over MapReduce -- The Pig...
Introduction of the Design of A High-level Language over MapReduce -- The Pig...Introduction of the Design of A High-level Language over MapReduce -- The Pig...
Introduction of the Design of A High-level Language over MapReduce -- The Pig...Yu Liu
 
Analysing of big data using map reduce
Analysing of big data using map reduceAnalysing of big data using map reduce
Analysing of big data using map reducePaladion Networks
 
Resource Aware Scheduling for Hadoop [Final Presentation]
Resource Aware Scheduling for Hadoop [Final Presentation]Resource Aware Scheduling for Hadoop [Final Presentation]
Resource Aware Scheduling for Hadoop [Final Presentation]Lu Wei
 
MapReduce Container ReUse
MapReduce Container ReUseMapReduce Container ReUse
MapReduce Container ReUseHortonworks
 

What's hot (20)

SOME WORKLOAD SCHEDULING ALTERNATIVES 11.07.2013
SOME WORKLOAD SCHEDULING ALTERNATIVES 11.07.2013SOME WORKLOAD SCHEDULING ALTERNATIVES 11.07.2013
SOME WORKLOAD SCHEDULING ALTERNATIVES 11.07.2013
 
Map reduce and Hadoop on windows
Map reduce and Hadoop on windowsMap reduce and Hadoop on windows
Map reduce and Hadoop on windows
 
Map/Reduce intro
Map/Reduce introMap/Reduce intro
Map/Reduce intro
 
Map reduce presentation
Map reduce presentationMap reduce presentation
Map reduce presentation
 
Large Scale Data Analysis with Map/Reduce, part I
Large Scale Data Analysis with Map/Reduce, part ILarge Scale Data Analysis with Map/Reduce, part I
Large Scale Data Analysis with Map/Reduce, part I
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to Yarn
 
Topic 6: MapReduce Applications
Topic 6: MapReduce ApplicationsTopic 6: MapReduce Applications
Topic 6: MapReduce Applications
 
Parallel Linear Regression in Interative Reduce and YARN
Parallel Linear Regression in Interative Reduce and YARNParallel Linear Regression in Interative Reduce and YARN
Parallel Linear Regression in Interative Reduce and YARN
 
Optimal Execution Of MapReduce Jobs In Cloud - Voices 2015
Optimal Execution Of MapReduce Jobs In Cloud - Voices 2015Optimal Execution Of MapReduce Jobs In Cloud - Voices 2015
Optimal Execution Of MapReduce Jobs In Cloud - Voices 2015
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to Yarn
 
Application of MapReduce in Cloud Computing
Application of MapReduce in Cloud ComputingApplication of MapReduce in Cloud Computing
Application of MapReduce in Cloud Computing
 
MapReduce
MapReduceMapReduce
MapReduce
 
Mapreduce by examples
Mapreduce by examplesMapreduce by examples
Mapreduce by examples
 
Mapreduce advanced
Mapreduce advancedMapreduce advanced
Mapreduce advanced
 
The google MapReduce
The google MapReduceThe google MapReduce
The google MapReduce
 
Introduction of the Design of A High-level Language over MapReduce -- The Pig...
Introduction of the Design of A High-level Language over MapReduce -- The Pig...Introduction of the Design of A High-level Language over MapReduce -- The Pig...
Introduction of the Design of A High-level Language over MapReduce -- The Pig...
 
MapReduce and Hadoop
MapReduce and HadoopMapReduce and Hadoop
MapReduce and Hadoop
 
Analysing of big data using map reduce
Analysing of big data using map reduceAnalysing of big data using map reduce
Analysing of big data using map reduce
 
Resource Aware Scheduling for Hadoop [Final Presentation]
Resource Aware Scheduling for Hadoop [Final Presentation]Resource Aware Scheduling for Hadoop [Final Presentation]
Resource Aware Scheduling for Hadoop [Final Presentation]
 
MapReduce Container ReUse
MapReduce Container ReUseMapReduce Container ReUse
MapReduce Container ReUse
 

Similar to Hadoop Internals

Hadoop Internals (2.3.0 or later)
Hadoop Internals (2.3.0 or later)Hadoop Internals (2.3.0 or later)
Hadoop Internals (2.3.0 or later)Emilio Coppa
 
Hadoop interview question
Hadoop interview questionHadoop interview question
Hadoop interview questionpappupassindia
 
Large scale logistic regression and linear support vector machines using spark
Large scale logistic regression and linear support vector machines using sparkLarge scale logistic regression and linear support vector machines using spark
Large scale logistic regression and linear support vector machines using sparkMila, Université de Montréal
 
Hadoop 31-frequently-asked-interview-questions
Hadoop 31-frequently-asked-interview-questionsHadoop 31-frequently-asked-interview-questions
Hadoop 31-frequently-asked-interview-questionsAsad Masood Qazi
 
XML Parsing with Map Reduce
XML Parsing with Map ReduceXML Parsing with Map Reduce
XML Parsing with Map ReduceEdureka!
 
Report Hadoop Map Reduce
Report Hadoop Map ReduceReport Hadoop Map Reduce
Report Hadoop Map ReduceUrvashi Kataria
 
Hadoop interview questions - Softwarequery.com
Hadoop interview questions - Softwarequery.comHadoop interview questions - Softwarequery.com
Hadoop interview questions - Softwarequery.comsoftwarequery
 
Lightening Fast Big Data Analytics using Apache Spark
Lightening Fast Big Data Analytics using Apache SparkLightening Fast Big Data Analytics using Apache Spark
Lightening Fast Big Data Analytics using Apache SparkManish Gupta
 
Big Data Analytics-Open Source Toolkits
Big Data Analytics-Open Source ToolkitsBig Data Analytics-Open Source Toolkits
Big Data Analytics-Open Source ToolkitsDataWorks Summit
 
Introduction to Spark Internals
Introduction to Spark InternalsIntroduction to Spark Internals
Introduction to Spark InternalsPietro Michiardi
 
Hadoop with Lustre WhitePaper
Hadoop with Lustre WhitePaperHadoop with Lustre WhitePaper
Hadoop with Lustre WhitePaperDavid Luan
 
1-s2.0-S1877050915011874-main
1-s2.0-S1877050915011874-main1-s2.0-S1877050915011874-main
1-s2.0-S1877050915011874-mainHamza Zafar
 
Introduction to Hadoop part 2
Introduction to Hadoop part 2Introduction to Hadoop part 2
Introduction to Hadoop part 2Giovanna Roda
 
Apache Spark: What's under the hood
Apache Spark: What's under the hoodApache Spark: What's under the hood
Apache Spark: What's under the hoodAdarsh Pannu
 
Apache spark - History and market overview
Apache spark - History and market overviewApache spark - History and market overview
Apache spark - History and market overviewMartin Zapletal
 

Similar to Hadoop Internals (20)

Hadoop Internals (2.3.0 or later)
Hadoop Internals (2.3.0 or later)Hadoop Internals (2.3.0 or later)
Hadoop Internals (2.3.0 or later)
 
Hadoop interview question
Hadoop interview questionHadoop interview question
Hadoop interview question
 
Hadoop Internals
Hadoop InternalsHadoop Internals
Hadoop Internals
 
20140708hcj
20140708hcj20140708hcj
20140708hcj
 
Data Science
Data ScienceData Science
Data Science
 
Large scale logistic regression and linear support vector machines using spark
Large scale logistic regression and linear support vector machines using sparkLarge scale logistic regression and linear support vector machines using spark
Large scale logistic regression and linear support vector machines using spark
 
Hadoop 31-frequently-asked-interview-questions
Hadoop 31-frequently-asked-interview-questionsHadoop 31-frequently-asked-interview-questions
Hadoop 31-frequently-asked-interview-questions
 
XML Parsing with Map Reduce
XML Parsing with Map ReduceXML Parsing with Map Reduce
XML Parsing with Map Reduce
 
Report Hadoop Map Reduce
Report Hadoop Map ReduceReport Hadoop Map Reduce
Report Hadoop Map Reduce
 
Hadoop interview questions - Softwarequery.com
Hadoop interview questions - Softwarequery.comHadoop interview questions - Softwarequery.com
Hadoop interview questions - Softwarequery.com
 
Hadoop pig
Hadoop pigHadoop pig
Hadoop pig
 
Hackathon bonn
Hackathon bonnHackathon bonn
Hackathon bonn
 
Lightening Fast Big Data Analytics using Apache Spark
Lightening Fast Big Data Analytics using Apache SparkLightening Fast Big Data Analytics using Apache Spark
Lightening Fast Big Data Analytics using Apache Spark
 
Big Data Analytics-Open Source Toolkits
Big Data Analytics-Open Source ToolkitsBig Data Analytics-Open Source Toolkits
Big Data Analytics-Open Source Toolkits
 
Introduction to Spark Internals
Introduction to Spark InternalsIntroduction to Spark Internals
Introduction to Spark Internals
 
Hadoop with Lustre WhitePaper
Hadoop with Lustre WhitePaperHadoop with Lustre WhitePaper
Hadoop with Lustre WhitePaper
 
1-s2.0-S1877050915011874-main
1-s2.0-S1877050915011874-main1-s2.0-S1877050915011874-main
1-s2.0-S1877050915011874-main
 
Introduction to Hadoop part 2
Introduction to Hadoop part 2Introduction to Hadoop part 2
Introduction to Hadoop part 2
 
Apache Spark: What's under the hood
Apache Spark: What's under the hoodApache Spark: What's under the hood
Apache Spark: What's under the hood
 
Apache spark - History and market overview
Apache spark - History and market overviewApache spark - History and market overview
Apache spark - History and market overview
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Hadoop Internals

  • 1. Introduction YARN MapReduce Conclusion Hadoop Internals Emilio Coppa April 29, 2014 Big Data Computing Master of Science in Computer Science 1 / 49 Emilio Coppa Hadoop Internals
  • 2. Introduction YARN MapReduce Conclusion Hadoop Facts Open-source software framework for storage and large-scale processing of data-sets on clusters of commodity hardware. MapReduce paradigm: “Our abstraction is inspired by the map and reduce primitives present in Lisp and many other functional languages” (Dean && Ghemawat – Google – 2004) First released in 2005 by D. Cutting (Yahoo) and Mike Cafarella (U. Michigan) 2 / 49 Emilio Coppa Hadoop Internals
  • 3. Introduction YARN MapReduce Conclusion Hadoop Facts (2) 2,5 millions of LOC – Java (47%), XML (36%) 681 years of effort (COCOMO) Organized in 4 projects: Common, HDFS, YARN, MapReduce 81 contributors 3 / 49 Emilio Coppa Hadoop Internals
  • 4. Introduction YARN MapReduce Conclusion Hadoop Facts (3) – Top Contributors Analyzing the top 10 of contributors... 4 / 49 Emilio Coppa Hadoop Internals
  • 5. Introduction YARN MapReduce Conclusion Hadoop Facts (3) – Top Contributors Analyzing the top 10 of contributors... 1 6 HortonWorks (“We Do Hadoop”) 4 / 49 Emilio Coppa Hadoop Internals
  • 6. Introduction YARN MapReduce Conclusion Hadoop Facts (3) – Top Contributors Analyzing the top 10 of contributors... 1 6 HortonWorks (“We Do Hadoop”) 2 3 Cloudera (“Ask Big Questions”) 4 / 49 Emilio Coppa Hadoop Internals
  • 7. Introduction YARN MapReduce Conclusion Hadoop Facts (3) – Top Contributors Analyzing the top 10 of contributors... 1 6 HortonWorks (“We Do Hadoop”) 2 3 Cloudera (“Ask Big Questions”) 3 1 Yahoo 4 / 49 Emilio Coppa Hadoop Internals
  • 8. Introduction YARN MapReduce Conclusion Hadoop Facts (3) – Top Contributors Analyzing the top 10 of contributors... 1 6 HortonWorks (“We Do Hadoop”) 2 3 Cloudera (“Ask Big Questions”) 3 1 Yahoo Doug Cutting currently works at Cloudera. 4 / 49 Emilio Coppa Hadoop Internals
  • 9. Introduction YARN MapReduce Conclusion Apache Hadoop Architecture 5 / 49 Emilio Coppa Hadoop Internals
  • 10. Introduction YARN MapReduce Conclusion Apache Hadoop Architecture Cluster: set of host machines (nodes). Nodes may be partitioned in racks. This is the hardware part of the infrastructure. 5 / 49 Emilio Coppa Hadoop Internals
  • 11. Introduction YARN MapReduce Conclusion Apache Hadoop Architecture YARN: Yet Another Resource Negotiator – framework responsible for providing the computational resources (e.g., CPUs, memory, etc.) needed for application executions. 5 / 49 Emilio Coppa Hadoop Internals
  • 12. Introduction YARN MapReduce Conclusion Apache Hadoop Architecture HDFS: framework responsible for providing permanent, reliable and distributed storage. This is typically used for storing inputs and output (but not intermediate ones). 5 / 49 Emilio Coppa Hadoop Internals
  • 13. Introduction YARN MapReduce Conclusion Apache Hadoop Architecture Storage: Other alternative storage solutions. Amazon uses the Simple Storage Service (S3). 5 / 49 Emilio Coppa Hadoop Internals
  • 14. Introduction YARN MapReduce Conclusion Apache Hadoop Architecture MapReduce: the software layer implementing the MapReduce paradigm. Notice that YARN and HDFS can easily support other frameworks (highly decoupled). 5 / 49 Emilio Coppa Hadoop Internals
  • 15. Introduction YARN MapReduce Conclusion YARN Infrastructure: Yet Another Resource Negotiator 6 / 49 Emilio Coppa Hadoop Internals
  • 16. Introduction YARN MapReduce Conclusion YARN Infrastructure: overview YARN handles the computational resources (CPU, memory, etc.) of the cluster. The main actors are: 7 / 49 Emilio Coppa Hadoop Internals
  • 17. Introduction YARN MapReduce Conclusion YARN Infrastructure: overview YARN handles the computational resources (CPU, memory, etc.) of the cluster. The main actors are: – Job Submitter: the client who submits an application 7 / 49 Emilio Coppa Hadoop Internals
  • 18. Introduction YARN MapReduce Conclusion YARN Infrastructure: overview YARN handles the computational resources (CPU, memory, etc.) of the cluster. The main actors are: – Job Submitter: the client who submits an application – Resource Manager: the master of the infrastructure 7 / 49 Emilio Coppa Hadoop Internals
  • 19. Introduction YARN MapReduce Conclusion YARN Infrastructure: overview YARN handles the computational resources (CPU, memory, etc.) of the cluster. The main actors are: – Job Submitter: the client who submits an application – Resource Manager: the master of the infrastructure – Node Manager: A slave of the infrastructure 7 / 49 Emilio Coppa Hadoop Internals
  • 20. Introduction YARN MapReduce Conclusion YARN Infrastructure: Node Manager The Node Manager (NM) is the slave. When it starts, it announces himself to the RM. Periodically, it sends an heartbeat to the RM. Its resource capacity is the amount of memory and the number of vcores. A container is a fraction of the NM capacity: container := (amount of memory, # vcores) # containers (on a NM) yarn.nodemanager.resource.memory-mb / yarn.scheduler.minimum-allocation-mb 8 / 49 Emilio Coppa Hadoop Internals
  • 21. Introduction YARN MapReduce Conclusion YARN Infrastructure: Resource Manager The Resource Manager (RM) is the master. It knows where the Node Managers are located (Rack Awareness) and how many resources (containers) they have. It runs several services, the most important is the Resource Scheduler. 9 / 49 Emilio Coppa Hadoop Internals
  • 22. Introduction YARN MapReduce Conclusion YARN Infrastructure: Application Startup 1 a client submits an application to the RM 2 the RM allocates a container 3 the RM contacts the NM 4 the NM launches the container 5 the container executes the Application Master 10 / 49 Emilio Coppa Hadoop Internals
  • 23. Introduction YARN MapReduce Conclusion YARN Infrastructure: Application Master The AM is responsible for the execution of an application. It asks for containers to the Resource Scheduler (RM) and executes specific programs (e.g., the main of a Java class) on the obtained containers. The AM is framework-specific. The RM is a single point of failure in YARN. Using AMs, YARN is spreading over the cluster the metadata related to the running applications. « RM: reduced load & fast recovery 11 / 49 Emilio Coppa Hadoop Internals
  • 24. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra MapReduce Framework: Anatomy of MR Job 12 / 49 Emilio Coppa Hadoop Internals
  • 25. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra MapReduce: Application MR Job Timeline of a MR Job execution: Map Phase: executed several Map Tasks Reduce Phase: executed several Reduce Tasks The MRAppMaster is the director of the job. 13 / 49 Emilio Coppa Hadoop Internals
  • 26. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra MapReduce: what does the user give us? A Job submitted by a user is composed by: a configuration: if partial then use global/default values a JAR containing: a map() implementation a combine implementation a reduce() implementation input and output information: input directory: are they on HDFS? S3? How many files? output directory: where? HDFS? S3? 14 / 49 Emilio Coppa Hadoop Internals
  • 27. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: How many Map Tasks? One Map Task for each input split (Job Submitter): num_splits = 0 for each input file f: remaining = f.length while remaining / split_size > split_slope: num_splits += 1 remaining -= split_size where: split_slope = 1.1 split_size dfs.blocksize mapreduce.job.maps is ignored in MRv2 (before it was an hint)! 15 / 49 Emilio Coppa Hadoop Internals
  • 28. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask launch The MRAppMaster immediately asks for containers needed by all MapTasks: =⇒ num_splits container requests A container request for a MapTask tries to exploit data locality: a node where input split is stored if not, a node in same rack if not, any other node This is just an hint to the Resource Scheduler! After a container has been assigned, the MapTask is launched. 16 / 49 Emilio Coppa Hadoop Internals
  • 29. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: Execution Overview Possible execution scenario: 2 Node Managers (capacity 2 containers) no other running applications 8 input splits 17 / 49 Emilio Coppa Hadoop Internals
  • 30. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask Execution timeline: 18 / 49 Emilio Coppa Hadoop Internals
  • 31. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask – Init 1 create a context (TaskAttemptContext) 2 create an instance of the user Mapper class 3 setup input (InputFormat, InputSplit, RecordReader) 4 setup output (NewOutputCollector) 5 create a mapper context (MapContext, Mapper.Context) 6 initialize input, e.g.: create a SplitLineReader obj create a HdfsDataInputStream obj 19 / 49 Emilio Coppa Hadoop Internals
  • 32. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask – Execution Mapper.Context.nextKeyValue() will load data from the input Mapper.Context.write() will write the output to a circular buffer 20 / 49 Emilio Coppa Hadoop Internals
  • 33. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask – Spilling Mapper.Context.write() writes to a MapOutputBuffer of size mapreduce.task.io.sort.mb (100MB). If it is mapreduce.map. sort.spill.percent (80%) full, then parallel spilling phase is started. If the circular buffer is 100% full, then map() is blocked! 21 / 49 Emilio Coppa Hadoop Internals
  • 34. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask – Spilling (2) 1 create a SpillRecord & create a FSOutputStream (local fs) 2 in-memory sort the chunk of the buffer (quicksort): sort by <partitionIdx, key> 3 divide in partitions: 1 partition for each reducer (mapreduce.job.reduces) write partitions into output file 22 / 49 Emilio Coppa Hadoop Internals
  • 35. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask – Spilling (partitioning) How do we partition the <key, value> tuples? During a Mapper.Context.write(): partitionIdx = (key.hashCode() & Integer.MAX_VALUE) % numReducers Stored as metadata of the tuple in circular buffer. Use mapreduce.job.partitioner.class for a custom partitioner 23 / 49 Emilio Coppa Hadoop Internals
  • 36. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask – Spilling (combine) If the user specifies a combiner then, before writing the tuples to the file, we apply it on tuples of a partition: 1 create an instance of the user Reducer class 2 create a Reducer.Context: output on the local fs file 3 execute Reduce.run(): see Reduce Task slides The combiner typically use the same implementation of the reduce() function and thus can be seen as a local reducer. 24 / 49 Emilio Coppa Hadoop Internals
  • 37. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask – Spilling (end of execution) At the end of the execution of the Mapper.run(): 1 sort and spill the remaining unspilled tuples 2 start the shuffle phase 25 / 49 Emilio Coppa Hadoop Internals
  • 38. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: MapTask – Shuffle Spill files need to be merged: this is done by a k-way merge where k is equal to mapreduce.task.io.sort.factor (100). These are intermediate output files of only one MapTask! 26 / 49 Emilio Coppa Hadoop Internals
  • 39. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Map Phase: Execution Overview Possible execution scenario: 2 Node Managers (capacity 2 containers) no other running applications 8 input splits The Node Managers locally store the map outputs (reduce inputs). 27 / 49 Emilio Coppa Hadoop Internals
  • 40. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task Launch The MRAppMaster waits until mapreduce.job.reduce. slowstart.completedmaps (5%) MapTasks are completed. Then (periodically executed): if all maps have a container assigned then all (remaining) reducers are scheduled otherwise it checks percentage of completed maps: check available cluster resources for the app check resource needed for unassigned rescheduled maps ramp down (unschedule/kill) or ramp up (schedule) reduce tasks When a reduce task is scheduled, a container request is made. This does NOT exploit data locality. A MapTask request has a higher priority than Reduce Task request. 28 / 49 Emilio Coppa Hadoop Internals
  • 41. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Execution Overview Possible execution scenario: 2 Node Managers (capacity 2 containers each) no other running applications 4 reducers (mapreduce.job.reduces, default: 1) 29 / 49 Emilio Coppa Hadoop Internals
  • 42. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task Execution timeline: 30 / 49 Emilio Coppa Hadoop Internals
  • 43. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task – Init 1 init a codec (if map outputs are compressed) 2 create an instance of the combine output collector (if needed) 3 create an instance of the shuffle plugin (mapreduce.job. reduce.shuffle.consumer.plugin.class, default: org.apache.hadoop.mapreduce.task.reduce.Shuffle.class) 4 create a shuffle context (ShuffleConsumerPlugin.Context) 31 / 49 Emilio Coppa Hadoop Internals
  • 44. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task – Shuffle The shuffle has two steps: 1 fetch map outputs from Node Managers 2 merge them 32 / 49 Emilio Coppa Hadoop Internals
  • 45. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task – Shuffle (fetch) Several parallel fetchers are started (up to mapreduce.reduce. shuffle.parallelcopies, default: 5). Each fetcher collects map outputs from one NM (possibly many containers): if output size less than 25% of NM memory then create an in memory output (wait until enough memory is available) otherwise create a disk output 33 / 49 Emilio Coppa Hadoop Internals
  • 46. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task – Shuffle (fetch) (2) Fetch the outputs over HTTP and add to related merge queue. A Reduce Task may start before the end of the Map Phase thus you can fetch only from completed map tasks. Periodically repeat fetch process. 34 / 49 Emilio Coppa Hadoop Internals
  • 47. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task – Shuffle (in memory merge) The in memory merger: 1 perform a k-way merge 2 run the combiner (if needed) 3 result is written on a On Disk Map Output and it is queued 35 / 49 Emilio Coppa Hadoop Internals
  • 48. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task – Shuffle (on disk merge) Extract from the queue, k-way merge and queue the result: Stop when all files has been merged together: the final merge will provide a RawKeyValueIterator instance (input of the reducer). 36 / 49 Emilio Coppa Hadoop Internals
  • 49. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task – Execution (init) 1 create a context (TaskAttemptContext) 2 create an instance of the user Reduce class 3 setup output (RecordWriter, TextOutputFormat) 4 create a reducer context (Reducer.Context) 37 / 49 Emilio Coppa Hadoop Internals
  • 50. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Reduce Task – Execution (run) The output is typically written on HDFS file. 38 / 49 Emilio Coppa Hadoop Internals
  • 51. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Reduce Phase: Execution Overview 39 / 49 Emilio Coppa Hadoop Internals
  • 52. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra MapReduce: Application MR Job Possible execution timeline: That’s it! 40 / 49 Emilio Coppa Hadoop Internals
  • 53. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra MapReduce: Task Progress A MapTask has two phases: Map (66%): progress due to perc. of processed input Sort (33%): 1 subphase for each reducer subphase progress due to perc. of merged bytes A ReduceTask has three phases: Copy (33%): progress due to perc. of fetched input Sort (33%): progress due to processed bytes in final merge Reduce (33%): progress due to perc. of processed input 41 / 49 Emilio Coppa Hadoop Internals
  • 54. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra MapReduce: Speculation MRAppMaster may launch speculative tasks: est = (ts - start) / MAX(0.0001, Status.progress()) estEndTime = start + est estReplacementEndTime = now() + TaskDurations.mean() if estEndTime < now() then return PROGRESS_IS_GOOD elif estReplacementEndTime >= estEndTime then return TOO_LATE_TO_SPECULATE else then return estEndTime - estReplacementEndTime // score Speculate the task with highest score. 42 / 49 Emilio Coppa Hadoop Internals
  • 55. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra MapReduce: Application Status The status of a MR job is tracked by the MRAppMaster using several Finite State Machines: Job: 14 states, 80 transitions, 19 events Task: 14 states, 36 transitions, 9 events Task Attempt: 13 states, 60 transitions, 17 events A job is composed by several tasks. Each tasks may have several task attempts. Each task attempt is executed on a container. Instead, a Node Manager maintains the states of: Application: 7 states, 21 transitions, 9 events Container: 11 states, 46 transitions, 12 events 43 / 49 Emilio Coppa Hadoop Internals
  • 56. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra MapReduce: Job FSM (example) 44 / 49 Emilio Coppa Hadoop Internals
  • 57. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Configuration Parameters (recap) Parameter Meaning mapreduce.framework.name The runtime framework for executing MapReduce jobs. Set to YARN. mapreduce.job.reduces Number of reduce tasks. Default: 1 dfs.blocksize HDFS block size. Default 128MB. yarn.resourcemanager. scheduler.class Scheduler class. Default: CapacityScheduler yarn.nodemanager. resource.memory-mb Memory available on a NM for containers. Default: 8192 yarn.scheduler. minimum-allocation-mb Min allocation for every container request. Default: 1024 mapreduce.map. memory.mb Memory request for a MapTask. Default: 1024 mapreduce.reduce. memory.mb Memory request for a ReduceTask. Default: 1024 45 / 49 Emilio Coppa Hadoop Internals
  • 58. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Configuration Parameters (recap) (2) Parameter Meaning mapreduce.task. io.sort.mb Size of the circular buffer (map output). De- fault: 100MB mapreduce.map. sort.spill.percent Circular buffer soft limit. Once reached, start the spilling process. Default: 0.80 mapreduce.job. partitioner.class The Partitioner class. Default: HashParti- tioner.class map.sort.class The sort class for sorting keys. Default: org.apache.hadoop.util.QuickSort mapreduce.reduce.shuffle .memory.limit.percent Maximum percentage of the in-memory limit that a single shuffle can consume. Default: 0.25 mapreduce.reduce.shuffle .input.buffer.percent The % of memory to be allocated from the maximum heap size to storing map outputs during the shuffle. Default: 0.70 46 / 49 Emilio Coppa Hadoop Internals
  • 59. Introduction YARN MapReduce Conclusion Map Phase Reduce Phase Extra Configuration Parameters (recap) (3) Parameter Meaning mapreduce.reduce.shuffle .merge.percent The usage % at which an in-memory merge will be initiated. Default: 0.66 mapreduce.map. combine.minspills Apply combine only if you at least this num- ber of spill files. Default: 3. mapreduce.task. io.sort.factor The number of streams to merge at once while sorting files. Default: 100 (10) mapreduce.job.reduce. slowstart.completedmaps Fraction of the number of maps in the job which should be complete before reduces are scheduled for the job. Default: 0.05 mapreduce.reduce. shuffle.parallelcopies Number of parallel transfers run by reduce during the shuffle (fetch) phase. Default: 5 mapreduce.reduce. memory.totalbytes Memory of a NM. Default: Run- time.maxMemory() 47 / 49 Emilio Coppa Hadoop Internals
  • 60. Introduction YARN MapReduce Conclusion Hadoop: a bad angel Writing a MapReduce program is relatively easy. On the other hand, writing an efficient MapReduce program is hard: many configuration parameters: YARN: 115 parameters MapReduce: 195 parameters HDFS: 173 parameters core: 145 parameters lack of control over the execution: how to debug? many implementation details: what is happening? 48 / 49 Emilio Coppa Hadoop Internals
  • 61. Introduction YARN MapReduce Conclusion How can we help the user? 49 / 49 Emilio Coppa Hadoop Internals
  • 62. Introduction YARN MapReduce Conclusion How can we help the user? We need profilers! 49 / 49 Emilio Coppa Hadoop Internals
  • 63. Introduction YARN MapReduce Conclusion How can we help the user? We need profilers! My current research is focused on this goal. 49 / 49 Emilio Coppa Hadoop Internals