merlimat commented on a change in pull request #9396:
URL: https://github.com/apache/pulsar/pull/9396#discussion_r568261578



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
##########
@@ -365,6 +365,21 @@ public void addCallback(MessageImpl<?> msg, SendCallback 
scb) {
         }
     }
 
+    /**
+     * Compress the payload if compression is configured
+     * @param payload
+     * @return a new payload
+     */
+    private ByteBuf applyCompression(ByteBuf payload) {
+        if (conf.getCompressionType() != CompressionType.NONE) {

Review comment:
       This check is not necessary. The `CompressionCodecNone` will already 
mimic the same behavior with respect to the reference counting.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to