bookkeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dongdong Guo <gu...@rd.netease.com>
Subject Re: Question about "asyncAddEntry"
Date Fri, 23 Dec 2011 10:12:13 GMT
I have done the test, the performance of asynchronous version is really greater than synchronous
version, but my question is below:

To the asynchronous version, I add lots of entries, then wait. but in fact that the AddOps
is done in order, that mean only when the qSize bookie finished for the first entry, then
the second entry can start
it is same with "synchronous version", where the performance difference comes

thanks very much

----- 原始邮件 -----
发件人: "Flavio Junqueira" <fpj@yahoo-inc.com>
收件人: bookkeeper-user@zookeeper.apache.org
抄送: ivank@apache.org
发送时间: 星期五, 2011年 12 月 23日 下午 5:53:58
主题: Re: Question about "asyncAddEntry"

The different is essentially speed. With the asynchronous version, you'll have a number of
requests outstanding at a time, and you'll be able to issue more add requests per second (higher
throughput). 


-Flavio 





On Dec 23, 2011, at 10:43 AM, Dongdong Guo wrote: 



thanks very much, I have saw the source code, but I have another question 

I use "asyncAddEntry" to add lots of entries, but it is done in order, what is difference
with using "addEntry" to add lots of entries 

----- 原始邮件 ----- 
发件人: "Ivan Kelly" < ivank@apache.org > 
收件人: bookkeeper-user@zookeeper.apache.org 
发送时间: 星期五, 2011年 12 月 23日 下午 5:33:28 
主题: Re: Question about "asyncAddEntry" 

See: 

https://github.com/apache/bookkeeper/blob/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
#L426 

Basically, the SafeRunnable is added to the worker thread in order, so these get run in order.
The SafeRunnable added the op to pendingAddOps, and runs the op. If an add op error unrecoverably,
all operations after the failed operation are failed by the ledger handle, see errorOutPendingAdds.


-Ivan 





On 23 December 2011 09:12, Dongdong Guo < guodd@rd.netease.com > wrote: 


I saw the source code, but i can not find the place where bookkeeper add entries in order,
could you tell me where ? 

thanks 


----- 原始邮件 ----- 
发件人: "Ivan Kelly" < ivank@apache.org > 
收件人: bookkeeper-user@zookeeper.apache.org 
发送时间: 星期四, 2011年 12 月 22日 下午 7:35:11 

主题: Re: Question about "asyncAddEntry" 



On Thu, Dec 22, 2011 at 07:25:40PM +0800, Dongdong Guo wrote: 


I use the "asyncAddEntry" and add lots of data, then wait finished, if the first entry failed,
is it possible that the subsequence entry success 
No, bookkeeper will add entries in order. If an add op fails 
completely, then all subsequent add ops will be errored, and the 
ledger will be forced to close. 

-Ivan 









flavio 
junqueira 

research scientist 

fpj@yahoo-inc.com 
direct +34 93-183-8828 

avinguda diagonal 177, 8th floor, barcelona, 08018, es 
phone (408) 349 3300 fax (408) 349 3301 

Mime
View raw message