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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]