在java中为distcp映射Reduce作业



我每天都在尝试将数据从一个集群复制到另一个集群。搜索了很多,但每个人都建议用args调用DistCp的主要函数。我也在苦读java代码。但它不起作用,我也没有犯任何错误。命令行上的distcp运行良好。这里需要做什么?

public static void customDiscp(String source, String destination) throws Exception {
  String[] args = new String[4];
  args[0] = "-log";
  args[1] = "/projects/logs";
  args[2] = source;
  args[3] = destination;
  DistCp.main(args);
}

要用Java编写map reduce作业,必须使用map reduce-api。参考本教程编写mr作业

https://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html

最新更新