标签:new color path sys bsp class dem directory tin
// 判断output文件夹是否存在,如果存在则删除 Path outPath = new Path("hdfs://192.168.9.13:8020/meanwhileFind");// 输出路径 FileSystem fs = outPath.getFileSystem(conf);// 根据输出路径找到文件,参数为配置文件 if (fs.exists(outPath)) { fs.delete(outPath); // fs.delete(outPath, true);true的意思是,就算output有东西,也一带删除,默认为true } FileInputFormat.setInputPaths(job, new Path("hdfs://192.168.9.13:8020/gradeMarking")); FileOutputFormat.setOutputPath(job, outPath);
从代码上解决Output directory already exists错误,避免每次调试都要手动删除输出文件夹
标签:new color path sys bsp class dem directory tin
原文地址:http://www.cnblogs.com/le-ping/p/7788947.html