HBase整体架构图
Hbase Table的基本单位是Region,一个Table对应多个Region,Table层级关系如下:
Table (HBase table)
Region (Regions for the table)
Store (Store per ColumnFamily for each Region for the table)
MemStore (MemStore for each Store for each Region for the table)
StoreFile (StoreFiles for each Store for each Region for the table)
Block (Blocks within a StoreFile within a Store for each Region for the table)
Region
每台RegionServer服务器中包含多个Region和一个Hlog(WAL),每个Region中包括多个Store
Store
一个Store中包含一个MemStore和多个StoreFile(HFile),每个HStore对应了Table中的一个column family的存储
MemStore
MemStore在内存中维护着对Store的修改日志,日志是KeyValue结构的。一旦MemStore被触发flush操作,当前的MemStore被标记为SnapShot,与此同时
Hbase创建新的MemStore并继续处理修改操作,直到标记为SnapShot的MemStore被通知已经成功刷写到StoreFile,则销毁该MemStore
StoreFile (HFile)
表数据真正存储的地方
Blocks
StoreFile由多个Block组成,BlockSize是根据每个ColumnFamily级别配置的,在StoreFiles中,压缩也是基于Block级别
查看HFile
使用HFile工具查看StoreFile(HFile)(版本:0.98.6+cdh5.2.1)
hbase org.apache.hadoop.hbase.io.hfile.HFile -v -f /hbase/data/default/s_table1/1744a33060309b4aaecfca1639444411/fm1/97f63077d177429497551fbc22e4be75