Skip to content

Commit 0845c21

Browse files
authored
[fix][doc] Refine ClientBuilder#memoryLimit and ConsumerBuilder#autoScaledReceiverQueueSizeEnabled javadoc (#23687)
1 parent 51e8247 commit 0845c21

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
@@ -439,9 +439,8 @@ ClientBuilder authentication(String authPluginClassName, Map<String, String> aut
439439
ClientBuilder tlsProtocols(Set<String> tlsProtocols);
440440

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

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

885885
/**
886886
* If this is enabled, the consumer receiver queue size is initialized as a very small value, 1 by default,
887-
* and will double itself until it reaches the value set by {@link #receiverQueueSize(int)}, if and only if:
887+
* and will double itself until it reaches either the value set by {@link #receiverQueueSize(int)} or the client
888+
* memory limit set by {@link ClientBuilder#memoryLimit(long, SizeUnit)}.
889+
*
890+
* <p>The consumer receiver queue size will double if and only if:
888891
* <p>1) User calls receive() and there are no messages in receiver queue.
889892
* <p>2) The last message we put in the receiver queue took the last space available in receiver queue.
890893
*
891-
* This is disabled by default and currentReceiverQueueSize is initialized as maxReceiverQueueSize.
894+
* <p>This is disabled by default and currentReceiverQueueSize is initialized as maxReceiverQueueSize.
892895
*
893-
* The feature should be able to reduce client memory usage.
896+
* <p>The feature should be able to reduce client memory usage.
894897
*
895898
* @param enabled whether to enable AutoScaledReceiverQueueSize.
896899
*/

0 commit comments

Comments
 (0)