This is an automated email from the ASF dual-hosted git repository.
feiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new c224a63b1 [KYUUBI #5054] Refine the kyuubi client version properties
file to prevent conflicts
c224a63b1 is described below
commit c224a63b1cf399da18df58695bc075448b4b4c8d
Author: fwang12 <[email protected]>
AuthorDate: Sat Jul 15 13:17:05 2023 +0800
[KYUUBI #5054] Refine the kyuubi client version properties file to prevent
conflicts
### _Why are the changes needed?_
To prevent conflicts in case that other dependency also has a resource
named `version.properties`.
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including
negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [x] [Run
test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests)
locally before make a pull request
Closes #5054 from turboFei/version_conflicts.
Closes #5054
fe1333dbe [fwang12] prevent version properties conflicts
Authored-by: fwang12 <[email protected]>
Signed-off-by: fwang12 <[email protected]>
---
.../src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java | 5 ++++-
.../src/main/resources/{ => org/apache/kyuubi}/version.properties | 0
.../src/main/java/org/apache/kyuubi/client/util/VersionUtils.java | 5 ++++-
.../src/main/resources/{ => org/apache/kyuubi}/version.properties | 0
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git
a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java
b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java
index ef723ea30..d0167e3e4 100644
--- a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java
+++ b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java
@@ -551,7 +551,10 @@ public class Utils {
if (KYUUBI_CLIENT_VERSION == null) {
try {
Properties prop = new Properties();
-
prop.load(Utils.class.getClassLoader().getResourceAsStream("version.properties"));
+ prop.load(
+ Utils.class
+ .getClassLoader()
+ .getResourceAsStream("org/apache/kyuubi/version.properties"));
KYUUBI_CLIENT_VERSION = prop.getProperty(KYUUBI_CLIENT_VERSION_KEY,
"unknown");
} catch (Exception e) {
LOG.error("Error getting kyuubi client version", e);
diff --git a/kyuubi-hive-jdbc/src/main/resources/version.properties
b/kyuubi-hive-jdbc/src/main/resources/org/apache/kyuubi/version.properties
similarity index 100%
rename from kyuubi-hive-jdbc/src/main/resources/version.properties
rename to
kyuubi-hive-jdbc/src/main/resources/org/apache/kyuubi/version.properties
diff --git
a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/util/VersionUtils.java
b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/util/VersionUtils.java
index bcabca5b9..1f8cedf4b 100644
---
a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/util/VersionUtils.java
+++
b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/util/VersionUtils.java
@@ -31,7 +31,10 @@ public class VersionUtils {
if (KYUUBI_CLIENT_VERSION == null) {
try {
Properties prop = new Properties();
-
prop.load(VersionUtils.class.getClassLoader().getResourceAsStream("version.properties"));
+ prop.load(
+ VersionUtils.class
+ .getClassLoader()
+ .getResourceAsStream("org/apache/kyuubi/version.properties"));
KYUUBI_CLIENT_VERSION = prop.getProperty(KYUUBI_CLIENT_VERSION_KEY,
"unknown");
} catch (Exception e) {
LOG.error("Error getting kyuubi client version", e);
diff --git a/kyuubi-rest-client/src/main/resources/version.properties
b/kyuubi-rest-client/src/main/resources/org/apache/kyuubi/version.properties
similarity index 100%
rename from kyuubi-rest-client/src/main/resources/version.properties
rename to
kyuubi-rest-client/src/main/resources/org/apache/kyuubi/version.properties