You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by mi...@apache.org on 2025/01/09 14:11:23 UTC
(kafka) branch 4.0 updated: MINOR: Remove ZooKeeper mentions in Sanitizer (#18420)
This is an automated email from the ASF dual-hosted git repository.
mimaison pushed a commit to branch 4.0
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/4.0 by this push:
new 67b465dc679 MINOR: Remove ZooKeeper mentions in Sanitizer (#18420)
67b465dc679 is described below
commit 67b465dc6797b1a73f7c0d0fe8a4f9ba953370d9
Author: Ken Huang <s7...@gmail.com>
AuthorDate: Thu Jan 9 21:33:43 2025 +0800
MINOR: Remove ZooKeeper mentions in Sanitizer (#18420)
Reviewers: Mickael Maison <mi...@gmail.com>
---
.../java/org/apache/kafka/common/utils/Sanitizer.java | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/clients/src/main/java/org/apache/kafka/common/utils/Sanitizer.java b/clients/src/main/java/org/apache/kafka/common/utils/Sanitizer.java
index 5b1b99692c9..669b9c37763 100644
--- a/clients/src/main/java/org/apache/kafka/common/utils/Sanitizer.java
+++ b/clients/src/main/java/org/apache/kafka/common/utils/Sanitizer.java
@@ -24,14 +24,11 @@ import java.util.regex.Pattern;
import javax.management.ObjectName;
/**
- * Utility class for sanitizing/desanitizing/quoting values used in JMX metric names
- * or as ZooKeeper node name.
+ * Utility class for sanitizing/desanitizing/quoting values used in JMX metric names.
* <p>
- * User principals and client-ids are URL-encoded using ({@link #sanitize(String)}
- * for use as ZooKeeper node names. User principals are URL-encoded in all metric
- * names as well. All other metric tags including client-id are quoted if they
- * contain special characters using {@link #jmxSanitize(String)} when
- * registering in JMX.
+ * User principals are URL-encoded using ({@link #sanitize(String)} in all metric names.
+ * All other metric tags including client-id are quoted if they contain special characters
+ * using {@link #jmxSanitize(String)} when registering in JMX.
*/
public class Sanitizer {
@@ -43,8 +40,7 @@ public class Sanitizer {
private static final Pattern MBEAN_PATTERN = Pattern.compile("[\\w-%\\. \t]*");
/**
- * Sanitize `name` for safe use as JMX metric name as well as ZooKeeper node name
- * using URL-encoding.
+ * Sanitize `name` for safe use as JMX metric name.
*/
public static String sanitize(String name) {
String encoded = URLEncoder.encode(name, StandardCharsets.UTF_8);
@@ -63,8 +59,7 @@ public class Sanitizer {
}
/**
- * Desanitize name that was URL-encoded using {@link #sanitize(String)}. This
- * is used to obtain the desanitized version of node names in ZooKeeper.
+ * Desanitize name that was URL-encoded using {@link #sanitize(String)}.
*/
public static String desanitize(String name) {
return URLDecoder.decode(name, StandardCharsets.UTF_8);