hbase中的資料儲存架構與格式 (1)
(問題)
hbase中資料如何儲存的?
(1) 甚麼是Region, RegionServer ,Store, StoreFile以及HFile?
(方法)
以下的文字是摘錄自 "HBase: The Definitive Guide"的文字和圖,
敘述hbase(0.92版)如何透過RegionSever進行資料儲存:
The HRegionServer opens the region and creates a corresponding HRegion object. When
the HRegion is opened it sets up a Store instance for each HColumnFamily for every table
as defined by the user beforehand. Each Store instance can, in turn, have one or more
StoreFile instances, which are lightweight wrappers around the actual storage file
called HFile. A Store also has a MemStore, and the HRegionServer a shared HLog in-stance.
簡單來說, RegionServer (HRegionServer)將開啟Region (HRegion)物件,
Region (HRegion) 則會根據Column Family的數量開啟Store,
每個Store都擁有一個MemStore (記憶體空間,包括寫入和讀取的快取)
並可以有多個StoreFile, StoreFile負責真正HFile的寫入.
HFile將透過HDFS的介面寫入HDFS中, 完成資料的儲存.
參考資料:
http://www.larsgeorge.com/2009/10/hbase-architecture-101-storage.html
HBase: The Definitive Guide by Lars George (O'Reilly)
留言
張貼留言