之前把一個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分切時,需要注意。