You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by li...@apache.org on 2026/08/11 18:13:09 UTC
(kafka) branch 4.4 updated: MINOR: update the javadocs in ConsumerNetworkClient (#23122)
This is an automated email from the ASF dual-hosted git repository.
lianetm pushed a commit to branch 4.4
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/4.4 by this push:
new 9ea8c3931cf MINOR: update the javadocs in ConsumerNetworkClient (#23122)
9ea8c3931cf is described below
commit 9ea8c3931cf9e5f6512790701cc0aaceec30a087
Author: Nikita Shupletsov <ni...@shupletsov.ca>
AuthorDate: Tue Aug 11 11:10:19 2026 -0700
MINOR: update the javadocs in ConsumerNetworkClient (#23122)
to include the information about WakeupException.
follow up for https://github.com/apache/kafka/pull/21592
---
.../kafka/clients/consumer/internals/ConsumerNetworkClient.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java
index 5a9bba6ded3..325d559704a 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java
@@ -158,7 +158,9 @@ public class ConsumerNetworkClient implements Closeable {
/**
* Block waiting on the metadata refresh with a timeout.
*
+ * @param timer Timer bounding how long this method can block
* @return true if update succeeded, false otherwise.
+ * @throws WakeupException if {@link #wakeup()} is called from another thread
*/
public boolean awaitMetadataUpdate(Timer timer) {
return awaitMetadataUpdate(timer, false);
@@ -170,6 +172,7 @@ public class ConsumerNetworkClient implements Closeable {
* @param timer Timer bounding how long this method can block
* @param disableWakeup true if we should not check for wakeups, false otherwise
* @return true if update succeeded, false otherwise.
+ * @throws WakeupException if {@link #wakeup()} is called from another thread and `disableWakeup` is false
*/
public boolean awaitMetadataUpdate(Timer timer, boolean disableWakeup) {
int version = this.metadata.requestUpdate(false);
@@ -182,6 +185,8 @@ public class ConsumerNetworkClient implements Closeable {
/**
* Ensure our metadata is fresh (if an update is expected, this will block
* until it has completed).
+ *
+ * @throws WakeupException if {@link #wakeup()} is called from another thread
*/
boolean ensureFreshMetadata(Timer timer) {
if (this.metadata.updateRequested() || this.metadata.timeToNextUpdate(timer.currentTimeMs()) == 0) {
@@ -259,6 +264,7 @@ public class ConsumerNetworkClient implements Closeable {
* Poll for any network IO.
* @param timer Timer bounding how long this method can block
* @param pollCondition Nullable blocking condition
+ * @throws WakeupException if {@link #wakeup()} is called from another thread
*/
public void poll(Timer timer, PollCondition pollCondition) {
poll(timer, pollCondition, false);
@@ -269,6 +275,7 @@ public class ConsumerNetworkClient implements Closeable {
* @param timer Timer bounding how long this method can block
* @param pollCondition Nullable blocking condition
* @param disableWakeup If TRUE disable triggering wake-ups
+ * @throws WakeupException if {@link #wakeup()} is called from another thread and `disableWakeup` is false
*/
public void poll(Timer timer, PollCondition pollCondition, boolean disableWakeup) {
// there may be handlers which need to be invoked if we woke up the previous call to poll
@@ -360,6 +367,7 @@ public class ConsumerNetworkClient implements Closeable {
* @param node The node to await requests from
* @param timer Timer bounding how long this method can block
* @return true If all requests finished, false if the timeout expired first
+ * @throws WakeupException if {@link #wakeup()} is called from another thread
*/
public boolean awaitPendingRequests(Node node, Timer timer) {
while (hasPendingRequests(node) && timer.notExpired()) {