[ https://issues.apache.org/jira/browse/KAFKA-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joel Koshy updated KAFKA-391: ----------------------------- Attachment: KAFKA-391-draft-r1374069.patch Attached a draft patch. I was out of action for the last two weeks and 0.8 has moved along quite a bit, so this will need a significant rebase. (This patch should cleanly apply on r1374069.) Before I spend time rebasing I was hoping to get some high-level feedback on this change. I think it makes the code clearer and likely more efficient (although an extensive perf test is pending). It is pretty straightforward and should be quick to review at least for this round. The main changes are as follows: - Switched to maps for the data/status in the producer request/response classes. - I'm using SortedMap as that helps with the serializing to the wire format. The maps of course are only in memory. The wire format is mostly the same although I modified the response format to include topic names (similar to the request format). This is not strictly required but I think it is clearer this way. - Made some of the related code simpler/clearer (e.g., produceToLocalLog, DelayedProduce.respond, etc.) - Minor fixes in the tests due to the above changes. > Producer request and response classes should use maps > ----------------------------------------------------- > > Key: KAFKA-391 > URL: https://issues.apache.org/jira/browse/KAFKA-391 > Project: Kafka > Issue Type: Bug > Reporter: Joel Koshy > Assignee: Joel Koshy > Labels: optimization > Fix For: 0.8 > > Attachments: KAFKA-391-draft-r1374069.patch > > > Producer request contains an array of TopicData which contains arrays of > PartitionData. > Producer response contains two arrays of error codes and offsets - the > ordering in these arrays correspond to the flattened ordering of the request > arrays. > It would be better to switch to maps in the request and response as this > would make the code clearer and more efficient (right now, linear scans are > used in handling producer acks). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira