mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-30 04:54:25 +08:00
Compare commits
2 Commits
1fed8ca4d9
...
ca96aa725d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca96aa725d | ||
|
|
614917ba76 |
@@ -1,12 +1,8 @@
|
|||||||
FROM supersonicbi/supersonic:0.9.10-SNAPSHOT
|
FROM openjdk:21-jdk-bullseye as base
|
||||||
|
|
||||||
# Set the working directory in the container
|
# Set the working directory in the container
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Delete old supersonic installation directory and the symbolic link
|
|
||||||
RUN rm -rf /usr/src/app/supersonic-standalone-0.9.10-SNAPSHOT
|
|
||||||
RUN rm -f /usr/src/app/supersonic-standalone-latest
|
|
||||||
|
|
||||||
# Argument to pass in the supersonic version at build time
|
# Argument to pass in the supersonic version at build time
|
||||||
ARG SUPERSONIC_VERSION
|
ARG SUPERSONIC_VERSION
|
||||||
|
|
||||||
@@ -17,6 +13,17 @@ COPY assembly/build/supersonic-standalone-${SUPERSONIC_VERSION}.zip .
|
|||||||
RUN unzip supersonic-standalone-${SUPERSONIC_VERSION}.zip && \
|
RUN unzip supersonic-standalone-${SUPERSONIC_VERSION}.zip && \
|
||||||
rm supersonic-standalone-${SUPERSONIC_VERSION}.zip
|
rm supersonic-standalone-${SUPERSONIC_VERSION}.zip
|
||||||
|
|
||||||
|
FROM openjdk:21-slim
|
||||||
|
|
||||||
|
# Set the working directory in the container
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# Argument to pass in the supersonic version at build time
|
||||||
|
ARG SUPERSONIC_VERSION
|
||||||
|
|
||||||
|
# Copy the supersonic standalone folder into the container
|
||||||
|
COPY --from=base /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION} ./supersonic-standalone-${SUPERSONIC_VERSION}
|
||||||
|
|
||||||
# Create a symbolic link to the supersonic installation directory
|
# Create a symbolic link to the supersonic installation directory
|
||||||
RUN ln -s /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION} /usr/src/app/supersonic-standalone-latest
|
RUN ln -s /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION} /usr/src/app/supersonic-standalone-latest
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -149,15 +150,17 @@ public abstract class BaseDbAdaptor implements DbAdaptor {
|
|||||||
// 设置通用属性
|
// 设置通用属性
|
||||||
properties.setProperty("user", connectionInfo.getUserName());
|
properties.setProperty("user", connectionInfo.getUserName());
|
||||||
|
|
||||||
|
|
||||||
|
String password = Optional.ofNullable(connectionInfo.getPassword()).orElse("");
|
||||||
// 针对 Presto 和 Trino ssl=false 的情况,不需要设置密码
|
// 针对 Presto 和 Trino ssl=false 的情况,不需要设置密码
|
||||||
if (url.startsWith("jdbc:presto") || url.startsWith("jdbc:trino")) {
|
if (url.startsWith("jdbc:presto") || url.startsWith("jdbc:trino")) {
|
||||||
// 检查是否需要处理 SSL
|
// 检查是否需要处理 SSL
|
||||||
if (!url.contains("ssl=false")) {
|
if (!url.contains("ssl=false")) {
|
||||||
properties.setProperty("password", connectionInfo.getPassword());
|
properties.setProperty("password", password);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 针对其他数据库类型
|
// 针对其他数据库类型
|
||||||
properties.setProperty("password", connectionInfo.getPassword());
|
properties.setProperty("password", password);
|
||||||
}
|
}
|
||||||
|
|
||||||
return properties;
|
return properties;
|
||||||
|
|||||||
Reference in New Issue
Block a user