Running the first Hadoop instance on Eclipse-WordCount (word counting program)

Source: Internet
Author: User
Tags shuffle

Demand

Calculates the frequency of each word in the file. The output results are ordered in alphabetical order by word. Each word and its frequency occupy one line, and there is a gap between the word and the frequency.

For example, enter a file with the following contents:

Hello World

Hello Hadoop

Hello MapReduce

corresponding to the input sample given above, the output sample is:

Hadoop 1

Hello 3

MapReduce 1

World 1

Programme development

For this case, the following mapreduce schemes can be designed:

1. Map stage Each node completes the input data to the word segmentation work

2. The shuffle phase completes the aggregation of the same word to the work of distributing to each reduce node (theshuffle phase is the default process for MapReduce )

3. Reduce phase is responsible for receiving all words and calculating their respective frequency

Summary

WordCount is a classic example of Hadoop, though simple but very representative.

To some extent, it also reflects the original intention of the design, the analysis of the log file.

Running the first Hadoop instance on Eclipse-WordCount (word counting program)

Related Article

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.