Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pull data in the Map/Reduce functions?

According to the Hadoop : The Definitive Guide.

The new API supports both a “push” and a “pull” style of iteration. In both APIs, key-value record pairs are pushed to the mapper, but in addition, the new API allows a mapper to pull records from within the map() method. The same goes for the reducer. An example of how the “pull” style can be useful is processing records in batches, rather than one by one.

Has anyone pulled data in the Map/Reduce functions? I am interested in the API or example for the same.

like image 565
Praveen Sripati Avatar asked Sep 24 '11 08:09

Praveen Sripati


People also ask

How does MapReduce process data?

MapReduce facilitates concurrent processing by splitting petabytes of data into smaller chunks, and processing them in parallel on Hadoop commodity servers. In the end, it aggregates all the data from multiple servers to return a consolidated output back to the application.

How do you do MapReduce?

MapReduce is a processing technique and a program model for distributed computing based on java. The MapReduce algorithm contains two important tasks, namely Map and Reduce. Map takes a set of data and converts it into another set of data, where individual elements are broken down into tuples (key/value pairs).

What is MapReduce in big data with example?

Learn to use QGIS for remote sensing and map making MapReduce is a programming model for writing applications that can process Big Data in parallel on multiple nodes. MapReduce provides analytical capabilities for analyzing huge volumes of complex data.

How MapReduce computation executes?

The "MapReduce System" (also called "infrastructure" or "framework") orchestrates the processing by marshalling the distributed servers, running the various tasks in parallel, managing all communications and data transfers between the various parts of the system, and providing for redundancy and fault tolerance.


1 Answers

I posted a query @ [email protected] and got the answer.

The next key value pair can be retrieved from the context object which is passed to the map, by calling nextKeyValue() on it. So you will be able to pull the next data from it in the new API.

Is the performance of pull better than push in this scenario? Also, what are the scenarios in which the pull will be useful?

like image 169
Praveen Sripati Avatar answered Sep 22 '22 10:09

Praveen Sripati