hadoop写文件:
流程:
修正:
跟了源代码,发现往HDFS里创建文件的源代码:
public FSDataOutputStream create(Path f, Progressable progress) throws IOException {
return create(f, true,
getConf().getInt("io.file.buffer.size", 4096),
getDefaultReplication(),
getDefaultBlockSize(), progress);
}
注意第二个参数写死true,的时候可以覆盖而不会报错。