mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-26 18:24:20 +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
|
||||
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
|
||||
ARG SUPERSONIC_VERSION
|
||||
|
||||
@@ -17,6 +13,17 @@ COPY assembly/build/supersonic-standalone-${SUPERSONIC_VERSION}.zip .
|
||||
RUN unzip 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
|
||||
RUN ln -s /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION} /usr/src/app/supersonic-standalone-latest
|
||||
|
||||
@@ -27,4 +34,4 @@ WORKDIR /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION}
|
||||
EXPOSE 9080
|
||||
# Command to run the supersonic daemon
|
||||
RUN chmod +x bin/supersonic-daemon.sh
|
||||
CMD ["bash", "-c", "bin/supersonic-daemon.sh restart standalone ${S2_DB_TYPE} && tail -f /dev/null"]
|
||||
CMD ["bash", "-c", "bin/supersonic-daemon.sh restart standalone ${S2_DB_TYPE} && tail -f /dev/null"]
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
|
||||
@Slf4j
|
||||
@@ -149,15 +150,17 @@ public abstract class BaseDbAdaptor implements DbAdaptor {
|
||||
// 设置通用属性
|
||||
properties.setProperty("user", connectionInfo.getUserName());
|
||||
|
||||
|
||||
String password = Optional.ofNullable(connectionInfo.getPassword()).orElse("");
|
||||
// 针对 Presto 和 Trino ssl=false 的情况,不需要设置密码
|
||||
if (url.startsWith("jdbc:presto") || url.startsWith("jdbc:trino")) {
|
||||
// 检查是否需要处理 SSL
|
||||
if (!url.contains("ssl=false")) {
|
||||
properties.setProperty("password", connectionInfo.getPassword());
|
||||
properties.setProperty("password", password);
|
||||
}
|
||||
} else {
|
||||
// 针对其他数据库类型
|
||||
properties.setProperty("password", connectionInfo.getPassword());
|
||||
properties.setProperty("password", password);
|
||||
}
|
||||
|
||||
return properties;
|
||||
|
||||
Reference in New Issue
Block a user