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.
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?
ReplyDeleteHi Mat, good to know that you are using HAcid.
DeleteThere 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.
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?
ReplyDelete@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)
Hi Mat,
ReplyDeleteThanks 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.
This comment has been removed by a blog administrator.
ReplyDeletehttp://www.officialwire.com/pr/revitol-eye-cream-is-the-new-formula-introduced-by-revitol-company-to-effectively-work-against-dark-eye-circles-now-with-extra-bottle-offers/,,,http://www.sbwire.com/press-releases/zetaclear-provides-a-2-step-solution-to-get-rid-of-unsightly-nail-fungus-now-available-with-1-extra-bottle-offer-365170.htm,http://www.officialwire.com/pr/clearpores-acne-cleansing-system-offers-the-3-step-natural-solution-against-the-acne-problem-now-with-huge-discounts/,http://www.officialwire.com/pr/wartrol-genital-warts-relief-solution-shed-warts-caused-by-hpv-easily-eliminate-every-type-of-warts-now-with-free-bottle-offers/,http://www.officialwire.com/pr/5-htp-max-the-natural-supplement-has-clinically-proven-highly-effective-to-aid-the-weight-loss-now-with-extra-bottle-offers/,http://www.officialwire.com/pr/saffron-extract-select-has-found-highly-effective-yet-the-safe-in-the-clinical-trials-to-shed-8-pounds-within-weeks,http://www.emailwire.com/release/136566-Revitol-Stretch-Mark-Cream-Reduce-the-Appearance-of-Existing-Stretch-Marks-in-Few-Weeks-Now-With-Extra-Bottles.html
ReplyDeleteLATEST 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
ReplyDeleteVigRX 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/
ReplyDeletePhenQ 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.
ReplyDeletePhenq Diet Plan helps to Supercharge energy levels, burn extra fat, suppress appetite & start losing your weight. Buy PhenQ and save with our discount offer!
ReplyDeleteWhy Zetaclear Is The Best Treatment for Toenail Fungus. Read expert and consumer reviews and compare zeta clear to other fungus relief solutions.
ReplyDeleteLooking 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/
ReplyDeleteI am really surprised with this topic. Keep up the good work and post more here to read.
ReplyDeletePhenQ Diet Pills
PhenQ Diet Pills
PhenQ
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!
ReplyDeleteBreast Actives
ReplyDeleteis a 3 step all natural solution for breast enlargement, combining breast pills, cream and a breast exercise and massage program.http://www.breastactivesbuy.com/
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" 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/"
ReplyDeleteNatural 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
ReplyDeletehaving 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.
ReplyDeleteDo Not Buy Testmax Nutrition Until You Read This Review! Does TestMax Nutrition Work? Learn More About its Ingredients & Side Effects.
ReplyDeletehow 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
ReplyDeleteDiscover the best steroids that work to enhance muscle growth and boost testosterone level.
ReplyDeleteWe 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
ReplyDeleteAlert! - 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!
ReplyDeletelegal steroids gnc supplement for muscle mass building a safe alternative that offers you the exact same wonderful results without the side effects.
ReplyDeleteSemen 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
ReplyDeleteAwhile 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
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.
ReplyDeleteThis 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
WARNING: DO NOT BUY Total Curve Until You Read This Review! Is TotalCurve a Scam
ReplyDeleteTotal Curve SHOCKING Reviews
nootropics
ReplyDeletenootropic
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.
legal steroids for sale
ReplyDeletesteroids 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.
Read more than 80 actual Reviews on Crazy Bulk!
ReplyDeleteCrazy Bulk Reviews
Kerfoot Electrics, the best electrical contractors in the Sydney area. Quality Commercial Electrical & mechanical services and contractors.
ReplyDeletehttps://www.kerfoot.com.au/
Crazy Bulk Reviews: Everything You Need to Know about Crazy bulk Supplements Store Parading Premium Bodybuilding
ReplyDeletecrazybulkreviews
Ph.375 is the best dietary supplement designed for weight loss and appetite suppression! Lose weight faster and easier than ever with Ph375 Weight Loss Pills
ReplyDeleteWhat 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.
ReplyDeleteVigRX Oil
Penis Enlargement Oil
VigRX Oil For Men
vigrx plus testimonials
vigrx real reviews
vigrx plus best male enhancement pills
vigrx cream
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.
ReplyDeletePh.375
Ph375
Weight Loss
Fat Burner
Ph375 Review
Ph375 Pills
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.
ReplyDeletehttp://www.healthmegamart.com/luna-trim-reviews/
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.
ReplyDeletehttps://bit.ly/2HzFRPn
Luna Trim is a weight loss pill which is helpful in to lose weight easily & fastly. It is made for both men & woman.
ReplyDeletehttp://www.supplementmegamart.com/luna-trim/
Buy genf20 plus HGH Pills - The #1 Rated Human Growth Hormone Releaser and Breakthrough Anti-aging Supplement! Max Discount
ReplyDelete