对 Hbase 的困惑 "region"
Confusion about Hbase's "region"
从Hbase的书中我注意到有一个重要的概念叫做"region"。
如:
Currently, flushing and compactions are done on a per Region basis so
if one column family is carrying the bulk of the data bringing on
flushes, the adjacent families will also be flushed even though the
amount of data they carry is small
Around 50-100 regions is a good number for a table with 1 or 2 column
families. Remember that a region is a contiguous segment of a column
family
好像有一个"region"属于一个或多个colume family?
我对 "region" 到底是什么感到困惑
如果您检查 HBase 数据是如何存储在 hdfs 上的:
user@host:~$ hdfs dfs -du -h /hbase/data/default/traffic
284 /hbase/data/default/traffic/.tabledesc
0 /hbase/data/default/traffic/.tmp
382.8 M /hbase/data/default/traffic/08ec69a079692f404c8d2949066f569b
124.1 M /hbase/data/default/traffic/0d986ba711e8dee5458090f98cccd446
110.9 M /hbase/data/default/traffic/0ea846c84192e3a744a4de907895351e
271.0 M /hbase/data/default/traffic/0f1682446b5331bdebbdee64b5a20c4f
198.3 M /hbase/data/default/traffic/0f349f966564ae0e87e927cc079aec86
...
您会看到许多文件夹的名称经过哈希处理 - 每个文件夹都包含区域数据。
在每个区域内,您将看到按列族分组的文件夹:
user@host:~$ hdfs dfs -du -h /hbase/data/default/traffic/f51ec9f3170e9abaf44537e96ebf8560
163 /hbase/data/default/traffic/f51ec9f3170e9abaf44537e96ebf8560/.regioninfo
243.8 M /hbase/data/default/traffic/f51ec9f3170e9abaf44537e96ebf8560/r
124.2 M /hbase/data/default/traffic/f51ec9f3170e9abaf44537e96ebf8560/z
在我的例子中,我有两个名称为 r
和 z
的列族。在列族文件夹中,您会找到 hfiles。
回答您的问题:区域是 table 的一部分,具有特定的调音域。它包含 table 的所有列族。如果您编辑 table 架构并添加新的列族,则此 table 的所有区域都将更新。
从Hbase的书中我注意到有一个重要的概念叫做"region"。
如:
Currently, flushing and compactions are done on a per Region basis so if one column family is carrying the bulk of the data bringing on flushes, the adjacent families will also be flushed even though the amount of data they carry is small
Around 50-100 regions is a good number for a table with 1 or 2 column families. Remember that a region is a contiguous segment of a column family
好像有一个"region"属于一个或多个colume family?
我对 "region" 到底是什么感到困惑
如果您检查 HBase 数据是如何存储在 hdfs 上的:
user@host:~$ hdfs dfs -du -h /hbase/data/default/traffic
284 /hbase/data/default/traffic/.tabledesc
0 /hbase/data/default/traffic/.tmp
382.8 M /hbase/data/default/traffic/08ec69a079692f404c8d2949066f569b
124.1 M /hbase/data/default/traffic/0d986ba711e8dee5458090f98cccd446
110.9 M /hbase/data/default/traffic/0ea846c84192e3a744a4de907895351e
271.0 M /hbase/data/default/traffic/0f1682446b5331bdebbdee64b5a20c4f
198.3 M /hbase/data/default/traffic/0f349f966564ae0e87e927cc079aec86
...
您会看到许多文件夹的名称经过哈希处理 - 每个文件夹都包含区域数据。
在每个区域内,您将看到按列族分组的文件夹:
user@host:~$ hdfs dfs -du -h /hbase/data/default/traffic/f51ec9f3170e9abaf44537e96ebf8560
163 /hbase/data/default/traffic/f51ec9f3170e9abaf44537e96ebf8560/.regioninfo
243.8 M /hbase/data/default/traffic/f51ec9f3170e9abaf44537e96ebf8560/r
124.2 M /hbase/data/default/traffic/f51ec9f3170e9abaf44537e96ebf8560/z
在我的例子中,我有两个名称为 r
和 z
的列族。在列族文件夹中,您会找到 hfiles。
回答您的问题:区域是 table 的一部分,具有特定的调音域。它包含 table 的所有列族。如果您编辑 table 架构并添加新的列族,则此 table 的所有区域都将更新。