// 判断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);

 

相关文章:

  • 2021-12-28
  • 2022-03-06
  • 2022-02-13
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
猜你喜欢
  • 2022-01-22
  • 2022-12-23
  • 2021-07-26
  • 2021-11-14
  • 2022-03-02
相关资源
相似解决方案