Mapreduce three-path Input

Source: Internet
Author: User

So far, we know that mapreduce has three path input methods.
1. The first method is to enter the following information:

Fileinputformat. addinputpath (job, new path (ARGs [0]);
Fileinputformat. addinputpath (job, new path (ARGs [1]);
Fileinputformat. addinputpath (job, new path (ARGs [2]);
Fileinputformat. addinputpath (job, new path (ARGs [3]);

This method can receive file input in multiple paths, but these files are processed by a map.
2. The second type is input in the following way (the second path parameter is pass, multiple paths are divided ):

Fileinputformat. addinputpaths (job, argS [0] + "," + ARGs [1] + "," + ARGs [2]);

This method is similar to the first method. You can see from the source code that this method splits the path into string [] paths arrays and then recycles the first method of calling, in addition, it uses a map for processing.
3. The third type is input in the following way:

Multipleinputs. addinputpath (job, new path (ARGs [0]), textinputformat. Class, mapper1.class );
Multipleinputs. addinputpath (job, new path (ARGs [1]), textinputformat. Class, mapper2.class );
Multipleinputs. addinputpath (job, new path (ARGs [2]), textinputformat. Class, mapper3.class );

This method is applicable to different input files. They may have different formats, and then write corresponding maps for their formats for processing. This method is more flexible.

From: http://f.dataguru.cn/thread-235219-1-1.html

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.