You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Xin Wang <an...@gmail.com> on 2010/11/22 18:28:37 UTC

How to put() and get() when setAutoFlush(false)?

Hello everyone,

  I am a beginner to HBase. I want to load a data file of 2 million lines
into a HBase table.
  I want to load data as fast as possible, so I called
HTable.setAutoFlush(false) at the beginning. However, when I HTable.put() a
row and then HTable.get() the same row, the result is empty. I know this is
because the setAutoFlush(false) make put() write into the buffer. But the
algorithm in my loading process requires to read the value of the previous
one that just is put into the HTable cell. I have tried to make
setAutoFlush(true), although the previous value can be read but the loading
process is slower down by about an order of magnitude. Can I get() value
directly from the write buffer? Are there any other solutions to this
problem that I do not know? Thank you in advance!

 Best regards,

Xin Wang