Bin YANG wrote:
Hi,
I am confused with some thing in HBase.
1. All data is stored in HDFS. Data is served to clients by
HRegionServers. Is it allowed that the tablet T is on machine A, and
served by a HRegionServers running on machine B?
Yes, tablet T may be hosted in HDFS on machine A but the regionserver
running on B may be serving it (A TODO is figuring a way of having the
master assign regions to regionservers in a manner consious of where the
data physically resides).
What information does the META table maintain?
The map from T to the physical address in machine A,
or
the map from T to which machine serves it, for example, machine B?
Check it out for yourself by browsing to the master's web UI at port
60010 and selecting the hql link or by running the hql command-line
shell. Here is a selection on the .META. table (Apologies if formatting
doesn't come across):
...
+-------------------------+-------------------------+-------------------------+
| enwiki,zjfpVz2fDfaySHbp_| info:regioninfo | regionname:
enwiki,zjfpV|
| jQ8_-==,8820829378360332| |
z2fDfaySHbp_jQ8_-==,8820|
| 654 | | 829378360332654,
startKe|
| | | y:
<zjfpVz2fDfaySHbp_jQ8|
| | | _-==>, tableDesc:
{name:|
| | | enwiki, families:
{anch|
| | | or:={name: anchor,
max v|
| | | ersions: 3,
compression:|
| | | NONE, in memory:
false,|
| | | max length:
2147483647,|
| | | bloom filter:
none}, mi|
| | | sc:={name: misc,
max ver|
| | | sions: 3,
compression: N|
| | | ONE, in memory:
false, m|
| | | ax length:
2147483647, b|
| | | loom filter:
none}, page|
| | | :={name: page, max
versi|
| | | ons: 3,
compression: NON|
| | | E, in memory:
false, max|
| | | length:
2147483647, blo|
| | | om filter:
none}}} |
+-------------------------+-------------------------+-------------------------+
| enwiki,zjfpVz2fDfaySHbp_| info:server |
208.76.44.142:60020 |
| jQ8_-==,8820829378360332|
| |
| 654 |
| |
+-------------------------+-------------------------+-------------------------+
| enwiki,zjfpVz2fDfaySHbp_| info:serverstartcode |
4374181357123093608 |
| jQ8_-==,8820829378360332|
| |
| 654 |
| |
+-------------------------+-------------------------+-------------------------+
The meta table has a row per region. The sample above is for region
'enwiki,zjfpVz2fDfaySHbp_Q8_-==,8820829378360332654', a region from the
table named 'enwiki' whose first key (encoded) is
zjfpVz2fDfaySHbp_Q8_-== and whose region id is 8820829378360332654.
There are three columns: regioninfo, server, and serverstartcode.
Sometimes there will be other column's present listing the region
daughters after a split.
2. Similar to Bigtable paper, what does the tablet location(section
5.1) stand for? Is it the map from the tablet id to physical address,
or
the map from the tablet to which machine serves it?
The above exposition should help clarify how the serverside is keeping
up tablet locations. One key difference from seciton 5.1 is that there
is no chubby-equivalent in hbase system (currently) and so the root
location, rather than a file in chubby, instead is kept in a special
'-ROOT-' table.
On the client-side, it keeps maps of table regions and server
locations. See the data members at the head of HConnectionManager and
head of HTable.
St.Ack
thanks