hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tsuna <tsuna...@gmail.com>
Subject Re: when does put return to the caller?
Date Thu, 24 Feb 2011 17:04:59 GMT
On Wed, Feb 23, 2011 at 1:25 PM, Hiller, Dean  (Contractor)
<dean.hiller@broadridge.com> wrote:
> I was wonder if put returns after writing the data into memory on two
> out of the three nodes letting my client continue so we don't have to
> wait for the memory to then go to disk.  After all, if it is replicated,
> probably don't need to wait for it to be written to disk(ie. Kind of
> like the in-memory data grids that exist out there).

If you use the WAL (Write Ahead Log), which is enabled by default,
your write has to be persisted on 3 disks before it returns
successfully to you.  Without the WAL, the write is only written to
memory of one node, so if that node crashes, you'll lose your edit
(much faster but unsafe).

> Also, is there an asynchronous request/response for PutAll so I can slam
> the grid with batches of 1000 entries kind of like
> PutAll(List<PutOps> puts, AsynchCallback cb); such that cb would be
> called with the failure or success response after the put?

HBase doesn't offer any asynchronous API out of the box, and in
addition HTable isn't thread-safe.  If you want an asynchronous HBase
API, I recommend you take a look at asynchbase
(https://github.com/stumbleupon/asynchbase) as it's an alternative
HBase client that is entirely asynchronous and non-blocking.  Javadoc
is at http://su.pr/1PJCSY

Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com

View raw message