Wednesday, May 20, 2015

Versioning in hbase

Create table

create 'htab48','colfam1'

htab48 = table name
colfam1 = column name

put 'htab48', 'row1', 'colfam1:mapreduce','mapreduce  is ment for parallel processing'
put 'htab48', 'row1', 'colfam1:hdfs','hdfs is ment for storage'


The beauty of hbase is it is versioned datastore 

put 'htab48', 'row1', 'colfam1:hdfs','hdfs1 is ment for storage'

but it is not not to work first disable table then give version to column

disable 'htab48'

alter 'htab48', NAME=>'colfam1',VERSIONS=>3

put 'htab48', 'row1', 'colfam1:hdfs1','hdfs1 is ment for storage'
put 'htab48', 'row1', 'colfam1:hdfs2','hdfs1 is ment for storage'

get 'htab48' ,'row1',{COLUMN=>'colfam1:hdfs',VERSIONS=>3}


COLUMN                                                                 CELL
colfam1:hdfs                          timestamp=1234567876543 , value=hdfs is ment for storage
colfam1:hdfs                          timestamp=1234467876543 , value=hdfs1 is ment for storage

No comments:

Post a Comment