HBase 压缩算法设置及修改
Compression就是在用CPU换IO吞吐量/磁盘空间,如果没有什么特殊原因推荐针对Column Family设置compression,下面主要有三种算法: GZIP, LZO, Snappy,作者推荐使用Snappy,因为它有较好的Encoding/Decoding速度和可以接受的压缩率。
HBase comes with support for a number of compression algorithims that can be enabled at the column family level. Enabling compression is recommended unless you have a reason not to do so, for example, when using already compressed content, such as JPEG images. For every other use-case compression usually will yield an overall better performance, because the overhead of the CPU performing the compression and decompression is less than what is required to read more data from disk.
Available Codecs
You can choose from a fixed list of supported compression algorithms. They have different qualities when it comes to compression ratio, as well as CPU and installation requirements.
Table 11.1. Comparison between compression algorithms
| Algorithm | % remaining | Encoding | Decoding |
|---|---|---|---|
| GZIP | 13.4% | 21 MB/s | 118 MB/s |
| LZO | 20.5% | 135 MB/s | 410 MB/s |
| Zippy/Snappy | 22.2% | 172 MB/s | 409 MB/s |
Note that some of the algorithms have a better compression ration while others are faster for the encoding, and a lot faster during decoding. Depending on your use-case you can choose one that suits you best.
Enabling Compression
Enabling compression requires the installation of the JNI and native compression libraries (unless you only want to use the Java code based GZIP compression), as described above, and specifying the chosen algorithm in the column family schema.
One way to accomplish this is during the creation of the table. The possible values are listed in the section called “Column Families”:
- hbase(main):001:0> create 'testtable', { NAME => 'colfam1', COMPRESSION => 'GZ' }
- 0 row(s) in 1.1920 seconds
- hbase(main):012:0> describe 'testtable'
- DESCRIPTION ENABLED
- {NAME => 'testtable', FAMILIES => [{NAME => 'colfam1', true
- BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '0', VERSIONS
- => '3', COMPRESSION => 'GZ', TTL => '2147483647', BLOCKSIZE
- => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}]}
- 1 row(s) in 0.0400 seconds
The describe shell command is used to read back the schema of the newly created table. You can see the compression is set to GZIP (using the shorter "GZ" value as required). Another option to enable - or change, or disable - the compression algorithm is using the alter command for existing tables:
- hbase(main):013:0> create 'testtable2', 'colfam1'
- 0 row(s) in 1.1920 seconds
- hbase(main):014:0> disable 'testtable2'
- 0 row(s) in 2.0650 seconds
- hbase(main):016:0> alter 'testtable2', { NAME => 'colfam1', COMPRESSION => 'GZ' }
- 0 row(s) in 0.2190 seconds
- hbase(main):017:0> enable 'testtable2'
- 0 row(s) in 2.0410 seconds
Note how the table was first disabled. This is necessary to perform the alteration of the column family definition. The final enable command brings the table back online.
HBase 压缩算法设置及修改的更多相关文章
- xampp默认mysql密码设置,修改mysql的默认空密码
xampp默认mysql密码设置,修改mysql的默认空密码 分类: xampp2012-09-12 11:24 30264人阅读 评论(5) 收藏 举报 mysqlphpmyadminauthent ...
- 【转】eclipse android 设置及修改生成apk的签名文件 -- custom debug keystore
原文网址:http://hold-on.iteye.com/blog/2064642 android eclipse 设置及修改生成apk的签名文件 1. 问题: 平时在使用eclipse进行andr ...
- Fiddler中设置断点修改Request和Response
Fiddler中设置断点修改Request Fiddler最强大的功能莫过于设置断点了,设置好断点后,你可以修改httpRequest 的任何信息包括host, cookie或者表单中的数据.设置断点 ...
- AndroidStudio制作“我”的界面,设置,修改密码,设置密保和找回密码
前言 大家好,给大家带来AndroidStudio制作"我"的界面,设置,修改密码,设置密保和找回密码的概述,希望你们喜欢 学习目标 掌握修改密码功能的开发,和实现用户密码的修改: ...
- Oracle密码过期设置和修改密码问题
Oracle密码过期设置和修改密码问题 学习了:https://jingyan.baidu.com/article/ce09321b5608612bff858ff3.html sqlplus / as ...
- paip.手机时间设置不能修改灰色禁用 解决大法
paip.手机时间设置不能修改灰色禁用 解决大法 作者Attilax , EMAIL:1466519819@qq.com 来源:attilax的专栏 地址:http://blog.csdn.net ...
- Linux:grub密码设置与修改
grub密码设置与修改 默认GRUB启动参数可以的进入单用户模式从而修改root密码,如果想要给GRUB菜单设置密码,可以修改/etc/grub.conf文件 (/boot/grub/grub.con ...
- Fiddler设置断点修改Request和Response【转】
Fiddler设置断点修改Request和Response 设置断点的两种方式:工具栏和命令 1.工具栏:Rules -> Automatic Breakpoints(automatic [ɔː ...
- 简化MVVM属性设置和修改 - .NET CORE(C#) WPF开发
微信公众号:Dotnet9,网站:Dotnet9,问题或建议:请网站留言, 如果对您有所帮助:欢迎赞赏. 简化MVVM属性设置和修改 - .NET CORE(C#) WPF开发 阅读导航 常用类属性设 ...
随机推荐
- 自定义Log模块
BuildConfig.DEBUG默认为true,在为app打上SignedKeyStore之后就为false, // Log控制器 MyLoger.openDebutLog(true); MyLog ...
- 安装less
1.下载安装iterm(http://www.iterm2.com/) 2.打开iterm,输入 sudo npm install -g less
- Python中如何读取xml的数据
<?xml version="1.0" encoding="utf-8" ?> - <catalog> <maxid>4&l ...
- 前端模板artTemplate,handlerbars的使用心得
写前端页面肯定离不开模板渲染,就近期项目中用的两个前端模板做一些使用总结,顺便复习一下,也方便后面温故. 1,artTemplate 优点: 1,一般web端用得较多,执行速度通常是 Mustache ...
- jquery学习笔记----元素筛选
1.eq() 筛选指定索引号的元素2.first() 筛选出第一个匹配的元素3.last() 筛选出最后一个匹配的元素4.hasClass() 检查匹配的元素是否含有指定的类5.filter() 筛 ...
- MongoDB基本命令
1. 启动和停止MongoDB: 执行mongod命令启动MongoDB服务器.mongod有很多可配置的选项,我们通过mongod --help可以查看所有选项,这里仅介绍一些主要选项: - ...
- Ultra-QuickSort【归并排序典型题目】
Ultra-QuickSort Time Limit: 7000MS Memory Limit: 65536K Total Submissions: 34470 Accepted: 12382 ...
- Fallout4 Creation Kit
按住SHIFT是旋转视角,按住鼠标中键 E是移动物品 双击W是旋转物品 数字键2 是调整物品大小
- .NET Nancy 详解(四) Self Host
Self Host 使得Nancy 能够在任意application 中启动,无论是console 还是windows service.这期我们使用的版本是Nancy v0.4.0. Demo 首先看 ...
- go sample - mongodb
简单的mongodb 操作 package mainimport ( "fmt" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2 ...