You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/08/02 11:44:44 UTC

[GitHub] [dolphinscheduler] WangJPLeo opened a new pull request, #11264: [Feature] Add Api service optional whether to register ZK.

WangJPLeo opened a new pull request, #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264

   <!--Thanks very much for contributing to Apache DolphinScheduler. Please review https://dolphinscheduler.apache.org/en-us/community/development/pull-request.html before opening a pull request.-->
   
   
   ## Purpose of the pull request
   
   Add Api service optional whether to register ZK.
   
   ## Brief change log
   
   related #11263
   
   ## Verify this pull request
   
   Manually verified the change by testing locally.
   


-- 
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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936576566


##########
dolphinscheduler-api/pom.xml:
##########
@@ -64,6 +64,10 @@
             <groupId>org.apache.dolphinscheduler</groupId>
             <artifactId>dolphinscheduler-registry-all</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-server</artifactId>
+        </dependency>

Review Comment:
   Understood, LGTM. 



-- 
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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936362475


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ApiConfig.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.api.configuration;
+
+import org.apache.dolphinscheduler.common.utils.NetUtils;
+
+import java.time.Duration;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.validation.Errors;
+import org.springframework.validation.Validator;
+import org.springframework.validation.annotation.Validated;
+
+import lombok.Data;
+
+@Data
+@Validated
+@Configuration
+@ConfigurationProperties(prefix = "api")

Review Comment:
   it`s ok.



-- 
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


[GitHub] [dolphinscheduler] WangJPLeo closed pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo closed pull request #11264: [Feature] Add Api service optional whether to register ZK.
URL: https://github.com/apache/dolphinscheduler/pull/11264


-- 
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


[GitHub] [dolphinscheduler] ruanwenjun commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936469367


##########
dolphinscheduler-api/pom.xml:
##########
@@ -64,6 +64,10 @@
             <groupId>org.apache.dolphinscheduler</groupId>
             <artifactId>dolphinscheduler-registry-all</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-server</artifactId>
+        </dependency>

Review Comment:
   There is a pr split `HeartBeatTask ` into MasterHeartBeatTask and `WorkerHeartBeatTask`. In fact, this task is just a schedule task, you don't need to rely on 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


[GitHub] [dolphinscheduler] WangJPLeo commented on pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#issuecomment-1206459264

   Consider service locking.


-- 
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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936357307


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/registry/ApiRegistryClient.java:
##########
@@ -0,0 +1,136 @@
+/*
+ * 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.api.registry;
+
+import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_APIS;
+import static org.apache.dolphinscheduler.common.Constants.SLEEP_TIME_MILLIS;
+
+import org.apache.dolphinscheduler.api.configuration.ApiConfig;
+import org.apache.dolphinscheduler.common.Constants;
+import org.apache.dolphinscheduler.common.IStoppable;
+import org.apache.dolphinscheduler.common.enums.NodeType;
+import org.apache.dolphinscheduler.common.thread.ThreadUtils;
+import org.apache.dolphinscheduler.common.utils.NetUtils;
+import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory;
+import org.apache.dolphinscheduler.server.registry.HeartBeatTask;
+import org.apache.dolphinscheduler.service.registry.RegistryClient;
+
+import java.io.IOException;
+import java.time.Duration;
+import java.util.Collections;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import javax.annotation.PostConstruct;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.google.common.collect.Sets;
+
+@Service

Review Comment:
   thx, it`s a good idea.



-- 
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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r938392442


##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/NodeType.java:
##########
@@ -18,5 +18,5 @@
 package org.apache.dolphinscheduler.common.enums;
 
 public enum NodeType {
-    MASTER, WORKER, DEAD_SERVER
+    API, MASTER, WORKER, DEAD_SERVER

Review Comment:
   ok



-- 
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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936361655


##########
dolphinscheduler-api/pom.xml:
##########
@@ -64,6 +64,10 @@
             <groupId>org.apache.dolphinscheduler</groupId>
             <artifactId>dolphinscheduler-registry-all</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-server</artifactId>
+        </dependency>

Review Comment:
   At present, HeartBeatTask is in this module. If this module is deprecated, can it be placed under `org/apache/dolphinscheduler/common/thread`?



-- 
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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936607184


##########
dolphinscheduler-api/pom.xml:
##########
@@ -64,6 +64,10 @@
             <groupId>org.apache.dolphinscheduler</groupId>
             <artifactId>dolphinscheduler-registry-all</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-server</artifactId>
+        </dependency>

Review Comment:
   After reading the PR of #10506, the dependency of Api on the Server service was removed in the latest commit, and the ApiHeartBeatTask was separated to prepare for the next refactoring merge. @ruanwenjun 



-- 
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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936358200


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/registry/ApiRegistryServer.java:
##########
@@ -0,0 +1,63 @@
+/*
+ * 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.api.registry;
+
+import org.apache.dolphinscheduler.api.configuration.ApiConfig;
+import org.apache.dolphinscheduler.common.Constants;
+import org.apache.dolphinscheduler.common.IStoppable;
+import org.apache.dolphinscheduler.common.thread.Stopper;
+import org.apache.dolphinscheduler.common.thread.ThreadUtils;
+
+import javax.annotation.PostConstruct;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component

Review Comment:
   Yeah, same as ApiRegistryClient.



-- 
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


[GitHub] [dolphinscheduler] ruanwenjun commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936298058


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ApiConfig.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.api.configuration;
+
+import org.apache.dolphinscheduler.common.utils.NetUtils;
+
+import java.time.Duration;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.validation.Errors;
+import org.springframework.validation.Validator;
+import org.springframework.validation.annotation.Validated;
+
+import lombok.Data;
+
+@Data
+@Validated
+@Configuration
+@ConfigurationProperties(prefix = "api")
+public class ApiConfig implements Validator {
+
+    private boolean registryEnabled = false;
+    private int listenPort = 7890;
+    private int execThreads = 10;
+    private Duration heartbeatInterval = Duration.ofSeconds(10);
+    private int heartbeatErrorThreshold = 5;
+    private int maxCpuLoadAvg = -1;
+    private double reservedMemory = 0.3;
+    private String apiAddress;

Review Comment:
   ```suggestion
       private Duration heartbeatInterval = Duration.ofSeconds(10);
       private int heartbeatErrorThreshold = 5;
       private String apiAddress;
   ```
   The API server doesn't has these properties.



##########
dolphinscheduler-api/pom.xml:
##########
@@ -64,6 +64,10 @@
             <groupId>org.apache.dolphinscheduler</groupId>
             <artifactId>dolphinscheduler-registry-all</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-server</artifactId>
+        </dependency>

Review Comment:
   It's better don't add `dolphinscheduler-server` in api, this module might be deprecated.



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ApiConfig.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.api.configuration;
+
+import org.apache.dolphinscheduler.common.utils.NetUtils;
+
+import java.time.Duration;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.validation.Errors;
+import org.springframework.validation.Validator;
+import org.springframework.validation.annotation.Validated;
+
+import lombok.Data;
+
+@Data
+@Validated
+@Configuration
+@ConfigurationProperties(prefix = "api")

Review Comment:
   ```suggestion
   @ConfigurationProperties(prefix = "register")
   ```



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/registry/ApiRegistryServer.java:
##########
@@ -0,0 +1,63 @@
+/*
+ * 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.api.registry;
+
+import org.apache.dolphinscheduler.api.configuration.ApiConfig;
+import org.apache.dolphinscheduler.common.Constants;
+import org.apache.dolphinscheduler.common.IStoppable;
+import org.apache.dolphinscheduler.common.thread.Stopper;
+import org.apache.dolphinscheduler.common.thread.ThreadUtils;
+
+import javax.annotation.PostConstruct;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component

Review Comment:
   Add @ConditionOnProperty?



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/registry/ApiRegistryClient.java:
##########
@@ -0,0 +1,136 @@
+/*
+ * 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.api.registry;
+
+import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_APIS;
+import static org.apache.dolphinscheduler.common.Constants.SLEEP_TIME_MILLIS;
+
+import org.apache.dolphinscheduler.api.configuration.ApiConfig;
+import org.apache.dolphinscheduler.common.Constants;
+import org.apache.dolphinscheduler.common.IStoppable;
+import org.apache.dolphinscheduler.common.enums.NodeType;
+import org.apache.dolphinscheduler.common.thread.ThreadUtils;
+import org.apache.dolphinscheduler.common.utils.NetUtils;
+import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory;
+import org.apache.dolphinscheduler.server.registry.HeartBeatTask;
+import org.apache.dolphinscheduler.service.registry.RegistryClient;
+
+import java.io.IOException;
+import java.time.Duration;
+import java.util.Collections;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import javax.annotation.PostConstruct;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.google.common.collect.Sets;
+
+@Service

Review Comment:
   Can we add @ContidionalOnProperty on this bean? there is no need to create thread pool if we don't open the switch.



-- 
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


[GitHub] [dolphinscheduler] lenboo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
lenboo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r938392018


##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/NodeType.java:
##########
@@ -18,5 +18,5 @@
 package org.apache.dolphinscheduler.common.enums;
 
 public enum NodeType {
-    MASTER, WORKER, DEAD_SERVER
+    API, MASTER, WORKER, DEAD_SERVER

Review Comment:
   It's better to put the new enum in the last index.



-- 
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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936364504


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ApiConfig.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.api.configuration;
+
+import org.apache.dolphinscheduler.common.utils.NetUtils;
+
+import java.time.Duration;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.validation.Errors;
+import org.springframework.validation.Validator;
+import org.springframework.validation.annotation.Validated;
+
+import lombok.Data;
+
+@Data
+@Validated
+@Configuration
+@ConfigurationProperties(prefix = "api")
+public class ApiConfig implements Validator {
+
+    private boolean registryEnabled = false;
+    private int listenPort = 7890;
+    private int execThreads = 10;
+    private Duration heartbeatInterval = Duration.ofSeconds(10);
+    private int heartbeatErrorThreshold = 5;
+    private int maxCpuLoadAvg = -1;
+    private double reservedMemory = 0.3;
+    private String apiAddress;

Review Comment:
   ok, i'll fix 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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r936412571


##########
dolphinscheduler-api/pom.xml:
##########
@@ -64,6 +64,10 @@
             <groupId>org.apache.dolphinscheduler</groupId>
             <artifactId>dolphinscheduler-registry-all</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-server</artifactId>
+        </dependency>

Review Comment:
   HeartBeatTask depends on the RegistryClient of the service module, it is not appropriate to move HeartBeatTask to common only. HeartBeatTask and RegistryClient can make a placed PR in the future. @ruanwenjun 



-- 
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


[GitHub] [dolphinscheduler] WangJPLeo commented on a diff in pull request #11264: [Feature] Add Api service optional whether to register ZK.

Posted by GitBox <gi...@apache.org>.
WangJPLeo commented on code in PR #11264:
URL: https://github.com/apache/dolphinscheduler/pull/11264#discussion_r938392326


##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/NodeType.java:
##########
@@ -18,5 +18,5 @@
 package org.apache.dolphinscheduler.common.enums;
 
 public enum NodeType {
-    MASTER, WORKER, DEAD_SERVER
+    API, MASTER, WORKER, DEAD_SERVER

Review Comment:
   ```suggestion
       MASTER, WORKER, DEAD_SERVER,API
   ```



-- 
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