Opening the New Java Project wizard
The New Java Project wizard can be used to create a new java project. There are many ways to open this wizard:- By clicking on the File menu and choosing New > Java Project
- By right clicking anywhere in the Project Explorer and selecting New > Java Project
- By clicking on the New button ( ) in the Tool bar and selecting Java Project
Using the New Java Project wizard
The New Java Project Wizard has two pages.On the first page:
- Enter the Project Name
- Select the Java Runtime Environment (JRE) or leave it at the default
- Select the Project Layout which determines whether there would be
a separate folder for the sources code and class files. The recommended
option is to create separate folders for sources and class files.
You can click on the Finish button to create the project or click on the Next button to change the java build settings.
On the second page you can change the Java Build Settings like setting the Project dependency (if there are multiple projects) and adding additional jar files to the build path.
Writing the Mapper Class
As we all start up with writing some basic code for map reduce hence we will write a Word Count program which will simply count the number of words in a file and give a out put.
Now here in the mapper class we write WordCountMapper
package com.hadoop.training;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import java.util.StringTokenizer;
public class WordCountMapper extends Mapper<LongWritable,Text,Text,IntWritable> {
private final static IntWritable one = new IntWritable(1);
private Text word = new Text();
public void map (LongWritable key,Text value, Context context) throws IOException,InterruptedException {
StringTokenizer itr = new StringTokenizer(value.toString());
while (itr.hasMoreTokens()){
word.set(itr.nextToken());
context.write(word,one);
}
}
}
Writing the Reducer Class
Now here in the reducer class we write WordCountReducer
package com.hadoop.training;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
public class WordCountReducer extends Reducer<Text,IntWritable,Text,IntWritable>{
private IntWritable result = new IntWritable();
public void reduce(Text key,Iterable<IntWritable> value, Context context) throws IOException,InterruptedException {
int sum = 0;
for (IntWritable val : value) {
sum +=val.get();
}
result.set(sum);
context.write(key,result);
}
}
Writing the MapReduce driver class
Writing the MapReduce driver class as WordCount
package com.hadoop.training;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
public class WordCount {
public static void main (String[] args) throws Exception {
if (args.length != 2) {
System.err.println("Usage: MaxTemperature <input path> <output path>");
System.exit(-1);
}
@SuppressWarnings("deprecation")
Job job = new Job();
job.setJarByClass(WordCount.class);
job.setJobName("Word Count");
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
job.setMapperClass(WordCountMapper.class);
job.setReducerClass(WordCountReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
Running The Map Reduce programme
$ hadoop jar WC.jar com.hadoop.training.WordCount hdfs://localhost:8020/user/rajeev/input hdfs://localhost:8020/user/rajeev/output
There are lots of information about latest technology and how to get trained in them, like Hadoop Training Chennai have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies(Hadoop Training in Chennai). By the way you are running a great blog. Thanks for sharing this.
ReplyDeleteHadoop training institutes in chennai | Hadoop Training Chennai
Cloud is one of the tremendous technology that any company in this world would rely on(Salesforce developer training in chennai). Using this technology many tough tasks can be accomplished easily in no time. Your content are also explaining the same(Salesforce training institutes in chennai). Thanks for sharing this in here. You are running a great blog, keep up this good work.
ReplyDeletebe projects in chennai
ReplyDeletens2 projects in chennai
ieee java projects in chennai
ieee dotnet projects in chennai
mba projects in chennai
mca projects in chennai
bulk projects in chennai
Appreciating the persistence you put into your blog and detailed information you provide.
ReplyDeleteBest Hadoop Training Institute In chennai
amazon-web-services-training-institute-in-chennai
This is very good content you share on this blog. it's very informative and provide me future related information.
ReplyDeletejava training in omr
java training in annanagar | java training in chennai
java training in marathahalli | java training in btm layout
java training in rajaji nagar | java training in jayanagar
Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article. thank you for sharing such a great blog with us.
ReplyDeletepython training in chennai | python training in bangalore
python online training | python training in pune
python training in chennai | python training in bangalore
python training in tambaram |
Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..
ReplyDeleteHadoop Training in Chennai
Hadoop Training in Bangalore
Big data training in tambaram
Big data training in Sholinganallur
Big data training in annanagar
I’ve desired to post about something similar to this on one of my blogs and this has given me an idea. Cool Mat.
ReplyDeleteData Science training in marathahalli
Data Science training in btm
Data Science training in rajaji nagar
Data Science training in chennai
Data Science training in kalyan nagar
Data Science training in electronic city
Data Science training in USA
Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
ReplyDeleterpa training in Chennai
rpa training in anna nagar | rpa training in marathahalli
rpa training in btm | rpa training in kalyan nagar
rpa training in electronic city | rpa training in chennai
rpa online training | selenium training in training
Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
ReplyDeletepython training in rajajinagar
Python training in btm
Python training in usa
This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me..
ReplyDeleteDevOps online Training
Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
ReplyDeleteangularjs Training in chennai
angularjs Training in chennai
angularjs-Training in tambaram
angularjs-Training in sholinganallur
angularjs-Training in velachery
Well done! Pleasant post! This truly helps me to discover the solutions for my inquiry. Trusting, that you will keep posting articles having heaps of valuable data. You're the best!
ReplyDeleteData Science training in rajaji nagar | Data Science with Python training in chenni
Data Science training in electronic city | Data Science training in USA
Data science training in pune | Data science training in kalyan nagar
I am obliged to you for sharing this piece of information here and updating us with your resourceful guidance. Hope this might benefit many learners. Keep sharing this gainful articles and continue updating us.
ReplyDeleteGerman Classes in Chennai
Java Training in Chennai
german classes chennai
german teaching institutes in chennai
Java Training Institute in Chennai
Best Java Training Institute in Chennai
Your blog is the best one about that latest technology that I have come across today, really thanks for spending your valuable time with us.
ReplyDeleteselenium Training in Chennai
Selenium Training Chennai
ios training institute in chennai
Digital Marketing Course in Chennai
.Net coaching centre in chennai
Software testing training institutes
Software Testing courses in chennai
Big Data Training in Chennai
Very interesting post! Thanks for sharing your experience suggestions...
ReplyDeleteJava Training in Chennai
Python Training in Chennai
IOT Training in Chennai
Selenium Training in Chennai
Data Science Training in Chennai
FSD Training in Chennai
MEAN Stack Training in Chennai
This was an excellant blog. Thanks to the admin for sharing this useful information.
ReplyDeleteIELTS Institute in Mumbai
Best IELTS Coaching Classes in Mumbai
IELTS Coaching Center in Mumbai
Best IELTS Classes in Mumbai
IELTS Coaching near me
IELTS Course in Mumbai
IELTS Training Institute in Mumbai
ReplyDeleteExcellent Blog!!! Such an interesting blog with clear vision, this will definitely help for beginner to make them update.
Cloud Training in Chennai
Cloud computing Training
cloud training in bangalore
cloud computing institutes in bangalore
cloud computing training in coimbatore
I have gone through your blog, it was very much useful for me and because of your blog, and also I gained much unknown information, the way you have clearly explained is really fantastic. Kindly post more like this, Thank You.
ReplyDeleteairport ground staff training courses in chennai
airport ground staff training in chennai
ground staff training in chennai
indian whatsapp group links
ReplyDeleteYour very own commitment to getting the message throughout came to be rather powerful and have consistently enabled employees just like me to arrive at their desired goals.
ReplyDeleteangularjs online training
apache spark online training
informatica mdm online training
devops online training
aws online training
Well somehow I got to read lots of articles on your blog. It’s amazing how interesting it is for me to visit you very often.
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
Java Script online training
Share Point online training
Very nice posts. this could not be explained better. Thanks for sharing, Keep up the good work.
ReplyDeletePython training in kalyan nagar
Java Training in Kalyan Nagar
Thanks for sharing valuable information.It will help everyone.keep Posting!! Machine Learning Training In Bangalore
ReplyDeleteCheers and thanks for the clear path.
ReplyDeleteBig Data Hadoop Training In Chennai | Big Data Hadoop Training In anna nagar | Big Data Hadoop Training In omr | Big Data Hadoop Training In porur | Big Data Hadoop Training In tambaram | Big Data Hadoop Training In velachery
"This was a well written blog. Was great reading your blog. Thanks for sharing.
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"
Very nice blog with useful content.This blog helps me for begginers guide.
ReplyDeleteThank you.
hadoop admin online training
hadoop administrator certification
hadoop admin training
ReplyDeleteI have finally found a Worth able content to read. The way you have presented information here is quite impressive. I have bookmarked this page for future use.
Java training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
This is my first time visit here. From the tons of comments ExcelR Machine Learning Course Pune on your articles.I guess I am not only one having all the enjoyment right here!
ReplyDeletethe content on your blog was really helpful and informative. Thakyou. # BOOST Your GOOGLE RANKING.It’s Your Time To Be On #1st Page
ReplyDeleteOur Motive is not just to create links but to get them indexed as will
Increase Domain Authority (DA).We’re on a mission to increase DA PA of your domain
High Quality Backlink Building Service
1000 Backlink at cheapest
50 High Quality Backlinks for just 50 INR
2000 Backlink at cheapest
5000 Backlink at cheapest
hi thanku so much this information
ReplyDeletecs executive
freecseetvideolectures/
Think This Is Owsm Post, But If You Check This BITFINEX
ReplyDeleteIs XM REVIEW Scam? Can They Be Trusted? What Are The Best Brokers? Check Out Our Detailed XM Review And Get The Answers To These Questions And Much More.
ReplyDeleteWant To Trade Forex With AVATRADE REVIEW ? Read This Blog First To Find Out About The Best Forex Trading Conditions. We Review The Most Popular Forex Brokers And Tell You What You Need To Know.
ReplyDeleteThis post is so interactive and informative.keep update more information...
ReplyDeleteSEO Training in Tambaram
SEO Training in ChennaiS
Such a good post .thanks for sharing
ReplyDeleteDevOps Training in T Nagar
DevOps Training in Chennai
Great post. keep sharing such a worthy information.
ReplyDeleteTally Course in Chennai
Online Tally Course
mmorpg oyunlar
ReplyDeleteinstagram takipci satın al
tiktok jeton hilesi
tiktok jeton hilesi
antalya saç ekimi
referans kimliği nedir
instagram takipçi satın al
metin2 pvp serverlar
instagram takipçi satın al
smm panel
ReplyDeleteSmm panel
İsilanlariblog.com
instagram takipçi satın al
Hırdavatçı
www.beyazesyateknikservisi.com.tr
servis
Tiktok Hile İndir
Star act man administration at more. Decade board face yet value him finally. Ball pull decision tax.
ReplyDeleteUseful post thanks for sharing this post
ReplyDeleteBuilding Contractors in Chennai
Nice Blog
ReplyDeleteJewellery Software
Jewellery Software