Skip to Main Content
Hadoop管理手冊
book

Hadoop管理手冊

by Eric Sammer
February 2014
Intermediate to advanced content levelIntermediate to advanced
312 pages
6h 28m
Chinese
GoTop Information, Inc.
Content preview from Hadoop管理手冊
32
|
第三章:
MapReduce
下一階段的處理稱為
洗牌與排序
shuffle and sort
),就是負責達成上述保證。洗牌
與排序階段實際上是在執行用戶的
reduce
函數前,在
reduce
工作(
task
)上執行的。
開始時,每個
reducer
會被分配到一個分割,並負責處理這個分割。首先,它們從每個
工作節點複製所負責分割的中間鍵值資料(
intermediate key-value data
)。在叢集中,
成千上萬個
map
工作很可能執行在不同的主機之上,每台都會輸出每個分割的鍵值
對。舉例來說,
reducer
負責分割一,很可能必須到叢集裡的每一台去擷取分割一的片
段。邏輯上,在叢集中跨所有機器的中間產物資料可能看起來像這樣:
worker 1, partition 2, DEBUG, 1
worker 1, partition 1, INFO, 1
worker 2, partition 1, INFO, 1
worker 2, partition 1, INFO, 1
worker 3, partition 2, WARN, 1
橫跨網路複製中間產物資料可能需要花相當長的時間,這取決於有多少資料。為減少
任務的總運行時間,框架允許在
map
工作完成時,就馬上複製中間產物資料。請記住,
洗牌和排序是在
reduce
工作中執行,每個都需要耗費叢集的資源。我們想要很快開始
複製階段,好在最後一個
map
工作完成前,複製完多數的中間產物資料。可是又不能
太快,導致
reduce
工作佔著系統資源卻閒置, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

HBase管理指南

HBase管理指南

Posts & Telecom Press, Yifeng Jiang
Python应用开发指南

Python应用开发指南

Posts & Telecom Press, Ninad Sathaye
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu
自然语言处理与计算语言学

自然语言处理与计算语言学

Posts & Telecom Press, Bhargav Srinivasa-Desikan

Publisher Resources

ISBN: 9789862769973