2
前処理のために、HDFSからローカルファイルシステムにファイルをコピーしようとしています。以下のコードはドキュメントに従って動作するはずです。エラーメッセージは表示されませんが、mapreduceジョブはスムーズに実行されますが、ローカルのハードドライブに出力が表示されません。問題は何だと思いますか?ありがとう。JAVAを使用してHDFSからローカルファイルシステムにファイルをコピーする
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();
}