VCNC / haeinsa

Haeinsa is linearly scalable multi-row, multi-table transaction library for HBase
Apache License 2.0
158 stars 42 forks source link

How can i use Transaction Operation on Hbase more detail with Haeinsa?? #32

Closed seriousmith closed 10 years ago

seriousmith commented 10 years ago

I was read some of your useage guide on github. (obviously, all of em) But i really curious about How this system running in HBase more specifically. For example, origin HBase executes its Put operation like that.

" hbase(main):001:0> put 'table', 'row', 'column family', 'value' "

But How can i use Haeinsa's transaction operation such 'terminal' environment like above? Maybe seems it like below?

" hbase(main):001:0> HaeinsaTx 'table1', 'row1', 'column family1', 'value1', 'table2', 'row2', 'column family2', 'value2' "

I really curious about it.

THANKS.

PLUS.

if i wanna use PUT operation with Haeinsa. Can i use it like that? " hbase(main):001:0> HaeinsaPut 'table', 'row', 'column family', 'value' "

eincs commented 10 years ago

HBase operations, such as Get, Scan, Put, Delete and so on, are native HBase operaitons. These are executable with HBase shell interface.

But Haeinsa operations, such as HaeinsaGet, HaeinsaPut, HaeinsaDelete, HaeinsaIntraScan, HaeinsaScan, are not executable via HBase shell. Executing Haeinsa operations with terminal interface is not yet provided.

For now, only way to executing Haeinsa operaiton is programatically with java codes.

seriousmith commented 10 years ago

Thanks, I see. Then if i wanna execute transaction with 2 read operation & 3 write operation, i type them in java codes and put them all into eclips (like) with HBase source code, and execute them?

eincs commented 10 years ago

Yes. And source codes of Haeina also should be included. More common way is: add HBase and Haeinsa jar files into your project. This can be done by put Haeinsa jar files and it's dependencies into classpath of your project, or if you are using maven, just add Haeinsa dependency in to your pom.xml file. See: https://github.com/VCNC/haeinsa/wiki/How-to-Use

After that, you can use Haeinsa APIs in your java codes as our wiki described: https://github.com/VCNC/haeinsa/wiki/API-Usage

seriousmith commented 10 years ago

What a great. Thanks. There is any critical error when you using it for business purpose??

PLUS. Read-Only Transactions are executable only when 'State' are 'STABLE' ?? or is it possible when 'PREWRITTEN' or 'COMMITTED' state??

eincs commented 10 years ago

We are using Haeinsa in our application more than an year, and it has been processing many transactions. There was no critical error in our application, but there can be a problem when you use Haeinsa in some special cases. See 'Important information' section to see about limitations of Haeinsa: https://github.com/VCNC/haeinsa/wiki/How-to-Use#important-information

And, You are right. Read-only transaction are executable when state of row is STABLE. When attempting to read row which is in unstable state, Haeinsa throws ConflictException. But row which is in unstable state, such as PREWRITTEN or COMMITTED, exists only when transaction is being committed. This period can be very short if transaction is not too big. Thus, in our case, rate of conflict is quite low: https://github.com/VCNC/haeinsa/wiki/Performance#conflict-rates

seriousmith commented 10 years ago

WOW You're already using it for your business. very interesting. Well, I have another question. For example, when i read an Row on client-memory, it's state was 'STABLE' BUT when it want to Commit(), the Row's state are 'PREWRITTEN'. Then, This Read-Only Transaction is going to be Aborted? or Committed?
Thanks for your reply and links you gave me. They're absolutely helpful and well written.

SMITH.

eincs commented 10 years ago

If lock modified since read operation executed, the transaction aborts. It is described on our slide: https://speakerdeck.com/vcnc/haeinsa-overview-hbase-transaction-library?slide=55