ACID in HBase: Row Level Operations Explained. Plus Something New
Lars Hofhansl:
HBase employs a kind of MVCC. And HBase has no mixed read/write transactions. […] When a write transaction (a set of puts or deletes) starts it retrieves the next highest transaction number. In HBase this is called a WriteNumber. When a read transaction (a Scan or Get) starts it retrieves the transaction number of the last committed transaction. HBase calls this the ReadPoint.
Understanding the behavior of read and write operations in HBase is definitely useful. Learning that an upcoming HBase version will support atomic multi operations (HBASE-3584) and even multi-row local transactions (HBASE-5229) is priceless.
For HBase atomic multi-operations:
Delete d = new Delete(ROW);
Put p = new Put(ROW);
...
AtomicRowMutation arm = new AtomicRowMutation(ROW);
arm.add(p);
arm.add(d);
myHtable.mutateAtomically(arm);
and HBase multi-row local transactions is implemented as mutateRowsWithLocks method in HRegion and can be used by coprocessors only (no client API).
Original title and link: ACID in HBase: Row Level Operations Explained. Plus Something New (©myNoSQL)
via: http://hadoop-hbase.blogspot.com/2012/03/acid-in-hbase.html?spref=tw