hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinod V <vinod...@gmail.com>
Subject Using RowMutations to replace all columns of a row
Date Sat, 25 May 2013 23:53:48 GMT
I have a HBase table with a single column family and columns are added to
it over time. These columns are named as the timestamp they were created,
so unless I query the row I do not know what all columns it has.

Now given a row, I want to _atomically_ remove all the existing columns of
this column family and add a new set of columns and values.

So I thought of using RowMutations like:

RowMutations mutations = new RowMutations(row);

//delete the column family
Delete delete = new Delete(row);

//add new columns
Put put = new Put(row);
put.add(cf, col1, v1);
put.add(cf, col2, v2);

//delete column family and add new columns to same family


But what this code ends up doing is just deleting the column family, it
does not add the new columns. Is this behaviour expected?

If so, then how can I achieve my goal of _atomically_ replacing all columns
of a column family with a new set of columns?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message