merlimat commented on pull request #14231: URL: https://github.com/apache/pulsar/pull/14231#issuecomment-1036517138
> If we really want to avoid adding the synchronized keyword, we could use a `LongAdder` in the `OpSendMsgQueue`. Then, anytime an object is added or removed, we can increment/decrement accordingly, and the `getPendingQueueSize` will return the sum of the `LongAdder`. I agree that it would be better to have a messageCount method in `OpSendMsgQueue`, so that we can encapsulate the logic in there (and we don't have to deal with batching enabled/disabled cases either). -- 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]
