MarvinCai opened a new pull request #11119:
URL: https://github.com/apache/pulsar/pull/11119


   Fixes #https://github.com/apache/pulsar/issues/10495
   
   ### Motivation
   MsgDropRate info is missing after NonPersistentTopics admin api merged with 
Topics admin api. This PR is trying to fix this.
   
   ### Modifications
   Seems due to API merging, data is not properly deserialized in admin client.
   And also due to the added TopicsStats interface, the field hiding causing 
weird behavior with Jackson so fields in NonPersistentTopicStatsImpl intended 
to hide superclass' fields are not shown in output.
   
   Fixing by not using same field name to hide superclass fields and use 
@JsonIgnore to hide them from output. And add new fields to store 
subscription/publisher/replicator info for NonPersistentTopic.
   This does change the output name of those info, but it only changed in cli 
output, for admin client the old 
getSubscriptions/getSubscriptions/getReplication will still work. 
   ```
   {
     "count" : 0,
     "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,
     "waitingPublishers" : 0,
     "nonContiguousDeletedMessagesRanges" : 0,
     "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
     "msgDropRate" : 0.0,
     "nonPersistentPublishers" : [ ],
     "nonPersistentSubscriptions" : {
       "my-sub" : {
         "msgRateOut" : 0.0,
         "msgThroughputOut" : 0.0,
         "bytesOutCounter" : 0,
         "msgOutCounter" : 0,
         "msgRateRedeliver" : 0.0,
         "chunkedMessageRate" : 0,
         "msgBacklog" : 0,
         "backlogSize" : 0,
         "msgBacklogNoDelayed" : 0,
         "blockedSubscriptionOnUnackedMsgs" : false,
         "msgDelayed" : 0,
         "unackedMessages" : 0,
         "type" : "Exclusive",
         "msgRateExpired" : 0.0,
         "totalMsgExpired" : 0,
         "lastExpireTimestamp" : 0,
         "lastConsumedFlowTimestamp" : 0,
         "lastConsumedTimestamp" : 0,
         "lastAckedTimestamp" : 0,
         "lastMarkDeleteAdvancedTimestamp" : 0,
         "consumers" : [ {
           "msgRateOut" : 0.0,
           "msgThroughputOut" : 0.0,
           "bytesOutCounter" : 0,
           "msgOutCounter" : 0,
           "msgRateRedeliver" : 0.0,
           "chunkedMessageRate" : 0.0,
           "consumerName" : "26c56",
           "availablePermits" : 1000,
           "unackedMessages" : 0,
           "avgMessagesPerEntry" : 1000,
           "blockedConsumerOnUnackedMsgs" : false,
           "lastAckedTimestamp" : 0,
           "lastConsumedTimestamp" : 0,
           "metadata" : { },
           "address" : "/127.0.0.1:52121",
           "connectedSince" : "2021-06-27T14:20:43.709766+08:00",
           "clientVersion" : "2.9.0-SNAPSHOT"
         } ],
         "isDurable" : false,
         "isReplicated" : false,
         "consumersAfterMarkDeletePosition" : { },
         "nonContiguousDeletedMessagesRanges" : 0,
         "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
         "msgDropRate" : 0.0,
         "durable" : false,
         "replicated" : false
       }
     },
     "nonPersistentReplicators" : { }
   }
   ```
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   This change added tests and can be verified as follows:
   - Added unit test.
   
   ### 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: yes
     - 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
   


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