1.HBase原理与开发实例
Hbase是hadoop下的一个面向列存储的数据库
![](https://img.haomeiwen.com/i3862858/e9a3383c5232028d.png)
读写示意图
![](https://img.haomeiwen.com/i3862858/dd5db131a7ccf617.png)
在hadoop2下安装hbase0.98.23并成功启动
![](https://img.haomeiwen.com/i3862858/fdbdf82dcbd630ee.png)
进入hbase shell
![](https://img.haomeiwen.com/i3862858/6b8249e5d7343f08.png)
编写put程序在hbase表中插入数据
![](https://img.haomeiwen.com/i3862858/c0732aeb8f06c6d7.png)
![](https://img.haomeiwen.com/i3862858/7a96473df44c13e1.png)
编写get和scan程序查询数据
![](https://img.haomeiwen.com/i3862858/5ce4e4117af19582.png)
![](https://img.haomeiwen.com/i3862858/9d4775d267c23313.png)
2.MapReduce开发实例中
- 定义partitioner来告诉MapReduce framework如何将见到的键和值送到哪个Reducer
- 定义key comparator来告诉MapReduce framework如何排序键
- 定义grouping comparator来告诉MapReduce framework如何控制“组合”键值在一起
![](https://img.haomeiwen.com/i3862858/e39cc3e554a95fba.png)
网友评论