Skip to content

Commit 0d757ad

Browse files
Shawyeoklhotari
authored andcommitted
[fix][doc] Refine ClientBuilder#memoryLimit and ConsumerBuilder#autoScaledReceiverQueueSizeEnabled javadoc (#23687)
(cherry picked from commit 0845c21)
1 parent c93da6e commit 0d757ad

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
@@ -839,13 +839,16 @@ public interface ConsumerBuilder<T> extends Cloneable {
839839

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

0 commit comments

Comments
 (0)