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



##########
File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/TopicStatsImpl.java
##########
@@ -90,7 +95,12 @@
 
     /** List of connected publishers on this topic w/ their stats. */
     @Getter(AccessLevel.NONE)
-    public List<PublisherStatsImpl> publishers;
+    @Setter(AccessLevel.NONE)
+    private List<PublisherStatsImpl> publishers;
+
+    @Getter(AccessLevel.NONE)
+    @Setter(AccessLevel.NONE)
+    private Map<String, PublisherStatsImpl> publishersMap;

Review comment:
       In my understanding, no. This field is just for internal use. If the 
jackson-databind selialize this POJO to JSON, the field will be returned as 
publishers through `TopicStatsImpl#getPublishers`. Also, deserialize it, the 
field will be separated to publishers and publishersMap through 
`TopicStatsImpl#setPublishers`.
   
   This because `PublisherStatsImpl#partialProducerSupported` is 
serialized/deserialized by jackson-databind.
   
   ```
   % ./bin/pulsar-admin topics partitioned-stats persistent://public/default/pt 
--per-partition
   {
     "msgRateIn" : 0.0,
     "msgThroughputIn" : 0.0,
     "msgRateOut" : 0.0,
     "msgThroughputOut" : 0.0,
     "bytesInCounter" : 488,
     "msgInCounter" : 8,
     "bytesOutCounter" : 0,
     "msgOutCounter" : 0,
     "averageMsgSize" : 0.0,
     "msgChunkPublished" : false,
     "storageSize" : 488,
     "backlogSize" : 0,
     "offloadedStorageSize" : 0,
     "lastOffloadLedgerId" : 0,
     "lastOffloadSuccessTimeStamp" : 0,
     "lastOffloadFailureTimeStamp" : 0,
     "publishers" : [ {
       "msgRateIn" : 0.0,
       "msgThroughputIn" : 0.0,
       "averageMsgSize" : 0.0,
       "chunkedMessageRate" : 0.0,
       "producerId" : 0,
       "partialProducerSupported" : true,
       "producerName" : "standalone-0-0"
     } ],
     "waitingPublishers" : 0,
     "subscriptions" : { },
     "replication" : { },
     "nonContiguousDeletedMessagesRanges" : 0,
     "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
     "compaction" : {
       "lastCompactionRemovedEventCount" : 0,
       "lastCompactionSucceedTimestamp" : 0,
       "lastCompactionFailedTimestamp" : 0,
       "lastCompactionDurationTimeInMills" : 0
     },
     "metadata" : {
       "partitions" : 2
     },
     "partitions" : {
       "persistent://public/default/pt-partition-1" : {
         "msgRateIn" : 0.0,
         "msgThroughputIn" : 0.0,
         "msgRateOut" : 0.0,
         "msgThroughputOut" : 0.0,
         "bytesInCounter" : 0,
         "msgInCounter" : 0,
         "bytesOutCounter" : 0,
         "msgOutCounter" : 0,
         "averageMsgSize" : 0.0,
         "msgChunkPublished" : false,
         "storageSize" : 0,
         "backlogSize" : 0,
         "offloadedStorageSize" : 0,
         "lastOffloadLedgerId" : 0,
         "lastOffloadSuccessTimeStamp" : 0,
         "lastOffloadFailureTimeStamp" : 0,
         "publishers" : [ ],
         "waitingPublishers" : 0,
         "subscriptions" : { },
         "replication" : { },
         "deduplicationStatus" : "Disabled",
         "nonContiguousDeletedMessagesRanges" : 0,
         "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
         "compaction" : {
           "lastCompactionRemovedEventCount" : 0,
           "lastCompactionSucceedTimestamp" : 0,
           "lastCompactionFailedTimestamp" : 0,
           "lastCompactionDurationTimeInMills" : 0
         }
       },
       "persistent://public/default/pt-partition-0" : {
         "msgRateIn" : 0.0,
         "msgThroughputIn" : 0.0,
         "msgRateOut" : 0.0,
         "msgThroughputOut" : 0.0,
         "bytesInCounter" : 488,
         "msgInCounter" : 8,
         "bytesOutCounter" : 0,
         "msgOutCounter" : 0,
         "averageMsgSize" : 0.0,
         "msgChunkPublished" : false,
         "storageSize" : 488,
         "backlogSize" : 0,
         "offloadedStorageSize" : 0,
         "lastOffloadLedgerId" : 0,
         "lastOffloadSuccessTimeStamp" : 0,
         "lastOffloadFailureTimeStamp" : 0,
         "publishers" : [ {
           "accessMode" : "Shared",
           "msgRateIn" : 0.0,
           "msgThroughputIn" : 0.0,
           "averageMsgSize" : 0.0,
           "chunkedMessageRate" : 0.0,
           "producerId" : 0,
           "partialProducerSupported" : true,
           "metadata" : { },
           "address" : "/127.0.0.1:64336",
           "producerName" : "standalone-0-0",
           "connectedSince" : "2021-11-15T19:21:23.335+09:00",
           "clientVersion" : "2.9.0-SNAPSHOT"
         } ],
         "waitingPublishers" : 0,
         "subscriptions" : { },
         "replication" : { },
         "deduplicationStatus" : "Disabled",
         "nonContiguousDeletedMessagesRanges" : 0,
         "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
         "compaction" : {
           "lastCompactionRemovedEventCount" : 0,
           "lastCompactionSucceedTimestamp" : 0,
           "lastCompactionFailedTimestamp" : 0,
           "lastCompactionDurationTimeInMills" : 0
         }
       }
     }
   }
   ```




-- 
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]


Reply via email to