Hi,

You could implement this in a code structure like so:

HTable table = new HTable(tableName, conf);
Put lastPut = null;
while ( moreData ) {
    Put put = makeNewPutBasedOnLastPutToo( lastPut, dataSource );
    table.put(put);
    lastPut = put;
    dataSource.next();
}

if that is unsatisfactory you may access the write buffer via
HTable.getWRiteBuffer().

-ryan


On Mon, Nov 22, 2010 at 5:41 PM, Xin Wang <and...@gmail.com> wrote:
> 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
>

Reply via email to