You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2024/07/16 12:05:34 UTC
(kyuubi-shaded) branch branch-0.4 updated: [KYUUBI #6496] Step 2/2: Port ZOOKEEPER-4377 to Kyuubi shaded ZooKeeper 3.4 and 3.6
This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch branch-0.4
in repository https://gitbox.apache.org/repos/asf/kyuubi-shaded.git
The following commit(s) were added to refs/heads/branch-0.4 by this push:
new fe3a44b [KYUUBI #6496] Step 2/2: Port ZOOKEEPER-4377 to Kyuubi shaded ZooKeeper 3.4 and 3.6
fe3a44b is described below
commit fe3a44b323f387a66505c92b024e8fc90469efbf
Author: madlnu <ma...@visa.com>
AuthorDate: Tue Jul 16 20:05:13 2024 +0800
[KYUUBI #6496] Step 2/2: Port ZOOKEEPER-4377 to Kyuubi shaded ZooKeeper 3.4 and 3.6
### _Why are the changes needed?_
This is continuation of PR - #46 aims to resolve issue [Kyuubi 6496](https://github.com/apache/kyuubi/issues/6496).
In this PR, the [zookeeper-4377](https://github.com/apache/zookeeper/pull/1764) change has been backported
### _How was this patch tested?_
This was built locally and tested in local using following steps:
1. perform build/mvn clean package to generate kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-34/target/kyuubi-relocated-zookeeper-34-0.5.0-SNAPSHOT.jar
2. download and install [apache-kyuubi-1.9.1-bin.tgz](https://dlcdn.apache.org/kyuubi/kyuubi-1.9.1/apache-kyuubi-1.9.1-bin.tgz)
3. replace KYUUBI_HOME/jars/kyuubi-relocated-zookeeper-34-0.3.0-SNAPSHOT.jar with kyuubi-relocated-zookeeper-34-0.5.0-SNAPSHOT.jar
4. perform bin/kyuubi-zk-cli -server xxxxx:2181 to connect a Zookeeper cluster
Closes #47 from Madhukar525722/zoo-4377.
84aca7c [madlnu] [KYUUBI #6496] Step 2/2: Port ZOOKEEPER-4377 to Kyuubi shaded ZooKeeper 3.4 and 3.6
Authored-by: madlnu <ma...@visa.com>
Signed-off-by: Cheng Pan <ch...@apache.org>
(cherry picked from commit b20fd148bd1dc19b2ef940baee7d8c451b513b24)
Signed-off-by: Cheng Pan <ch...@apache.org>
---
.../src/main/java/org/apache/zookeeper/KeeperException.java | 12 +++++++++---
.../src/main/java/org/apache/zookeeper/KeeperException.java | 12 +++++++++---
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-34/src/main/java/org/apache/zookeeper/KeeperException.java b/kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-34/src/main/java/org/apache/zookeeper/KeeperException.java
index 0e1106c..c53710e 100644
--- a/kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-34/src/main/java/org/apache/zookeeper/KeeperException.java
+++ b/kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-34/src/main/java/org/apache/zookeeper/KeeperException.java
@@ -118,7 +118,7 @@ public abstract class KeeperException extends Exception {
case OK:
default:
- throw new IllegalArgumentException("Invalid exception code");
+ throw new IllegalArgumentException("Invalid exception code:" + code.code);
}
}
@@ -282,10 +282,16 @@ public abstract class KeeperException extends Exception {
* Get the Code value for a particular integer error code
*
* @param code int error code
- * @return Code value corresponding to specified int code, or null
+ * @return Code value corresponding to specified int code, if null throws
+ * IllegalArgumentException
*/
public static Code get(int code) {
- return lookup.get(code);
+ Code codeVal = lookup.get(code);
+ if (codeVal == null) {
+ throw new IllegalArgumentException(
+ "The current client version cannot lookup this code:" + code);
+ }
+ return codeVal;
}
}
diff --git a/kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-36/src/main/java/org/apache/zookeeper/KeeperException.java b/kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-36/src/main/java/org/apache/zookeeper/KeeperException.java
index d61be4a..67b56c0 100644
--- a/kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-36/src/main/java/org/apache/zookeeper/KeeperException.java
+++ b/kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-36/src/main/java/org/apache/zookeeper/KeeperException.java
@@ -136,7 +136,7 @@ public abstract class KeeperException extends Exception {
return new RequestTimeoutException();
case OK:
default:
- throw new IllegalArgumentException("Invalid exception code");
+ throw new IllegalArgumentException("Invalid exception code:" + code.code);
}
}
@@ -340,10 +340,16 @@ public abstract class KeeperException extends Exception {
* Get the Code value for a particular integer error code
*
* @param code int error code
- * @return Code value corresponding to specified int code, or null
+ * @return Code value corresponding to specified int code, if null throws
+ * IllegalArgumentException
*/
public static Code get(int code) {
- return lookup.get(code);
+ Code codeVal = lookup.get(code);
+ if (codeVal == null) {
+ throw new IllegalArgumentException(
+ "The current client version cannot lookup this code:" + code);
+ }
+ return codeVal;
}
}