[KYUUBI-SHADED #34] [KYUUBI-SHADED #33] Step 2/2: Port ZOOKEEPER-1718 to support JLine2 in ZK client 3.4

### _Why are the changes needed?_

This PR aims to port ZOOKEEPER-1718 to make the Zookeeper 3.4 to support JLine2.

To gain a clear change history, I propose to split the change into 2 PRs,

1. copy [org.apache.zookeeper.ZooKeeperMain](https://raw.githubusercontent.com/apache/zookeeper/release-3.4.14/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java) and [org.apache.zookeeper.JLineZNodeCompletor](https://raw.githubusercontent.com/apache/zookeeper/release-3.4.14/zookeeper-server/src/main/java/org/apache/zookeeper/JLineZNodeCompletor.java) from Apache Zookeeper v3.4.14 as-is
2. apply changes in ZOOKEEPER-1718

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate

1. perform `build/mvn clean package` to generate `kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-34/target/kyuubi-relocated-zookeeper-34-0.3.0-SNAPSHOT.jar`
2. download and install [apache-kyuubi-1.8.0-bin.tgz](https://dlcdn.apache.org/kyuubi/kyuubi-1.8.0/apache-kyuubi-1.8.0-bin.tgz)
3. replace `KYUUBI_HOME/jars/kyuubi-shaded-zookeeper-34-0.1.0.jar` with `kyuubi-relocated-zookeeper-34-0.3.0-SNAPSHOT.jar`
4. replace `KYUUBI_HOME/jars/jline-0.9.94.jar` with `jline-2.14.6.jar`
5. perform `bin/kyuubi-zk-cli -server xxxxx:2181` to connect a Zookeeper cluster
6. check the logs to make sure JLine is enabled and run some command to check basic functionalities
```
...
2024-01-15 19:52:04.593 INFO org.apache.kyuubi.shaded.zookeeper.ZooKeeper: Client environment:java.class.path=...:jline-2.14.6.jar:...:kyuubi-relocated-zookeeper-34-0.3.0-SNAPSHOT.jar...
...
JLine support is enabled
...
```

- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #34 from pan3793/jline2-2.

e769ee8 [Cheng Pan] [KYUUBI-SHADED #33] Step 2/2: Port ZOOKEEPER-1718 to support JLine2 in ZK client 3.4

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
3 files changed
tree: e7145267f61f5027c275c746d67545b0cceb51e5
  1. .github/
  2. build/
  3. dev/
  4. kyuubi-relocated-force-shading/
  5. kyuubi-relocated-hive-service-rpc/
  6. kyuubi-relocated-zookeeper-parent/
  7. .asf.yaml
  8. .gitattributes
  9. .gitignore
  10. .rat-excludes
  11. LICENSE
  12. NOTICE
  13. pom.xml
  14. README.md
README.md

Apache Kyuubi Shaded Dependencies

This project packages relocated third-party libraries used by Apache Kyuubi.

All relocated classes is under the package org.apache.kyuubi.shaded, and the binary artifacts' name start with kyuubi-relocated-.

DISCLAIMER

This project is for Apache Kyuubi internal use. Included libs and/or their versions are subject to change at the dictate of Kyuubi without regard to the concern of others!

About

Apache Kyuubi is an open source project of The Apache Software Foundation (ASF).