The difference between Spark and MapReduce

Source: Internet
Author: User
Tags shuffle

Learn from http://spark-internals.books.yourtion.com/markdown/4-shuffleDetails.html

1. Shuffle read fetch edge processing or a one-time fetch finish again processing?

Edge fetch edge processing.

  • Mapreduce

Shuffle stage is the side fetch side uses combine () to handle, just combine () processing is partial data. In order for the records to enter reduce (), MapReduce must wait until all the data is shuffle-sort before starting reduce ().

  • Spark

Because Spark does not require shuffle data to be globally ordered, it is not necessary to wait until all the data shuffle is complete before processing.

Use data structures that can be aggregate, such as HashMap. Each shuffle gets (deserialize out of the buffered filesegment) a \<key, value\= "" > Record, which is placed directly into the HASHMAP. If the HashMap already exists the corresponding Key, then the direct aggregate func(hashMap.get(Key), Value) that is, such as the above WordCount example of the Func is hashMap.get(Key) + Value , and the result of the Func re-put (Key) to HashMap.

2.

The difference between Spark and MapReduce

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.