Hadoop支持文件追加"append"

来源:互联网 发布:网络散布谣言罪 编辑:程序博客网 时间:2024/05/16 10:14
首先需要配置hdfs-site.xml文件:
     <property>
        <name>dfs.support.append</name>
        <value>true</value>

     </property>

默认dfs.support.append参数是false的

 
然后在mapreduce程序中可以如下实现文件的追加
FileSystem fs = FileSystem.get(URI.create(dst), conf);
FSDataOutputStream out = fs.append(new Path(dst));
 

具体支持文件追加的Hadoop版本信息如下:


原创粉丝点击