Browse Source

[Improvement-3686][service] ProcessService method name meets naming convention. (#3687)

* ProcessService method name meets naming convention.

* add code checkstyle.

* update test.

* update test.

* add code checkstyle.

* add code checkstyle.

* update pom.

* update pom.

* ProcessService method name meets naming convention.

* update processService code.

* update code style.

* update code style.

* update code style.

Co-authored-by: zhuangchong <zhuangchong8@163.com>
pull/3/MERGE
zhuangchong 4 years ago committed by GitHub
parent
commit
2fbbf96cde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
  2. 29
      dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

2
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java

@ -326,7 +326,7 @@ public class TaskPriorityQueueConsumer extends Thread{
udfFunIdsArray[i]=Integer.parseInt(udfFunIds[i]);
}
List<UdfFunc> udfFuncList = processService.queryUdfFunListByids(udfFunIdsArray);
List<UdfFunc> udfFuncList = processService.queryUdfFunListByIds(udfFunIdsArray);
Map<UdfFunc,String> udfFuncMap = new HashMap<>();
for(UdfFunc udfFunc : udfFuncList) {
String tenantCode = processService.queryTenantCodeByResName(udfFunc.getResourceName(), ResourceType.UDF);

29
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.service.process;
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE;
@ -144,8 +145,6 @@ public class ProcessService {
@Autowired
private ResourceMapper resourceMapper;
@Autowired
private ErrorCommandMapper errorCommandMapper;
@ -180,7 +179,7 @@ public class ProcessService {
processInstance.addHistoryCmd(command.getCommandType());
saveProcessInstance(processInstance);
this.setSubProcessParam(processInstance);
delCommandByid(command.getId());
delCommandById(command.getId());
return processInstance;
}
@ -193,7 +192,7 @@ public class ProcessService {
public void moveToErrorCommand(Command command, String message) {
ErrorCommand errorCommand = new ErrorCommand(command, message);
this.errorCommandMapper.insert(errorCommand);
delCommandByid(command.getId());
delCommandById(command.getId());
}
/**
@ -355,7 +354,6 @@ public class ProcessService {
return 1;
}
/**
* remove task log file
* @param processInstanceId processInstanceId
@ -384,13 +382,11 @@ public class ProcessService {
ip = taskInstance.getHost();
}
// remove task log from loggerserver
logClient.removeTaskLog(ip,port,taskLogPath);
}
}
/**
* calculate sub process number in the process define.
* @param processDefinitionId processDefinitionId
@ -792,7 +788,6 @@ public class ProcessService {
}
/**
* set sub work process parameters.
* handle sub work process instance, update relation table and command parameters
@ -1132,7 +1127,6 @@ public class ProcessService {
return taskInstance;
}
/**
* ${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskInstanceId}_${task executed by ip1},${ip2}...
* The tasks with the highest priority are selected by comparing the priorities of the above four levels from high to low.
@ -1306,11 +1300,12 @@ public class ProcessService {
int count = taskInstanceMapper.updateById(taskInstance);
return count > 0;
}
/**
* delete a command by id
* @param id id
*/
public void delCommandByid(int id) {
public void delCommandById(int id) {
commandMapper.deleteById(id);
}
@ -1323,7 +1318,6 @@ public class ProcessService {
return taskInstanceMapper.selectById(taskId);
}
/**
* package task instanceassociate processInstance and processDefine
* @param taskInstId taskInstId
@ -1345,7 +1339,6 @@ public class ProcessService {
return taskInstance;
}
/**
* get id list by task state
* @param instanceId instanceId
@ -1383,7 +1376,6 @@ public class ProcessService {
return processInstanceMapMapper.updateById(processInstanceMap);
}
/**
* create work process instance map
* @param processInstanceMap processInstanceMap
@ -1448,7 +1440,6 @@ public class ProcessService {
return processInstance;
}
/**
* change task state
* @param state state
@ -1568,7 +1559,6 @@ public class ProcessService {
* @return process instance list
*/
public List<ProcessInstance> queryNeedFailoverProcessInstances(String host) {
return processInstanceMapper.queryByHostAndStatus(host, stateArray);
}
@ -1610,7 +1600,6 @@ public class ProcessService {
return dataSourceMapper.selectById(id);
}
/**
* update process instance state by id
* @param processInstanceId processInstanceId
@ -1642,7 +1631,7 @@ public class ProcessService {
* @param ids ids
* @return udf function list
*/
public List<UdfFunc> queryUdfFunListByids(int[] ids){
public List<UdfFunc> queryUdfFunListByIds(int[] ids) {
return udfFuncMapper.queryUdfByIdStr(ids, null);
}
@ -1699,7 +1688,6 @@ public class ProcessService {
return cycleDependencyList;
}
String strCrontab = "";
CronExpression depCronExpression;
Cron depCron;
@ -1809,8 +1797,6 @@ public class ProcessService {
return queue;
}
/**
* get task worker group
* @param taskInstance taskInstance
@ -1898,6 +1884,8 @@ public class ProcessService {
Set<Integer> authorizedUdfs = udfFuncMapper.listAuthorizedUdfFunc(userId, needChecks).stream().map(t -> t.getId()).collect(toSet());
originResSet.removeAll(authorizedUdfs);
break;
default:
break;
}
resultList.addAll(originResSet);
@ -1924,7 +1912,6 @@ public class ProcessService {
return resourceMapper.selectById(resoruceId);
}
/**
* list resources by ids
* @param resIds resIds

Loading…
Cancel
Save