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

Jun Rao commented on KAFKA-267:
-------------------------------

Thanks for patch v4. It's better, but still messy. Some more comments:

40. I  suggest that we combine initialMessageIdOpt and varyMessageSizeOpt into 
one option, something like message-mode. It will take 3 choices: sequence, 
fix-length, and variable-length that are mutually exclusive.

41. I suggest that batchSizeOpt be only used in async mode. In sync mode, we 
always send a single message at a time without batching. This will simplify the 
way that we generate messages. When generating the data, we just need to 
generate one message at a time, depending on message-mode.

42. The following 2 methods should be moved out of ProducerThread and put in a 
util class.
generateProducerData
generateMessageWithSeqId

43. UniqueRandom: Why do we need this class? Can't we just use 
Random.nextBytes()?

44. The following chunk of code is identical to that in Kafka. Could we create 
a util function to share the code?
      val metricsConfig = new KafkaMetricsConfig(verifiableProps)
      metricsConfig.reporters.foreach(reporterType => {
        val reporter = Utils.createObject[KafkaMetricsReporter](reporterType)
        reporter.init(verifiableProps)
        if (reporter.isInstanceOf[KafkaMetricsReporterMBean])
          Utils.registerMBean(reporter, 
reporter.asInstanceOf[KafkaMetricsReporterMBean].getMBeanName)
      })

45. There are a few long lines like the following. Let's put .format in a 
separate line.
            println(("%s, %d, %d, %d, %d, %.2f, %.4f, %d, 
%.4f").format(formattedReportTime, config.compressionCodec.codec,
                                                                        
threadId, config.messageSize, config.batchSize, (bytesSent*1.0)/(1024 * 1024), 
mbPerSec, nSends, numMessagesPerSec))

                
> 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

Reply via email to