你是在正确的轨道上!
row:column_family:column_qualifier:timestamp:value
注:
HBase
datamodel可以被看作是一个“多维地图”和每个单元值与时间戳(默认insertion_time)相关联的时间戳与每个单个值相关联,并且而不是整行(这使得几个很好的功能)!
在阅读时,默认情况下您将获得最新版本,除非您另行指定。默认情况下应该存储3 versions。 Hbase进行“合并读取”,它将返回每一行的最新单元格值。
请从您的HBase的壳试试这个(未发布之前真正的考验):
put ‘table_name’, ‘1’, ‘f:name’, ‘Ritesh’
put ‘table_name’, ‘1’, ‘f:surname’, ‘Rai’
put ‘table_name’, ‘1’, ‘f:name’, ‘RiteshKumar’
put ‘table_name’, ‘1’, ‘f:surname’, ‘Rai’
put ‘table_name’, ‘1’, ‘f:other’, ‘Some other stuff’
// Data on 'disk' (that might just be the memstore for now) will look like this:
// 1:f:name:1234567890:‘Ritesh’
// 1:f:surname:1234567891:‘Rai’
// 1:f:name:1234567892:‘RiteshKumar’
// 1:f:surname:1234567893:‘Rai’
// 1:f:other:1234567894:‘Some other stuff’
// Now try... And you will get ‘RiteshKumar’, ‘Rai’, ‘Some other stuff’
get ‘table_name’, ‘1’
// To get the previous versions of the data use the following:
get ‘table_name’, ‘1’, {COLUMN => ‘f’, VERSIONS => 2}
不要忘了看一看的schema design
的最佳实践是有可能得到以前在这种情况下的价值? –