专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > 数据库

hfile为何会把偏移信息放在hfile的尾部

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
hfile为什么会把偏移信息放在hfile的尾部?

今天会上大家争论了hfile为什么会把偏移信息放在hfile的尾部?

quora上有个解释如下:

If it's at the end, you can efficiently compute the contents of the index while writing the file out. This index often has a lot of byte offsets in it, and figuring out what these offsets are can be done easily as you write the file.

Having the index at the end doesn't make reading it inefficient: you can read the very end of the file to find out where the index starts, and then read the index. This is about the same as reading the index out of the start of the file. 

如果再做compression,figure out offset就更方便了。memstore flash时,keyvalue compress完后就写hfile比compress完暂留在内存并等所有的keyvalue计算完后才写hfile能充分利用cpu、内存和磁盘io。

 

欢迎指正。

友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: