Prechádzať zdrojové kódy

[Bug][Master] Typo in MasterConfig #5141 (#5142)

wenjun 4 rokov pred
rodič
commit
a8b47e1d4f

+ 1 - 1
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java

@@ -37,7 +37,7 @@ public class MasterConfig {
     @Value("${master.task.commit.retryTimes:5}")
     private int masterTaskCommitRetryTimes;
 
-    @Value("${master.dispatch.task.num :3}")
+    @Value("${master.dispatch.task.num:3}")
     private int masterDispatchTaskNumber;
 
     @Value("${master.task.commit.interval:1000}")

+ 39 - 0
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/config/MasterConfigTest.java

@@ -0,0 +1,39 @@
+/*
+ * 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.server.master.config;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {MasterConfig.class})
+public class MasterConfigTest {
+
+    @Autowired
+    private MasterConfig masterConfig;
+
+    @Test
+    public void getMasterDispatchTaskNumber() {
+        int masterDispatchTaskNumber = masterConfig.getMasterDispatchTaskNumber();
+        Assert.assertEquals(6, masterDispatchTaskNumber);
+    }
+}

+ 43 - 0
dolphinscheduler-server/src/test/resources/master.properties

@@ -0,0 +1,43 @@
+#
+# 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.
+#
+
+# master execute thread num
+#master.exec.threads=100
+
+# master execute task number in parallel
+#master.exec.task.num=20
+
+# master dispatch task number
+master.dispatch.task.num=6
+
+# master heartbeat interval
+#master.heartbeat.interval=10
+
+# master commit task retry times
+#master.task.commit.retryTimes=5
+
+# master commit task interval
+#master.task.commit.interval=1000
+
+# only less than cpu avg load, master server can work.  default value -1 : the number of cpu cores * 2
+#master.max.cpuload.avg=-1
+
+# only larger than reserved memory, master server can work. default value : physical memory * 1/10, unit is G.
+#master.reserved.memory=0.3
+
+# master listen port
+#master.listen.port=5678

+ 1 - 0
pom.xml

@@ -914,6 +914,7 @@
                         <!--<include>**/server/log/TaskLogDiscriminatorTest.java</include>-->
                         <include>**/server/log/TaskLogFilterTest.java</include>
                         <include>**/server/log/WorkerLogFilterTest.java</include>
+                        <include>**/server/master/config/MasterConfigTest.java</include>
                         <include>**/server/master/consumer/TaskPriorityQueueConsumerTest.java</include>
                         <include>**/server/master/runner/MasterTaskExecThreadTest.java</include>
                         <!--<include>**/server/master/dispatch/executor/NettyExecutorManagerTest.java</include>-->