HQebupt opened a new pull request #13239: URL: https://github.com/apache/pulsar/pull/13239
### Motivation PartitionedProducerImpl should public the number of partitions of its topic. Although we can get the number partitions of a topic by calling the pulsar client's RPC, this will consume one RPC request. - Topic partition may change, which causes me to call RPC to get it when I need to know the number of partitions. Producer can always get the number of Topic partitions because it has TopicsPartitionChangedListener. Therefore, the public API can improve performance, which is worthwhile. When you use Producer to send, you also want to know the number of topic partitions. This was indeed used when I designed and implemented MQ on Pulsar, which improved the performance of Proxy and increased throughput. ### Modifications ### Verifying this change - [x] Make sure that the change passes the CI checks. This change is a trivial rework / code cleanup without any test coverage. ### Does this pull request potentially affect one of the following parts: If `yes` was chosen, please highlight the changes - Dependencies (does it add or upgrade a dependency): (no) - The public API: (no) - The schema: (no) - The default values of configurations: (no) - The wire protocol: (no) - The rest endpoints: (no) - The admin cli options: (no) - Anything that affects deployment: (no) ### Documentation Check the box below and label this PR (if you have committer privilege). Need to update docs? - [x] `no-need-doc` Enhancement -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org