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 2019/08/27 02:42:25 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #5045: [client] Introduce `batchingMaxBytes` setting in pulsar producer

codelipenghui commented on a change in pull request #5045: [client] Introduce `batchingMaxBytes` setting in pulsar producer
URL: https://github.com/apache/pulsar/pull/5045#discussion_r317872363
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/AbstractBatchMessageContainer.java
 ##########
 @@ -37,11 +37,11 @@
     protected ProducerImpl producer;
 
     protected int maxNumMessagesInBatch;
+    protected int maxBytesInBatch;
     protected int numMessagesInBatch = 0;
     protected long currentBatchSizeBytes = 0;
 
-    protected static final int INITIAL_BATCH_BUFFER_SIZE = 1024;
-    protected static final int MAX_MESSAGE_BATCH_SIZE_BYTES = 128 * 1024;
+    protected static final int INITIAL_BATCH_BUFFER_SIZE = 128 * 1024;
 
 Review comment:
   It's better to keep INITIAL_BATCH_BUFFER_SIZE as 1KB, in key_based batcher properly create lot of ByteBuf, if the INITIAL_BATCH_BUFFER_SIZE is 128KB, more memory overhead may be incurred.
   
   We can add the option for init batch buffer size in the future, so that user can decide according to their own situation. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services