MAPREDUCE服务 MRS-删除HDFS文件:代码样例

时间:2024-06-19 14:14:17

代码样例

如下是删除文件的代码片段,详细代码请参考com.huawei.bigdata.hdfs.examples中的HdfsMain类。

  /**
   * 删除文件
   *
   * @throws IOException
   */
  private void delete() throws IOException {
    Path beDeletedPath = new Path(DEST_PATH + File.separator + FILE_NAME);
    fSystem.deleteOnExit(beDeletedPath);
    System.out.println("succee to delete the file " + DEST_PATH
        + File.separator + FILE_NAME);
  }
support.huaweicloud.com/devg-mrs/mrs_06_0129.html