Skip to content

Commit

Permalink
[fix][doc] Refine ClientBuilder#memoryLimit and ConsumerBuilder#autoS…
Browse files Browse the repository at this point in the history
…caledReceiverQueueSizeEnabled javadoc (apache#23687)
  • Loading branch information
Shawyeok authored Dec 13, 2024
1 parent 51e8247 commit 0845c21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,8 @@ ClientBuilder authentication(String authPluginClassName, Map<String, String> aut
ClientBuilder tlsProtocols(Set<String> tlsProtocols);

/**
* Configure a limit on the amount of direct memory that will be allocated by this client instance.
* <p>
* <b>Note: at this moment this is only limiting the memory for producers.</b>
* Configure a limit on the amount of direct memory that will be allocated by this client instance
* <i>(default: 64 MB)</i>.
* <p>
* Setting this to 0 will disable the limit.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -884,13 +884,16 @@ public interface ConsumerBuilder<T> extends Cloneable {

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

0 comments on commit 0845c21

Please sign in to comment.