Mapreduce programming series twelve reduce stage internal details and Adjustment Parameters

Source: Internet
Author: User
Reduce computing is divided into several stages 1. Copy (or shuffle) stage and merge stage parallel

Previously, map results are stored on a local disk. In this case, data needs to be copied from the reduce node from the map node. Store the data in the memory. If the memory size is large, the data is written to the local disk.

At the same time, there are two threads that perform merge operations on the acquired data in the memory and on the disk.

Details:

Call RPC to query the list of map tasks completed by the task tracker. Shuffle is a shuffling operation on all the task tracker hosts, which can disrupt the order of copy data, prevents network Hotspots (a large number of processes read data from a task tracker node ).

Tasks that can be copied are stored in scheduledcopies.

Once data is copied, multiple mapoutputcopier threads are started to copy data through http get requests. If the data is large, the data is saved to the disk. Otherwise, the data is saved to the cache.

In the cache, The inmemoryfsmerge thread is responsible for merge, and the localfsmerger thread is responsible for merge for files.


Therefore, after observing jobtracker, we can see that the map operation has not been completely completed, and the reduce operation has started, that is, it enters the copy stage.


2. parallelism between the sort stage and reduce function that calls CER

Sort sorts the <key, value> data sent from the map stage by merging keys to generate <key, values>

Reduce compiled by the user transfers the preceding <key, values> to the ruduce function for processing.


Parallel algorithms improve program performance. The specific algorithms will be discussed later.

3. Write

Write the result to HDFS.


Reduce optimization parameters

Mapred. Reduce. Parallel. Copies is 5 by default, indicating how many concurrent threads are there to copy data from the task tracker Node

Io. Sort. factor appears again. The default value is 10. It still refers to the number of parallel merged files.

Mapred. Job. Shuffle. Merge. percent is 0.66 by default. If the value exceeds 66%, the data is merged and then written to the disk.

Mapred. inmem. Merge. threshold is 1000 by default. When the threshold value is exceeded, data is merged and written to the disk.




Mapreduce programming series twelve reduce stage internal details and Adjustment Parameters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.