doleyzi commented on code in PR #8424:
URL: https://github.com/apache/inlong/pull/8424#discussion_r1252957794
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/ck/ClickHouseConfig.java:
##########
@@ -30,45 +35,61 @@
* Clickhouse config information, including url, user, etc.
*/
@Component
+@Service
+@Slf4j
public class ClickHouseConfig {
+ @Autowired
+ private AuditQuerySourceConfigEntityMapper querySourceConfigEntityMapper;
private static volatile DataSource source;
+ private static volatile String currentJdbcUrl = null;
+ private static volatile String currentUserName = null;
+ private static volatile String currentPassword = null;
- private static String jdbcUrl;
-
- private static String username;
-
- private static String password;
-
- @Value("${audit.ck.jdbcUrl}")
- public void setUrl(String jdbcUrl) {
- ClickHouseConfig.jdbcUrl = jdbcUrl;
- }
-
- @Value("${audit.ck.username}")
- public void setUsername(String username) {
- ClickHouseConfig.username = username;
- }
-
- @Value("${audit.ck.password}")
- public void setPassword(String password) {
- ClickHouseConfig.password = password;
- }
+ public void updateCkSource() {
+ try {
+ if (querySourceConfigEntityMapper == null) {
Review Comment:
If querySourceConfigEntityMapper is equal to null, it should return,
otherwise, a null pointer exception will be reported later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]