加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

nosql – HDFS如何放松POSIX

发布时间:2020-12-13 13:29:15 所属栏目:百科 来源:网络整理
导读:从我所读到的,HDFS很快,因为它放松了一些POSIX技术,但这是如何工作的?或者至少是哪些?我没有找到答案,因为在Google上,我发现有人将提问者重定向到一个大型网站! 解决方法 根据 Hadoop – The Definitive Guide(建议拿到这本书) After creating a file,it
从我所读到的,HDFS很快,因为它放松了一些POSIX技术,但这是如何工作的?或者至少是哪些?我没有找到答案,因为在Google上,我发现有人将提问者重定向到一个大型网站!

解决方法

根据 Hadoop – The Definitive Guide(建议拿到这本书)

After creating a file,it is visible in the filesystem namespace,as expected:

A coherency model for a filesystem describes the data visibility of reads and writes for a file. HDFS trades off some POSIX requirements for performance,so some operations may behave differently than you expect them to.

However,any content written to the file is not guaranteed to be visible,even if the stream is flushed. So the file appears to have a length of zero:

Once more than a block’s worth of data has been written,the first block will be visible to new readers. This is true of subsequent blocks,too: it is always the current block being written that is not visible to other readers.

HDFS provides a method for forcing all buffers to be synchronized to the datanodes via the sync() method on FSDataOutputStream. After a successful return from sync(),HDFS guarantees that the data written up to that point in the file is persisted and visible
to all new readers:

另一件事是

There are three types of permission: the read permission (r),the write permission ( w),and the execute permission (x). The read permission is required to read files or list the contents of a directory. The write permission is required to write a file,or for a directory,to create or delete files or directories in it. The execute permission is ignored for a file since you can’t execute a file on HDFS (unlike POSIX),and for a directory it is required to access its children.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读