Documente Academic
Documente Profesional
Documente Cultură
Page 1
Tez Introduction
Distributed execution
framework targeted
towards data-processing
applications.
Based on expressing a
computation as a dataflow
graph.
Highly customizable to
meet a broad spectrum of
use cases.
Built on top of YARN the
resource management
framework for Hadoop.
Open source Apache
Hortonworks Inc. 2013
Page 2
Page 3
Page 4
TaskD-1
TaskC-1
TaskD-2
TaskE-1
TaskC-2
TaskE-2
Page 5
Task-1
Task-2
Task-1
Preprocessor Stage
Sampler
Ranges
Distributed Sort
Task-1
Task-2Aggregate Stage
Page 6
ShuffleInput
MapProcessor
ReduceProcessor
JoinProcessor
FileSortedOutput
HDFSOutput
FileSortedOutput
Mapper
FinalReduce
IntermediateJoiner
Input1
Page 7
Input2
File
User Code
Key Value
Bytes
Bytes
Tuples
Stream
Page 8
Tez Lib 2
TezClient
TezTask
TezTask
TezClient
Client
Machine
Node
Manager
Node
Manager
Client
Machine
Page 9
Page 10
Page 11
Pig/Hive - Tez
Pig/Hive - MR
Page 12
Stage 2
100
reducers
Stage 1
50 maps
100
partitions
Only 10GBs
of data
YARN
Resources
Page 13
Stage 2
100 10
reducers
Task Done
Start Task
YARN Container
Shared
Shared Objects
Objects
Start Task
TezTask1
TezTask2
YARN Container
Page 14
Producer
Local File
At Runtime
In-Memory
Consumer
Consumer
Page 15
Page 16
map1
Scatter_Gather
Bipartite
Sequential
map2
reduce1
reduce2
Scatter_Gather
Bipartite
Sequential
dag.addVertex(map1).addVertex(map2)
join1
.addVertex(reduce1).addVertex(reduce2)
.addVertex(join1)
.addEdge(edge1).addEdge(edge2)
.addEdge(edge3).addEdge(edge4);
Hortonworks Inc. 2013
Page 17
Page 18
map2
reduce1
reduce2
join1
Page 19
Page 20
Task Attempt
(logical in AM)
Env, cmd line,
resources
Input
Processor
Output
Task Attempt
(real on machine)
Start container
Get Task
Input
Processor
Control/Data
Information
Data Events
Control Events
Output
Page 21
Map Task 1
Output1
Output3
Output2
Map Task 2
Output1
Output3
AM
Router
Scatter-Gather Edge
Error Event
Input1
Input2
Reduce Task 2
Output2
Page 22
Map Task 1
Output1
Output3
Output2
Map Task 2
Output1
Output3
Data Event
AM
Router
Scatter-Gather Edge
Error Event
Input1
Input2
Reduce Task 2
Output2
Page 23
Map Task 1
Output1
Output3
Output2
Map Task 2
Output1
Output3
Data Event
AM
Router
Scatter-Gather Edge
Error Event
Input1
Input2
Reduce Task 2
Output2
Page 24
Determines task
parallelism
Determines
when tasks in a
vertex can start.
DAG Scheduler
Determines priority
of task
Task Scheduler
Allocates
containers from
YARN and assigns
them to tasks
Start
vertex
Get container
map1
Get Priority
Start
vertex
Vertex Manager
DAG
Scheduler
Task
Scheduler
Start
tasks
reduce1
Get Priority
Get container
Page 25
Vertex Manager
Map Vertex
Vertex Manager
Pluggable user logic
that understands the
data statistics and can
formulate the correct
parallelism. Advises
vertex controller on
parallelism
Vertex State
Machine
App Master
Reduce Vertex
Cancel Task
Page 26
Vertex Manager
Data Size
Statistics
Map Vertex
Vertex Manager
Pluggable user logic
that understands the
data statistics and can
formulate the correct
parallelism. Advises
vertex controller on
parallelism
Vertex State
Machine
App Master
Reduce Vertex
Cancel Task
Page 27
Data Size
Statistics
Vertex Manager
Map Vertex
Set Parallelism
Vertex Manager
Pluggable user logic
that understands the
data statistics and can
formulate the correct
parallelism. Advises
vertex controller on
parallelism
Re-Route
Vertex State
Machine
App Master
Reduce Vertex
Cancel Task
Page 28
Vertex Manager
Map Vertex
Vertex Manager
Pluggable user logic
that understands the
data size. Advises the
vertex controller to
launch the reducers
before all maps have
completed so that
shuffle can start.
Vertex State
Machine
App Master
Reduce Vertex
Page 29
Vertex Manager
Task Completed
Map Vertex
Vertex Manager
Pluggable user logic
that understands the
data size. Advises the
vertex controller to
launch the reducers
before all maps have
completed so that
shuffle can start.
Vertex State
Machine
App Master
Reduce Vertex
Page 30
Task Completed
Vertex Manager
Map Vertex
Start Tasks
Vertex State
Machine
App Master
Start
Reduce Vertex
Page 31
Map Vertex
1-1 Edges
1-1 Edges
Page 32
Set
Parallelism
Get
Block
Locations
Map Vertex
1-1 Edges
HDFS
1-1 Edges
Page 33
Set
Parallelism
Map Vertex
Get
Block
Locations
HDFS
Page 34
Tez - Sessions
Start
Session
Client
Submit
DAG
Application Master
Task Scheduler
Container Pool
Pre
Warmed
JVM
Page 35
Shared
Object
Registry
Page 36
Dimension
Table 1
Fact Table
Broadcast
Join
Result
Table 1
Dimension
Table 2
Broadcast join
for small data sets
Dimension
Table 1
Dimension
Table 1
Dimension
Table 1
Broadcast
Join
Result
Table 2
Dimension
Table 3
Shuffle
Join
Typical pattern in a
TPC-DS query
Result
Table 3
Page 37
Page 38
Dimension tables
broadcasted to Hive
MapJoin tasks
Page 39
Focus on stability
Testing and quality are highest priority.
Code ready and deployed on multi-node environments.
Page 40
Tez Roadmap
Richer DAG support
Support for co-scheduling and streaming
Better fault tolerance with checkpoints
Performance optimizations
More efficiencies in transfer of data
Improve session performance
Usability.
Stability and testability
Recovery and history
Tools for performance analysis and debugging
Page 41
Tez Community
Early adopters and code contributors
welcome
Adopters to drive more scenarios. Contributors to make them
happen.
Hive and Pig communities are on-board and making great
progress - HIVE-4660 and PIG-3446
Useful links
Work tracking: https://issues.apache.org/jira/browse/TEZ
Code: https://github.com/apache/incubator-tez
Developer list: dev@tez.incubator.apache.org
Page 42
Hortonworks Inc. 2013
User list: user@tez.incubator.apache.org
Tez Takeaways
Distributed execution framework that works
on computations represented as dataflow
graphs
Naturally maps to execution plans produced
by query optimizers
Customizable execution architecture
designed to enable dynamic performance
optimizations at runtime
Works out of the box with the platform
figuring out the hard stuf
Span the spectrum of interactive latency to
batch
Open source Apache project your use-cases
and code are welcome
Hortonworks Inc. 2013
Page 43
Tez
Thanks for your time and attention!
Questions?
@bikassaha
Page 44