HFile index

HFile index, which is proportional to the total number of Data Blocks. The total amount of memory needed to hold the index can be estimated as (56+AvgKeySize)*NumBlocks.

HFile的索引记录数量是与HFile所包含的Data Block数目成正比的。整个索引所需要的内存空间大约是(56+AvgKeySize)*NumBlocks。

Suggestions on performance optimization
Minimum block size. We recommend a setting of minimum block size between 8KB to 1MB for general usage. Larger block size is preferred if files are primarily for sequential access. However, it would lead to inefficient random access (because there are more data to decompress). Smaller blocks are good for random access, but require more memory to hold the block index, and may be slower to create (because we must flush the compressor stream at the conclusion of each data block, which leads to an FS I/O flush). Further, due to the internal caching in Compression codec, the smallest possible block size would be around 20KB-30KB.

在一般的使用场景中推荐将HBase Data Block的大小设置为8KB到1MB之间。

如果顺序访问的场景居多,可以将Data Block的大小调大,但是这会导致HBase随机访问效率低下,因为需要对更多的数据进行解压。

小一点的Data Block非常有利于HBase的随机访问,但是需要消耗更多的内存来维护索引记录;在创建这些Data Block的时候也会比较慢,因为我们需要在每一个Data Block被写满之后对其进行Flush,这会导致低层HDFS的I/O Flush。而且,由于一些压缩库在使用时内部会包含一些Cache,所以Data Block的大小最好控制在20KB到30KB之间。

HFile Format

File is made of data blocks followed by meta data blocks (if any), a fileinfo block, data block index, meta data block index, and a fixed size trailer which records the offsets at which file changes content type.

 <data blocks><meta blocks><fileinfo><data index><meta index><trailer>
 

Each block has a bit of magic at its start. Block are comprised of key/values. In data blocks, they are both byte arrays. Metadata blocks are a String key and a byte array value. An empty file looks like this:

 <fileinfo><trailer>
 

That is, there are not data nor meta blocks present.

HBase HFile的更多相关文章

  1. hbase Hfile处理原因

    Hile 内部的数据是按key排序好的,但Hfile之间数据并不能保证key的排序,也就是说对于新生成的Hfile,其内部的key并不都比老的Hfile的大,因此每次检索时,都需要在所有的Hfile中 ...

  2. HBase工具:如何查看HBase的HFile

    root@root:~/Desktop/sourceCodes/hbase-2.1.1/bin# ./hbase Usage: hbase [<options>] <command& ...

  3. Hadoop生态圈-HBase的HFile创建方式

    Hadoop生态圈-HBase的HFile创建方式 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 废话不多说,直接上代码,想说的话都在代码的注释里面. 一.环境准备 list cr ...

  4. 如何查看HBase的HFile

    记一个比较初级的笔记. ===流程=== 1. 创建一张表 2. 插入10条数据 3. 查看HFile ===操作=== 1.创建表 package api; import org.apache.ha ...

  5. HBase之HFile解析

    Sumary: Protobuf BinarySearch 本篇主要讲HFileV2的相关内容,包括HFile的构成.解析及怎么样从HFile中快速找到相关的KeyValue.基于Hbase 0.98 ...

  6. hbase 查看hfile文件

    emp表数据结构 hbase(main):098:0> scan 'emp' ROW COLUMN+CELL row1 column=mycf:depart, timestamp=1555846 ...

  7. HBase相关

    hadoop和hbase节点添加和单独重启 有时候hadoop或hbase集群运行时间久了后,某些节点就会失效,这个时候如果不想重启整个集群(这种情况在很多情况下已经不被允许),这个时候可以单独重启失 ...

  8. HBase学习笔记-高级(一)

    HBase1. hbase.id记录了集群的唯一标识:hbase.version记录了文件格式的版本号2. split和.corrupt目录在日志分裂过程中使用,以便保存一些中间结果和损坏的日志在表目 ...

  9. HBase(八): 表结构设计优化

    在 HBase(六): HBase体系结构剖析(上) 介绍过,Hbase创建表时,只需指定表名和至少一个列族,基于HBase表结构的设计优化主要是基于列族级别的属性配置,如下图: 目录: BLOOMF ...

随机推荐

  1. Java 8 Features – The ULTIMATE Guide--reference

    Now, it is time to gather all the major Java 8 features under one reference post for your reading pl ...

  2. jquery ajax 提交表单(file && input)

    用到的插件 jquery.js jquery.form.js[http://malsup.github.io/jquery.form.js] 提交页面 <form enctype="m ...

  3. 9.6noip模拟试题

    题目名称 盘子序列 四轮车 点名 提交文件 disk.pas/c/cpp car.pas/c/cpp rollcall.pas/c/cpp 输入文件 disk.in car.in rollcall.i ...

  4. 设计模式UML图

    1.简单工厂模式 2.工厂模式 工厂模式与简单工厂模式的不同在于,每个操作类都有自己的工厂,而且把逻辑判断交给了客户端,而简单工厂的逻辑判断在工厂类里边,当增加新的操作类时,简单工厂需要修改工厂类,而 ...

  5. Sublime Text3使用详解

    Sublime Text简介 Sublime Text - 性感的代码编辑器.程序员之必备神器 Sublime Text 是一个代码编辑器,也是HTML和散文先进的文本编辑器.Sublime Text ...

  6. js星级评分点击星级评论打分效果--收藏--转载

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. KMP算法总结

    kmp算法的T子字符串的下标的变化规律 大话数据结构这边书中的KMP算法的讲解跟最终的算法代码还是有很大的差别 java语言只会if判断语句,循环语句,但是这些语句以及可以包罗万象了,可以适用很多情况 ...

  8. My.Ioc 代码示例——谈一谈如何实现装饰器模式,兼谈如何扩展 My.Ioc

    装饰器模式体现了一种“组合优于继承”的思想.当我们要动态为对象增加新功能时,装饰器模式往往是我们的好帮手. 很多后期出现的 Ioc 容器都为装饰器模式提供了支持,比如说 Autofac.在 My.Io ...

  9. asp.net中过滤器的两种写法

    1.写在一个单独的类库中在web.config中进行配置 <httpModules> <add name="" type="类的全名称,程序集的名称&q ...

  10. MySQL where

    MySQL where 子句 我们知道从MySQL表中使用SQL SELECT 语句来读取数据. 如需有条件地从表中选取数据,可将 WHERE 子句添加到 SELECT 语句中. 语法 以下是SQL ...