1.写入流程

1.从zookeeper上获取meta地址
2.在meta里面获取数据的regionserver和region
3.获取地址后,在那个region里面获取想要的结果
4.先从memstore里面读,没有的话到blockcache里面读,再没有到hfile里面读,读到之后写入blockcache以便下次读取
2.读取流程

1.zookeeper中获取meta位置
2.从meta中获取写入到的regionserver位置
3.写入HLog,写入memstore ,最后通过flush操作刷入HFile
4.storefile里面的文件不断增多,要发生合并操作,生成一个大的storefile
5.storefile不断增大
6.region中最大的storefile增大到一定程度,发生split操作,region分成两个region然后由master分配到新的regionserver上
2.1memstore发生flush操作的情况
1.memstore的总内存量超过40%,发生flush操作,降低到35%为止
2.memstore单个的内存超过128M时候,发生flush操作
3.HLog的数量到达上限,默认是24个的时候
4.api手动操作
5.正常关闭regionserver的时候
6.regionserver发生故障,region迁移到其他regionserver,region数据恢复的时候
网友评论