Re: two questions regarding 0.8.2 producer code

2014-11-10 Thread Steven Wu
Jay, thanks a lot for the quick response. For #2, I do see some isSendable() check in Sender.java and NetworkClient.java that is eventually mapped to InFlightRequests#canSendMore() check. it wasn't immediately clear to me how is that translated to transmissions.hasSend() check. anyway, I will dig

Re: two questions regarding 0.8.2 producer code

2014-11-10 Thread Jay Kreps
1. No, the send does a poll/select on all the connections that will block for a specified time waiting for data to read or write on any connection. 2. The api of the selector only allows you to send a request to a ready connection. The definition of ready is that it doesn't have another request in

two questions regarding 0.8.2 producer code

2014-11-10 Thread Steven Wu
I am checking out the source code of 0.8.2 producer code. I have two questions and hope to get some clarifications. 1) Sender thread/Runnable has this run loop. what if the in-memory queue is mostly empty (i.e. producer has very few msgs to send out)? will this become a simple tight loop that just