You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jay Kreps (JIRA)" <ji...@apache.org> on 2014/05/07 01:52:14 UTC

[jira] [Commented] (KAFKA-1316) Refactor Sender

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

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

Okay so here is my proposal. I want to refactor out a couple of helper objects from Sender, specifically NodeState, InFlightRequest and InFlightRequests.

This will be packaged up inside a class that does this stuff and wraps the Selector. It will implement a partition aware request/response layer on top of the more general selector API. Not sure what to call this, maybe something like ClusterSelector or RequestSelector or something like that.

This class will model the state machine we current go through where a request is directed to a particular node and connections are set up in a non-blocking way before a request can be made. It will also handle the request/response correlation.

I think I may need to just take a stab at it to see exactly how this will work so I am just going to dive in.

> 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)