Skip to content

Commit e3cbdc5

Browse files
Shawyeoknikhil-ctds
authored andcommitted
[fix][doc] Refine ClientBuilder#memoryLimit and ConsumerBuilder#autoScaledReceiverQueueSizeEnabled javadoc (apache#23687)
(cherry picked from commit 0845c21) (cherry picked from commit 0d757ad)
1 parent 15deabf commit e3cbdc5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ClientBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,8 @@ ClientBuilder authentication(String authPluginClassName, Map<String, String> aut
437437
ClientBuilder tlsProtocols(Set<String> tlsProtocols);
438438

439439
/**
440-
* Configure a limit on the amount of direct memory that will be allocated by this client instance.
441-
* <p>
442-
* <b>Note: at this moment this is only limiting the memory for producers.</b>
440+
* Configure a limit on the amount of direct memory that will be allocated by this client instance
441+
* <i>(default: 64 MB)</i>.
443442
* <p>
444443
* Setting this to 0 will disable the limit.
445444
*

pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,13 +837,16 @@ public interface ConsumerBuilder<T> extends Cloneable {
837837

838838
/**
839839
* If this is enabled, the consumer receiver queue size is initialized as a very small value, 1 by default,
840-
* and will double itself until it reaches the value set by {@link #receiverQueueSize(int)}, if and only if:
840+
* and will double itself until it reaches either the value set by {@link #receiverQueueSize(int)} or the client
841+
* memory limit set by {@link ClientBuilder#memoryLimit(long, SizeUnit)}.
842+
*
843+
* <p>The consumer receiver queue size will double if and only if:
841844
* <p>1) User calls receive() and there are no messages in receiver queue.
842845
* <p>2) The last message we put in the receiver queue took the last space available in receiver queue.
843846
*
844-
* This is disabled by default and currentReceiverQueueSize is initialized as maxReceiverQueueSize.
847+
* <p>This is disabled by default and currentReceiverQueueSize is initialized as maxReceiverQueueSize.
845848
*
846-
* The feature should be able to reduce client memory usage.
849+
* <p>The feature should be able to reduce client memory usage.
847850
*
848851
* @param enabled whether to enable AutoScaledReceiverQueueSize.
849852
*/

0 commit comments

Comments
 (0)