HBase的start key和end key疑惑

轉載請標明來源:http://blackwing.iteye.com/blog/1791848

之前把一個region人工拆分成多個region,每個region的起始key是具體某個row,但後來發現,hbase是把byte[0]作爲一個表的起始key。官方文檔這樣描述:
http://hbase.apache.org/book.html#arch.catalog
[quote]Notes on HRegionInfo: the empty key is used to denote table start and table end. A region with an empty start key is the first region in a table. If region has both an empty start and an empty end key, it's the only region in the table[/quote]

這樣就能解釋,爲什麼獲得某個表的其實key時,看到的是第一個region的start key是空,最後一個region的end key也是空了。
Pair<byte[][], byte[][]> keys = table.getStartEndKeys();


這樣自己寫代碼操作region分切時,需要注意。
發佈了62 篇原創文章 · 獲贊 1 · 訪問量 7324
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章