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

2010-11-23 Thread Lars George
Hi Xin, You can always ask for the write buffer from the table using HTable.getWriteBuffer(), but yll you get is a list of the uncommitted Puts. You would need to handle them yourself to get values back. Lars On Tue, Nov 23, 2010 at 4:12 AM, Xin Wang and...@gmail.com wrote: Hi Ryan,    Thank

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

2010-11-22 Thread Xin Wang
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

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

2010-11-22 Thread Ryan Rawson
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

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

2010-11-22 Thread Xin Wang
Hi Ryan, Thank you for your reply. Actually, my source data file is a sequence of triples. Each line is a triple of the form (k, p, v), which means the key k has a property p whose value is v. A key k can have multiple different properties and values. And the triples for the same key may not