You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Jane Wayne <ja...@gmail.com> on 2013/08/26 23:19:55 UTC

question about Sqoop.run(String[] args, Configuration conf) exiting after hadoop job is created

hi, i am using Sqoop v1.4.4 for hadoop 0.20. i have a question about the
following method.

Sqoop.run(String[] args, Configuration conf)

how can i call this method to "exit" immediately after a hadoop job has
been created? for now, after i call this method, the whole import has to
actually finish before any code following it will be called. for example,
my code looks like the following.

1. Configuraiton conf = MyMapReduceUtil.getConf();
2. String[] args = { "import", "--connect", jdbcUrl, "--username",
username, "--password", pw, "--table", table, "--target-dir", hdfsOutputDir
};
3. Sqoop.runTool(args, conf);
4. System.out.println("finished calling sqoop");

in the code above, i notice that line #4 is not called until the MapReduce
import job created by Sqoop is completely finished. is this how Sqoop is
supposed to work?

any help is appreciated.

Re: question about Sqoop.run(String[] args, Configuration conf) exiting after hadoop job is created

Posted by Jarek Jarcec Cecho <ja...@apache.org>.
Hi Jane,
Sqoop 1 do not have official Java API, so this usage is not supported. As third party usage is not intended, there is no API that would run the mapreduce job in asynchronous mode.

We've added fully fledged Java API in Sqoop2, you can take a look on the documentation at:

http://sqoop.apache.org/docs/1.99.2/ClientAPI.html

Jarcec

On Mon, Aug 26, 2013 at 05:19:55PM -0400, Jane Wayne wrote:
> hi, i am using Sqoop v1.4.4 for hadoop 0.20. i have a question about the
> following method.
> 
> Sqoop.run(String[] args, Configuration conf)
> 
> how can i call this method to "exit" immediately after a hadoop job has
> been created? for now, after i call this method, the whole import has to
> actually finish before any code following it will be called. for example,
> my code looks like the following.
> 
> 1. Configuraiton conf = MyMapReduceUtil.getConf();
> 2. String[] args = { "import", "--connect", jdbcUrl, "--username",
> username, "--password", pw, "--table", table, "--target-dir", hdfsOutputDir
> };
> 3. Sqoop.runTool(args, conf);
> 4. System.out.println("finished calling sqoop");
> 
> in the code above, i notice that line #4 is not called until the MapReduce
> import job created by Sqoop is completely finished. is this how Sqoop is
> supposed to work?
> 
> any help is appreciated.