[
https://issues.apache.org/jira/browse/KAFKA-267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474299#comment-13474299
]
Jun Rao commented on KAFKA-267:
-------------------------------
Thanks for patch v3. The code is still pretty messy, mostly for historical
reasons. For example, the fix/variable length option is mixed with seqIdMode
and batch size, etc. I suggest that we do the following: (1) Get rid of the
seqId mode and always generate sequential ids in the message header. If the
user doesn't specify the starting index, seq Id will start from 0. (2) Alway
pad a message with random bytes, whether the message is fix length or variable
length. (3) Don't batch messages into sets in the sync mode. Instead, send one
message at a time in sync mode. (4) The send gap should probably be added after
sending a batch of messages, not after each message. If we do all this, the
send thread can just have one simple loop as the following:
while(j < messagesPerThread) {
for each topic {
msgString = // get the message for a seq id of a given size
msg = create Message
producer.send(msg)
if(config.messageSendGapMs > 0 && batch size is reached)
Thread.sleep(config.messageSendGapMs)
}
}
Also, we need to patch system test since the command line option has changed.
> Enhance ProducerPerformance to generate unique random Long value for payload
> ----------------------------------------------------------------------------
>
> Key: KAFKA-267
> URL: https://issues.apache.org/jira/browse/KAFKA-267
> Project: Kafka
> Issue Type: Improvement
> Reporter: John Fung
> Assignee: Yang Ye
> Attachments: kafka-267-v1.patch, kafka-267-v2.patch,
> kafka-267-v3.patch
>
>
> This is achieved by:
> 1. Adding a new class UniqueRandom to shuffle a range of numbers.
> 2. An optional new argument "start-index" is added to specify the starting
> number of the range to be shuffled. If this argument is omitted, it is
> defaulted to 1. So it is backward compatible with the argument options.
> 3. The ending number of the range is the starting number + number of messages
> - 1.
> Other ProducerPerformance advancement:
> 1. producing to multiple topics
> 2. supporting multiple instances of producer performance ( and distinguishes
> them)
> 3. allowing waiting some time after sending a request
--
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