有一个名为webtable的表,包含两行(com.cnn.www和com.example.www)和三个列族,分别命名为contents
, anchor
, 和people
。在这个例子中,对于第一行(com.cnn.www),锚包含两列(anchor:cssnsi.com
, anchor:my.look.ca
) ,内容包含一列(contents:html
)。此示例包含具有行键com.cnn.www的行的5个版本,以及具有行键com.example.www的行的一个版本。锚列族的限定符每个都包含外部站点,该外部站点链接到由行表示的站点,以及它在链接的锚中使用的文本。人列家族代表与该站点相关的人。
列名:按照惯例,列名由其列族前缀和限定符组成。例如,列content:html由列族内容和html限定符组成。冒号字符(:)从列族限定符中划定列族。
Row Key | Time Stamp | ColumnFamily contents | ColumnFamily anchor | ColumnFamily people |
---|---|---|---|---|
"com.cnn.www" |
t9 |
anchor:cnnsi.com = "CNN" | ||
"com.cnn.www" |
t8 |
anchor:my.look.ca = "CNN.com" | ||
"com.cnn.www" |
t6 |
contents:html = "<html>…" | ||
"com.cnn.www" |
t5 |
contents:html = "<html>…" | ||
"com.cnn.www" |
t3 |
contents:html = "<html>…" | ||
"com.example.www" |
t5 |
contents:html = "<html>…" |
people:author = "John Doe" |
这个表中空的单元不占用空间,或者实际上存在于HBase中。这就是HBase“稀疏”的原因。表格视图不是查看HBase中数据的唯一可能方法,甚至也不是最准确的方法。下面表示与多维地图相同的信息。这只是一个说明性的模型,可能不是严格准确的。
{
"com.cnn.www": {
contents: {
t6: contents:html: "<html>..."
t5: contents:html: "<html>..."
t3: contents:html: "<html>..."
}
anchor: {
t9: anchor:cnnsi.com = "CNN"
t8: anchor:my.look.ca = "CNN.com"
}
people: {}
}
"com.example.www": {
contents: {
t5: contents:html: "<html>..."
}
anchor: {}
people: {
t5: people:author: "John Doe"
}
}
}