heesung-sn commented on code in PR #18807:
URL: https://github.com/apache/pulsar/pull/18807#discussion_r1059498810
##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/NonPersistentTopicStatsImpl.java:
##########
@@ -165,20 +166,15 @@ public NonPersistentTopicStatsImpl
add(NonPersistentTopicStats ts) {
return newStats;
})).add((NonPersistentPublisherStatsImpl) s);
} else {
- if (this.nonPersistentPublishers.size() !=
stats.getNonPersistentPublishers().size()) {
- for (int i = 0; i <
stats.getNonPersistentPublishers().size(); i++) {
- NonPersistentPublisherStatsImpl newStats = new
NonPersistentPublisherStatsImpl();
- newStats.setSupportsPartialProducer(false);
-
this.nonPersistentPublishers.add(newStats.add((NonPersistentPublisherStatsImpl)
s));
- }
- } else {
- for (int i = 0; i <
stats.getNonPersistentPublishers().size(); i++) {
- ((NonPersistentPublisherStatsImpl)
this.nonPersistentPublishers.get(i))
- .add((NonPersistentPublisherStatsImpl) s);
- }
+ if (index == this.nonPersistentPublishers.size()) {
+ NonPersistentPublisherStatsImpl newStats = new
NonPersistentPublisherStatsImpl();
+ newStats.setSupportsPartialProducer(false);
+ this.nonPersistentPublishers.add(newStats);
Review Comment:
Added comments.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]