hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hangartner <hangart...@strands.com>
Subject HBase transactions model question
Date Sat, 19 Jul 2008 05:47:03 GMT
Hi,

This is a question about the HBase transaction model.

Suppose I have a table with two columns "c1" and "c2".  Now assume for  
each timestamp in each row, I have a entry in each column.  That is,  
assume the table is ALWAYS written such that it is "dense" (e.g. a  
complete relation) rather than sparse (e.g. a partial relation) using  
the transaction semantics:

     HTable table = new HTable(conf, new Text("test"));
     static final Text rowId = new Text("row_num");
     static final Text col1Id = new Text("c1");
     static final Text col2Id = new Text("c2");

     long lockid = table.startUpdate(rowId);

     // always write all columns in a row
     table.put( lockid, col1Id, val );
     table.put( lockid, col2Id, val );

     table.commit( lockid, timestamp );

Also assume that  the two columns are read as something like:

     byte[][] c1Vals = table.get( rowId, col1Id, versions );
     byte[][] c2Vals = table.get( rowId, col2Id, versions );


Is it guaranteed that for each index value i,  c1Vals[i][] and  
c2Vals[i][] are the two column entries originally written with the  
same timestamp?

Also, is something like:

     byte[][] c1Vals = table.get( rowId, col1Id, MAX_VALUE );

sufficient to guarantee all versions are returned in the "get"  
operations?

Thanks,
Rick



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