Hadoop tasted the first Hadoop program

Source: Internet
Author: User

A Hadoop programmer needs to complete three classes.

The map class, the reduce class, and the main class.

The map and reduce classes are naturally done separately for map and reduce. The main class is responsible for setting up the job for these two classes. After completing these three classes, we generate a jar file. Use this jar file to complete the rest of the work.

First, execute Bin/hdfs dfs-put/home/hadoop/test input
Here, it means to put the file/home/hadoop/test file into input. This input is set up well in advance and the instructions are as follows:

Bin/hadoop Fs–mkdir Input

After inserting input, we execute the instruction:

Bin/hadoop Jar/home/hadoop/workspace/test.jar invertedindexer Input Output
/home/hadoop/workspace/test.jar is the address of the previously generated jar file, and input contains the pending file. The output has yet to be examined.

It is important to note that the invertedindexer here is the name of the main class in the three classes written by the programmer.

Hadoop tasted the first Hadoop program

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.