Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Sqoop >> mail # user >> question about Sqoop.run(String[] args, Configuration conf) exiting after hadoop job is created


Copy link to this message
-
Re: question about Sqoop.run(String[] args, Configuration conf) exiting after hadoop job is created
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.
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB