如何在hadoop map-reduce作业中创建文件?

我搜索了网络,但我找到的只是一个声称可以完成的网站。 它没有说怎么样。

查看FileSystem的API: 单击我
有一种叫做“create()”的方法。

FileSystem fs = FileSystem.get(conf); Path path = new Path("/my/path/file") OutputStream os = fs.create(path) // write to os os.close()