Browse Source
* [dolphinscheduler-1345] [newfeature] Add DB2 Datasource (#1391) * Fix the problem that the 'queueId' is not present when creating a tenant based on the default queue. (#1409) * dolphinscheduler-#1403][bug]improve the check rules (#1408) 1. When check failed, we don’t know whitch parameter has is wrong, Because username、password、email and phone were checks together. I refactored the check method ,Now it will return failed msg by each field. 2. The email check regex support [_|\-|\.]?) in createUser.vue, But it do not support in backend server , I fix it, Now they have the same check regex both in frontend and backend * jcip-annotations define version information and maven-assembly-plugin add groupId (#1413) * "v-for" add key (#1419) * [dolphinscheduler-#1397] [bug]Resources can not be previewed or updated (#1406) When create an resource the name will add the suffix, But When rename the resource there is no suffix add to the name, So When update resource name without suffix just like "test.sh" => "test" , Then the bug reproduced. To fix this bug i add the logic bellow: When rename, if the name without suffix then add it ,else use the origin name * simply server module configs (#1424) * move updateTaskState into try/catch block in case of exception * fix NPE * using conf.getInt instead of getString * for AbstractZKClient, remove the log, for it will print the same log message in createZNodePath. for AlertDao, correct the spelling. * duplicate * refactor getTaskWorkerGroupId * add friendly log * update hearbeat thread num = 1 * fix the bug when worker execute task using queue. and remove checking Tenant user anymore in TaskScheduleThread * 1. move verifyTaskInstanceIsNull after taskInstance 2. keep verifyTenantIsNull/verifyTaskInstanceIsNull clean and readable * fix the message * delete before check to avoid KeeperException$NoNodeException * fix the message * check processInstance state before delete tenant * check processInstance state before delete worker group * refactor * merge api constants into common constatns * update the resource perm * update the dataSource perm * fix CheckUtils.checkUserParams method * update AlertGroupService, extends from BaseService, remove duplicate methods * refactor * modify method name * add hasProjectAndPerm method * using checkProject instead of getResultStatus * delete checkAuth method, using hasProjectAndPerm instead. * correct spelling * add transactional for deleteWorkerGroupById * add Transactional for deleteProcessInstanceById method * change sqlSessionTemplate singleton * change sqlSessionTemplate singleton and reformat code * fix unsuitable error message * update shutdownhook methods * fix worker log bug * fix api server debug mode bug * upgrade zk version * delete this line ,for zkClient.close() will do the whole thing * fix master server shutdown error * degrade zk version and add FourLetterWordMain class * fix PathChildrenCache not close * add Transactional for createSession method * add more message for java-doc * delete App, let spring manage connectionFactory * add license * add class Application for test support * refactor masterServer and workerServer * add args * fix the spring transaction not work bug * remove author * delete @Bean annotation * delete master/worker properties * updates * rename application.properties to application-dao.properties * delete this class * delete master/worker properties and refactory master/worker * delete unused imports * merge * delete unused configpull/2/head
bao liang
5 years ago
committed by
qiaozhanwei
35 changed files with 451 additions and 350 deletions
@ -1,38 +0,0 @@ |
|||||||
# |
|
||||||
# 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.number=20 |
|
||||||
|
|
||||||
# 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=100 |
|
||||||
|
|
||||||
|
|
||||||
# only less than cpu avg load, master server can work. default value : the number of cpu cores * 2 |
|
||||||
#master.max.cpuload.avg=100 |
|
||||||
|
|
||||||
# only larger than reserved memory, master server can work. default value : physical memory * 1/10, unit is G. |
|
||||||
master.reserved.memory=0.1 |
|
@ -1,32 +0,0 @@ |
|||||||
# |
|
||||||
# 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. |
|
||||||
# |
|
||||||
|
|
||||||
# worker execute thread num |
|
||||||
worker.exec.threads=100 |
|
||||||
|
|
||||||
# worker heartbeat interval |
|
||||||
worker.heartbeat.interval=10 |
|
||||||
|
|
||||||
# submit the number of tasks at a time |
|
||||||
worker.fetch.task.num = 3 |
|
||||||
|
|
||||||
|
|
||||||
# only less than cpu avg load, worker server can work. default value : the number of cpu cores * 2 |
|
||||||
#worker.max.cpuload.avg=10 |
|
||||||
|
|
||||||
# only larger than reserved memory, worker server can work. default value : physical memory * 1/6, unit is G. |
|
||||||
worker.reserved.memory=1 |
|
@ -0,0 +1,75 @@ |
|||||||
|
/* |
||||||
|
* 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.common.job.db; |
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
import org.apache.dolphinscheduler.common.Constants; |
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
|
||||||
|
import java.sql.Connection; |
||||||
|
import java.sql.DriverManager; |
||||||
|
import java.sql.SQLException; |
||||||
|
|
||||||
|
/** |
||||||
|
* data source of DB2 Server |
||||||
|
*/ |
||||||
|
public class DB2ServerDataSource extends BaseDataSource { |
||||||
|
private static final Logger logger = LoggerFactory.getLogger(DB2ServerDataSource.class); |
||||||
|
|
||||||
|
/** |
||||||
|
* gets the JDBC url for the data source connection |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public String getJdbcUrl() { |
||||||
|
String jdbcUrl = getAddress(); |
||||||
|
if (jdbcUrl.lastIndexOf("/") != (jdbcUrl.length() - 1)) { |
||||||
|
jdbcUrl += "/"; |
||||||
|
} |
||||||
|
|
||||||
|
jdbcUrl += getDatabase(); |
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(getOther())) { |
||||||
|
jdbcUrl += ":" + getOther(); |
||||||
|
} |
||||||
|
return jdbcUrl; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* test whether the data source can be connected successfully |
||||||
|
* @throws Exception |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public void isConnectable() throws Exception { |
||||||
|
Connection con = null; |
||||||
|
try { |
||||||
|
Class.forName(Constants.COM_DB2_JDBC_DRIVER); |
||||||
|
con = DriverManager.getConnection(getJdbcUrl(), getUser(), getPassword()); |
||||||
|
} finally { |
||||||
|
if (con != null) { |
||||||
|
try { |
||||||
|
con.close(); |
||||||
|
} catch (SQLException e) { |
||||||
|
logger.error("DB2 Server datasource try conn close conn error", e); |
||||||
|
throw e; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -1,49 +0,0 @@ |
|||||||
/* |
|
||||||
* 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; |
|
||||||
|
|
||||||
import org.apache.dolphinscheduler.common.IStoppable; |
|
||||||
import org.apache.commons.configuration.Configuration; |
|
||||||
import org.slf4j.Logger; |
|
||||||
import org.slf4j.LoggerFactory; |
|
||||||
import org.springframework.boot.CommandLineRunner; |
|
||||||
import org.springframework.context.annotation.ComponentScan; |
|
||||||
|
|
||||||
/** |
|
||||||
* master server |
|
||||||
*/ |
|
||||||
public abstract class AbstractServer implements IStoppable { |
|
||||||
|
|
||||||
|
|
||||||
/** |
|
||||||
* abstract server onfiguration |
|
||||||
*/ |
|
||||||
protected static Configuration conf; |
|
||||||
|
|
||||||
/** |
|
||||||
* heartbeat interval, unit second |
|
||||||
*/ |
|
||||||
protected int heartBeatInterval; |
|
||||||
|
|
||||||
/** |
|
||||||
* gracefully stop |
|
||||||
* @param cause why stopping |
|
||||||
*/ |
|
||||||
@Override |
|
||||||
public abstract void stop(String cause); |
|
||||||
} |
|
||||||
|
|
@ -0,0 +1,101 @@ |
|||||||
|
/* |
||||||
|
* 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.springframework.beans.factory.annotation.Value; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
@Component |
||||||
|
public class MasterConfig { |
||||||
|
|
||||||
|
@Value("${master.exec.threads:100}") |
||||||
|
private int masterExecThreads; |
||||||
|
|
||||||
|
@Value("${master.exec.task.num:20}") |
||||||
|
private int masterExecTaskNum; |
||||||
|
|
||||||
|
@Value("${master.heartbeat.interval:10}") |
||||||
|
private int masterHeartbeatInterval; |
||||||
|
|
||||||
|
@Value("${master.task.commit.retryTimes:5}") |
||||||
|
private int masterTaskCommitRetryTimes; |
||||||
|
|
||||||
|
@Value("${master.task.commit.interval:100}") |
||||||
|
private int masterTaskCommitInterval; |
||||||
|
|
||||||
|
@Value("${master.max.cpuload.avg:100}") |
||||||
|
private double masterMaxCpuloadAvg; |
||||||
|
|
||||||
|
@Value("${master.reserved.memory:0.1}") |
||||||
|
private double masterReservedMemory; |
||||||
|
|
||||||
|
public int getMasterExecThreads() { |
||||||
|
return masterExecThreads; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMasterExecThreads(int masterExecThreads) { |
||||||
|
this.masterExecThreads = masterExecThreads; |
||||||
|
} |
||||||
|
|
||||||
|
public int getMasterExecTaskNum() { |
||||||
|
return masterExecTaskNum; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMasterExecTaskNum(int masterExecTaskNum) { |
||||||
|
this.masterExecTaskNum = masterExecTaskNum; |
||||||
|
} |
||||||
|
|
||||||
|
public int getMasterHeartbeatInterval() { |
||||||
|
return masterHeartbeatInterval; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMasterHeartbeatInterval(int masterHeartbeatInterval) { |
||||||
|
this.masterHeartbeatInterval = masterHeartbeatInterval; |
||||||
|
} |
||||||
|
|
||||||
|
public int getMasterTaskCommitRetryTimes() { |
||||||
|
return masterTaskCommitRetryTimes; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMasterTaskCommitRetryTimes(int masterTaskCommitRetryTimes) { |
||||||
|
this.masterTaskCommitRetryTimes = masterTaskCommitRetryTimes; |
||||||
|
} |
||||||
|
|
||||||
|
public int getMasterTaskCommitInterval() { |
||||||
|
return masterTaskCommitInterval; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMasterTaskCommitInterval(int masterTaskCommitInterval) { |
||||||
|
this.masterTaskCommitInterval = masterTaskCommitInterval; |
||||||
|
} |
||||||
|
|
||||||
|
public double getMasterMaxCpuloadAvg() { |
||||||
|
return masterMaxCpuloadAvg; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMasterMaxCpuloadAvg(double masterMaxCpuloadAvg) { |
||||||
|
this.masterMaxCpuloadAvg = masterMaxCpuloadAvg; |
||||||
|
} |
||||||
|
|
||||||
|
public double getMasterReservedMemory() { |
||||||
|
return masterReservedMemory; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMasterReservedMemory(double masterReservedMemory) { |
||||||
|
this.masterReservedMemory = masterReservedMemory; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,79 @@ |
|||||||
|
/* |
||||||
|
* 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.worker.config; |
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
@Component |
||||||
|
public class WorkerConfig { |
||||||
|
|
||||||
|
@Value("${worker.exec.threads:100}") |
||||||
|
private int workerExecThreads; |
||||||
|
|
||||||
|
@Value("${worker.heartbeat.interval:10}") |
||||||
|
private int workerHeartbeatInterval; |
||||||
|
|
||||||
|
@Value("${worker.fetch.task.num:3}") |
||||||
|
private int workerFetchTaskNum; |
||||||
|
|
||||||
|
@Value("${worker.max.cpuload.avg:10}") |
||||||
|
private int workerMaxCpuloadAvg; |
||||||
|
|
||||||
|
@Value("${master.reserved.memory:1}") |
||||||
|
private double workerReservedMemory; |
||||||
|
|
||||||
|
public int getWorkerExecThreads() { |
||||||
|
return workerExecThreads; |
||||||
|
} |
||||||
|
|
||||||
|
public void setWorkerExecThreads(int workerExecThreads) { |
||||||
|
this.workerExecThreads = workerExecThreads; |
||||||
|
} |
||||||
|
|
||||||
|
public int getWorkerHeartbeatInterval() { |
||||||
|
return workerHeartbeatInterval; |
||||||
|
} |
||||||
|
|
||||||
|
public void setWorkerHeartbeatInterval(int workerHeartbeatInterval) { |
||||||
|
this.workerHeartbeatInterval = workerHeartbeatInterval; |
||||||
|
} |
||||||
|
|
||||||
|
public int getWorkerFetchTaskNum() { |
||||||
|
return workerFetchTaskNum; |
||||||
|
} |
||||||
|
|
||||||
|
public void setWorkerFetchTaskNum(int workerFetchTaskNum) { |
||||||
|
this.workerFetchTaskNum = workerFetchTaskNum; |
||||||
|
} |
||||||
|
|
||||||
|
public double getWorkerReservedMemory() { |
||||||
|
return workerReservedMemory; |
||||||
|
} |
||||||
|
|
||||||
|
public void setWorkerReservedMemory(double workerReservedMemory) { |
||||||
|
this.workerReservedMemory = workerReservedMemory; |
||||||
|
} |
||||||
|
|
||||||
|
public int getWorkerMaxCpuloadAvg() { |
||||||
|
return workerMaxCpuloadAvg; |
||||||
|
} |
||||||
|
|
||||||
|
public void setWorkerMaxCpuloadAvg(int workerMaxCpuloadAvg) { |
||||||
|
this.workerMaxCpuloadAvg = workerMaxCpuloadAvg; |
||||||
|
} |
||||||
|
} |
@ -1,38 +0,0 @@ |
|||||||
# |
|
||||||
# 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.number=20 |
|
||||||
|
|
||||||
# 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=100 |
|
||||||
|
|
||||||
|
|
||||||
# only less than cpu avg load, master server can work. default value : the number of cpu cores * 2 |
|
||||||
master.max.cpuload.avg=100 |
|
||||||
|
|
||||||
# only larger than reserved memory, master server can work. default value : physical memory * 1/10, unit is G. |
|
||||||
master.reserved.memory=0.1 |
|
@ -1,32 +0,0 @@ |
|||||||
# |
|
||||||
# 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. |
|
||||||
# |
|
||||||
|
|
||||||
# worker execute thread num |
|
||||||
worker.exec.threads=100 |
|
||||||
|
|
||||||
# worker heartbeat interval |
|
||||||
worker.heartbeat.interval=10 |
|
||||||
|
|
||||||
# submit the number of tasks at a time |
|
||||||
worker.fetch.task.num = 3 |
|
||||||
|
|
||||||
|
|
||||||
# only less than cpu avg load, worker server can work. default value : the number of cpu cores * 2 |
|
||||||
#worker.max.cpuload.avg=10 |
|
||||||
|
|
||||||
# only larger than reserved memory, worker server can work. default value : physical memory * 1/6, unit is G. |
|
||||||
worker.reserved.memory=1 |
|
Loading…
Reference in new issue