21.物理视图
尽管概念层面的表可能被看成行的稀疏集合,他们是通过列簇物理地存储。一个新的列修饰符(列簇:列修饰符)可以在任何时候被加入到一个已存在的列簇当中。
表5. 列簇 anchor
Row Key | Time Stamp | Column Family anchor |
---|---|---|
"com.cnn.www" | t9 | anchor:cnnsi.com="CNN" |
"com.cnn.www" | t8 | anchor:my.look.ca="CNN.com" |
表6. 列簇 contents
Row Key | Time Stamp | Column Family anchor |
---|---|---|
"com.cnn.www" | t6 | contents:html="..." |
"com.cnn.www" | t5 | contents:html="..." |
"com.cnn.www" | t3 | contents:html="..." |
在概念视图中看到的空单元格(cell)没有被存储。因此,一个对列contents:html,时间戳为t8的值的请求将检索不到任何值。同样,一个对列anchor:my.look.ca,时间戳为t9的请求也不会有值返回。然后,如果没有提供时间戳,将返回指定列的最新的值。给出多个版本,也是最近的最先找到,因为时间戳是倒序存储的。因此,如果对行com.cnn.www所有列的值进行请求,如果没有指定时间戳,则请求的值为:时间戳为t6,列为contents:html的值,时间戳为t9,列为anchor:cnnsi.com的值,时间戳为t8,列为anchor:my.look.ca的值。(t5,t3没有返回,是因为返回了最近的t6)。
想要更多关于Apache HBase内部数据是如何存储的信息,请看regions.arch。