Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HBase write: which one better on performance, batch or put(List<Put>)?

I am starting to learn HBase to write data streams. I use HTableInterface and having problem in performance. It took much times to insert only 500 rows, almost 500,000ms per batch List that I inserted.

Any example or suggestion for batch write into HTable with HTableInterface ? I am using HBase 0.94

Thanks

like image 825
ans4175 Avatar asked Nov 17 '25 19:11

ans4175


1 Answers

They're essentially the same: batch(List<? extends Row> actions, Object[] results) allows not only puts but also gets, deletes, increments... put(List<Put> puts) just do a batch of puts (it also validates them client-side).

You can also perform batches by disabling table.setAutoFlush(false), issuing standard puts to the table and flushing the buffer afterwards with table.flushCommits().

I don't know the size of your rows but unless they're huge it seems you have some sort of problem with your configuration (network latency maybe?), even performing 500 puts row by row should be performed a lot faster.

like image 122
Rubén Moraleda Avatar answered Nov 19 '25 08:11

Rubén Moraleda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!