You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "qifanlili (via GitHub)" <gi...@apache.org> on 2023/11/08 06:59:37 UTC
[PR] [Feature][Standalone]Support using JDBC registry plugin in standalone mode. #15103 [dolphinscheduler]
qifanlili opened a new pull request, #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139
<!--Thanks very much for contributing to Apache DolphinScheduler, we are happy that you want to help us improve DolphinScheduler! -->
## Purpose of the pull request
<!--(For example: This pull request adds checkstyle plugin).-->
This pull request support using JDBC registry plugin in standalone mode. #15103
## Brief change log
<!--*(for example:)*
- *Add maven-checkstyle-plugin to root pom.xml*
-->
- *Same configuration as the Zookeeper/JDBC plugin. Type gives the user the option to use any type as a registry*
- *Add README.mdl*
## Verify this pull request
<!--*(Please pick either of the following options)*-->
This pull request is already covered by existing tests, such as *(please describe tests)*.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1386457726
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/registry/ZookeeperStandaloneRegistry.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.registry;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.curator.test.TestingServer;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@Component
+public class ZookeeperStandaloneRegistry implements StandaloneRegistry {
+
+ @Override
+ public void init() {
+ try {
+ TestingServer zookeeperServer = new TestingServer(true);
Review Comment:
I've fixed it
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1801704929
## [Codecov](https://app.codecov.io/gh/apache/dolphinscheduler/pull/15139?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#15139](https://app.codecov.io/gh/apache/dolphinscheduler/pull/15139?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (2ccdf3c) into [dev](https://app.codecov.io/gh/apache/dolphinscheduler/commit/65a7c7f26ba69fe96bc70e6964e969b0bf3b78a6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (65a7c7f) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
> :exclamation: Current head 2ccdf3c differs from pull request most recent head b93ae76. Consider uploading reports for the commit b93ae76 to get more accurate results
```diff
@@ Coverage Diff @@
## dev #15139 +/- ##
=========================================
Coverage 38.17% 38.18%
- Complexity 4681 4682 +1
=========================================
Files 1281 1281
Lines 45347 45308 -39
Branches 4941 4918 -23
=========================================
- Hits 17311 17300 -11
+ Misses 26149 26123 -26
+ Partials 1887 1885 -2
```
[see 25 files with indirect coverage changes](https://app.codecov.io/gh/apache/dolphinscheduler/pull/15139/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in [Chrome](https://chrome.google.com/webstore/detail/codecov/gedikamndpbemklijjkncpnolildpbgo) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/codecov/) today!
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1801432084
> @ruanwenjun I don't know how to add labels, I'm a bit confused. Can you help me ?
You don't have permission to add label.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-2026364396
This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1386420254
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/registry/ZookeeperStandaloneRegistry.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.registry;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.curator.test.TestingServer;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@Component
+public class ZookeeperStandaloneRegistry implements StandaloneRegistry {
+
+ @Override
+ public void init() {
+ try {
+ TestingServer zookeeperServer = new TestingServer(true);
Review Comment:
## Unread local variable
Variable 'TestingServer zookeeperServer' is never read.
[Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/3550)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1387430436
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
> It's not a good idea add name 'sqlSessionFactory' for this bean, since this will cause the JdbcRegistry use the same sql session factory with the business.
Thank you for reminding me of this.
I write this because I find that if I don't explicitly declare 'sqlSessionFactory' , an exception will be thrown at startup:
[dolphinscheduler-standalone.log](https://github.com/apache/dolphinscheduler/files/13303243/dolphinscheduler-standalone.log)
I think it might be because of 'daoconfiguration. Java 'references it
<img width="972" alt="image" src="https://github.com/apache/dolphinscheduler/assets/40498606/803b41ea-d4c7-4cf1-b72a-0e52243e2588">
Is this a known problem?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1801713704
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15139)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list)
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1801230100
@ruanwenjun I don't know how to add this tag, I'm a bit confused. Can you help me ?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1386457075
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java:
##########
@@ -17,28 +17,50 @@
package org.apache.dolphinscheduler;
-import org.apache.curator.test.TestingServer;
+import org.apache.dolphinscheduler.registry.StandaloneRegistry;
+
+import java.util.List;
+import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
@Slf4j
public class StandaloneServer {
+ @Value("${registry.type}")
+ private String registryType;
+
+ @Autowired
+ private List<StandaloneRegistry> registries;
+
public static void main(String[] args) throws Exception {
try {
- // We cannot use try-with-resources to close "TestingServer", since SpringApplication.run() will not block
- // the main thread.
- TestingServer zookeeperServer = new TestingServer(true);
- System.setProperty("registry.zookeeper.connect-string", zookeeperServer.getConnectString());
- SpringApplication.run(StandaloneServer.class, args);
+ ConfigurableApplicationContext context = SpringApplication.run(StandaloneServer.class, args);
+ StandaloneServer standaloneServer = context.getBean(StandaloneServer.class);
+ standaloneServer.registry();
} catch (Exception ex) {
log.error("StandaloneServer start failed", ex);
System.exit(1);
}
}
-}
+ private void registry() {
+ Optional<StandaloneRegistry> registry = registries.stream()
+ .filter(r -> r.supports(registryType))
+ .findFirst();
+
+ if (registry.isPresent()) {
+ registry.get().init();
+ } else {
+ log.error("Unsupported registry type: {}", registryType);
+ }
+ }
+
+}
Review Comment:
> Please add a blank line here.
Thanks for the tip! I haven't made a habit of using “mvn spotless: apply”
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java:
##########
@@ -17,28 +17,50 @@
package org.apache.dolphinscheduler;
-import org.apache.curator.test.TestingServer;
+import org.apache.dolphinscheduler.registry.StandaloneRegistry;
+
+import java.util.List;
+import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
@Slf4j
public class StandaloneServer {
+ @Value("${registry.type}")
+ private String registryType;
+
+ @Autowired
+ private List<StandaloneRegistry> registries;
+
public static void main(String[] args) throws Exception {
try {
- // We cannot use try-with-resources to close "TestingServer", since SpringApplication.run() will not block
- // the main thread.
- TestingServer zookeeperServer = new TestingServer(true);
- System.setProperty("registry.zookeeper.connect-string", zookeeperServer.getConnectString());
- SpringApplication.run(StandaloneServer.class, args);
+ ConfigurableApplicationContext context = SpringApplication.run(StandaloneServer.class, args);
+ StandaloneServer standaloneServer = context.getBean(StandaloneServer.class);
+ standaloneServer.registry();
} catch (Exception ex) {
log.error("StandaloneServer start failed", ex);
System.exit(1);
}
}
-}
+ private void registry() {
+ Optional<StandaloneRegistry> registry = registries.stream()
+ .filter(r -> r.supports(registryType))
+ .findFirst();
+
+ if (registry.isPresent()) {
+ registry.get().init();
+ } else {
+ log.error("Unsupported registry type: {}", registryType);
+ }
+ }
+
+}
Review Comment:
> Please add a blank line here.
Thanks for the tip! I haven't made a habit of using “mvn spotless: apply”
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1802160147
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15139)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list)
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1802162858
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15139)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list)
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1387433757
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
> > It's not a good idea add name 'sqlSessionFactory' for this bean, since this will cause the JdbcRegistry use the same sql session factory with the business.
>
> Thank you for reminding me of this. I write this because I find that When I using `JDBCRegistry plugin`,
if I don't explicitly declare 'sqlSessionFactory' , an exception will be thrown at startup: [dolphinscheduler-standalone.log](https://github.com/apache/dolphinscheduler/files/13303243/dolphinscheduler-standalone.log) <img alt="image" width="1106" src="https://user-images.githubusercontent.com/40498606/281602379-e26c6a96-4dfa-415e-ba99-2c1b618850a9.png">
>
> I think it might be because of 'DaoConfiguration. java 'references it <img alt="image" width="972" src="https://user-images.githubusercontent.com/40498606/281602082-803b41ea-d4c7-4cf1-b72a-0e52243e2588.png">
>
> Is this a known problem?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1386803607
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/registry/JdbcStandaloneRegistry.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.registry;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class JdbcStandaloneRegistry implements StandaloneRegistry {
+
+ @Override
+ public void init() {
+ // The JDBC plugin will take effect via @ConditionalOnProperty.
+ }
+
+ @Override
+ public boolean supports(String registryType) {
+ return "jdbc".equalsIgnoreCase(registryType);
+ }
+}
Review Comment:
Can we remove this? I hope we can only add a StandaloneZookeeperRegistry, in this class, we will start a `TestingServer`, and user can still use zookeeper registry to connect their own zk cluster or use JDBC to connect their own db.
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
It's not a good idea add name 'sqlSessionFactory' for this bean, since this will cause the JdbcRegistry use the same sql session factory with the business.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1387430436
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
> It's not a good idea add name 'sqlSessionFactory' for this bean, since this will cause the JdbcRegistry use the same sql session factory with the business.
Thank you for reminding me of this. I write this because I find that When I using `JDBCRegistry plugin`,
if I don't explicitly declare 'sqlSessionFactory' , an exception will be thrown at startup: [dolphinscheduler-standalone.log](https://github.com/apache/dolphinscheduler/files/13303243/dolphinscheduler-standalone.log) <img alt="image" width="1106" src="https://user-images.githubusercontent.com/40498606/281602379-e26c6a96-4dfa-415e-ba99-2c1b618850a9.png">
I think it might be because of 'DaoConfiguration. java 'references it <img alt="image" width="972" src="https://user-images.githubusercontent.com/40498606/281602082-803b41ea-d4c7-4cf1-b72a-0e52243e2588.png">
Is this a known problem?
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
> > It's not a good idea add name 'sqlSessionFactory' for this bean, since this will cause the JdbcRegistry use the same sql session factory with the business.
>
> Thank you for reminding me of this. I write this because I find that When I using `JDBCRegistry plugin`,
if I don't explicitly declare 'sqlSessionFactory' , an exception will be thrown at startup: [dolphinscheduler-standalone.log](https://github.com/apache/dolphinscheduler/files/13303243/dolphinscheduler-standalone.log) <img alt="image" width="1106" src="https://user-images.githubusercontent.com/40498606/281602379-e26c6a96-4dfa-415e-ba99-2c1b618850a9.png">
>
> I think it might be because of 'DaoConfiguration. java 'references it <img alt="image" width="972" src="https://user-images.githubusercontent.com/40498606/281602082-803b41ea-d4c7-4cf1-b72a-0e52243e2588.png">
>
> Is this a known problem?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-2010956112
This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1386455673
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java:
##########
@@ -17,28 +17,50 @@
package org.apache.dolphinscheduler;
-import org.apache.curator.test.TestingServer;
+import org.apache.dolphinscheduler.registry.StandaloneRegistry;
+
+import java.util.List;
+import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
@Slf4j
public class StandaloneServer {
+ @Value("${registry.type}")
+ private String registryType;
+
+ @Autowired
+ private List<StandaloneRegistry> registries;
+
public static void main(String[] args) throws Exception {
try {
- // We cannot use try-with-resources to close "TestingServer", since SpringApplication.run() will not block
Review Comment:
> Why remove this?
I'm sorry I missed that. My idea is to move it to the “dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/registry/ZookeeperStandaloneRegistry.java”
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java:
##########
@@ -17,28 +17,50 @@
package org.apache.dolphinscheduler;
-import org.apache.curator.test.TestingServer;
+import org.apache.dolphinscheduler.registry.StandaloneRegistry;
+
+import java.util.List;
+import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
@Slf4j
public class StandaloneServer {
+ @Value("${registry.type}")
+ private String registryType;
+
+ @Autowired
+ private List<StandaloneRegistry> registries;
+
public static void main(String[] args) throws Exception {
try {
- // We cannot use try-with-resources to close "TestingServer", since SpringApplication.run() will not block
Review Comment:
> Why remove this?
I'm sorry I missed that. My idea is to move it to the “dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/registry/ZookeeperStandaloneRegistry.java”
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1387430436
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
> It's not a good idea add name 'sqlSessionFactory' for this bean, since this will cause the JdbcRegistry use the same sql session factory with the business.
Thank you for reminding me of this.
I write this because I find that if I don't explicitly declare 'sqlSessionFactory' , an exception will be thrown at startup:
[dolphinscheduler-standalone.log](https://github.com/apache/dolphinscheduler/files/13303243/dolphinscheduler-standalone.log)
<img width="1106" alt="image" src="https://github.com/apache/dolphinscheduler/assets/40498606/e26c6a96-4dfa-415e-ba99-2c1b618850a9">
I think it might be because of 'DaoConfiguration. java 'references it
<img width="972" alt="image" src="https://github.com/apache/dolphinscheduler/assets/40498606/803b41ea-d4c7-4cf1-b72a-0e52243e2588">
Is this a known problem?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1400107813
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
I didn't meet this problem, it can work well when I use JDBC registry
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #15139: [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode.
URL: https://github.com/apache/dolphinscheduler/pull/15139
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1801733126
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15139)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list)
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1805282173
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15139)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list)
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1386327390
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java:
##########
@@ -17,28 +17,50 @@
package org.apache.dolphinscheduler;
-import org.apache.curator.test.TestingServer;
+import org.apache.dolphinscheduler.registry.StandaloneRegistry;
+
+import java.util.List;
+import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
@Slf4j
public class StandaloneServer {
+ @Value("${registry.type}")
+ private String registryType;
+
+ @Autowired
+ private List<StandaloneRegistry> registries;
+
public static void main(String[] args) throws Exception {
try {
- // We cannot use try-with-resources to close "TestingServer", since SpringApplication.run() will not block
- // the main thread.
- TestingServer zookeeperServer = new TestingServer(true);
- System.setProperty("registry.zookeeper.connect-string", zookeeperServer.getConnectString());
- SpringApplication.run(StandaloneServer.class, args);
+ ConfigurableApplicationContext context = SpringApplication.run(StandaloneServer.class, args);
+ StandaloneServer standaloneServer = context.getBean(StandaloneServer.class);
+ standaloneServer.registry();
} catch (Exception ex) {
log.error("StandaloneServer start failed", ex);
System.exit(1);
}
}
-}
+ private void registry() {
+ Optional<StandaloneRegistry> registry = registries.stream()
+ .filter(r -> r.supports(registryType))
+ .findFirst();
+
+ if (registry.isPresent()) {
+ registry.get().init();
+ } else {
+ log.error("Unsupported registry type: {}", registryType);
+ }
+ }
+
+}
Review Comment:
Please add a blank line here.
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java:
##########
@@ -17,28 +17,50 @@
package org.apache.dolphinscheduler;
-import org.apache.curator.test.TestingServer;
+import org.apache.dolphinscheduler.registry.StandaloneRegistry;
+
+import java.util.List;
+import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
@Slf4j
public class StandaloneServer {
+ @Value("${registry.type}")
+ private String registryType;
+
+ @Autowired
+ private List<StandaloneRegistry> registries;
+
public static void main(String[] args) throws Exception {
try {
- // We cannot use try-with-resources to close "TestingServer", since SpringApplication.run() will not block
Review Comment:
Why remove this?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1820349478
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15139)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [3 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [236 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list) [65.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list) [1.6% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list)
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1387430436
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
> It's not a good idea add name 'sqlSessionFactory' for this bean, since this will cause the JdbcRegistry use the same sql session factory with the business.
Thank you for reminding me of this.
I write this because I find that if I don't explicitly declare 'sqlSessionFactory' , an exception will be thrown at startup:
[dolphinscheduler-standalone.log](https://github.com/apache/dolphinscheduler/files/13303243/dolphinscheduler-standalone.log)
<img width="1106" alt="image" src="https://github.com/apache/dolphinscheduler/assets/40498606/e26c6a96-4dfa-415e-ba99-2c1b618850a9">
I think it might be because of 'daoconfiguration. Java 'references it
<img width="972" alt="image" src="https://github.com/apache/dolphinscheduler/assets/40498606/803b41ea-d4c7-4cf1-b72a-0e52243e2588">
Is this a known problem?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1801465728
> > @ruanwenjun I don't know how to add labels, I'm a bit confused. Can you help me ?
>
> You don't have permission to add label.
@ruanwenjun Thank you so much! But I see here the check is still not passed. Do you need to review these checks before they pass
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1397019174
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
@ruanwenjun can you help me? What can I do to improve this feature?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1805290134
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15139)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list)
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#issuecomment-1820348965
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15139)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG) [3 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT) [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL) [236 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15139&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list) [65.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list) [1.6% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15139&metric=new_duplicated_lines_density&view=list)
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1387453956
##########
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/registry/JdbcStandaloneRegistry.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.registry;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class JdbcStandaloneRegistry implements StandaloneRegistry {
+
+ @Override
+ public void init() {
+ // The JDBC plugin will take effect via @ConditionalOnProperty.
+ }
+
+ @Override
+ public boolean supports(String registryType) {
+ return "jdbc".equalsIgnoreCase(registryType);
+ }
+}
Review Comment:
> Can we remove this? I hope we can only add a StandaloneZookeeperRegistry, in this class, we will start a `TestingServer`, and user can still use zookeeper registry to connect their own zk cluster or use JDBC to connect their own db.
Sure!
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature-#15103][Standalone]Support using JDBC registry plugin in standalone mode. [dolphinscheduler]
Posted by "qifanlili (via GitHub)" <gi...@apache.org>.
qifanlili commented on code in PR #15139:
URL: https://github.com/apache/dolphinscheduler/pull/15139#discussion_r1387430436
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistryConfiguration.java:
##########
@@ -34,7 +34,7 @@
@ConditionalOnProperty(prefix = "registry", name = "type", havingValue = "jdbc")
public class JdbcRegistryConfiguration {
- @Bean
+ @Bean("sqlSessionFactory")
Review Comment:
> It's not a good idea add name 'sqlSessionFactory' for this bean, since this will cause the JdbcRegistry use the same sql session factory with the business.
Thank you for reminding me of this. I write this because I find that When I using `JDBCRegistry plugin`,
if I don't explicitly declare 'sqlSessionFactory' , an exception will be thrown at startup:
[dolphinscheduler-standalone.log](https://github.com/apache/dolphinscheduler/files/13303243/dolphinscheduler-standalone.log) <img alt="image" width="1106" src="https://user-images.githubusercontent.com/40498606/281602379-e26c6a96-4dfa-415e-ba99-2c1b618850a9.png">
I think it might be because of 'DaoConfiguration. java 'references it <img alt="image" width="972" src="https://user-images.githubusercontent.com/40498606/281602082-803b41ea-d4c7-4cf1-b72a-0e52243e2588.png">
Is this a known problem?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org