nosql – HDFS如何放松POSIX

前端之家收集整理的这篇文章主要介绍了nosql – HDFS如何放松POSIX前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
从我所读到的,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.

猜你在找的NoSQL相关文章