我想看一下路径,然后判断文件是否存在?你妹的,真麻烦?
找个半天,用import org.apache.hadoop.io.MapFile;这个类,很恶心,自己查。
知道肯定跟Configuration,查了半天用这个:
String name =context.getConfiguration().get("mapred.output.dir");
顺便判断个文件存在:
FileSystem fs = FileSystem.newInstance(conf) ;
Path path = new Path("/user/zhoujie/log2session/log2session-bydomain-liumingjian/mso/"+test+key.toString().substring(key.toString().lastIndexOf(":")+1));
if (fs.exists(path))
test=test+10000;
DistributedFileSystem这个类也行。