Why do we use job waitForCompletion true

0 votes

Hi. I am new to mapreduce and hadoop and I was going through some code and I came across this line. 

job.waitForCompletion(true)

Why is it used? Is it because internally the code uses threads.

Jul 10, 2019 in Big Data Hadoop by Kunal
4,821 views

1 answer to this question.

0 votes

The main reason for job.waitForCompletion exists is that its method call returns only when the job gets finished, and it returns with its success or failure status which can be used to determine that further steps are to be run or not.

 Actually, the files are split into blocks and each block is executed on a separate node. All the map tasks run in parallel and they are fed to the reducer after they are done. There is no question of synchronization as you would think about in a multi-threaded program. In a multi-threaded program, all the threads are running on the same box and since they share some of the data you have to synchronize them. But here threads are not involved unless you use threads to submit jobs in parallel and wait for their completion. For that, you have to use a job class instance per thread. 

answered Jul 10, 2019 by Josh

Related Questions In Big Data Hadoop

0 votes
1 answer

Why do we use job.waitForCompletion(true) ?

The main reason for job.waitForCompletion exists is that ...READ MORE

answered Jul 22, 2019 in Big Data Hadoop by Kiran
1,065 views
0 votes
1 answer

Why we are configuring mapred.job.tracker in YARN?

I really dont know the reason behind ...READ MORE

answered Mar 29, 2018 in Big Data Hadoop by Ashish
• 2,650 points
1,856 views
0 votes
1 answer

Why do we need Hadoop framework?

The function of Distributes File System is ...READ MORE

answered Apr 10, 2019 in Big Data Hadoop by Gitika
• 65,770 points

edited Apr 12, 2019 by Gitika 1,392 views
0 votes
2 answers

Why we use --split by command in Sqoop?

In simple explanation, When specify SPLIT_BY only ...READ MORE

answered Feb 6, 2020 in Big Data Hadoop by Ramji Sridaran
15,106 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,015 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,528 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,739 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,605 views
+1 vote
1 answer

Why do we use STORE command in pig?

Hey, We use store command to store the ...READ MORE

answered May 7, 2019 in Big Data Hadoop by Gitika
• 65,770 points
2,439 views
0 votes
1 answer

Why should we use "extends Mapper" for Mapreduce code?

The Mapper class belongs to package org.apache.hadoop.mapreduce ...READ MORE

answered Feb 8, 2019 in Big Data Hadoop by Omkar
• 69,220 points
1,064 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP