MapReduce服务 MRS-规则:HDFS创建文件

时间:2023-11-01 16:19:45

HDFS创建文件

通过"FileSystem.mkdirs(Path f)"可在HDFS上创建文件夹,其中f为文件夹的完整路径。

正确示例:

public class CreateDir {     public static void main(String[] args) throws Exception{         Configuration conf=new Configuration();         FileSystem hdfs=FileSystem.get(conf);                Path dfs=new Path("/TestDir");                hdfs.mkdirs(dfs);      }  } 
support.huaweicloud.com/devg3-mrs/mrs_07_450021.html