350 likes | 1.01k Views
This Hadoop tutorial on MapReduce Example ( Mapreduce Tutorial Blog Series: https://goo.gl/w0on2G ) will help you understand how to write a MapReduce program in Java. You will also get to see multiple mapreduce examples on Analytics and Testing. <br><br>Check our complete Hadoop playlist here: https://goo.gl/ExJdZs<br><br>Below are the topics covered in this tutorial:<br><br>1) MapReduce Way<br>2) Classes and Packages in MapReduce<br>3) Explanation of a Complete MapReduce Program<br>4) MapReduce Examples on Analytics<br>5) MapReduce Example on Testing - MRUnit
E N D
EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Agenda for today’s Session MapReduce Way Classes and Packages in MapReduce Explanation of a Complete MapReduce Program MapReduce Examples on Analytics MapReduce Example on Testing EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
MapReduce Example on Word Count Process EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
MapReduce Way EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
MapReduce Way – Word Count Process EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Input/Output Classes in MapReduce EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Input Format – Class Hierarchy EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Output Format – Class Hierarchy EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Packages and Classes in Word Count MapReduce Example EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Packages to Import import java.io.IOException; import java.util.*; import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.*; import org.apache.hadoop.io.*; All these packages are present in hadoop-common.jar import org.apache.hadoop.mapreduce.*; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; All these packages are present in hadoop-mapreduce- client-core.jar EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Mapper Class Name of the Mapper Class which inherits Super Class Mapper public static class Map extends Mapper<LongWritable, Text, Text, IntWritable> { Mapper Class takes 4 Arguments i.e. Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT> EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Reducer Class Name of the Reducer Class which inherits Super Class Reducer public static class Reduce extends Reducer<Text, IntWritable, Text, IntWritable> { Reducer Class takes 4 Arguments i.e. Reducer <KEYIN, VALUEIN, KEYOUT, VALUEOUT> EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Its Time to see some MapReduce Examples EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
MapReduce is useful in a wide range of applications in multiple domains. It is majorly used for 2 things: Analytics: Process the data and give the desired results Testing: Perform few test cases using MRUnit EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Let us see few MapReduce Examples on Analytics EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
MapReduce Temperature Example EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Temperature Example Problem Statement: » Analysing weather data of Austin to determine Hot and Cold Days. We have weather data set of Austin by NCIE. NOAA's National Centres for Environmental Information (NCEI) (previously NCDC) is responsible for preserving, monitoring, assessing, and providing public access to the Nation's treasure of climate and historical weather data and information. Weather Forecasting Refer -> ftp://ftp.ncdc.noaa.gov/pub/data/uscrn/products/daily01 EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Temperature Example - Weather Dataset 6thColumn Max Temp 6thColumn Min Temp EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
MapReduce Example EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Last.fm Example is an online music website where users listen to various tracks, the data gets collected like shown below. Write a map reduce program to get the Number of unique listeners. The data is coming in log files and looks like as shown below: UserId TrackId Shared Radio Skip 100001 150 1 1 0 100005 103 0 0 1 100142 78 1 0 0 110005 289 1 0 1 EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Let us see a MapReduce Example on Testing EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
MRUnit Testing Framework Provides 4 drivers for separately testing MapReduce code » MapDriver » ReduceDriver » MapReduceDriver » PipelineMapReduceDriver *JUnit is a simple framework to write repeatable tests. Helps in filling the gap between MapReduce programs and JUnit* Better control on log messages with JUnit Integration EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
MapReduce MRUnit Example EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Learning Resources Hadoop Tutorial: www.edureka.co/blog/hadoop-tutorial MapReduce Tutorial: www.edureka.co/blog/mapreduce-tutorial MapReduce Interview Questions: www.edureka.co/blog/interview-questions/hadoop-interview-questions-mapreduce EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop
Thank You … Questions/Queries/Feedback EDUREKA HADOOP CERTIFICATION TRAINING www.edureka.co/big-data-and-hadoop