You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by xeonmailinglist <xe...@gmail.com> on 2015/02/03 19:19:41 UTC
create Job with java code.
Hi,
I want this because I want to create depency between 2 jobs. The first
job execute the wordcount example, and the second job copy the output of
the wordcount to another HDFS.
Therefore, I want to create a job (job 2) that includes the code to copy
data to another HDFS. The code is below. Is there a way to do it with
the API?
| // Put inside a job()
String proto = "webhdfs://";
String src = "hadoop-coc-1/input1";
String dest = "hadoop-coc-2/input1";
List<Path> lsrc = new ArrayList<Path>();
lsrc.add(new Path(proto+src));
DistCpOptions options = new DistCpOptions(lsrc, new Path(proto+dest));
DistCp distcp = new DistCp(conf, options);
distcp.execute();
|