20,808
社区成员
发帖
与我相关
我的任务
分享
for (FileStatus file : outfiles) {
if (file.isDir() == false && file.getPath().toString().indexOf("part-r-") >= 0) {
String mvinpath = file.getPath().toString();
String mvoutpath = _myfs.myConf.get("MoveOutPutPath") + "_"
+ file.getPath().toString().substring(file.getPath().toString().indexOf("part-r-") + 7);
new MoveFile(mvinpath, mvoutpath, _myfs.getMyConf());
System.out.println(mvinpath);
System.out.println(mvoutpath);
}
}
我每次都会把part-r-文件移走,并重命名,然后删除原来那个OUTPUT目录