Hadoop Combat 5:mapreduce Programming-wordcount count Words-eclipse-java-windows Environment

Source: Internet
Author: User

Development of Hadoop in the context of Java environments

Since the MapReduce program has been written in the form of Hadoop streaming, the current Hadoop program is limited to the Python language. In order to expand the Java language development, this experiment uses window System, MAVEN packaging, CentOS system MAPR environment operation.

Two steps

1 View hadoop versions, command Hadoop version, get version number hadoop2.7.0

2 Write POW files, note hadoop2.7 dependencies,

<dependency>

<groupId>org.apache.hadoop</groupId>

<artifactId>Hadoop-client</artifactid>

<version>2.7.0</version>

</dependency>

3 Writing Java version of the WordCount project (specific Java code slightly)

4 maven Install download the dependency package and compile it into a jar package, and test the jar package to the cluster in target.

Enter a command to run the project in a 5MAPR cluster:

Hadoop jar Maven-hadoop-java-wordcount-template-0.0.1-snapshot.jar com.example.Driver Input Output

6 experimental results.

Run successfully, 1

2

Three appendices

The path structure of the project in eclipse

I put the project source on GitHub

Https://github.com/rongyux/Hadoop_Maven_Java_HellloWorld

Hadoop Combat 5:mapreduce Programming-wordcount count Words-eclipse-java-windows Environment

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.