Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase, mail # user - Is Put() operation a synchronous call on server side?


Copy link to this message
-
Re: Is Put() operation a synchronous call on server side?
daidong 2012-12-06, 13:43
2012/12/6 yun peng <[EMAIL PROTECTED]>

> Hi, since on client side HBase can immediately send Put() by turning off
> setAutoFlush(), I am wondering if Put() in HBase server side is executed in
> synchronous way? Be a bit more specific, given a Put() that already arrives
> at HRegion, will it wait (or be blocking) until all put-related operations
> are done, such as write to WAL and write to memstore, or even flush to disk
> (though may not on every time). Or it just triggers put-related operations
> and immediately returns....
>
>
> Besides, in research of this problem, I found it not very easy to find the
> code that perform RPC in HBase, for example, how does client-side
> HTable.put() invoke the server-side HRegion.put().... Can anyone points to
> me the related code path on this regards? Thanks...
> regards,
> Yun
>

I think the path should be like this:
put() -> flushCommits() -> processBatch() -> processBatchCallback() ->
submit() -> ExecutorService.submit()

The callback we submit contains a "connect" and "call" function, which
really
does the RPC stuff. See ProtobufUtil.java and its "multi" method. About the
question how
to get the ClientProtocol, you can see HConnectionManager.getProtocol()
method.

Hope it helps, and I also want somebody can give more inform about how
Protobuf and HBaseRPC work together. :)