...
Multiple-thread is not implemented in ConsumerPerformance. It was implemented for old consumer and removed completely in https://github.com/apache/kafka/pull/5230/, but the option [threads] was kept. It's necessary to make option [threads] work again.
Public Interfaces
We define a new class ConsumerPerfThread in ConsumerPerformance to implement multi-thread.
...
Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.
A public interface is any change to the following:
Binary log format
The network protocol and api behavior
Any class in the public packages under clientsConfiguration, especially client configuration
org/apache/kafka/common/serialization
org/apache/kafka/common
org/apache/kafka/common/errors
org/apache/kafka/clients/producer
org/apache/kafka/clients/consumer (eventually, once stable)
Monitoring
Command line tools and arguments
- Anything else that will likely break existing users in some way when they upgrade
kafka.tools.ConsumerPerformance is used in kafka-consumer-perf-test.sh.
Proposed Changes
Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.
We define a new class ConsumerPerfThread in ConsumerPerformance to implement multi-thread.
Attribute | Description |
---|---|
threadId : Int | The thread Id. |
config : ConsumerPerfConfig | The configuration of ComsumerPerformance |
totalMessagesRead : LongAdder | The total number of messages which have been read |
totalBytesRead : LongAdder | The total byte of messages which have been read |
consumer : KafkaConsumer[Array[Byte], Array[Byte]] | The consumer to fetch messages |
metric : mutable.Map[MetricName, _ <: Metric] | The metric for consumer, which used to get rebalanceTime |
Compatibility, Deprecation, and Migration Plan
...