You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/02/02 07:26:29 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #12401: [PIP 79][common,broker,client] Change PartitionedTopicStats to aggregate by producerName

eolivelli commented on a change in pull request #12401:
URL: https://github.com/apache/pulsar/pull/12401#discussion_r797329606



##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/NonPersistentTopicStatsImpl.java
##########
@@ -57,7 +62,11 @@
 
     @JsonProperty("publishers")
     public List<NonPersistentPublisherStats> getNonPersistentPublishers() {
-        return (List<NonPersistentPublisherStats>) nonPersistentPublishers;
+        return Stream.concat(nonPersistentPublishers.stream()
+                                .sorted(Comparator.comparing(NonPersistentPublisherStats::getProducerName)),

Review comment:
       sorting here may be a problem for users.
   because users will tend to think that this list is always sorted by producerName, but there is documentation about this, and stuff like this tend to break in future refactors.
   
   do you really need this list to be sorted ?




-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org