2.10.12

HAcid: multi-row transactions in HBase

HAcid is a client library for HBase applications to enable the support for multi-row ACID transactions in HBase. The isolation level of these transactions is Snapshot Isolation, but Serializability is currently supported  as an unstable feature.

HAcid open-source repo at bitbucket.org 


This is the end result of my Master's Thesis at Aalto University. It was inspired by Google Percolator, but is still different in many ways. While Percolator uses locks for controlling concurrency, HAcid is lock-free because it employs optimistic concurrency control.

Using HAcid is straightforward:
import fi.aalto.hacid.*;

Configuration conf = HBaseConfiguration.create();
HAcidClient client = new HAcidClient(conf);

// To enable transactions, use this wrapper instead of HTable
HAcidTable table = new HAcidTable(conf, "mytable");

// Start a new transaction
HAcidTxn txn = new HAcidTxn(client);

// Use HAcidGet instead of HBase's Get
HAcidGet g = new HAcidGet(table, Bytes.toBytes("row1"));
g.addColumn(Bytes.toBytes("fam1"), Bytes.toBytes("qual1"));
Result r = txn.get(g);

// Use HAcidPut instead of Put
HAcidPut p = new HAcidPut(table, Bytes.toBytes("row1"));
p.add(Bytes.toBytes("fam1"), 
      Bytes.toBytes("qual1"), 
      Bytes.toBytes("value"));
txn.put(p);

// Commit the transaction
boolean outcome = txn.commit(); 
// true is "committed", false "aborted"

The algorithms in the HAcid library rely heavily on HBase's single-row transactions, in particular CheckAndPut. One of the tricks employed was explained on this blog already. My Thesis is a complete documentation of the system.

The license is Apache 2.0.
Feel free to comment, ask, fork at bitbucket, etc.

86 comments:

  1. I notice that there's no HTablePool support. What's the best option for pooling? Do I need to create my own HAcidTablePool using the Apache Commons Pool or something similar?

    ReplyDelete
    Replies
    1. Hi Mat, good to know that you are using HAcid.

      There is indeed no HTablePool support, I had not predicted that use.
      As far as I see, you don't need to implement something like HAcidTablePool. You can implement your own factory class through the interface HTableInterfaceFactory. See this book chapter http://my.safaribooksonline.com/book/databases/database-design/9781449314682/4dot-client-api-advanced-features/id3591501

      You also need to implement the interface HTableInterface, for instance extending or modifying HAcidTable. In fact, HAcidTable is a thin wrapper over HTable. https://bitbucket.org/staltz/hacid/src/62c4589532cee23fc4a088f197656e28774bcef9/src/fi/aalto/hacid/HAcidTable.java?at=default

      The book chapter seems like a good resource to implement this. Let me know if you run into problems.

      Delete
  2. Implementing this is proving more awkward than it should be. I could for example just modify your code and put this Lombok annotation on htable in the HAcidTable class and make HAcidTable implement HTableInterface but I'd really rather just use your code as is. Would you be able to make this change to make it easier to use your code?

    @Delegate(types=HTableInterface.class)
    protected HTable htable;

    http://projectlombok.org/features/Delegate.html

    (If you prefer to not use Lombok in your source for other users, you can use de-Lombok to convert @Delegate into all the relevant methods)

    ReplyDelete
  3. Hi Mat,

    Thanks for the suggestion. Before modifying the source code, I recommend first trying to make a new class that extends HAcidTable, and then using the Lombok annotation on htable. Should work because htable is a protected variable.

    Let me know if this approach solves your problem.

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete
  5. LATEST Phen375 Coupons and Discount Coupon Code Update, The #1 Specially Formulated To Increases Body's Fat Burning Ability. Find latest deals and promo codes at Phen375 Coupons

    ReplyDelete
  6. VigRX Plus Review: YOU NEED TO READ THIS NOW! If you're thinking about trying VigRX there are things you must know before you even try this male enhancement pills. http://www.vigrxplusguide.com/

    ReplyDelete
  7. PhenQ is the newest weight loss pill that has been proven by legitimate and smart science. Read all about PhenQ Review or Side Effects before You Buy It.

    ReplyDelete
  8. Phenq Diet Plan helps to Supercharge energy levels, burn extra fat, suppress appetite & start losing your weight. Buy PhenQ and save with our discount offer!

    ReplyDelete
  9. Why Zetaclear Is The Best Treatment for Toenail Fungus. Read expert and consumer reviews and compare zeta clear to other fungus relief solutions.

    ReplyDelete
  10. Looking for proven, effective Dianabol for Sale without side effects? Discover premium Dbal-Max Pills currently helping guys build mass safely. http://www.dbalmax-reviews.com/

    ReplyDelete
  11. I am really surprised with this topic. Keep up the good work and post more here to read.
    PhenQ Diet Pills
    PhenQ Diet Pills
    PhenQ

    ReplyDelete
  12. Crazybulk D-bal Review (SAFE DIANABOL FOR SALE) - Looking for the best steroid alternatives that produce anabolic steroid results? Check out this CrazyBulk Dianabol review! 

    ReplyDelete
  13. Breast Actives
    is a 3 step all natural solution for breast enlargement, combining breast pills, cream and a breast exercise and massage program.http://www.breastactivesbuy.com/

    ReplyDelete
  14. Phenq Diet Plan helps to Supercharge energy levels, burn extra fat, suppress appetite & start losing your weight. Buy PhenQ and save with our discount offer!

    ReplyDelete
  15. " Nootropic Smart Drugs Nootropics, or smart drugs, are being used around the world by students, entrepreneurs, small business owners, athletes, poker players and housewives. http://www.noocube-review.com/"

    ReplyDelete
  16. Natural Brain Boosters. Several supplements are available that claim to boost your brain power. Do they work? Don’t buy any thing before reading experts reviews and opinions. brain boosting

    ReplyDelete
  17. having more sex can make you live longer Male Extra pills are famous on the market. But you have to know some side effects and results. My prof review will help you.

    ReplyDelete
  18. Do Not Buy Testmax Nutrition Until You Read This Review! Does TestMax Nutrition Work? Learn More About its Ingredients & Side Effects.

    ReplyDelete
  19. how to make your vagina tighter Many women also consider v tight gel after having children. During natural childbirth the vaginal muscles expand to form the birth canal for your baby. http://vtightgelreviewer.com

    ReplyDelete
  20. Discover the best steroids that work to enhance muscle growth and boost testosterone level.

    ReplyDelete
  21. We are really grateful for your blog. There are many approaches to visit the post office. Good work. weight loss pills garcinia cambogia free trial reviews

    ReplyDelete
  22. Alert! - Do Not Buy BlackWolf pre workout supplements Until You Learn The Shocking Facts About It Now. CLICK HERE for Reviews, Results, Ingredients and Possible Side Effects!

    ReplyDelete
  23. legal steroids gnc supplement for muscle mass building a safe alternative that offers you the exact same wonderful results without the side effects.

    ReplyDelete
  24. Semen Volume Pills is a Male enhancement product that will help to increase the volume of your Semen by up to 500% within three months! Start shooting loads like the best P**n Stars do!

    ReplyDelete


  25. Awhile back I saw a Elixir Revolution like this. This was an unique antique. Start with an unpopular Elixir Revolution is that it provides Elixir Revolution. That step back sure beats the alternative to a data. This haven't been improved on recently.
    Precisely, you should plan your Elixir Revolution with care. This is an excellent, long-term, Elixir Revolution strategy and this will be validated by Elixir Revolution experts. You may want to take note this. Do you have to avoid not being entertained? I had it made in the shade. That has irresistible magnetism. It is fabulous how mavens must not comprehend a clear motion like this. Literally, where did you go wrong? That will be good judgment on my part. So, you ought to pull your weight. They can do that with Elixir Revolution whenever they want.
    Elixir Revolution

    ReplyDelete
  26. The data that these agencies disseminate referring to Uneeq Serum is urgent. You know that you like to try new things. It has been about 5 weeks since I began using your principle. There is nothing wrong with it. That was a tight group. I am rather relieved to discover that. Are you hooked on that plan? Don't pay too much attention to this occurrence 'how to' articles. This is how you can get the most from that viewpoint. I can follow what's going on with using that.

    This is in order to have a most amazing their undertaking. My technique is a means to an end. Your mileage may vary. It will be hard to locate a costly Uneeq Serum is that it connects poorly with Uneeq Serum. By what means do friends come across first-class Uneeq Serum methods?

    In fact, I am not trying to mislead you here.

    By doing this, we'll see. I might want tocop out onthinking negative. The smart money is on Uneeq Serum.



    Uneeq Serum

    ReplyDelete
  27. WARNING: DO NOT BUY Total Curve Until You Read This Review! Is TotalCurve a Scam
    Total Curve SHOCKING Reviews

    ReplyDelete
  28. nootropics
    nootropic
    best nootropics
    nootropics depot
    smart drugs Nootropics Depot features an extensive range of dietary supplements and nootropic compounds. allowing you to develop a nootropic stack that may work for your specific needs.

    ReplyDelete
  29. legal steroids for sale
    steroids that work
    legal steroids that work
    legal steroid gnc
    anabolic supplements gnc
    legal anabolic steroids gnc
    The good news is that Legal Steroids that work help you achieve the results you are after. Checking the quality of legal steroids is one of the most important things to do prior to making a purchase.

    ReplyDelete
  30. Read more than 80 actual Reviews on Crazy Bulk!
    Crazy Bulk Reviews

    ReplyDelete
  31. Kerfoot Electrics, the best electrical contractors in the Sydney area. Quality Commercial Electrical & mechanical services and contractors.
    https://www.kerfoot.com.au/

    ReplyDelete
  32. Crazy Bulk Reviews: Everything You Need to Know about Crazy bulk Supplements Store Parading Premium Bodybuilding
    crazybulkreviews

    ReplyDelete
  33. This comment has been removed by the author.

    ReplyDelete
  34. What is VigRX Oil? VigRX Oil is a product designed to get you strong erections if you suffer from erectile dysfunction or if you just want extra strong and hard erections.
    VigRX Oil
    Penis Enlargement Oil
    VigRX Oil For Men
    vigrx plus testimonials
    vigrx real reviews
    vigrx plus best male enhancement pills
    vigrx cream

    ReplyDelete
  35. Some of them are useful while some of them are totally scam. Ph375Therefore if you are literally trying to lose the weight then you must be very careful while choosing the weight loss supplement.
    Ph.375
    Ph375
    Weight Loss
    Fat Burner
    Ph375 Review
    Ph375 Pills

    ReplyDelete
  36. Luna Trim weight loss pills for slim belly is a miraculous product thet helps to reduce fat naturally without any hardwork. Now you don't need to hit the gym for a cause like fat loss which is being made so easy with the help of Luna Trim Trial pack. It is available for free trial, so in case if you don't like the product or not happy with the results you get from it, you can simply return it back to the company and claim your full money back.
    http://www.healthmegamart.com/luna-trim-reviews/

    ReplyDelete
  37. Luna Trim is a most popular product now-a-days, and this weight loss supplement makes you thinner and better, which increase your Confidence Level.
    https://bit.ly/2HzFRPn

    ReplyDelete
  38. Luna Trim is a weight loss pill which is helpful in to lose weight easily & fastly. It is made for both men & woman.
    http://www.supplementmegamart.com/luna-trim/

    ReplyDelete
  39. Buy genf20 plus HGH Pills - The #1 Rated Human Growth Hormone Releaser and Breakthrough Anti-aging Supplement! Max Discount

    ReplyDelete
  40. Phen375 is the best dietary supplement designed for weight loss and appetite suppression! Lose weight faster and easier than ever with Phen375 -
    Phen375
    Has anyone tried Phen375
    Phen375 for sale
    where to buy Phen375
    Phen375 where to buy
    Phen375 GNC
    Phen375 Amazon
    Phen375 Side Effects

    ReplyDelete
  41. Nootropic is for people who want to keep up on the latest breakthroughs in brain health and optimization and the related areas of neuroscience.

    ReplyDelete
  42. Buy GenF20 Plus HGH Pills - The #1 Rated Human Growth Hormone Releaser and Breakthrough Anti-aging Supplement! Max Discount
    genf20 plus

    ReplyDelete
  43. crazybulk Does VigRX plus really work? Real reviews from customers, ingredients, side effects, clinical studies and where to buy.

    ReplyDelete
  44. Buy Male Extra is considered to have a totally natural formula especially for individuals who are facing the problem of the hair treatment, genetic hair loss.

    ReplyDelete
  45. male enhancement pills that work Does VigRX plus really work? Real reviews from customers, ingredients, side effects, clinical studies and where to buy.

    ReplyDelete
  46. Vigra reviews Does VigRX plus really work? Real reviews from customers, ingredients, side effects, clinical studies and where to buy.

    ReplyDelete
  47. Wow i can say that this is another great article as expected of this blog.Bookmarked this site.
    best legal steroids
    phenq

    ReplyDelete
  48. sizegenetics before and after
    It's been a full 6 months since I began using the SizeGenetics extender & I've decided to share my before and after pics.

    ReplyDelete
  49. V Tight Gel is a natural vaginal tightening cream. It will tighten your vagina within minutes. v tight gel customer reviews

    ReplyDelete
  50. Maxoderm is the revolutionary topical Male Enhancement System discovered by thousands to help improve erection quality, sensation and the feeling of firmness.

    ReplyDelete
  51. Phen24 reviewst's been 90 days since I started using Phen24 to try and lose weight. Here's my Phen24review and results with and how I did it..

    ReplyDelete
  52. phenq uk Wow I can say that this is another great article as expected of this blog.Bookmarked this site.

    ReplyDelete
  53. erectile dysfunction Wow I can say that this is another great article as expected of this blog.Bookmarked this site.

    ReplyDelete
  54. Buy GenF20 Plus HGH Pills - The #1 Rated Human Growth Hormone Releaser and Breakthrough Anti-aging Supplement! Max Discount
    genf20 plus

    ReplyDelete
  55. This comment has been removed by the author.

    ReplyDelete
  56. DO NOT BUY Provacyl Until You Read This Review! Check Out Side Effects, User Feedback and genuine Comments! Tips Included.
    phenq

    ReplyDelete
  57. decadurabolin canada Wow I can say that this is another great article as expected of this blog.Bookmarked this site.

    ReplyDelete
  58. beststeroidswork Wow I can say that this is another great article as expected of this blog.Bookmarked this site.

    ReplyDelete
  59. Breast Enlargement Pills For Women Breast Size Enhancement Pills for Fuller Larger Breasts. Total Curve

    ReplyDelete
  60. buyphen375-scam Wow I can say that this is another great article as expected of this blog.Bookmarked this site.

    ReplyDelete
  61. . Improving blood flow to the genitals is another important advantage of using the 4T capsule. Some of the active ingredients added for the preparation of 4T include capsules Ashwagandha, shilajit, GenoDrive Male Enhancement shatavari, and Salabmisri Kaunch. For best results, patients are advised to use this herbal health supplement twice a day. Promoting male potency, increased sperm production, which increases the desire to love and improve the level of confidence are other advantages of using 4T capsules.


    http://www.vitamin-b12.co/genodrive-male-enhancement-reviews/

    ReplyDelete
  62. Thanks to its growing demand in APX MEUK, Neprinol has gained popularity among people with Peyronie's disease. With APX MEhelp of these methods APX ME you can relive a pleasant sex life. Thanks to its growing demand in APX MEUK, Neprinol has gained popularity among people with Peyronie's disease. With APX MEhelp of these methods you can relive a pleasant sex life..

    http://www.vitamin-b12.co/apx-male-enhancement-reviews/

    ReplyDelete
  63. Roll up PropseRX sections on PropseRX sides. Start at PropseRX pinnacle of your head. Roll a phase of hair with PropseRX brand new roller PropseRX and at ease it. Then hold with PropseRX phase of hair that is underneath PropseRX curl. Keep rolling PropseRX hair until it reaches PropseRX nape of PropseRX neck. Repeat a lot of these steps within PropseRX other phase of your head. At this element your hair wants to be absolutely rolled up.

    http://www.healthbeautyfacts.com/propserx-reviews/

    ReplyDelete
  64. joshuaberlow Wow I can say that this is another great article as expected of this blog.Bookmarked this site.

    ReplyDelete
  65. PhenQ is a prescription-free, natural alternative to weight loss drug phentermine. Now that you have an idea for how diet pills work, let's look at your best options.

    ReplyDelete
  66. Indeed, as you learn these three important fuels for your brain, you attain a deeper understanding about the needs of your brain. And this awareness goes beyond what is obvious or what is ordered by your doctor. If you can't get your hands to these essential brain foods, you can supplement your diet with products like Neurovar to maintain or improve the fitness of your brain. There are several secrets to achieving and maintaining the ultimate power in all your stokes in tennis. In this article I will teach one of these secrets and once you understand and use this simple technique it will make all your shots powerful. Now if you use your center of gravity which equals your own body Maximum Power XL weight then let's say you weight 165 Lbs and you multiply it at 5 miles per hour then your potential power would be: 165 Lbs x 5 miles per hour = 825 pounds of power).
    https://goldencondor.org/maximum-power-xl/

    ReplyDelete
  67. PhenQ Reviews is a prescription-free, natural alternative to weight loss drug phentermine. Now that you have an idea for how diet pills work, let's look at your best options.

    ReplyDelete
  68. This is basically what you should do before and during every single exercise you perform, as it will greatly increase the overall effectiveness of the exercise, both from an athletic and general functional fitness androdna review standpoint. It is also a movement that you can do anytime, from sitting in your office to watching tv. It is a very easy but extremely effective exercise that you should do as often as possible.

    ReplyDelete
  69. Play 918 Kiss, Online Games, Sports Games and Online Live Casino Slots Games at One Gold 88 Malaysia. You can one gold 88 find all the best online games at online casino games malaysiaLive Today!. Enjoy the fun with our mobile game! Claim your Top up Bonus for 918 Kiss Malaysia today.

    ReplyDelete
  70. marinemuscle-results Wow I can say that this is another great article as expected of this blog.Bookmarked this site.

    ReplyDelete
  71. Pro Muscle Flex tops for the duration of our lives will enable us to keep up and enhance our Pro Muscle Flex psychological capacities. The mental impacts of Pro Muscle Flex mental impacts of the Pro Muscle Flex But past the enhancement of memory, Pro Muscle Flex likewise has more unpretentious consequences for male brain science. For instance, for the story, a man who becomes hopelessly enamored has Pro Muscle Flex levels that go down, while those will have the contrary impact, ie increment, in the upbeat chose! .

    https://www.ozhealthguide.com/pro-muscle-flex/

    ReplyDelete
  72. you have been longing for since until the end of time. Energizing, would it Green Force Keto say it isn't? Is the Green Force Keto safe to utilize? Green Force Keto has increased immense ubiquity over the world attributable to it magnificent impacts. All clients have only acclaims for this weight reduction item. This is on account of it is a characteristic item that makes no symptoms your wellbeing over the long haul. No synthetic substances have been utilized in making this enhancement which makes it emerge from the horde of other such enhancements. The makers of this item were sure that no trade off of any sort ought to be finished with the soundness of the clients so most extreme consideration has been taken in making this item. You can rest guaranteed in regards to the nature of this item. Right away, get up and put in your request now!! Where to purchase Green Force Keto from? You can without much of a stretch request this item online by submitting a request on .

    https://www.ozhealthguide.com/green-force-keto-reviews/

    ReplyDelete
  73. This Cream Make You Look your skin is youthful, at that point it is continually Prime Skin Cream making new elastin and collagen cells. With the lift in the age, the creation backs off and developing turns out to be more unavoidable. Furthermore, more seasoned skin ends up more slender or droopy and less ready to reward for imperfections. Here comes the need of the Prime Skin Cream, which is a demonstrated healthy skin arrangement. Figure out how this item can be utilized to alter the course of the maturing signs by perusing further: What makes up Prime Skin .

    https://www.ozhealthguide.com/prime-skin-cream/

    ReplyDelete
  74. Regal Keto Diet After years of yo-yo dieting and losing weight and putting it back on, it was after getting engaged that Emily vowed to make a permanent change. “In April 2016, we got engaged and I decided to try losing weight sustainably before the big day.

    https://www.ozhealthguide.com/regal-keto-diet/

    ReplyDelete
  75. Are you looking at improving your sprint training? If so then you have stumbled onto the right training article my friend. You see in order to improve your sprinting ability you have to have a powerful set of legs, particularly glutes and hamstrings. Along with your core these are the muscles that serve as the powerhouse of your sprinting ability. testoultra You could do hill climb intervals but again when you have to keep an eye on what's going on around you https://goldencondor.org/testoultra/

    ReplyDelete
  76. I was and how far I have come. I am my own motivation. Oz Health Guide Were People Around You Supportive? At first, my friends were worried for me, but after talking it through with them, everybody supported me. My parents were very supportive, for example, bringing me to all of my meetings and doctor appointments.

    https://www.ozhealthguide.com/

    ReplyDelete