On 10/18/2012 09:46 PM, Yang Ye (JIRA) wrote:
[
https://issues.apache.org/jira/browse/KAFKA-267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yang Ye updated KAFKA-267:
--------------------------
Attachment: kafka-267-v4.patch
create a function "generateProducerData" for common use. It can generate for
both sync and async mode, fixed and variable length, sequential id mode and
non-sequential id mode.
The main structure of the fun() function of ProducerThread is shrinked to :
For each batch:
For each topic:
generateProducerData
send
sleep if required
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, kafka-267-v4.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
the only reason to sleep is? that's not part of your function. But if
you're batching your function needs to know where it left off sending
and where it left off receiving ack's and then you run the batch with an
error condition on those .... what i mean....generateProducerData, in a
batch, should do as little and report as much as possible as quickly as
possible. eh? batches fail because of records. no batcher runs serially
when the code below is mt safe.
w