【发布时间】:2012-02-29 06:05:43
【问题描述】:
我正在尝试将文件从 HDFS 复制到本地文件系统以进行预处理。下面的代码应该根据文档工作。尽管它没有给出任何错误消息并且 mapreduce 作业运行顺利,但我在本地硬盘驱动器上看不到任何输出。你认为问题是什么?谢谢。
try {
Path phdfs_input = new Path("hdfs://master:54310/user/hduser/conninput/"+value.toString());
Path plocal_input = new Path("/home/hduser/Desktop/"+avlue.toString());
FileSystem fs = FileSystem.get(context.getConfiguration());
fs.copyToLocalFile(phdfs_input, plocal_input);
/* String localoutput_file = "/home/hduser/Destop/output/"+value.toString();
String cmd1[] = {"mafia", "-mfi", ".5", "-ascii", "~/Desktop/"+value.toString(), localoutput_file };
File mafia_dir = new File("/home/hduser/");
ShellCommandExecutor s = new ShellCommandExecutor(cmd1, mafia_dir);*/
} catch (Exception e) {
e.printStackTrace();
}
【问题讨论】: