HDFS和截断文件 [英] HDFS and truncating file

查看:93
本文介绍了HDFS和截断文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HDFS文档声明文件只是可追加的。因此,您只能将数据附加到文件末尾,并且不能更改以前写入的数据。



但是API有截断方法,您可以在其中指定新的文件大小必须小于当前的大小。一般来说,我可以使用这种方法来更改文件内容。



谁可以解释这种差异?这个方法如何工作?

解决方案

您可以检查 link


HDFS documentation declares that files are just appendable. So you can only append data to the end of file and can't change previously written data.

But API has truncate method where you can specify а new size of file which must be less then its current size. Generally speaking I can use this method to change file content.

Who can explain this discrepancy? How does this method work inside?

解决方案

Could you please check this link ?

这篇关于HDFS和截断文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆