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 Pavel Nuzhdin <pn...@gmail.com> on 2010/11/07 17:50:30 UTC
How to use copyMerge ?
Hello,
I want to merge all files from output to one text file.
I looked into
http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/fs/FileUtil.html
and
found copyMerge method.
I trying to use it like that:
FileSystem fs = FileSystem.get(conf);
Path tmpout_path = new Path(output_dir.toString() + "-tmp");
if(!FileUtil.copyMerge(fs, output_dir, fs, tmpout_path, false,
conf, null))
throw new IllegalStateException("Can't merge files from "
+ output_dir.toString()
+ " to " + tmpout_path.toString());
But it always fail.
P.S. output_dir - directory, I check this by isDirectory method.
Thanks.