[ 
https://issues.apache.org/jira/browse/KAFKA-1316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14005249#comment-14005249
 ] 

Jay Kreps commented on KAFKA-1316:
----------------------------------

Neha, yeah I'll post something as I get it in shape.

Jun, ready is non-blocking. This is important for the producer which needs to 
intersect the set of partitions hosted by nodes whom we are ready to send to 
with the set of nodes for whom we have data. But for the consumer we should 
think this through. Implementing a blocking connect would be something like
{noformat}
while(!client.ready(node, System.currentTimeMillis()))
  client.poll(Collections.emptyList(), 100)
{noformat}
which is not terribly intuitive. We could add an api for this if it would help. 
But let's think through how we would implement the consumer state machine and 
then I think we will know what we need.

> Refactor Sender
> ---------------
>
>                 Key: KAFKA-1316
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1316
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: producer 
>            Reporter: Jay Kreps
>            Assignee: Jay Kreps
>
> Currently most of the logic of the producer I/O thread is in Sender.java.
> However we will need to do a fair number of similar things in the new 
> consumer. Specifically:
>  - Track in-flight requests
>  - Fetch metadata
>  - Manage connection lifecycle
> It may be possible to refactor some of this into a helper class that can be 
> shared with the consumer. This will require some detailed thought.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to