hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naganarasimha G R (Naga)" <garlanaganarasi...@huawei.com>
Subject RE: Invoking a MapRed job via Runtime class
Date Thu, 08 Oct 2015 03:22:16 GMT
Hi Ista,
IIUC you just want it to be submitted and not wait till it finish and print the stats ?
Basically sample code which you might be referring will be creating the instance of "org.apache.hadoop.mapreduce.Job"
and setting with the req configurations calling
job.waitForCompletion(true); Instead you can just call job.submit();

From: Istabrak Abdul-Fatah [ifatah@gmail.com]
Sent: Wednesday, October 07, 2015 19:58
To: user@hadoop.apache.org
Subject: Invoking a MapRed job via Runtime class

Greetings to all,
Is it possible to invoke a MapReduce job from another java class using the runtime command?
If not, what are the alternatives?

Here is a sample code snippet:

public static void main(String[] args) {
     Runtime rt = Runtime.getRuntime();
try {
Process p = rt.exec("yarn jar /opt/yarn/my_examples/AvgSeven.jar -Dtest=\"9999\" /user/yarn/input/samplefile.csv
} catch (IOException e) {



View raw message