status
stringclasses 1
value | repo_name
stringclasses 31
values | repo_url
stringclasses 31
values | issue_id
int64 1
104k
| title
stringlengths 4
233
| body
stringlengths 0
186k
⌀ | issue_url
stringlengths 38
56
| pull_url
stringlengths 37
54
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
timestamp[us, tz=UTC] | language
stringclasses 5
values | commit_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,671 | [Enhancement][API] Suggest support batch copy workflow with scheduler | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Should the batch copy workflow support copy scheduler of workflow
### Use case
The workflow and the scheduler of the workflow should be copied together so that the copied workflow does not have to reconfigure the scheduler
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10671 | https://github.com/apache/dolphinscheduler/pull/10677 | de5c22b27654e3f3fd48ea3be97ce994be52a94d | cc2f17ddcc3649bf9f1222e01c00e95053d376ad | 2022-06-29T12:25:05Z | java | 2022-07-27T05:45:45Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java | }
int tenantId = -1;
if (!Constants.DEFAULT.equals(tenantCode)) {
Tenant tenant = tenantMapper.queryByTenantCode(tenantCode);
if (tenant == null) {
putMsg(result, Status.TENANT_NOT_EXIST);
return result;
}
tenantId = tenant.getId();
}
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(code);
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(code));
return result;
}
if (processDefinition.getReleaseState() == ReleaseState.ONLINE) {
putMsg(result, Status.PROCESS_DEFINE_NOT_ALLOWED_EDIT, processDefinition.getName());
return result;
}
if (!name.equals(processDefinition.getName())) {
ProcessDefinition definition = processDefinitionMapper.verifyByDefineName(project.getCode(), name);
if (definition != null) {
putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name);
return result;
}
}
ProcessDefinition processDefinitionDeepCopy = JSONUtils.parseObject(JSONUtils.toJsonString(processDefinition), ProcessDefinition.class); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,671 | [Enhancement][API] Suggest support batch copy workflow with scheduler | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Should the batch copy workflow support copy scheduler of workflow
### Use case
The workflow and the scheduler of the workflow should be copied together so that the copied workflow does not have to reconfigure the scheduler
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10671 | https://github.com/apache/dolphinscheduler/pull/10677 | de5c22b27654e3f3fd48ea3be97ce994be52a94d | cc2f17ddcc3649bf9f1222e01c00e95053d376ad | 2022-06-29T12:25:05Z | java | 2022-07-27T05:45:45Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java | processDefinition.set(projectCode, name, description, globalParams, "", timeout, tenantId);
processDefinition.setExecutionType(executionType);
List<ProcessTaskRelationLog> taskRelationList = processTaskRelationLogMapper.queryByProcessCodeAndVersion(processDefinition.getCode(), processDefinition.getVersion());
result = updateDagDefine(loginUser, taskRelationList, processDefinition, processDefinitionDeepCopy, Lists.newArrayList(), otherParamsJson);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (StringUtils.isBlank(scheduleJson)) {
return result;
}
Map<String, Object> scheduleResult = updateDagSchedule(loginUser, projectCode, code, scheduleJson);
if (scheduleResult.get(Constants.STATUS) != Status.SUCCESS) {
Status scheduleResultStatus = (Status) scheduleResult.get(Constants.STATUS);
putMsg(result, scheduleResultStatus);
throw new ServiceException(scheduleResultStatus);
}
return result;
}
protected Map<String, Object> updateDagSchedule(User loginUser,
long projectCode,
long processDefinitionCode,
String scheduleJson) {
Map<String, Object> result = new HashMap<>();
Schedule schedule = JSONUtils.parseObject(scheduleJson, Schedule.class);
if (schedule == null) {
putMsg(result, Status.DATA_IS_NOT_VALID, scheduleJson);
throw new ServiceException(Status.DATA_IS_NOT_VALID);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,671 | [Enhancement][API] Suggest support batch copy workflow with scheduler | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Should the batch copy workflow support copy scheduler of workflow
### Use case
The workflow and the scheduler of the workflow should be copied together so that the copied workflow does not have to reconfigure the scheduler
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10671 | https://github.com/apache/dolphinscheduler/pull/10677 | de5c22b27654e3f3fd48ea3be97ce994be52a94d | cc2f17ddcc3649bf9f1222e01c00e95053d376ad | 2022-06-29T12:25:05Z | java | 2022-07-27T05:45:45Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java | FailureStrategy failureStrategy = schedule.getFailureStrategy() == null ? FailureStrategy.CONTINUE : schedule.getFailureStrategy();
WarningType warningType = schedule.getWarningType() == null ? WarningType.NONE : schedule.getWarningType();
Priority processInstancePriority = schedule.getProcessInstancePriority() == null ? Priority.MEDIUM : schedule.getProcessInstancePriority();
int warningGroupId = schedule.getWarningGroupId() == 0 ? 1 : schedule.getWarningGroupId();
String workerGroup = schedule.getWorkerGroup() == null ? "default" : schedule.getWorkerGroup();
long environmentCode = schedule.getEnvironmentCode() == null ? -1 : schedule.getEnvironmentCode();
ScheduleParam param = new ScheduleParam();
param.setStartTime(schedule.getStartTime());
param.setEndTime(schedule.getEndTime());
param.setCrontab(schedule.getCrontab());
param.setTimezoneId(schedule.getTimezoneId());
return schedulerService.updateScheduleByProcessDefinitionCode(
loginUser,
projectCode,
processDefinitionCode,
JSONUtils.toJsonString(param),
warningType,
warningGroupId,
failureStrategy,
processInstancePriority,
workerGroup,
environmentCode);
}
/**
* release process definition and schedule
*
* @param loginUser login user
* @param projectCode project code
* @param code process definition code
* @param releaseState releaseState |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,671 | [Enhancement][API] Suggest support batch copy workflow with scheduler | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Should the batch copy workflow support copy scheduler of workflow
### Use case
The workflow and the scheduler of the workflow should be copied together so that the copied workflow does not have to reconfigure the scheduler
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10671 | https://github.com/apache/dolphinscheduler/pull/10677 | de5c22b27654e3f3fd48ea3be97ce994be52a94d | cc2f17ddcc3649bf9f1222e01c00e95053d376ad | 2022-06-29T12:25:05Z | java | 2022-07-27T05:45:45Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java | * @return update result code
*/
@Transactional
@Override
public Map<String, Object> releaseWorkflowAndSchedule(User loginUser, long projectCode, long code, ReleaseState releaseState) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode,WORKFLOW_ONLINE_OFFLINE);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (null == releaseState) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE);
return result;
}
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(code);
if (processDefinition == null) {
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(code));
return result;
}
Schedule scheduleObj = scheduleMapper.queryByProcessDefinitionCode(code);
if (scheduleObj == null) {
putMsg(result, Status.SCHEDULE_CRON_NOT_EXISTS, "processDefinitionCode:" + code);
return result;
}
switch (releaseState) {
case ONLINE:
List<ProcessTaskRelation> relationList = processService.findRelationByCode(code, processDefinition.getVersion());
if (CollectionUtils.isEmpty(relationList)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,671 | [Enhancement][API] Suggest support batch copy workflow with scheduler | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Should the batch copy workflow support copy scheduler of workflow
### Use case
The workflow and the scheduler of the workflow should be copied together so that the copied workflow does not have to reconfigure the scheduler
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10671 | https://github.com/apache/dolphinscheduler/pull/10677 | de5c22b27654e3f3fd48ea3be97ce994be52a94d | cc2f17ddcc3649bf9f1222e01c00e95053d376ad | 2022-06-29T12:25:05Z | java | 2022-07-27T05:45:45Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java | putMsg(result, Status.PROCESS_DAG_IS_EMPTY);
return result;
}
processDefinition.setReleaseState(releaseState);
processDefinitionMapper.updateById(processDefinition);
schedulerService.setScheduleState(loginUser, projectCode, scheduleObj.getId(), ReleaseState.ONLINE);
break;
case OFFLINE:
processDefinition.setReleaseState(releaseState);
int updateProcess = processDefinitionMapper.updateById(processDefinition);
if (updateProcess > 0) {
logger.info("set schedule offline, project code: {}, schedule id: {}, process definition code: {}", projectCode, scheduleObj.getId(), code);
scheduleObj.setReleaseState(ReleaseState.OFFLINE);
int updateSchedule = scheduleMapper.updateById(scheduleObj);
if (updateSchedule == 0) {
putMsg(result, Status.OFFLINE_SCHEDULE_ERROR);
throw new ServiceException(Status.OFFLINE_SCHEDULE_ERROR);
}
schedulerService.deleteSchedule(project.getId(), scheduleObj.getId());
}
break;
default:
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE);
return result;
}
putMsg(result, Status.SUCCESS);
return result;
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,671 | [Enhancement][API] Suggest support batch copy workflow with scheduler | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Should the batch copy workflow support copy scheduler of workflow
### Use case
The workflow and the scheduler of the workflow should be copied together so that the copied workflow does not have to reconfigure the scheduler
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10671 | https://github.com/apache/dolphinscheduler/pull/10677 | de5c22b27654e3f3fd48ea3be97ce994be52a94d | cc2f17ddcc3649bf9f1222e01c00e95053d376ad | 2022-06-29T12:25:05Z | java | 2022-07-27T05:45:45Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java | * save other relation
* @param loginUser
* @param processDefinition
* @param result
* @param otherParamsJson
*/
@Override
public void saveOtherRelation(User loginUser, ProcessDefinition processDefinition, Map<String, Object> result, String otherParamsJson) {
}
/**
* get Json String
* @param loginUser
* @param processDefinition
* @return Json String
*/
@Override
public String doOtherOperateProcess(User loginUser, ProcessDefinition processDefinition) {
return null;
}
/**
* delete other relation
* @param project
* @param result
* @param processDefinition
*/
@Override
public void deleteOtherRelation(Project project, Map<String, Object> result, ProcessDefinition processDefinition) {
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,101 | [Bug-BE] [Master Server] Master server reports an error | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Error caused by a large number of complement execution
<img width="1736" alt="image" src="https://user-images.githubusercontent.com/76080484/180342547-ed4923d9-b478-4290-86cc-ca570ba6ce22.png">
### What you expected to happen
The master service is running normally
### How to reproduce
Error caused by a large number of complement execution
### Anything else
_No response_
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11101 | https://github.com/apache/dolphinscheduler/pull/11168 | 181cd2ff791822e5cb90a4e8897c80eea1c0ae56 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | 2022-07-22T01:35:20Z | java | 2022-07-27T11:21:21Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/service/MasterFailoverService.java | /*
* 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.service;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.NodeType;
import org.apache.dolphinscheduler.common.model.Server;
import org.apache.dolphinscheduler.common.utils.LoggerUtils;
import org.apache.dolphinscheduler.common.utils.NetUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,101 | [Bug-BE] [Master Server] Master server reports an error | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Error caused by a large number of complement execution
<img width="1736" alt="image" src="https://user-images.githubusercontent.com/76080484/180342547-ed4923d9-b478-4290-86cc-ca570ba6ce22.png">
### What you expected to happen
The master service is running normally
### How to reproduce
Error caused by a large number of complement execution
### Anything else
_No response_
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11101 | https://github.com/apache/dolphinscheduler/pull/11168 | 181cd2ff791822e5cb90a4e8897c80eea1c0ae56 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | 2022-07-22T01:35:20Z | java | 2022-07-27T11:21:21Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/service/MasterFailoverService.java | import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
import org.apache.dolphinscheduler.plugin.task.api.enums.ExecutionStatus;
import org.apache.dolphinscheduler.remote.command.TaskKillRequestCommand;
import org.apache.dolphinscheduler.remote.utils.Host;
import org.apache.dolphinscheduler.server.master.builder.TaskExecutionContextBuilder;
import org.apache.dolphinscheduler.server.master.config.MasterConfig;
import org.apache.dolphinscheduler.server.master.dispatch.exceptions.ExecuteException;
import org.apache.dolphinscheduler.server.master.dispatch.executor.NettyExecutorManager;
import org.apache.dolphinscheduler.server.master.metrics.ProcessInstanceMetrics;
import org.apache.dolphinscheduler.server.master.metrics.TaskMetrics;
import org.apache.dolphinscheduler.server.master.runner.task.TaskProcessorFactory;
import org.apache.dolphinscheduler.server.utils.ProcessUtils;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.service.registry.RegistryClient;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.time.StopWatch;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import io.micrometer.core.annotation.Counted;
import io.micrometer.core.annotation.Timed;
import lombok.NonNull;
@Service |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,101 | [Bug-BE] [Master Server] Master server reports an error | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Error caused by a large number of complement execution
<img width="1736" alt="image" src="https://user-images.githubusercontent.com/76080484/180342547-ed4923d9-b478-4290-86cc-ca570ba6ce22.png">
### What you expected to happen
The master service is running normally
### How to reproduce
Error caused by a large number of complement execution
### Anything else
_No response_
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11101 | https://github.com/apache/dolphinscheduler/pull/11168 | 181cd2ff791822e5cb90a4e8897c80eea1c0ae56 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | 2022-07-22T01:35:20Z | java | 2022-07-27T11:21:21Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/service/MasterFailoverService.java | public class MasterFailoverService {
private static final Logger LOGGER = LoggerFactory.getLogger(MasterFailoverService.class);
private final RegistryClient registryClient;
private final MasterConfig masterConfig;
private final ProcessService processService;
private final String localAddress;
private final NettyExecutorManager nettyExecutorManager;
public MasterFailoverService(@NonNull RegistryClient registryClient,
@NonNull MasterConfig masterConfig,
@NonNull ProcessService processService,
@NonNull NettyExecutorManager nettyExecutorManager) {
this.registryClient = registryClient;
this.masterConfig = masterConfig;
this.processService = processService;
this.localAddress = NetUtils.getAddr(masterConfig.getListenPort());
this.nettyExecutorManager = nettyExecutorManager;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,101 | [Bug-BE] [Master Server] Master server reports an error | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Error caused by a large number of complement execution
<img width="1736" alt="image" src="https://user-images.githubusercontent.com/76080484/180342547-ed4923d9-b478-4290-86cc-ca570ba6ce22.png">
### What you expected to happen
The master service is running normally
### How to reproduce
Error caused by a large number of complement execution
### Anything else
_No response_
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11101 | https://github.com/apache/dolphinscheduler/pull/11168 | 181cd2ff791822e5cb90a4e8897c80eea1c0ae56 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | 2022-07-22T01:35:20Z | java | 2022-07-27T11:21:21Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/service/MasterFailoverService.java | /**
* check master failover
*/
@Counted(value = "ds.master.scheduler.failover.check.count")
@Timed(value = "ds.master.scheduler.failover.check.time", percentiles = {0.5, 0.75, 0.95, 0.99}, histogram = true)
public void checkMasterFailover() {
List<String> needFailoverMasterHosts = processService.queryNeedFailoverProcessInstanceHost()
.stream()
.filter(host -> localAddress.equals(host) || !registryClient.checkNodeExists(host, NodeType.MASTER))
.distinct()
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(needFailoverMasterHosts)) {
return;
}
LOGGER.info("Master failover service {} begin to failover hosts:{}", localAddress, needFailoverMasterHosts);
for (String needFailoverMasterHost : needFailoverMasterHosts) {
failoverMaster(needFailoverMasterHost);
}
}
public void failoverMaster(String masterHost) {
String failoverPath = Constants.REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS + "/" + masterHost;
try {
registryClient.getLock(failoverPath);
doFailoverMaster(masterHost);
} catch (Exception e) {
LOGGER.error("Master server failover failed, host:{}", masterHost, e);
} finally {
registryClient.releaseLock(failoverPath);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,101 | [Bug-BE] [Master Server] Master server reports an error | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Error caused by a large number of complement execution
<img width="1736" alt="image" src="https://user-images.githubusercontent.com/76080484/180342547-ed4923d9-b478-4290-86cc-ca570ba6ce22.png">
### What you expected to happen
The master service is running normally
### How to reproduce
Error caused by a large number of complement execution
### Anything else
_No response_
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11101 | https://github.com/apache/dolphinscheduler/pull/11168 | 181cd2ff791822e5cb90a4e8897c80eea1c0ae56 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | 2022-07-22T01:35:20Z | java | 2022-07-27T11:21:21Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/service/MasterFailoverService.java | }
/**
* Failover master, will failover process instance and associated task instance.
* <p>When the process instance belongs to the given masterHost and the restartTime is before the current server start up time,
* then the process instance will be failovered.
*
* @param masterHost master host
*/
private void doFailoverMaster(@NonNull String masterHost) {
StopWatch failoverTimeCost = StopWatch.createStarted();
Optional<Date> masterStartupTimeOptional = getServerStartupTime(registryClient.getServerList(NodeType.MASTER),
masterHost);
List<ProcessInstance> needFailoverProcessInstanceList = processService.queryNeedFailoverProcessInstances(
masterHost);
if (CollectionUtils.isEmpty(needFailoverProcessInstanceList)) {
return;
}
LOGGER.info(
"Master[{}] failover starting there are {} workflowInstance may need to failover, will do a deep check, workflowInstanceIds: {}",
masterHost,
needFailoverProcessInstanceList.size(),
needFailoverProcessInstanceList.stream().map(ProcessInstance::getId).collect(Collectors.toList()));
for (ProcessInstance processInstance : needFailoverProcessInstanceList) {
try {
LoggerUtils.setWorkflowInstanceIdMDC(processInstance.getId());
LOGGER.info("WorkflowInstance failover starting");
if (!checkProcessInstanceNeedFailover(masterStartupTimeOptional, processInstance)) {
LOGGER.info("WorkflowInstance doesn't need to failover");
continue;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,101 | [Bug-BE] [Master Server] Master server reports an error | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Error caused by a large number of complement execution
<img width="1736" alt="image" src="https://user-images.githubusercontent.com/76080484/180342547-ed4923d9-b478-4290-86cc-ca570ba6ce22.png">
### What you expected to happen
The master service is running normally
### How to reproduce
Error caused by a large number of complement execution
### Anything else
_No response_
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11101 | https://github.com/apache/dolphinscheduler/pull/11168 | 181cd2ff791822e5cb90a4e8897c80eea1c0ae56 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | 2022-07-22T01:35:20Z | java | 2022-07-27T11:21:21Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/service/MasterFailoverService.java | ProcessDefinition processDefinition
= processService.findProcessDefinition(processInstance.getProcessDefinitionCode(),
processInstance.getProcessDefinitionVersion());
processInstance.setProcessDefinition(processDefinition);
int processInstanceId = processInstance.getId();
List<TaskInstance> taskInstanceList = processService.findValidTaskListByProcessId(processInstanceId);
for (TaskInstance taskInstance : taskInstanceList) {
try {
LoggerUtils.setTaskInstanceIdMDC(taskInstance.getId());
LOGGER.info("TaskInstance failover starting");
if (!checkTaskInstanceNeedFailover(taskInstance)) {
LOGGER.info("The taskInstance doesn't need to failover");
continue;
}
failoverTaskInstance(processInstance, taskInstance);
LOGGER.info("TaskInstance failover finished");
} finally {
LoggerUtils.removeTaskInstanceIdMDC();
}
}
ProcessInstanceMetrics.incProcessInstanceByState("failover");
processInstance.setHost(Constants.NULL);
processService.processNeedFailoverProcessInstances(processInstance);
LOGGER.info("WorkflowInstance failover finished");
} finally {
LoggerUtils.removeWorkflowInstanceIdMDC();
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,101 | [Bug-BE] [Master Server] Master server reports an error | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Error caused by a large number of complement execution
<img width="1736" alt="image" src="https://user-images.githubusercontent.com/76080484/180342547-ed4923d9-b478-4290-86cc-ca570ba6ce22.png">
### What you expected to happen
The master service is running normally
### How to reproduce
Error caused by a large number of complement execution
### Anything else
_No response_
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11101 | https://github.com/apache/dolphinscheduler/pull/11168 | 181cd2ff791822e5cb90a4e8897c80eea1c0ae56 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | 2022-07-22T01:35:20Z | java | 2022-07-27T11:21:21Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/service/MasterFailoverService.java | }
failoverTimeCost.stop();
LOGGER.info("Master[{}] failover finished, useTime:{}ms",
masterHost,
failoverTimeCost.getTime(TimeUnit.MILLISECONDS));
}
private Optional<Date> getServerStartupTime(List<Server> servers, String host) {
if (CollectionUtils.isEmpty(servers)) {
return Optional.empty();
}
Date serverStartupTime = null;
for (Server server : servers) {
if (host.equals(server.getHost() + Constants.COLON + server.getPort())) {
serverStartupTime = server.getCreateTime();
break;
}
}
return Optional.ofNullable(serverStartupTime);
}
/**
* failover task instance
* <p>
* 1. kill yarn job if run on worker and there are yarn jobs in tasks.
* 2. change task state from running to need failover.
* 3. try to notify local master
*
* @param processInstance
* @param taskInstance
*/
private void failoverTaskInstance(@NonNull ProcessInstance processInstance, @NonNull TaskInstance taskInstance) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,101 | [Bug-BE] [Master Server] Master server reports an error | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Error caused by a large number of complement execution
<img width="1736" alt="image" src="https://user-images.githubusercontent.com/76080484/180342547-ed4923d9-b478-4290-86cc-ca570ba6ce22.png">
### What you expected to happen
The master service is running normally
### How to reproduce
Error caused by a large number of complement execution
### Anything else
_No response_
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11101 | https://github.com/apache/dolphinscheduler/pull/11168 | 181cd2ff791822e5cb90a4e8897c80eea1c0ae56 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | 2022-07-22T01:35:20Z | java | 2022-07-27T11:21:21Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/service/MasterFailoverService.java | TaskMetrics.incTaskInstanceByState("failover");
boolean isMasterTask = TaskProcessorFactory.isMasterTask(taskInstance.getTaskType());
taskInstance.setProcessInstance(processInstance);
if (!isMasterTask) {
LOGGER.info("The failover taskInstance is not master task");
TaskExecutionContext taskExecutionContext = TaskExecutionContextBuilder.get()
.buildTaskInstanceRelatedInfo(taskInstance)
.buildProcessInstanceRelatedInfo(processInstance)
.buildProcessDefinitionRelatedInfo(processInstance.getProcessDefinition())
.create();
if (masterConfig.isKillYarnJobWhenTaskFailover()) {
LOGGER.info("TaskInstance failover begin kill the task related yarn job");
ProcessUtils.killYarnJob(taskExecutionContext);
}
try {
TaskKillRequestCommand killCommand = new TaskKillRequestCommand(taskInstance.getId());
Host workerHost = Host.of(taskInstance.getHost());
nettyExecutorManager.doExecute(workerHost, killCommand.convert2Command());
LOGGER.info("Failover task success, has killed the task in worker: {}", taskInstance.getHost());
} catch (ExecuteException e) {
LOGGER.error("Kill task failed", e);
}
} else {
LOGGER.info("The failover taskInstance is a master task");
}
taskInstance.setState(ExecutionStatus.NEED_FAULT_TOLERANCE); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,101 | [Bug-BE] [Master Server] Master server reports an error | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Error caused by a large number of complement execution
<img width="1736" alt="image" src="https://user-images.githubusercontent.com/76080484/180342547-ed4923d9-b478-4290-86cc-ca570ba6ce22.png">
### What you expected to happen
The master service is running normally
### How to reproduce
Error caused by a large number of complement execution
### Anything else
_No response_
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11101 | https://github.com/apache/dolphinscheduler/pull/11168 | 181cd2ff791822e5cb90a4e8897c80eea1c0ae56 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | 2022-07-22T01:35:20Z | java | 2022-07-27T11:21:21Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/service/MasterFailoverService.java | taskInstance.setFlag(Flag.NO);
processService.saveTaskInstance(taskInstance);
}
private boolean checkTaskInstanceNeedFailover(@NonNull TaskInstance taskInstance) {
if (taskInstance.getState() != null && taskInstance.getState().typeIsFinished()) {
return false;
}
return true;
}
private boolean checkProcessInstanceNeedFailover(Optional<Date> beFailoveredMasterStartupTimeOptional,
@NonNull ProcessInstance processInstance) {
if (Constants.NULL.equals(processInstance.getHost())) {
return false;
}
if (!beFailoveredMasterStartupTimeOptional.isPresent()) {
return true;
}
Date beFailoveredMasterStartupTime = beFailoveredMasterStartupTimeOptional.get();
if (processInstance.getStartTime().after(beFailoveredMasterStartupTime)) {
return false;
}
return true;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | /*
* 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.utils;
import static org.apache.dolphinscheduler.common.Constants.AWS_END_POINT;
import static org.apache.dolphinscheduler.common.Constants.FOLDER_SEPARATOR;
import static org.apache.dolphinscheduler.common.Constants.FORMAT_S_S;
import static org.apache.dolphinscheduler.common.Constants.RESOURCE_STORAGE_TYPE;
import static org.apache.dolphinscheduler.common.Constants.RESOURCE_TYPE_FILE; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | import static org.apache.dolphinscheduler.common.Constants.RESOURCE_TYPE_UDF;
import static org.apache.dolphinscheduler.common.Constants.STORAGE_S3;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.ResUploadType;
import org.apache.dolphinscheduler.common.storage.StorageOperate;
import org.apache.dolphinscheduler.plugin.task.api.TaskConstants;
import org.apache.dolphinscheduler.spi.enums.ResourceType;
import org.apache.commons.lang3.StringUtils;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | import com.amazonaws.services.s3.model.AmazonS3Exception;
import com.amazonaws.services.s3.model.Bucket;
import com.amazonaws.services.s3.model.ObjectMetadata;
import com.amazonaws.services.s3.model.PutObjectRequest;
import com.amazonaws.services.s3.model.S3Object;
import com.amazonaws.services.s3.model.S3ObjectInputStream;
import com.amazonaws.services.s3.transfer.MultipleFileDownload;
import com.amazonaws.services.s3.transfer.TransferManager;
import com.amazonaws.services.s3.transfer.TransferManagerBuilder;
public class S3Utils implements Closeable, StorageOperate {
private static final Logger logger = LoggerFactory.getLogger(S3Utils.class);
public static final String ACCESS_KEY_ID = PropertyUtils.getString(TaskConstants.AWS_ACCESS_KEY_ID);
public static final String SECRET_KEY_ID = PropertyUtils.getString(TaskConstants.AWS_SECRET_ACCESS_KEY);
public static final String REGION = PropertyUtils.getString(TaskConstants.AWS_REGION);
public static final String BUCKET_NAME = PropertyUtils.getString(Constants.AWS_S3_BUCKET_NAME);
private AmazonS3 s3Client = null;
private S3Utils() {
if (PropertyUtils.getString(RESOURCE_STORAGE_TYPE).equals(STORAGE_S3)) {
if (!StringUtils.isEmpty(PropertyUtils.getString(AWS_END_POINT))) {
s3Client = AmazonS3ClientBuilder
.standard()
.withPathStyleAccessEnabled(true)
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(PropertyUtils.getString(AWS_END_POINT), Regions.fromName(REGION).getName()))
.withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_KEY_ID)))
.build();
} else {
s3Client = AmazonS3ClientBuilder
.standard()
.withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_KEY_ID)))
.withRegion(Regions.fromName(REGION)) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | .build();
}
checkBucketNameExists(BUCKET_NAME);
}
}
/**
* S3Utils single
*/
private enum S3Singleton {
INSTANCE;
private final S3Utils instance;
S3Singleton() {
instance = new S3Utils();
}
private S3Utils getInstance() {
return instance;
}
}
public static S3Utils getInstance() {
return S3Singleton.INSTANCE.getInstance();
}
@Override
public void close() throws IOException {
s3Client.shutdown();
}
@Override
public void createTenantDirIfNotExists(String tenantCode) throws Exception {
getInstance().mkdir(tenantCode, getS3ResDir(tenantCode));
getInstance().mkdir(tenantCode, getS3UdfDir(tenantCode));
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | @Override
public String getResDir(String tenantCode) {
return getS3ResDir(tenantCode) + FOLDER_SEPARATOR;
}
@Override
public String getUdfDir(String tenantCode) {
return getS3UdfDir(tenantCode) + FOLDER_SEPARATOR;
}
@Override
public boolean mkdir(String tenantCode, String path) throws IOException {
String objectName = path + FOLDER_SEPARATOR;
if (!s3Client.doesObjectExist(BUCKET_NAME, objectName)) {
ObjectMetadata metadata = new ObjectMetadata();
metadata.setContentLength(0);
InputStream emptyContent = new ByteArrayInputStream(new byte[0]);
PutObjectRequest putObjectRequest = new PutObjectRequest(BUCKET_NAME, objectName, emptyContent, metadata);
s3Client.putObject(putObjectRequest);
}
return true;
}
@Override
public String getResourceFileName(String tenantCode, String fileName) {
if (fileName.startsWith(FOLDER_SEPARATOR)) {
fileName = fileName.replaceFirst(FOLDER_SEPARATOR, "");
}
return String.format(FORMAT_S_S, getS3ResDir(tenantCode), fileName);
}
@Override
public String getFileName(ResourceType resourceType, String tenantCode, String fileName) {
if (fileName.startsWith(FOLDER_SEPARATOR)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | fileName = fileName.replaceFirst(FOLDER_SEPARATOR, "");
}
return getDir(resourceType, tenantCode) + fileName;
}
@Override
public void download(String tenantCode, String srcFilePath, String dstFile, boolean deleteSource, boolean overwrite) throws IOException {
S3Object o = s3Client.getObject(BUCKET_NAME, srcFilePath);
try (S3ObjectInputStream s3is = o.getObjectContent();
FileOutputStream fos = new FileOutputStream(dstFile)) {
byte[] readBuf = new byte[1024];
int readLen = 0;
while ((readLen = s3is.read(readBuf)) > 0) {
fos.write(readBuf, 0, readLen);
}
} catch (AmazonServiceException e) {
logger.error("the resource can`t be downloaded,the bucket is {},and the src is {}", tenantCode, srcFilePath);
throw new IOException(e.getMessage());
} catch (FileNotFoundException e) {
logger.error("the file isn`t exists");
throw new IOException("the file isn`t exists");
}
}
@Override
public boolean exists(String tenantCode, String fileName) throws IOException {
return s3Client.doesObjectExist(BUCKET_NAME, fileName);
}
@Override
public boolean delete(String tenantCode, String filePath, boolean recursive) throws IOException {
try {
s3Client.deleteObject(BUCKET_NAME, filePath); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | return true;
} catch (AmazonServiceException e) {
logger.error("delete the object error,the resource path is {}", filePath);
return false;
}
}
@Override
public boolean copy(String srcPath, String dstPath, boolean deleteSource, boolean overwrite) throws IOException {
s3Client.copyObject(BUCKET_NAME, srcPath, BUCKET_NAME, dstPath);
s3Client.deleteObject(BUCKET_NAME, srcPath);
return true;
}
@Override
public String getDir(ResourceType resourceType, String tenantCode) {
switch (resourceType) {
case UDF:
return getUdfDir(tenantCode);
case FILE:
return getResDir(tenantCode);
default:
return "";
}
}
@Override
public boolean upload(String tenantCode, String srcFile, String dstPath, boolean deleteSource, boolean overwrite) throws IOException {
try {
s3Client.putObject(BUCKET_NAME, dstPath, new File(srcFile));
return true;
} catch (AmazonServiceException e) {
logger.error("upload failed,the bucketName is {},the filePath is {}", BUCKET_NAME, dstPath); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | return false;
}
}
@Override
public List<String> vimFile(String tenantCode, String filePath, int skipLineNums, int limit) throws IOException {
if (StringUtils.isBlank(filePath)) {
logger.error("file path:{} is blank", filePath);
return Collections.emptyList();
}
S3Object s3Object = s3Client.getObject(BUCKET_NAME, filePath);
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(s3Object.getObjectContent()))) {
Stream<String> stream = bufferedReader.lines().skip(skipLineNums).limit(limit);
return stream.collect(Collectors.toList());
}
}
@Override
public void deleteTenant(String tenantCode) throws Exception {
deleteTenantCode(tenantCode);
}
/**
* S3 resource dir
*
* @param tenantCode tenant code
* @return S3 resource dir
*/
public static String getS3ResDir(String tenantCode) {
return String.format("%s/" + RESOURCE_TYPE_FILE, getS3TenantDir(tenantCode));
}
/**
* S3 udf dir |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | *
* @param tenantCode tenant code
* @return get udf dir on S3
*/
public static String getS3UdfDir(String tenantCode) {
return String.format("%s/" + RESOURCE_TYPE_UDF, getS3TenantDir(tenantCode));
}
/**
* @param tenantCode tenant code
* @return file directory of tenants on S3
*/
public static String getS3TenantDir(String tenantCode) {
return String.format(FORMAT_S_S, getS3DataBasePath(), tenantCode);
}
/**
* get data S3 path
*
* @return data S3 path
*/
public static String getS3DataBasePath() {
if (FOLDER_SEPARATOR.equals(RESOURCE_UPLOAD_PATH)) {
return "";
} else {
return RESOURCE_UPLOAD_PATH.replaceFirst(FOLDER_SEPARATOR, "");
}
}
private void deleteTenantCode(String tenantCode) {
deleteDirectory(getResDir(tenantCode));
deleteDirectory(getUdfDir(tenantCode));
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | /**
* xxx untest
* upload local directory to S3
*
* @param tenantCode
* @param keyPrefix the name of directory
* @param strPath
*/
private void uploadDirectory(String tenantCode, String keyPrefix, String strPath) {
s3Client.putObject(BUCKET_NAME, tenantCode + FOLDER_SEPARATOR + keyPrefix, new File(strPath));
}
/**
* xxx untest
* download S3 Directory to local
*
* @param tenantCode
* @param keyPrefix the name of directory
* @param srcPath
*/
private void downloadDirectory(String tenantCode, String keyPrefix, String srcPath) {
TransferManager tm = TransferManagerBuilder.standard().withS3Client(s3Client).build();
try {
MultipleFileDownload download = tm.downloadDirectory(BUCKET_NAME, tenantCode + FOLDER_SEPARATOR + keyPrefix, new File(srcPath));
download.waitForCompletion();
} catch (AmazonS3Exception | InterruptedException e) {
logger.error("download the directory failed with the bucketName is {} and the keyPrefix is {}", BUCKET_NAME, tenantCode + FOLDER_SEPARATOR + keyPrefix);
Thread.currentThread().interrupt();
} finally {
tm.shutdownNow();
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 10,665 | [Bug] [Worker] Tasks with S3 resource files failed incorrectly | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The following error is thrown while executing a task, Failed to download S3(MINIO) resource causing task failed


### What you expected to happen
1.The error is because the folder in the resource path is not created
2.The ambiguity of the error log makes it possible to interpret the file as a file on S3, but it is actually the destination file
### How to reproduce
Set the resource type to S3 and select a file on S3 in the shell script task
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/10665 | https://github.com/apache/dolphinscheduler/pull/10675 | 6c7e00c4aa51172dd36d505885ebcd848eed4f3c | efd68f480548839fe6c21dcdf3836afa42bc9029 | 2022-06-29T04:24:01Z | java | 2022-07-27T13:25:13Z | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/S3Utils.java | }
public void checkBucketNameExists(String bucketName) {
if (StringUtils.isBlank(bucketName)) {
throw new IllegalArgumentException("resource.aws.s3.bucket.name is blank");
}
Bucket existsBucket = s3Client.listBuckets()
.stream()
.filter(
bucket -> bucket.getName().equals(bucketName)
)
.findFirst()
.orElseThrow(() -> {
return new IllegalArgumentException("bucketName: " + bucketName + " is not exists, you need to create them by yourself");
});
logger.info("bucketName: {} has been found, the current regionName is {}", existsBucket.getName(), s3Client.getRegionName());
}
/**
* only delete the object of directory ,it`s better to delete the files in it -r
*/
private void deleteDirectory(String directoryName) {
if (s3Client.doesObjectExist(BUCKET_NAME, directoryName)) {
s3Client.deleteObject(BUCKET_NAME, directoryName);
}
}
@Override
public ResUploadType returnStorageType() {
return ResUploadType.S3;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | /*
* 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.service.impl;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_START;
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE;
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST;
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE;
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING;
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_START_NODES;
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_START_PARAMS;
import static org.apache.dolphinscheduler.common.Constants.COMMA;
import static org.apache.dolphinscheduler.common.Constants.MAX_TASK_TIMEOUT;
import static org.apache.dolphinscheduler.common.Constants.SCHEDULE_TIME_MAX_LENGTH;
import org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | import org.apache.dolphinscheduler.api.enums.ExecuteType;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.ExecutorService;
import org.apache.dolphinscheduler.api.service.MonitorService;
import org.apache.dolphinscheduler.api.service.ProjectService;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.CommandType;
import org.apache.dolphinscheduler.common.enums.ComplementDependentMode;
import org.apache.dolphinscheduler.common.enums.CycleEnum;
import org.apache.dolphinscheduler.common.enums.FailureStrategy;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.Priority;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.RunMode;
import org.apache.dolphinscheduler.common.enums.TaskDependType;
import org.apache.dolphinscheduler.common.enums.TaskGroupQueueStatus;
import org.apache.dolphinscheduler.common.enums.WarningType;
import org.apache.dolphinscheduler.common.model.Server;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.entity.Command;
import org.apache.dolphinscheduler.dao.entity.DependentProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.Schedule;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskGroupQueue;
import org.apache.dolphinscheduler.dao.entity.Tenant; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskGroupQueueMapper;
import org.apache.dolphinscheduler.plugin.task.api.TaskConstants;
import org.apache.dolphinscheduler.plugin.task.api.enums.ExecutionStatus;
import org.apache.dolphinscheduler.remote.command.StateEventChangeCommand;
import org.apache.dolphinscheduler.remote.command.WorkflowExecutingDataRequestCommand;
import org.apache.dolphinscheduler.remote.command.WorkflowExecutingDataResponseCommand;
import org.apache.dolphinscheduler.remote.dto.WorkflowExecuteDto;
import org.apache.dolphinscheduler.remote.processor.StateEventCallbackService;
import org.apache.dolphinscheduler.remote.utils.Host;
import org.apache.dolphinscheduler.service.cron.CronUtils;
import org.apache.dolphinscheduler.service.exceptions.CronParseException;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.collect.Lists;
/**
* executor service impl
*/
@Service
public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorService {
private static final Logger logger = LoggerFactory.getLogger(ExecutorServiceImpl.class);
@Autowired
private ProjectMapper projectMapper;
@Autowired
private ProjectService projectService;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
@Autowired
private MonitorService monitorService;
@Autowired
private ProcessInstanceMapper processInstanceMapper;
@Autowired
private ProcessService processService;
@Autowired
private StateEventCallbackService stateEventCallbackService;
@Autowired
private TaskDefinitionMapper taskDefinitionMapper;
@Autowired |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | private ProcessTaskRelationMapper processTaskRelationMapper;
@Autowired
private TaskGroupQueueMapper taskGroupQueueMapper;
/**
* execute process instance
*
* @param loginUser login user
* @param projectCode project code
* @param processDefinitionCode process definition code
* @param cronTime cron time
* @param commandType command type
* @param failureStrategy failure strategy
* @param startNodeList start nodelist
* @param taskDependType node dependency type
* @param warningType warning type
* @param warningGroupId notify group id
* @param processInstancePriority process instance priority
* @param workerGroup worker group name
* @param environmentCode environment code
* @param runMode run mode
* @param timeout timeout
* @param startParams the global param values which pass to new process instance
* @param expectedParallelismNumber the expected parallelism number when execute complement in parallel mode
* @return execute process instance code
*/
@Override
public Map<String, Object> execProcessInstance(User loginUser, long projectCode, long processDefinitionCode,
String cronTime, CommandType commandType,
FailureStrategy failureStrategy, String startNodeList,
TaskDependType taskDependType, WarningType warningType, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | int warningGroupId, RunMode runMode,
Priority processInstancePriority, String workerGroup,
Long environmentCode, Integer timeout,
Map<String, String> startParams, Integer expectedParallelismNumber,
int dryRun, ComplementDependentMode complementDependentMode) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_START);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (timeout <= 0 || timeout > MAX_TASK_TIMEOUT) {
putMsg(result, Status.TASK_TIMEOUT_PARAMS_ERROR);
return result;
}
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode);
result = checkProcessDefinitionValid(projectCode, processDefinition, processDefinitionCode, processDefinition.getVersion());
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (!checkTenantSuitable(processDefinition)) {
logger.error("there is not any valid tenant for the process definition: id:{},name:{}, ",
processDefinition.getId(), processDefinition.getName());
putMsg(result, Status.TENANT_NOT_SUITABLE);
return result;
}
if (!checkScheduleTimeNum(commandType, cronTime)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | putMsg(result, Status.SCHEDULE_TIME_NUMBER);
return result;
}
if (!checkMasterExists(result)) {
return result;
}
/**
* create command
*/
int create =
this.createCommand(commandType, processDefinition.getCode(), taskDependType, failureStrategy, startNodeList,
cronTime, warningType, loginUser.getId(), warningGroupId, runMode, processInstancePriority, workerGroup,
environmentCode, startParams, expectedParallelismNumber, dryRun, complementDependentMode);
if (create > 0) {
processDefinition.setWarningGroupId(warningGroupId);
processDefinitionMapper.updateById(processDefinition);
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.START_PROCESS_INSTANCE_ERROR);
}
return result;
}
/**
* check whether master exists
*
* @param result result
* @return master exists return true , otherwise return false
*/
private boolean checkMasterExists(Map<String, Object> result) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | List<Server> masterServers = monitorService.getServerListFromRegistry(true);
if (masterServers.isEmpty()) {
putMsg(result, Status.MASTER_NOT_EXISTS);
return false;
}
return true;
}
/**
* @param complementData
* @param cronTime
* @return CommandType is COMPLEMENT_DATA and cronTime's number is not greater than 100 return true , otherwise return false
*/
private boolean checkScheduleTimeNum(CommandType complementData, String cronTime) {
if (!CommandType.COMPLEMENT_DATA.equals(complementData)) {
return true;
}
if (cronTime == null) {
return true;
}
Map<String, String> cronMap = JSONUtils.toMap(cronTime);
if (cronMap.containsKey(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST)) {
String[] stringDates = cronMap.get(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST).split(COMMA);
if (stringDates.length > SCHEDULE_TIME_MAX_LENGTH) {
return false;
}
}
return true;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | /**
* check whether the process definition can be executed
*
* @param projectCode project code
* @param processDefinition process definition
* @param processDefineCode process definition code
* @param version process instance verison
* @return check result code
*/
@Override
public Map<String, Object> checkProcessDefinitionValid(long projectCode, ProcessDefinition processDefinition,
long processDefineCode, Integer version) {
Map<String, Object> result = new HashMap<>();
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(processDefineCode));
} else if (processDefinition.getReleaseState() != ReleaseState.ONLINE) {
putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, String.valueOf(processDefineCode), version);
} else if (!checkSubProcessDefinitionValid(processDefinition)) {
putMsg(result, Status.SUB_PROCESS_DEFINE_NOT_RELEASE);
} else {
result.put(Constants.STATUS, Status.SUCCESS);
}
return result;
}
/**
* check if the current process has subprocesses and all subprocesses are valid
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | * @param processDefinition
* @return check result
*/
@Override
public boolean checkSubProcessDefinitionValid(ProcessDefinition processDefinition) {
List<ProcessTaskRelation> processTaskRelations =
processTaskRelationMapper.queryDownstreamByProcessDefinitionCode(processDefinition.getCode());
if (processTaskRelations.isEmpty()) {
return true;
}
Set<Long> relationCodes =
processTaskRelations.stream().map(ProcessTaskRelation::getPostTaskCode).collect(Collectors.toSet());
List<TaskDefinition> taskDefinitions = taskDefinitionMapper.queryByCodeList(relationCodes);
Set<Long> processDefinitionCodeSet = new HashSet<>();
taskDefinitions.stream()
.filter(task -> TaskConstants.TASK_TYPE_SUB_PROCESS.equalsIgnoreCase(task.getTaskType())).forEach(
taskDefinition -> processDefinitionCodeSet.add(Long.valueOf(
JSONUtils.getNodeString(taskDefinition.getTaskParams(), Constants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE))));
if (processDefinitionCodeSet.isEmpty()) {
return true;
}
List<ProcessDefinition> processDefinitions = processDefinitionMapper.queryByCodes(processDefinitionCodeSet);
return processDefinitions.stream()
.filter(definition -> definition.getReleaseState().equals(ReleaseState.OFFLINE)).collect(Collectors.toSet())
.isEmpty();
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | * do action to process instance:pause, stop, repeat, recover from pause, recover from stop
*
* @param loginUser login user
* @param projectCode project code
* @param processInstanceId process instance id
* @param executeType execute type
* @return execute result code
*/
@Override
public Map<String, Object> execute(User loginUser, long projectCode, Integer processInstanceId, ExecuteType executeType) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode,
ApiFuncIdentificationConstant.map.get(executeType));
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (!checkMasterExists(result)) {
return result;
}
ProcessInstance processInstance = processService.findProcessInstanceDetailById(processInstanceId);
if (processInstance == null) {
putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
return result;
}
ProcessDefinition processDefinition =
processService.findProcessDefinition(processInstance.getProcessDefinitionCode(),
processInstance.getProcessDefinitionVersion());
if (executeType != ExecuteType.STOP && executeType != ExecuteType.PAUSE) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | result =
checkProcessDefinitionValid(projectCode, processDefinition, processInstance.getProcessDefinitionCode(),
processInstance.getProcessDefinitionVersion());
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
}
result = checkExecuteType(processInstance, executeType);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (!checkTenantSuitable(processDefinition)) {
logger.error("there is not any valid tenant for the process definition: id:{},name:{}, ",
processDefinition.getId(), processDefinition.getName());
putMsg(result, Status.TENANT_NOT_SUITABLE);
}
//
Map<String, Object> commandMap =
JSONUtils.parseObject(processInstance.getCommandParam(), new TypeReference<Map<String, Object>>() {
});
String startParams = null;
if (MapUtils.isNotEmpty(commandMap) && executeType == ExecuteType.REPEAT_RUNNING) {
Object startParamsJson = commandMap.get(Constants.CMD_PARAM_START_PARAMS);
if (startParamsJson != null) {
startParams = startParamsJson.toString();
}
}
switch (executeType) {
case REPEAT_RUNNING:
result = insertCommand(loginUser, processInstanceId, processDefinition.getCode(), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | processDefinition.getVersion(), CommandType.REPEAT_RUNNING, startParams);
break;
case RECOVER_SUSPENDED_PROCESS:
result = insertCommand(loginUser, processInstanceId, processDefinition.getCode(),
processDefinition.getVersion(), CommandType.RECOVER_SUSPENDED_PROCESS, startParams);
break;
case START_FAILURE_TASK_PROCESS:
result = insertCommand(loginUser, processInstanceId, processDefinition.getCode(),
processDefinition.getVersion(), CommandType.START_FAILURE_TASK_PROCESS, startParams);
break;
case STOP:
if (processInstance.getState() == ExecutionStatus.READY_STOP) {
putMsg(result, Status.PROCESS_INSTANCE_ALREADY_CHANGED, processInstance.getName(),
processInstance.getState());
} else {
result =
updateProcessInstancePrepare(processInstance, CommandType.STOP, ExecutionStatus.READY_STOP);
}
break;
case PAUSE:
if (processInstance.getState() == ExecutionStatus.READY_PAUSE) {
putMsg(result, Status.PROCESS_INSTANCE_ALREADY_CHANGED, processInstance.getName(), processInstance.getState());
} else {
result = updateProcessInstancePrepare(processInstance, CommandType.PAUSE, ExecutionStatus.READY_PAUSE);
}
break;
default:
logger.error("unknown execute type : {}", executeType);
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "unknown execute type");
break; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | }
return result;
}
@Override
public Map<String, Object> forceStartTaskInstance(User loginUser, int queueId) {
Map<String, Object> result = new HashMap<>();
TaskGroupQueue taskGroupQueue = taskGroupQueueMapper.selectById(queueId);
//
ProcessInstance processInstance = processInstanceMapper.selectById(taskGroupQueue.getProcessId());
if (processInstance == null) {
putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, taskGroupQueue.getProcessId());
return result;
}
if (!checkMasterExists(result)) {
return result;
}
return forceStart(processInstance, taskGroupQueue);
}
/**
* check tenant suitable
*
* @param processDefinition process definition
* @return true if tenant suitable, otherwise return false
*/
private boolean checkTenantSuitable(ProcessDefinition processDefinition) {
Tenant tenant =
processService.getTenantForProcess(processDefinition.getTenantId(), processDefinition.getUserId());
return tenant != null;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | /**
* Check the state of process instance and the type of operation match
*
* @param processInstance process instance
* @param executeType execute type
* @return check result code
*/
private Map<String, Object> checkExecuteType(ProcessInstance processInstance, ExecuteType executeType) {
Map<String, Object> result = new HashMap<>();
ExecutionStatus executionStatus = processInstance.getState();
boolean checkResult = false;
switch (executeType) {
case PAUSE:
case STOP:
if (executionStatus.typeIsRunning()) {
checkResult = true;
}
break;
case REPEAT_RUNNING:
if (executionStatus.typeIsFinished()) {
checkResult = true;
}
break;
case START_FAILURE_TASK_PROCESS:
if (executionStatus.typeIsFailure()) {
checkResult = true;
}
break;
case RECOVER_SUSPENDED_PROCESS:
if (executionStatus.typeIsPause() || executionStatus.typeIsCancel()) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | checkResult = true;
}
break;
default:
break;
}
if (!checkResult) {
putMsg(result, Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR, processInstance.getName(),
executionStatus.toString(), executeType.toString());
} else {
putMsg(result, Status.SUCCESS);
}
return result;
}
/**
* prepare to update process instance command type and status
*
* @param processInstance process instance
* @param commandType command type
* @param executionStatus execute status
* @return update result
*/
private Map<String, Object> updateProcessInstancePrepare(ProcessInstance processInstance, CommandType commandType,
ExecutionStatus executionStatus) {
Map<String, Object> result = new HashMap<>();
processInstance.setCommandType(commandType);
processInstance.addHistoryCmd(commandType);
processInstance.setState(executionStatus);
int update = processService.updateProcessInstance(processInstance);
// |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | if (update > 0) {
//
StateEventChangeCommand stateEventChangeCommand = new StateEventChangeCommand(
processInstance.getId(), 0, processInstance.getState(), processInstance.getId(), 0
);
Host host = new Host(processInstance.getHost());
stateEventCallbackService.sendResult(host, stateEventChangeCommand.convert2Command());
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.EXECUTE_PROCESS_INSTANCE_ERROR);
}
return result;
}
/**
* prepare to update process instance command type and status
*
* @param processInstance process instance
* @return update result
*/
private Map<String, Object> forceStart(ProcessInstance processInstance, TaskGroupQueue taskGroupQueue) {
Map<String, Object> result = new HashMap<>();
if (taskGroupQueue.getStatus() != TaskGroupQueueStatus.WAIT_QUEUE) {
putMsg(result, Status.TASK_GROUP_QUEUE_ALREADY_START);
return result;
}
taskGroupQueue.setForceStart(Flag.YES.getCode());
processService.updateTaskGroupQueue(taskGroupQueue);
processService.sendStartTask2Master(processInstance, taskGroupQueue.getTaskId(),
org.apache.dolphinscheduler.remote.command.CommandType.TASK_FORCE_STATE_EVENT_REQUEST);
putMsg(result, Status.SUCCESS); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | return result;
}
/**
* insert command, used in the implementation of the page, re run, recovery (pause / failure) execution
*
* @param loginUser login user
* @param instanceId instance id
* @param processDefinitionCode process definition code
* @param processVersion
* @param commandType command type
* @return insert result code
*/
private Map<String, Object> insertCommand(User loginUser, Integer instanceId, long processDefinitionCode,
int processVersion, CommandType commandType, String startParams) {
Map<String, Object> result = new HashMap<>();
//
Map<String, Object> cmdParam = new HashMap<>();
cmdParam.put(CMD_PARAM_RECOVER_PROCESS_ID_STRING, instanceId);
if (!StringUtils.isEmpty(startParams)) {
cmdParam.put(CMD_PARAM_START_PARAMS, startParams);
}
Command command = new Command();
command.setCommandType(commandType);
command.setProcessDefinitionCode(processDefinitionCode);
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
command.setExecutorId(loginUser.getId());
command.setProcessDefinitionVersion(processVersion);
command.setProcessInstanceId(instanceId);
if (!processService.verifyIsNeedCreateCommand(command)) {
putMsg(result, Status.PROCESS_INSTANCE_EXECUTING_COMMAND, String.valueOf(processDefinitionCode)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | return result;
}
int create = processService.createCommand(command);
if (create > 0) {
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.EXECUTE_PROCESS_INSTANCE_ERROR);
}
return result;
}
/**
* check if sub processes are offline before starting process definition
*
* @param processDefinitionCode process definition code
* @return check result code
*/
@Override
public Map<String, Object> startCheckByProcessDefinedCode(long processDefinitionCode) {
Map<String, Object> result = new HashMap<>();
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode);
if (processDefinition == null) {
logger.error("process definition is not found");
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "processDefinitionCode");
return result;
}
List<Long> codes = new ArrayList<>();
processService.recurseFindSubProcess(processDefinition.getCode(), codes);
if (!codes.isEmpty()) {
List<ProcessDefinition> processDefinitionList = processDefinitionMapper.queryByCodes(codes);
if (processDefinitionList != null) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | for (ProcessDefinition processDefinitionTmp : processDefinitionList) {
/**
* if there is no online process, exit directly
*/
if (processDefinitionTmp.getReleaseState() != ReleaseState.ONLINE) {
putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, processDefinitionTmp.getName());
logger.info("not release process definition id: {} , name : {}", processDefinitionTmp.getId(),
processDefinitionTmp.getName());
return result;
}
}
}
}
putMsg(result, Status.SUCCESS);
return result;
}
/**
* create command
*
* @param commandType commandType
* @param processDefineCode processDefineCode
* @param nodeDep nodeDep
* @param failureStrategy failureStrategy
* @param startNodeList startNodeList
* @param schedule schedule
* @param warningType warningType
* @param executorId executorId
* @param warningGroupId warningGroupId
* @param runMode runMode
* @param processInstancePriority processInstancePriority |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | * @param workerGroup workerGroup
* @param environmentCode environmentCode
* @return command id
*/
private int createCommand(CommandType commandType, long processDefineCode, TaskDependType nodeDep,
FailureStrategy failureStrategy, String startNodeList, String schedule,
WarningType warningType, int executorId, int warningGroupId, RunMode runMode,
Priority processInstancePriority, String workerGroup, Long environmentCode,
Map<String, String> startParams, Integer expectedParallelismNumber, int dryRun,
ComplementDependentMode complementDependentMode) {
/**
* instantiate command schedule instance
*/
Command command = new Command();
Map<String, String> cmdParam = new HashMap<>();
if (commandType == null) {
command.setCommandType(CommandType.START_PROCESS);
} else {
command.setCommandType(commandType);
}
command.setProcessDefinitionCode(processDefineCode);
if (nodeDep != null) {
command.setTaskDependType(nodeDep);
}
if (failureStrategy != null) {
command.setFailureStrategy(failureStrategy);
}
if (!StringUtils.isEmpty(startNodeList)) {
cmdParam.put(CMD_PARAM_START_NODES, startNodeList);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | if (warningType != null) {
command.setWarningType(warningType);
}
if (startParams != null && startParams.size() > 0) {
cmdParam.put(CMD_PARAM_START_PARAMS, JSONUtils.toJsonString(startParams));
}
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
command.setExecutorId(executorId);
command.setWarningGroupId(warningGroupId);
command.setProcessInstancePriority(processInstancePriority);
command.setWorkerGroup(workerGroup);
command.setEnvironmentCode(environmentCode);
command.setDryRun(dryRun);
ProcessDefinition processDefinition = processService.findProcessDefinitionByCode(processDefineCode);
if (processDefinition != null) {
command.setProcessDefinitionVersion(processDefinition.getVersion());
}
command.setProcessInstanceId(0);
//
if (commandType == CommandType.COMPLEMENT_DATA) {
if (schedule == null || StringUtils.isEmpty(schedule)) {
return 0;
}
if (!isValidateScheduleTime(schedule)) {
return 0;
}
try {
return createComplementCommandList(schedule, runMode, command, expectedParallelismNumber,
complementDependentMode);
} catch (CronParseException cronParseException) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | //
logger.error("Parse cron error", cronParseException);
return 0;
}
} else {
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
return processService.createCommand(command);
}
}
/**
* create complement command
* close left and close right
*
* @param scheduleTimeParam
* @param runMode
* @return
*/
protected int createComplementCommandList(String scheduleTimeParam, RunMode runMode, Command command,
Integer expectedParallelismNumber,
ComplementDependentMode complementDependentMode)
throws CronParseException {
int createCount = 0;
String startDate = null;
String endDate = null;
String dateList = null;
int dependentProcessDefinitionCreateCount = 0;
runMode = (runMode == null) ? RunMode.RUN_MODE_SERIAL : runMode;
Map<String, String> cmdParam = JSONUtils.toMap(command.getCommandParam());
Map<String, String> scheduleParam = JSONUtils.toMap(scheduleTimeParam);
if (scheduleParam.containsKey(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | dateList = scheduleParam.get(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST);
dateList = removeDuplicates(dateList);
}
if (scheduleParam.containsKey(CMDPARAM_COMPLEMENT_DATA_START_DATE) && scheduleParam.containsKey(
CMDPARAM_COMPLEMENT_DATA_END_DATE)) {
startDate = scheduleParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE);
endDate = scheduleParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE);
}
switch (runMode) {
case RUN_MODE_SERIAL: {
if (StringUtils.isNotEmpty(dateList)) {
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST, dateList);
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
createCount = processService.createCommand(command);
}
if (startDate != null && endDate != null) {
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, startDate);
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_END_DATE, endDate);
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
createCount = processService.createCommand(command);
//
List<Schedule> schedules = processService.queryReleaseSchedulerListByProcessDefinitionCode(
command.getProcessDefinitionCode());
if (schedules.isEmpty() || complementDependentMode == ComplementDependentMode.OFF_MODE) {
logger.info("process code: {} complement dependent in off mode or schedule's size is 0, skip "
+ "dependent complement data", command.getProcessDefinitionCode());
} else {
dependentProcessDefinitionCreateCount += createComplementDependentCommand(schedules, command);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | break;
}
case RUN_MODE_PARALLEL: {
if (startDate != null && endDate != null) {
List<Schedule> schedules = processService.queryReleaseSchedulerListByProcessDefinitionCode(
command.getProcessDefinitionCode());
List<ZonedDateTime> listDate = new ArrayList<>(
CronUtils.getSelfFireDateList(DateUtils.stringToZoneDateTime(startDate),
DateUtils.stringToZoneDateTime(endDate), schedules));
int listDateSize = listDate.size();
createCount = listDate.size();
if (!CollectionUtils.isEmpty(listDate)) {
if (expectedParallelismNumber != null && expectedParallelismNumber != 0) {
createCount = Math.min(listDate.size(), expectedParallelismNumber);
if (listDateSize < createCount) {
createCount = listDateSize;
}
}
logger.info("In parallel mode, current expectedParallelismNumber:{}", createCount);
//
//
int itemsPerCommand = (listDateSize / createCount);
int remainingItems = (listDateSize % createCount);
int startDateIndex = 0;
int endDateIndex = 0;
for (int i = 1; i <= createCount; i++) {
int extra = (i <= remainingItems) ? 1 : 0;
int singleCommandItems = (itemsPerCommand + extra);
if (i == 1) {
endDateIndex += singleCommandItems - 1; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | } else {
startDateIndex = endDateIndex + 1;
endDateIndex += singleCommandItems;
}
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, DateUtils.dateToString(listDate.get(startDateIndex)));
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_END_DATE, DateUtils.dateToString(listDate.get(endDateIndex)));
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
processService.createCommand(command);
if (schedules.isEmpty() || complementDependentMode == ComplementDependentMode.OFF_MODE) {
logger.info(
"process code: {} complement dependent in off mode or schedule's size is 0, skip "
+ "dependent complement data", command.getProcessDefinitionCode());
} else {
dependentProcessDefinitionCreateCount +=
createComplementDependentCommand(schedules, command);
}
}
}
}
if (StringUtils.isNotEmpty(dateList)) {
List<String> listDate = Arrays.asList(dateList.split(COMMA));
int listDateSize = listDate.size();
createCount = listDate.size();
if (!CollectionUtils.isEmpty(listDate)) {
if (expectedParallelismNumber != null && expectedParallelismNumber != 0) {
createCount = Math.min(listDate.size(), expectedParallelismNumber);
if (listDateSize < createCount) {
createCount = listDateSize;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | logger.info("In parallel mode, current expectedParallelismNumber:{}", createCount);
for (List<String> stringDate : Lists.partition(listDate, createCount)) {
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST, String.join(COMMA, stringDate));
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
processService.createCommand(command);
}
}
}
break;
}
default:
break;
}
logger.info("create complement command count: {}, create dependent complement command count: {}", createCount,
dependentProcessDefinitionCreateCount);
return createCount;
}
/**
* create complement dependent command
*/
protected int createComplementDependentCommand(List<Schedule> schedules, Command command) {
int dependentProcessDefinitionCreateCount = 0;
Command dependentCommand;
try {
dependentCommand = (Command) BeanUtils.cloneBean(command);
} catch (Exception e) {
logger.error("copy dependent command error: ", e);
return dependentProcessDefinitionCreateCount;
}
List<DependentProcessDefinition> dependentProcessDefinitionList = |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | getComplementDependentDefinitionList(dependentCommand.getProcessDefinitionCode(),
CronUtils.getMaxCycle(schedules.get(0).getCrontab()), dependentCommand.getWorkerGroup());
dependentCommand.setTaskDependType(TaskDependType.TASK_POST);
for (DependentProcessDefinition dependentProcessDefinition : dependentProcessDefinitionList) {
dependentCommand.setProcessDefinitionCode(dependentProcessDefinition.getProcessDefinitionCode());
dependentCommand.setWorkerGroup(dependentProcessDefinition.getWorkerGroup());
Map<String, String> cmdParam = JSONUtils.toMap(dependentCommand.getCommandParam());
cmdParam.put(CMD_PARAM_START_NODES, String.valueOf(dependentProcessDefinition.getTaskDefinitionCode()));
dependentCommand.setCommandParam(JSONUtils.toJsonString(cmdParam));
dependentProcessDefinitionCreateCount += processService.createCommand(dependentCommand);
}
return dependentProcessDefinitionCreateCount;
}
/**
* get complement list
*/
private List<DependentProcessDefinition> getComplementDependentDefinitionList(long processDefinitionCode,
CycleEnum processDefinitionCycle,
String workerGroup) {
List<DependentProcessDefinition> dependentProcessDefinitionList =
processService.queryDependentProcessDefinitionByProcessDefinitionCode(processDefinitionCode);
return checkDependentProcessDefinitionValid(dependentProcessDefinitionList, processDefinitionCycle,
workerGroup);
}
/**
* Check whether the dependency cycle of the dependent node is consistent with the schedule cycle of
* the and if there is no worker group in the schedule, use the complement selection's
* worker group
*/
private List<DependentProcessDefinition> checkDependentProcessDefinitionValid( |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | List<DependentProcessDefinition> dependentProcessDefinitionList, CycleEnum processDefinitionCycle,
String workerGroup) {
List<DependentProcessDefinition> validDependentProcessDefinitionList = new ArrayList<>();
List<Long> processDefinitionCodeList =
dependentProcessDefinitionList.stream().map(DependentProcessDefinition::getProcessDefinitionCode)
.collect(Collectors.toList());
Map<Long, String> processDefinitionWorkerGroupMap =
processService.queryWorkerGroupByProcessDefinitionCodes(processDefinitionCodeList);
for (DependentProcessDefinition dependentProcessDefinition : dependentProcessDefinitionList) {
if (dependentProcessDefinition.getDependentCycle() == processDefinitionCycle) {
if (processDefinitionWorkerGroupMap.get(dependentProcessDefinition.getProcessDefinitionCode())
== null) {
dependentProcessDefinition.setWorkerGroup(workerGroup);
}
validDependentProcessDefinitionList.add(dependentProcessDefinition);
}
}
return validDependentProcessDefinitionList;
}
/**
* @param schedule
* @return check error return 0 otherwish 1
*/
private boolean isValidateScheduleTime(String schedule) {
Map<String, String> scheduleResult = JSONUtils.toMap(schedule);
if (scheduleResult == null) {
return false;
}
if (scheduleResult.containsKey(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST)) {
if (scheduleResult.get(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST) == null) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | return false;
}
}
if (scheduleResult.containsKey(CMDPARAM_COMPLEMENT_DATA_START_DATE)) {
String startDate = scheduleResult.get(CMDPARAM_COMPLEMENT_DATA_START_DATE);
String endDate = scheduleResult.get(CMDPARAM_COMPLEMENT_DATA_END_DATE);
if (startDate == null || endDate == null) {
return false;
}
try {
ZonedDateTime start = DateUtils.stringToZoneDateTime(startDate);
ZonedDateTime end = DateUtils.stringToZoneDateTime(endDate);
if (start == null || end == null) {
return false;
}
if (start.isAfter(end)) {
logger.error("complement data error, wrong date start:{} and end date:{} ", start, end);
return false;
}
} catch (Exception ex) {
logger.warn("Parse schedule time error, startDate: {}, endDate: {}", startDate, endDate);
return false;
}
}
return true;
}
/**
* @param scheduleTimeList
* @return remove duplicate date list
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,118 | [Improvement][ExecutorServiceImpl] remove some unnecessary | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

Do you mind if I delete the part marked in red, I don't think these lines of code are necessary
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11118 | https://github.com/apache/dolphinscheduler/pull/11122 | a52d1b4acdafde308d8b0524d1e44764a5cdcfea | 81fa09678c201250312ef5acb5874227c9b3ce97 | 2022-07-23T06:43:45Z | java | 2022-07-28T01:57:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | private String removeDuplicates(String scheduleTimeList) {
if (StringUtils.isNotEmpty(scheduleTimeList)) {
Set<String> dateSet = Arrays.stream(scheduleTimeList.split(COMMA)).map(String::trim).collect(Collectors.toSet());
return String.join(COMMA, dateSet);
}
return null;
}
/**
* query executing data of processInstance by master
* @param processInstanceId
* @return
*/
@Override
public WorkflowExecuteDto queryExecutingWorkflowByProcessInstanceId(Integer processInstanceId) {
ProcessInstance processInstance = processService.findProcessInstanceDetailById(processInstanceId);
if (processInstance == null) {
return null;
}
Host host = new Host(processInstance.getHost());
WorkflowExecutingDataRequestCommand requestCommand = new WorkflowExecutingDataRequestCommand();
requestCommand.setProcessInstanceId(processInstanceId);
org.apache.dolphinscheduler.remote.command.Command command = stateEventCallbackService.sendSync(host, requestCommand.convert2Command());
if (command == null) {
return null;
}
WorkflowExecutingDataResponseCommand responseCommand = JSONUtils.parseObject(command.getBody(), WorkflowExecutingDataResponseCommand.class);
return responseCommand.getWorkflowExecuteDto();
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,071 | [Bug] [3.0.0-beta-2] custom parameter does not work in spark plugin sql task | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
I create a spark sql task to run a spark sql to insert data to another table.
I add a custom parameter and run the task, it failed, the log showed there was a null pointer exception.
> [ERROR] 2022-07-20 07:56:30.177 +0000 [taskAppId=TASK-20220720-6246094233696_12-28-70] TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.spark.SparkTask:[53] - yarn process failure
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.getInputLocalParametersMap(AbstractParameters.java:96)
at org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils.convert(ParamUtils.java:64)
at org.apache.dolphinscheduler.plugin.task.spark.SparkTask.buildCommand(SparkTask.java:120)
at org.apache.dolphinscheduler.plugin.task.api.AbstractYarnTask.handle(AbstractYarnTask.java:48)
at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:180)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
### What you expected to happen
I think It shoud run properly. But It failed, and It seemed not submit the job to yarn.
### How to reproduce
just create a spark task, set "Program Type" to "SQL", use a custom parameter, and run it.
### Anything else
I check the database to compare this task and a normally SQL task, I found that in "t_ds_task_definition" table, the json field "localParam" in task_param field lack 2 properties: direct and type
I add the properties manually and rerun the task, it works.
I think the issue is caused by the frontend, when add a custom parameter, there should have 4 properties, but spark task can only input 2 of them, the others didn't have default value.
I didn't know much about frontend, I think someone should fix it.
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11071 | https://github.com/apache/dolphinscheduler/pull/11184 | 2e81f3029832f5db76df47b07802fbf5b181e8e2 | 818648df7dab928ed61d7239454e7996079316c7 | 2022-07-20T09:49:59Z | java | 2022-07-28T07:07:04Z | dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java | /*
* 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 |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,071 | [Bug] [3.0.0-beta-2] custom parameter does not work in spark plugin sql task | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
I create a spark sql task to run a spark sql to insert data to another table.
I add a custom parameter and run the task, it failed, the log showed there was a null pointer exception.
> [ERROR] 2022-07-20 07:56:30.177 +0000 [taskAppId=TASK-20220720-6246094233696_12-28-70] TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.spark.SparkTask:[53] - yarn process failure
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.getInputLocalParametersMap(AbstractParameters.java:96)
at org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils.convert(ParamUtils.java:64)
at org.apache.dolphinscheduler.plugin.task.spark.SparkTask.buildCommand(SparkTask.java:120)
at org.apache.dolphinscheduler.plugin.task.api.AbstractYarnTask.handle(AbstractYarnTask.java:48)
at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:180)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
### What you expected to happen
I think It shoud run properly. But It failed, and It seemed not submit the job to yarn.
### How to reproduce
just create a spark task, set "Program Type" to "SQL", use a custom parameter, and run it.
### Anything else
I check the database to compare this task and a normally SQL task, I found that in "t_ds_task_definition" table, the json field "localParam" in task_param field lack 2 properties: direct and type
I add the properties manually and rerun the task, it works.
I think the issue is caused by the frontend, when add a custom parameter, there should have 4 properties, but spark task can only input 2 of them, the others didn't have default value.
I didn't know much about frontend, I think someone should fix it.
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11071 | https://github.com/apache/dolphinscheduler/pull/11184 | 2e81f3029832f5db76df47b07802fbf5b181e8e2 | 818648df7dab928ed61d7239454e7996079316c7 | 2022-07-20T09:49:59Z | java | 2022-07-28T07:07:04Z | dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java | * 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.plugin.task.api.parameters;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.dolphinscheduler.plugin.task.api.enums.Direct;
import org.apache.dolphinscheduler.plugin.task.api.model.Property;
import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo;
import org.apache.dolphinscheduler.plugin.task.api.parameters.resource.ResourceParametersHelper;
import org.apache.dolphinscheduler.spi.utils.JSONUtils;
import org.apache.dolphinscheduler.spi.utils.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
/**
* job params related class
*/
public abstract class AbstractParameters implements IParameters { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,071 | [Bug] [3.0.0-beta-2] custom parameter does not work in spark plugin sql task | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
I create a spark sql task to run a spark sql to insert data to another table.
I add a custom parameter and run the task, it failed, the log showed there was a null pointer exception.
> [ERROR] 2022-07-20 07:56:30.177 +0000 [taskAppId=TASK-20220720-6246094233696_12-28-70] TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.spark.SparkTask:[53] - yarn process failure
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.getInputLocalParametersMap(AbstractParameters.java:96)
at org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils.convert(ParamUtils.java:64)
at org.apache.dolphinscheduler.plugin.task.spark.SparkTask.buildCommand(SparkTask.java:120)
at org.apache.dolphinscheduler.plugin.task.api.AbstractYarnTask.handle(AbstractYarnTask.java:48)
at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:180)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
### What you expected to happen
I think It shoud run properly. But It failed, and It seemed not submit the job to yarn.
### How to reproduce
just create a spark task, set "Program Type" to "SQL", use a custom parameter, and run it.
### Anything else
I check the database to compare this task and a normally SQL task, I found that in "t_ds_task_definition" table, the json field "localParam" in task_param field lack 2 properties: direct and type
I add the properties manually and rerun the task, it works.
I think the issue is caused by the frontend, when add a custom parameter, there should have 4 properties, but spark task can only input 2 of them, the others didn't have default value.
I didn't know much about frontend, I think someone should fix it.
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11071 | https://github.com/apache/dolphinscheduler/pull/11184 | 2e81f3029832f5db76df47b07802fbf5b181e8e2 | 818648df7dab928ed61d7239454e7996079316c7 | 2022-07-20T09:49:59Z | java | 2022-07-28T07:07:04Z | dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java | @Override
public abstract boolean checkParameters();
@Override
public List<ResourceInfo> getResourceFilesList() {
return new ArrayList<>();
}
/**
* local parameters
*/
public List<Property> localParams;
/**
* var pool
*/
public List<Property> varPool;
/**
* get local parameters list
*
* @return Property list
*/
public List<Property> getLocalParams() {
return localParams;
}
public void setLocalParams(List<Property> localParams) {
this.localParams = localParams;
}
/**
* get local parameters map |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,071 | [Bug] [3.0.0-beta-2] custom parameter does not work in spark plugin sql task | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
I create a spark sql task to run a spark sql to insert data to another table.
I add a custom parameter and run the task, it failed, the log showed there was a null pointer exception.
> [ERROR] 2022-07-20 07:56:30.177 +0000 [taskAppId=TASK-20220720-6246094233696_12-28-70] TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.spark.SparkTask:[53] - yarn process failure
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.getInputLocalParametersMap(AbstractParameters.java:96)
at org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils.convert(ParamUtils.java:64)
at org.apache.dolphinscheduler.plugin.task.spark.SparkTask.buildCommand(SparkTask.java:120)
at org.apache.dolphinscheduler.plugin.task.api.AbstractYarnTask.handle(AbstractYarnTask.java:48)
at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:180)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
### What you expected to happen
I think It shoud run properly. But It failed, and It seemed not submit the job to yarn.
### How to reproduce
just create a spark task, set "Program Type" to "SQL", use a custom parameter, and run it.
### Anything else
I check the database to compare this task and a normally SQL task, I found that in "t_ds_task_definition" table, the json field "localParam" in task_param field lack 2 properties: direct and type
I add the properties manually and rerun the task, it works.
I think the issue is caused by the frontend, when add a custom parameter, there should have 4 properties, but spark task can only input 2 of them, the others didn't have default value.
I didn't know much about frontend, I think someone should fix it.
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11071 | https://github.com/apache/dolphinscheduler/pull/11184 | 2e81f3029832f5db76df47b07802fbf5b181e8e2 | 818648df7dab928ed61d7239454e7996079316c7 | 2022-07-20T09:49:59Z | java | 2022-07-28T07:07:04Z | dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java | * @return parameters map
*/
public Map<String, Property> getLocalParametersMap() {
Map<String, Property> localParametersMaps = new LinkedHashMap<>();
if (localParams != null) {
for (Property property : localParams) {
localParametersMaps.put(property.getProp(),property);
}
}
return localParametersMaps;
}
/**
* get input local parameters map if the param direct is IN
* @return parameters map
*/
public Map<String, Property> getInputLocalParametersMap() {
Map<String, Property> localParametersMaps = new LinkedHashMap<>();
if (localParams != null) {
for (Property property : localParams) {
if (Objects.equals(Direct.IN, property.getDirect())) {
localParametersMaps.put(property.getProp(), property);
}
}
}
return localParametersMaps;
}
/**
* get varPool map
*
* @return parameters map |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,071 | [Bug] [3.0.0-beta-2] custom parameter does not work in spark plugin sql task | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
I create a spark sql task to run a spark sql to insert data to another table.
I add a custom parameter and run the task, it failed, the log showed there was a null pointer exception.
> [ERROR] 2022-07-20 07:56:30.177 +0000 [taskAppId=TASK-20220720-6246094233696_12-28-70] TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.spark.SparkTask:[53] - yarn process failure
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.getInputLocalParametersMap(AbstractParameters.java:96)
at org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils.convert(ParamUtils.java:64)
at org.apache.dolphinscheduler.plugin.task.spark.SparkTask.buildCommand(SparkTask.java:120)
at org.apache.dolphinscheduler.plugin.task.api.AbstractYarnTask.handle(AbstractYarnTask.java:48)
at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:180)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
### What you expected to happen
I think It shoud run properly. But It failed, and It seemed not submit the job to yarn.
### How to reproduce
just create a spark task, set "Program Type" to "SQL", use a custom parameter, and run it.
### Anything else
I check the database to compare this task and a normally SQL task, I found that in "t_ds_task_definition" table, the json field "localParam" in task_param field lack 2 properties: direct and type
I add the properties manually and rerun the task, it works.
I think the issue is caused by the frontend, when add a custom parameter, there should have 4 properties, but spark task can only input 2 of them, the others didn't have default value.
I didn't know much about frontend, I think someone should fix it.
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11071 | https://github.com/apache/dolphinscheduler/pull/11184 | 2e81f3029832f5db76df47b07802fbf5b181e8e2 | 818648df7dab928ed61d7239454e7996079316c7 | 2022-07-20T09:49:59Z | java | 2022-07-28T07:07:04Z | dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java | */
public Map<String, Property> getVarPoolMap() {
Map<String, Property> varPoolMap = new LinkedHashMap<>();
if (varPool != null) {
for (Property property : varPool) {
varPoolMap.put(property.getProp(), property);
}
}
return varPoolMap;
}
public List<Property> getVarPool() {
return varPool;
}
public void setVarPool(String varPool) {
if (org.apache.dolphinscheduler.spi.utils.StringUtils.isEmpty(varPool)) {
this.varPool = new ArrayList<>();
} else {
this.varPool = JSONUtils.toList(varPool, Property.class);
}
}
public void dealOutParam(String result) {
if (CollectionUtils.isEmpty(localParams)) {
return;
}
List<Property> outProperty = getOutProperty(localParams);
if (CollectionUtils.isEmpty(outProperty)) {
return;
}
if (StringUtils.isEmpty(result)) {
varPool.addAll(outProperty); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,071 | [Bug] [3.0.0-beta-2] custom parameter does not work in spark plugin sql task | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
I create a spark sql task to run a spark sql to insert data to another table.
I add a custom parameter and run the task, it failed, the log showed there was a null pointer exception.
> [ERROR] 2022-07-20 07:56:30.177 +0000 [taskAppId=TASK-20220720-6246094233696_12-28-70] TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.spark.SparkTask:[53] - yarn process failure
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.getInputLocalParametersMap(AbstractParameters.java:96)
at org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils.convert(ParamUtils.java:64)
at org.apache.dolphinscheduler.plugin.task.spark.SparkTask.buildCommand(SparkTask.java:120)
at org.apache.dolphinscheduler.plugin.task.api.AbstractYarnTask.handle(AbstractYarnTask.java:48)
at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:180)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
### What you expected to happen
I think It shoud run properly. But It failed, and It seemed not submit the job to yarn.
### How to reproduce
just create a spark task, set "Program Type" to "SQL", use a custom parameter, and run it.
### Anything else
I check the database to compare this task and a normally SQL task, I found that in "t_ds_task_definition" table, the json field "localParam" in task_param field lack 2 properties: direct and type
I add the properties manually and rerun the task, it works.
I think the issue is caused by the frontend, when add a custom parameter, there should have 4 properties, but spark task can only input 2 of them, the others didn't have default value.
I didn't know much about frontend, I think someone should fix it.
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11071 | https://github.com/apache/dolphinscheduler/pull/11184 | 2e81f3029832f5db76df47b07802fbf5b181e8e2 | 818648df7dab928ed61d7239454e7996079316c7 | 2022-07-20T09:49:59Z | java | 2022-07-28T07:07:04Z | dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java | return;
}
Map<String, String> taskResult = getMapByString(result);
if (taskResult.size() == 0) {
return;
}
for (Property info : outProperty) {
String propValue = taskResult.get(info.getProp());
if (StringUtils.isNotEmpty(propValue)) {
info.setValue(propValue);
addPropertyToValPool(info);
}
}
}
public List<Property> getOutProperty(List<Property> params) {
if (CollectionUtils.isEmpty(params)) {
return new ArrayList<>();
}
List<Property> result = new ArrayList<>();
for (Property info : params) {
if (info.getDirect() == Direct.OUT) {
result.add(info);
}
}
return result;
}
public List<Map<String, String>> getListMapByString(String json) {
List<Map<String, String>> allParams = new ArrayList<>();
ArrayNode paramsByJson = JSONUtils.parseArray(json);
for (JsonNode jsonNode : paramsByJson) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,071 | [Bug] [3.0.0-beta-2] custom parameter does not work in spark plugin sql task | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
I create a spark sql task to run a spark sql to insert data to another table.
I add a custom parameter and run the task, it failed, the log showed there was a null pointer exception.
> [ERROR] 2022-07-20 07:56:30.177 +0000 [taskAppId=TASK-20220720-6246094233696_12-28-70] TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.spark.SparkTask:[53] - yarn process failure
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.getInputLocalParametersMap(AbstractParameters.java:96)
at org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils.convert(ParamUtils.java:64)
at org.apache.dolphinscheduler.plugin.task.spark.SparkTask.buildCommand(SparkTask.java:120)
at org.apache.dolphinscheduler.plugin.task.api.AbstractYarnTask.handle(AbstractYarnTask.java:48)
at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:180)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
### What you expected to happen
I think It shoud run properly. But It failed, and It seemed not submit the job to yarn.
### How to reproduce
just create a spark task, set "Program Type" to "SQL", use a custom parameter, and run it.
### Anything else
I check the database to compare this task and a normally SQL task, I found that in "t_ds_task_definition" table, the json field "localParam" in task_param field lack 2 properties: direct and type
I add the properties manually and rerun the task, it works.
I think the issue is caused by the frontend, when add a custom parameter, there should have 4 properties, but spark task can only input 2 of them, the others didn't have default value.
I didn't know much about frontend, I think someone should fix it.
### Version
3.0.0-beta-2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11071 | https://github.com/apache/dolphinscheduler/pull/11184 | 2e81f3029832f5db76df47b07802fbf5b181e8e2 | 818648df7dab928ed61d7239454e7996079316c7 | 2022-07-20T09:49:59Z | java | 2022-07-28T07:07:04Z | dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java | Map<String, String> param = JSONUtils.toMap(jsonNode.toString());
allParams.add(param);
}
return allParams;
}
/**
* shell's result format is key=value$VarPool$key=value$VarPool$
* @param result
* @return
*/
public static Map<String, String> getMapByString(String result) {
String[] formatResult = result.split("\\$VarPool\\$");
Map<String, String> format = new HashMap<>();
for (String info : formatResult) {
if (StringUtils.isNotEmpty(info) && info.contains("=")) {
String[] keyValue = info.split("=");
format.put(keyValue[0], keyValue[1]);
}
}
return format;
}
public ResourceParametersHelper getResources() {
return new ResourceParametersHelper();
}
private void addPropertyToValPool(Property property) {
varPool.removeIf(p -> p.getProp().equals(property.getProp()));
varPool.add(property);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | /*
* 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.service.impl;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_START;
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE;
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST;
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING;
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_START_NODES;
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_START_PARAMS;
import static org.apache.dolphinscheduler.common.Constants.COMMA;
import static org.apache.dolphinscheduler.common.Constants.MAX_TASK_TIMEOUT;
import static org.apache.dolphinscheduler.common.Constants.SCHEDULE_TIME_MAX_LENGTH;
import org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant;
import org.apache.dolphinscheduler.api.enums.ExecuteType;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.ExecutorService;
import org.apache.dolphinscheduler.api.service.MonitorService;
import org.apache.dolphinscheduler.api.service.ProjectService;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.CommandType;
import org.apache.dolphinscheduler.common.enums.ComplementDependentMode;
import org.apache.dolphinscheduler.common.enums.CycleEnum;
import org.apache.dolphinscheduler.common.enums.FailureStrategy;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.Priority;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.RunMode;
import org.apache.dolphinscheduler.common.enums.TaskDependType;
import org.apache.dolphinscheduler.common.enums.TaskGroupQueueStatus;
import org.apache.dolphinscheduler.common.enums.WarningType;
import org.apache.dolphinscheduler.common.model.Server;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.entity.Command;
import org.apache.dolphinscheduler.dao.entity.DependentProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.Schedule;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskGroupQueue;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskGroupQueueMapper;
import org.apache.dolphinscheduler.plugin.task.api.TaskConstants;
import org.apache.dolphinscheduler.plugin.task.api.enums.ExecutionStatus;
import org.apache.dolphinscheduler.remote.command.StateEventChangeCommand;
import org.apache.dolphinscheduler.remote.command.WorkflowExecutingDataRequestCommand;
import org.apache.dolphinscheduler.remote.command.WorkflowExecutingDataResponseCommand;
import org.apache.dolphinscheduler.remote.dto.WorkflowExecuteDto;
import org.apache.dolphinscheduler.remote.processor.StateEventCallbackService;
import org.apache.dolphinscheduler.remote.utils.Host;
import org.apache.dolphinscheduler.service.cron.CronUtils;
import org.apache.dolphinscheduler.service.exceptions.CronParseException;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import java.time.ZonedDateTime; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.collect.Lists;
/**
* executor service impl
*/
@Service
public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorService {
private static final Logger logger = LoggerFactory.getLogger(ExecutorServiceImpl.class);
@Autowired
private ProjectMapper projectMapper;
@Autowired
private ProjectService projectService;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
@Autowired
private MonitorService monitorService;
@Autowired
private ProcessInstanceMapper processInstanceMapper; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | @Autowired
private ProcessService processService;
@Autowired
private StateEventCallbackService stateEventCallbackService;
@Autowired
private TaskDefinitionMapper taskDefinitionMapper;
@Autowired
private ProcessTaskRelationMapper processTaskRelationMapper;
@Autowired
private TaskGroupQueueMapper taskGroupQueueMapper;
/**
* execute process instance
*
* @param loginUser login user
* @param projectCode project code
* @param processDefinitionCode process definition code
* @param cronTime cron time
* @param commandType command type
* @param failureStrategy failure strategy
* @param startNodeList start nodelist
* @param taskDependType node dependency type
* @param warningType warning type
* @param warningGroupId notify group id
* @param processInstancePriority process instance priority
* @param workerGroup worker group name
* @param environmentCode environment code
* @param runMode run mode
* @param timeout timeout
* @param startParams the global param values which pass to new process instance
* @param expectedParallelismNumber the expected parallelism number when execute complement in parallel mode |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | * @return execute process instance code
*/
@Override
public Map<String, Object> execProcessInstance(User loginUser, long projectCode, long processDefinitionCode,
String cronTime, CommandType commandType,
FailureStrategy failureStrategy, String startNodeList,
TaskDependType taskDependType, WarningType warningType,
int warningGroupId, RunMode runMode,
Priority processInstancePriority, String workerGroup,
Long environmentCode, Integer timeout,
Map<String, String> startParams, Integer expectedParallelismNumber,
int dryRun, ComplementDependentMode complementDependentMode) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_START);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (timeout <= 0 || timeout > MAX_TASK_TIMEOUT) {
putMsg(result, Status.TASK_TIMEOUT_PARAMS_ERROR);
return result;
}
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode);
result = checkProcessDefinitionValid(projectCode, processDefinition, processDefinitionCode, processDefinition.getVersion());
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | if (!checkTenantSuitable(processDefinition)) {
logger.error("there is not any valid tenant for the process definition: id:{},name:{}, ",
processDefinition.getId(), processDefinition.getName());
putMsg(result, Status.TENANT_NOT_SUITABLE);
return result;
}
if (!checkScheduleTimeNum(commandType, cronTime)) {
putMsg(result, Status.SCHEDULE_TIME_NUMBER);
return result;
}
if (!checkMasterExists(result)) {
return result;
}
/**
* create command
*/
int create =
this.createCommand(commandType, processDefinition.getCode(), taskDependType, failureStrategy, startNodeList,
cronTime, warningType, loginUser.getId(), warningGroupId, runMode, processInstancePriority, workerGroup,
environmentCode, startParams, expectedParallelismNumber, dryRun, complementDependentMode);
if (create > 0) {
processDefinition.setWarningGroupId(warningGroupId);
processDefinitionMapper.updateById(processDefinition);
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.START_PROCESS_INSTANCE_ERROR);
}
return result;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | /**
* check whether master exists
*
* @param result result
* @return master exists return true , otherwise return false
*/
private boolean checkMasterExists(Map<String, Object> result) {
List<Server> masterServers = monitorService.getServerListFromRegistry(true);
if (masterServers.isEmpty()) {
putMsg(result, Status.MASTER_NOT_EXISTS);
return false;
}
return true;
}
/**
* @param complementData
* @param cronTime
* @return CommandType is COMPLEMENT_DATA and cronTime's number is not greater than 100 return true , otherwise return false
*/
private boolean checkScheduleTimeNum(CommandType complementData, String cronTime) {
if (!CommandType.COMPLEMENT_DATA.equals(complementData)) {
return true;
}
if (cronTime == null) {
return true;
}
Map<String, String> cronMap = JSONUtils.toMap(cronTime);
if (cronMap.containsKey(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | String[] stringDates = cronMap.get(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST).split(COMMA);
if (stringDates.length > SCHEDULE_TIME_MAX_LENGTH) {
return false;
}
}
return true;
}
/**
* check whether the process definition can be executed
*
* @param projectCode project code
* @param processDefinition process definition
* @param processDefineCode process definition code
* @param version process instance verison
* @return check result code
*/
@Override
public Map<String, Object> checkProcessDefinitionValid(long projectCode, ProcessDefinition processDefinition,
long processDefineCode, Integer version) {
Map<String, Object> result = new HashMap<>();
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(processDefineCode));
} else if (processDefinition.getReleaseState() != ReleaseState.ONLINE) {
putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, String.valueOf(processDefineCode), version);
} else if (!checkSubProcessDefinitionValid(processDefinition)) {
putMsg(result, Status.SUB_PROCESS_DEFINE_NOT_RELEASE);
} else { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | result.put(Constants.STATUS, Status.SUCCESS);
}
return result;
}
/**
* check if the current process has subprocesses and all subprocesses are valid
*
* @param processDefinition
* @return check result
*/
@Override
public boolean checkSubProcessDefinitionValid(ProcessDefinition processDefinition) {
List<ProcessTaskRelation> processTaskRelations =
processTaskRelationMapper.queryDownstreamByProcessDefinitionCode(processDefinition.getCode());
if (processTaskRelations.isEmpty()) {
return true;
}
Set<Long> relationCodes =
processTaskRelations.stream().map(ProcessTaskRelation::getPostTaskCode).collect(Collectors.toSet());
List<TaskDefinition> taskDefinitions = taskDefinitionMapper.queryByCodeList(relationCodes);
Set<Long> processDefinitionCodeSet = new HashSet<>();
taskDefinitions.stream()
.filter(task -> TaskConstants.TASK_TYPE_SUB_PROCESS.equalsIgnoreCase(task.getTaskType())).forEach(
taskDefinition -> processDefinitionCodeSet.add(Long.valueOf(
JSONUtils.getNodeString(taskDefinition.getTaskParams(), Constants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE))));
if (processDefinitionCodeSet.isEmpty()) {
return true;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | List<ProcessDefinition> processDefinitions = processDefinitionMapper.queryByCodes(processDefinitionCodeSet);
return processDefinitions.stream()
.filter(definition -> definition.getReleaseState().equals(ReleaseState.OFFLINE)).collect(Collectors.toSet())
.isEmpty();
}
/**
* do action to process instance:pause, stop, repeat, recover from pause, recover from stop
*
* @param loginUser login user
* @param projectCode project code
* @param processInstanceId process instance id
* @param executeType execute type
* @return execute result code
*/
@Override
public Map<String, Object> execute(User loginUser, long projectCode, Integer processInstanceId, ExecuteType executeType) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode,
ApiFuncIdentificationConstant.map.get(executeType));
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (!checkMasterExists(result)) {
return result;
}
ProcessInstance processInstance = processService.findProcessInstanceDetailById(processInstanceId);
if (processInstance == null) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
return result;
}
ProcessDefinition processDefinition =
processService.findProcessDefinition(processInstance.getProcessDefinitionCode(),
processInstance.getProcessDefinitionVersion());
if (executeType != ExecuteType.STOP && executeType != ExecuteType.PAUSE) {
result =
checkProcessDefinitionValid(projectCode, processDefinition, processInstance.getProcessDefinitionCode(),
processInstance.getProcessDefinitionVersion());
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
}
result = checkExecuteType(processInstance, executeType);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (!checkTenantSuitable(processDefinition)) {
logger.error("there is not any valid tenant for the process definition: id:{},name:{}, ",
processDefinition.getId(), processDefinition.getName());
putMsg(result, Status.TENANT_NOT_SUITABLE);
}
//
Map<String, Object> commandMap =
JSONUtils.parseObject(processInstance.getCommandParam(), new TypeReference<Map<String, Object>>() {
});
String startParams = null;
if (MapUtils.isNotEmpty(commandMap) && executeType == ExecuteType.REPEAT_RUNNING) {
Object startParamsJson = commandMap.get(Constants.CMD_PARAM_START_PARAMS); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | if (startParamsJson != null) {
startParams = startParamsJson.toString();
}
}
switch (executeType) {
case REPEAT_RUNNING:
result = insertCommand(loginUser, processInstanceId, processDefinition.getCode(),
processDefinition.getVersion(), CommandType.REPEAT_RUNNING, startParams);
break;
case RECOVER_SUSPENDED_PROCESS:
result = insertCommand(loginUser, processInstanceId, processDefinition.getCode(),
processDefinition.getVersion(), CommandType.RECOVER_SUSPENDED_PROCESS, startParams);
break;
case START_FAILURE_TASK_PROCESS:
result = insertCommand(loginUser, processInstanceId, processDefinition.getCode(),
processDefinition.getVersion(), CommandType.START_FAILURE_TASK_PROCESS, startParams);
break;
case STOP:
if (processInstance.getState() == ExecutionStatus.READY_STOP) {
putMsg(result, Status.PROCESS_INSTANCE_ALREADY_CHANGED, processInstance.getName(),
processInstance.getState());
} else {
result =
updateProcessInstancePrepare(processInstance, CommandType.STOP, ExecutionStatus.READY_STOP);
}
break;
case PAUSE:
if (processInstance.getState() == ExecutionStatus.READY_PAUSE) {
putMsg(result, Status.PROCESS_INSTANCE_ALREADY_CHANGED, processInstance.getName(), processInstance.getState());
} else { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | result = updateProcessInstancePrepare(processInstance, CommandType.PAUSE, ExecutionStatus.READY_PAUSE);
}
break;
default:
logger.error("unknown execute type : {}", executeType);
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "unknown execute type");
break;
}
return result;
}
@Override
public Map<String, Object> forceStartTaskInstance(User loginUser, int queueId) {
Map<String, Object> result = new HashMap<>();
TaskGroupQueue taskGroupQueue = taskGroupQueueMapper.selectById(queueId);
//
ProcessInstance processInstance = processInstanceMapper.selectById(taskGroupQueue.getProcessId());
if (processInstance == null) {
putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, taskGroupQueue.getProcessId());
return result;
}
if (!checkMasterExists(result)) {
return result;
}
return forceStart(processInstance, taskGroupQueue);
}
/**
* check tenant suitable
*
* @param processDefinition process definition |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | * @return true if tenant suitable, otherwise return false
*/
private boolean checkTenantSuitable(ProcessDefinition processDefinition) {
Tenant tenant =
processService.getTenantForProcess(processDefinition.getTenantId(), processDefinition.getUserId());
return tenant != null;
}
/**
* Check the state of process instance and the type of operation match
*
* @param processInstance process instance
* @param executeType execute type
* @return check result code
*/
private Map<String, Object> checkExecuteType(ProcessInstance processInstance, ExecuteType executeType) {
Map<String, Object> result = new HashMap<>();
ExecutionStatus executionStatus = processInstance.getState();
boolean checkResult = false;
switch (executeType) {
case PAUSE:
case STOP:
if (executionStatus.typeIsRunning()) {
checkResult = true;
}
break;
case REPEAT_RUNNING:
if (executionStatus.typeIsFinished()) {
checkResult = true;
}
break; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | case START_FAILURE_TASK_PROCESS:
if (executionStatus.typeIsFailure()) {
checkResult = true;
}
break;
case RECOVER_SUSPENDED_PROCESS:
if (executionStatus.typeIsPause() || executionStatus.typeIsCancel()) {
checkResult = true;
}
break;
default:
break;
}
if (!checkResult) {
putMsg(result, Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR, processInstance.getName(),
executionStatus.toString(), executeType.toString());
} else {
putMsg(result, Status.SUCCESS);
}
return result;
}
/**
* prepare to update process instance command type and status
*
* @param processInstance process instance
* @param commandType command type
* @param executionStatus execute status
* @return update result
*/
private Map<String, Object> updateProcessInstancePrepare(ProcessInstance processInstance, CommandType commandType, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | ExecutionStatus executionStatus) {
Map<String, Object> result = new HashMap<>();
processInstance.setCommandType(commandType);
processInstance.addHistoryCmd(commandType);
processInstance.setState(executionStatus);
int update = processService.updateProcessInstance(processInstance);
//
if (update > 0) {
//
StateEventChangeCommand stateEventChangeCommand = new StateEventChangeCommand(
processInstance.getId(), 0, processInstance.getState(), processInstance.getId(), 0
);
Host host = new Host(processInstance.getHost());
stateEventCallbackService.sendResult(host, stateEventChangeCommand.convert2Command());
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.EXECUTE_PROCESS_INSTANCE_ERROR);
}
return result;
}
/**
* prepare to update process instance command type and status
*
* @param processInstance process instance
* @return update result
*/
private Map<String, Object> forceStart(ProcessInstance processInstance, TaskGroupQueue taskGroupQueue) {
Map<String, Object> result = new HashMap<>();
if (taskGroupQueue.getStatus() != TaskGroupQueueStatus.WAIT_QUEUE) {
putMsg(result, Status.TASK_GROUP_QUEUE_ALREADY_START); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | return result;
}
taskGroupQueue.setForceStart(Flag.YES.getCode());
processService.updateTaskGroupQueue(taskGroupQueue);
processService.sendStartTask2Master(processInstance, taskGroupQueue.getTaskId(),
org.apache.dolphinscheduler.remote.command.CommandType.TASK_FORCE_STATE_EVENT_REQUEST);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* insert command, used in the implementation of the page, re run, recovery (pause / failure) execution
*
* @param loginUser login user
* @param instanceId instance id
* @param processDefinitionCode process definition code
* @param processVersion
* @param commandType command type
* @return insert result code
*/
private Map<String, Object> insertCommand(User loginUser, Integer instanceId, long processDefinitionCode,
int processVersion, CommandType commandType, String startParams) {
Map<String, Object> result = new HashMap<>();
//
Map<String, Object> cmdParam = new HashMap<>();
cmdParam.put(CMD_PARAM_RECOVER_PROCESS_ID_STRING, instanceId);
if (!StringUtils.isEmpty(startParams)) {
cmdParam.put(CMD_PARAM_START_PARAMS, startParams);
}
Command command = new Command();
command.setCommandType(commandType); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | command.setProcessDefinitionCode(processDefinitionCode);
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
command.setExecutorId(loginUser.getId());
command.setProcessDefinitionVersion(processVersion);
command.setProcessInstanceId(instanceId);
if (!processService.verifyIsNeedCreateCommand(command)) {
putMsg(result, Status.PROCESS_INSTANCE_EXECUTING_COMMAND, String.valueOf(processDefinitionCode));
return result;
}
int create = processService.createCommand(command);
if (create > 0) {
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.EXECUTE_PROCESS_INSTANCE_ERROR);
}
return result;
}
/**
* check if sub processes are offline before starting process definition
*
* @param processDefinitionCode process definition code
* @return check result code
*/
@Override
public Map<String, Object> startCheckByProcessDefinedCode(long processDefinitionCode) {
Map<String, Object> result = new HashMap<>();
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode);
if (processDefinition == null) {
logger.error("process definition is not found");
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "processDefinitionCode"); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | return result;
}
List<Long> codes = new ArrayList<>();
processService.recurseFindSubProcess(processDefinition.getCode(), codes);
if (!codes.isEmpty()) {
List<ProcessDefinition> processDefinitionList = processDefinitionMapper.queryByCodes(codes);
if (processDefinitionList != null) {
for (ProcessDefinition processDefinitionTmp : processDefinitionList) {
/**
* if there is no online process, exit directly
*/
if (processDefinitionTmp.getReleaseState() != ReleaseState.ONLINE) {
putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, processDefinitionTmp.getName());
logger.info("not release process definition id: {} , name : {}", processDefinitionTmp.getId(),
processDefinitionTmp.getName());
return result;
}
}
}
}
putMsg(result, Status.SUCCESS);
return result;
}
/**
* create command
*
* @param commandType commandType
* @param processDefineCode processDefineCode
* @param nodeDep nodeDep
* @param failureStrategy failureStrategy |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | * @param startNodeList startNodeList
* @param schedule schedule
* @param warningType warningType
* @param executorId executorId
* @param warningGroupId warningGroupId
* @param runMode runMode
* @param processInstancePriority processInstancePriority
* @param workerGroup workerGroup
* @param environmentCode environmentCode
* @return command id
*/
private int createCommand(CommandType commandType, long processDefineCode, TaskDependType nodeDep,
FailureStrategy failureStrategy, String startNodeList, String schedule,
WarningType warningType, int executorId, int warningGroupId, RunMode runMode,
Priority processInstancePriority, String workerGroup, Long environmentCode,
Map<String, String> startParams, Integer expectedParallelismNumber, int dryRun,
ComplementDependentMode complementDependentMode) {
/**
* instantiate command schedule instance
*/
Command command = new Command();
Map<String, String> cmdParam = new HashMap<>();
if (commandType == null) {
command.setCommandType(CommandType.START_PROCESS);
} else {
command.setCommandType(commandType);
}
command.setProcessDefinitionCode(processDefineCode);
if (nodeDep != null) {
command.setTaskDependType(nodeDep); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | }
if (failureStrategy != null) {
command.setFailureStrategy(failureStrategy);
}
if (!StringUtils.isEmpty(startNodeList)) {
cmdParam.put(CMD_PARAM_START_NODES, startNodeList);
}
if (warningType != null) {
command.setWarningType(warningType);
}
if (startParams != null && startParams.size() > 0) {
cmdParam.put(CMD_PARAM_START_PARAMS, JSONUtils.toJsonString(startParams));
}
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
command.setExecutorId(executorId);
command.setWarningGroupId(warningGroupId);
command.setProcessInstancePriority(processInstancePriority);
command.setWorkerGroup(workerGroup);
command.setEnvironmentCode(environmentCode);
command.setDryRun(dryRun);
ProcessDefinition processDefinition = processService.findProcessDefinitionByCode(processDefineCode);
if (processDefinition != null) {
command.setProcessDefinitionVersion(processDefinition.getVersion());
}
command.setProcessInstanceId(0);
//
if (commandType == CommandType.COMPLEMENT_DATA) {
if (schedule == null || StringUtils.isEmpty(schedule)) {
return 0;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | if (!isValidateScheduleTime(schedule)) {
return 0;
}
try {
return createComplementCommandList(schedule, runMode, command, expectedParallelismNumber,
complementDependentMode);
} catch (CronParseException cronParseException) {
//
logger.error("Parse cron error", cronParseException);
return 0;
}
} else {
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
return processService.createCommand(command);
}
}
/**
* create complement command
* close left and close right
*
* @param scheduleTimeParam
* @param runMode
* @return
*/
protected int createComplementCommandList(String scheduleTimeParam, RunMode runMode, Command command,
Integer expectedParallelismNumber,
ComplementDependentMode complementDependentMode)
throws CronParseException {
int createCount = 0;
String startDate = null; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | String endDate = null;
String dateList = null;
int dependentProcessDefinitionCreateCount = 0;
runMode = (runMode == null) ? RunMode.RUN_MODE_SERIAL : runMode;
Map<String, String> cmdParam = JSONUtils.toMap(command.getCommandParam());
Map<String, String> scheduleParam = JSONUtils.toMap(scheduleTimeParam);
if (scheduleParam.containsKey(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST)) {
dateList = scheduleParam.get(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST);
dateList = removeDuplicates(dateList);
}
if (scheduleParam.containsKey(CMDPARAM_COMPLEMENT_DATA_START_DATE) && scheduleParam.containsKey(
CMDPARAM_COMPLEMENT_DATA_END_DATE)) {
startDate = scheduleParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE);
endDate = scheduleParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE);
}
switch (runMode) {
case RUN_MODE_SERIAL: {
if (StringUtils.isNotEmpty(dateList)) {
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST, dateList);
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
createCount = processService.createCommand(command);
}
if (startDate != null && endDate != null) {
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, startDate);
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_END_DATE, endDate);
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
createCount = processService.createCommand(command);
//
List<Schedule> schedules = processService.queryReleaseSchedulerListByProcessDefinitionCode(
command.getProcessDefinitionCode()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | if (schedules.isEmpty() || complementDependentMode == ComplementDependentMode.OFF_MODE) {
logger.info("process code: {} complement dependent in off mode or schedule's size is 0, skip "
+ "dependent complement data", command.getProcessDefinitionCode());
} else {
dependentProcessDefinitionCreateCount += createComplementDependentCommand(schedules, command);
}
}
break;
}
case RUN_MODE_PARALLEL: {
if (startDate != null && endDate != null) {
List<Schedule> schedules = processService.queryReleaseSchedulerListByProcessDefinitionCode(
command.getProcessDefinitionCode());
List<ZonedDateTime> listDate = new ArrayList<>(
CronUtils.getSelfFireDateList(DateUtils.stringToZoneDateTime(startDate),
DateUtils.stringToZoneDateTime(endDate), schedules));
int listDateSize = listDate.size();
createCount = listDate.size();
if (!CollectionUtils.isEmpty(listDate)) {
if (expectedParallelismNumber != null && expectedParallelismNumber != 0) {
createCount = Math.min(createCount, expectedParallelismNumber);
}
logger.info("In parallel mode, current expectedParallelismNumber:{}", createCount);
//
//
int itemsPerCommand = (listDateSize / createCount);
int remainingItems = (listDateSize % createCount);
int startDateIndex = 0;
int endDateIndex = 0;
for (int i = 1; i <= createCount; i++) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | int extra = (i <= remainingItems) ? 1 : 0;
int singleCommandItems = (itemsPerCommand + extra);
if (i == 1) {
endDateIndex += singleCommandItems - 1;
} else {
startDateIndex = endDateIndex + 1;
endDateIndex += singleCommandItems;
}
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, DateUtils.dateToString(listDate.get(startDateIndex)));
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_END_DATE, DateUtils.dateToString(listDate.get(endDateIndex)));
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
processService.createCommand(command);
if (schedules.isEmpty() || complementDependentMode == ComplementDependentMode.OFF_MODE) {
logger.info(
"process code: {} complement dependent in off mode or schedule's size is 0, skip "
+ "dependent complement data", command.getProcessDefinitionCode());
} else {
dependentProcessDefinitionCreateCount +=
createComplementDependentCommand(schedules, command);
}
}
}
}
if (StringUtils.isNotEmpty(dateList)) {
List<String> listDate = Arrays.asList(dateList.split(COMMA));
createCount = listDate.size();
if (!CollectionUtils.isEmpty(listDate)) {
if (expectedParallelismNumber != null && expectedParallelismNumber != 0) {
createCount = Math.min(createCount, expectedParallelismNumber);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | logger.info("In parallel mode, current expectedParallelismNumber:{}", createCount);
for (List<String> stringDate : Lists.partition(listDate, createCount)) {
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST, String.join(COMMA, stringDate));
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
processService.createCommand(command);
}
}
}
break;
}
default:
break;
}
logger.info("create complement command count: {}, create dependent complement command count: {}", createCount,
dependentProcessDefinitionCreateCount);
return createCount;
}
/**
* create complement dependent command
*/
protected int createComplementDependentCommand(List<Schedule> schedules, Command command) {
int dependentProcessDefinitionCreateCount = 0;
Command dependentCommand;
try {
dependentCommand = (Command) BeanUtils.cloneBean(command);
} catch (Exception e) {
logger.error("copy dependent command error: ", e);
return dependentProcessDefinitionCreateCount;
}
List<DependentProcessDefinition> dependentProcessDefinitionList = |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | getComplementDependentDefinitionList(dependentCommand.getProcessDefinitionCode(),
CronUtils.getMaxCycle(schedules.get(0).getCrontab()), dependentCommand.getWorkerGroup());
dependentCommand.setTaskDependType(TaskDependType.TASK_POST);
for (DependentProcessDefinition dependentProcessDefinition : dependentProcessDefinitionList) {
dependentCommand.setProcessDefinitionCode(dependentProcessDefinition.getProcessDefinitionCode());
dependentCommand.setWorkerGroup(dependentProcessDefinition.getWorkerGroup());
Map<String, String> cmdParam = JSONUtils.toMap(dependentCommand.getCommandParam());
cmdParam.put(CMD_PARAM_START_NODES, String.valueOf(dependentProcessDefinition.getTaskDefinitionCode()));
dependentCommand.setCommandParam(JSONUtils.toJsonString(cmdParam));
dependentProcessDefinitionCreateCount += processService.createCommand(dependentCommand);
}
return dependentProcessDefinitionCreateCount;
}
/**
* get complement list
*/
private List<DependentProcessDefinition> getComplementDependentDefinitionList(long processDefinitionCode,
CycleEnum processDefinitionCycle,
String workerGroup) {
List<DependentProcessDefinition> dependentProcessDefinitionList =
processService.queryDependentProcessDefinitionByProcessDefinitionCode(processDefinitionCode);
return checkDependentProcessDefinitionValid(dependentProcessDefinitionList, processDefinitionCycle,
workerGroup);
}
/**
* Check whether the dependency cycle of the dependent node is consistent with the schedule cycle of
* the and if there is no worker group in the schedule, use the complement selection's
* worker group
*/
private List<DependentProcessDefinition> checkDependentProcessDefinitionValid( |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | List<DependentProcessDefinition> dependentProcessDefinitionList, CycleEnum processDefinitionCycle,
String workerGroup) {
List<DependentProcessDefinition> validDependentProcessDefinitionList = new ArrayList<>();
List<Long> processDefinitionCodeList =
dependentProcessDefinitionList.stream().map(DependentProcessDefinition::getProcessDefinitionCode)
.collect(Collectors.toList());
Map<Long, String> processDefinitionWorkerGroupMap =
processService.queryWorkerGroupByProcessDefinitionCodes(processDefinitionCodeList);
for (DependentProcessDefinition dependentProcessDefinition : dependentProcessDefinitionList) {
if (dependentProcessDefinition.getDependentCycle() == processDefinitionCycle) {
if (processDefinitionWorkerGroupMap.get(dependentProcessDefinition.getProcessDefinitionCode())
== null) {
dependentProcessDefinition.setWorkerGroup(workerGroup);
}
validDependentProcessDefinitionList.add(dependentProcessDefinition);
}
}
return validDependentProcessDefinitionList;
}
/**
* @param schedule
* @return check error return 0 otherwish 1
*/
private boolean isValidateScheduleTime(String schedule) {
Map<String, String> scheduleResult = JSONUtils.toMap(schedule);
if (scheduleResult == null) {
return false;
}
if (scheduleResult.containsKey(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST)) {
if (scheduleResult.get(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST) == null) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | return false;
}
}
if (scheduleResult.containsKey(CMDPARAM_COMPLEMENT_DATA_START_DATE)) {
String startDate = scheduleResult.get(CMDPARAM_COMPLEMENT_DATA_START_DATE);
String endDate = scheduleResult.get(CMDPARAM_COMPLEMENT_DATA_END_DATE);
if (startDate == null || endDate == null) {
return false;
}
try {
ZonedDateTime start = DateUtils.stringToZoneDateTime(startDate);
ZonedDateTime end = DateUtils.stringToZoneDateTime(endDate);
if (start == null || end == null) {
return false;
}
if (start.isAfter(end)) {
logger.error("complement data error, wrong date start:{} and end date:{} ", start, end);
return false;
}
} catch (Exception ex) {
logger.warn("Parse schedule time error, startDate: {}, endDate: {}", startDate, endDate);
return false;
}
}
return true;
}
/**
* @param scheduleTimeList
* @return remove duplicate date list
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,181 | [BUG] [Document] text check | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description

缺一个点字。应该为子流程节点
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11181 | https://github.com/apache/dolphinscheduler/pull/11183 | d85ea8f62f2e1717413d49b6a8da48d27a4b07a1 | d73ad2e7d5fb3253a34c1169cd149fa811ec73d7 | 2022-07-27T13:49:01Z | java | 2022-07-29T15:49:46Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java | private String removeDuplicates(String scheduleTimeList) {
if (StringUtils.isNotEmpty(scheduleTimeList)) {
Set<String> dateSet = Arrays.stream(scheduleTimeList.split(COMMA)).map(String::trim).collect(Collectors.toSet());
return String.join(COMMA, dateSet);
}
return null;
}
/**
* query executing data of processInstance by master
* @param processInstanceId
* @return
*/
@Override
public WorkflowExecuteDto queryExecutingWorkflowByProcessInstanceId(Integer processInstanceId) {
ProcessInstance processInstance = processService.findProcessInstanceDetailById(processInstanceId);
if (processInstance == null) {
return null;
}
Host host = new Host(processInstance.getHost());
WorkflowExecutingDataRequestCommand requestCommand = new WorkflowExecutingDataRequestCommand();
requestCommand.setProcessInstanceId(processInstanceId);
org.apache.dolphinscheduler.remote.command.Command command = stateEventCallbackService.sendSync(host, requestCommand.convert2Command());
if (command == null) {
return null;
}
WorkflowExecutingDataResponseCommand responseCommand = JSONUtils.parseObject(command.getBody(), WorkflowExecutingDataResponseCommand.class);
return responseCommand.getWorkflowExecuteDto();
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,007 | [Bug] [Master] Recovery failed and stuck after successful enforcement of failed tasks in sub workflow | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Recovery failed and stuck after successful enforcement of failed tasks in sub workflow
### What you expected to happen
Sub workflow succeeded
### How to reproduce
1. AA workflow have three tasks A, B and C. A and B run successfully, while C fails
2. AA is a sub workflow of BB
3. Run BB.
4. Forced successfully C task
5. Execute on BB recovery Failed
### Anything else
_No response_
### Version
2.0.5
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11007 | https://github.com/apache/dolphinscheduler/pull/11088 | bfff3a7c5d58429dd14cb81f91931687b236a069 | e5cca0e79bfe16d07e931bcc68c279643ad45fab | 2022-07-16T09:21:52Z | java | 2022-07-30T15:28:31Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java | /*
* 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.service.impl;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.ProcessInstanceService;
import org.apache.dolphinscheduler.api.service.ProjectService;
import org.apache.dolphinscheduler.api.service.TaskInstanceService;
import org.apache.dolphinscheduler.api.service.UsersService; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,007 | [Bug] [Master] Recovery failed and stuck after successful enforcement of failed tasks in sub workflow | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Recovery failed and stuck after successful enforcement of failed tasks in sub workflow
### What you expected to happen
Sub workflow succeeded
### How to reproduce
1. AA workflow have three tasks A, B and C. A and B run successfully, while C fails
2. AA is a sub workflow of BB
3. Run BB.
4. Forced successfully C task
5. Execute on BB recovery Failed
### Anything else
_No response_
### Version
2.0.5
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11007 | https://github.com/apache/dolphinscheduler/pull/11088 | bfff3a7c5d58429dd14cb81f91931687b236a069 | e5cca0e79bfe16d07e931bcc68c279643ad45fab | 2022-07-16T09:21:52Z | java | 2022-07-30T15:28:31Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java | import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskInstanceMapper;
import org.apache.dolphinscheduler.plugin.task.api.enums.ExecutionStatus;
import org.apache.dolphinscheduler.service.process.ProcessService;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.FORCED_SUCCESS;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_INSTANCE;
/**
* task instance service impl
*/
@Service |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,007 | [Bug] [Master] Recovery failed and stuck after successful enforcement of failed tasks in sub workflow | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Recovery failed and stuck after successful enforcement of failed tasks in sub workflow
### What you expected to happen
Sub workflow succeeded
### How to reproduce
1. AA workflow have three tasks A, B and C. A and B run successfully, while C fails
2. AA is a sub workflow of BB
3. Run BB.
4. Forced successfully C task
5. Execute on BB recovery Failed
### Anything else
_No response_
### Version
2.0.5
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11007 | https://github.com/apache/dolphinscheduler/pull/11088 | bfff3a7c5d58429dd14cb81f91931687b236a069 | e5cca0e79bfe16d07e931bcc68c279643ad45fab | 2022-07-16T09:21:52Z | java | 2022-07-30T15:28:31Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java | public class TaskInstanceServiceImpl extends BaseServiceImpl implements TaskInstanceService {
@Autowired
ProjectMapper projectMapper;
@Autowired
ProjectService projectService;
@Autowired
ProcessService processService;
@Autowired
TaskInstanceMapper taskInstanceMapper;
@Autowired
ProcessInstanceService processInstanceService;
@Autowired
UsersService usersService;
@Autowired
TaskDefinitionMapper taskDefinitionMapper;
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,007 | [Bug] [Master] Recovery failed and stuck after successful enforcement of failed tasks in sub workflow | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Recovery failed and stuck after successful enforcement of failed tasks in sub workflow
### What you expected to happen
Sub workflow succeeded
### How to reproduce
1. AA workflow have three tasks A, B and C. A and B run successfully, while C fails
2. AA is a sub workflow of BB
3. Run BB.
4. Forced successfully C task
5. Execute on BB recovery Failed
### Anything else
_No response_
### Version
2.0.5
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11007 | https://github.com/apache/dolphinscheduler/pull/11088 | bfff3a7c5d58429dd14cb81f91931687b236a069 | e5cca0e79bfe16d07e931bcc68c279643ad45fab | 2022-07-16T09:21:52Z | java | 2022-07-30T15:28:31Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java | * query task list by project, process instance, task name, task start time, task end time, task status, keyword paging
*
* @param loginUser login user
* @param projectCode project code
* @param processInstanceId process instance id
* @param searchVal search value
* @param taskName task name
* @param stateType state type
* @param host host
* @param startDate start time
* @param endDate end time
* @param pageNo page number
* @param pageSize page size
* @return task list page
*/
@Override
public Result queryTaskListPaging(User loginUser,
long projectCode,
Integer processInstanceId,
String processInstanceName,
String taskName,
String executorName,
String startDate,
String endDate,
String searchVal,
ExecutionStatus stateType,
String host,
Integer pageNo,
Integer pageSize) {
Result result = new Result(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 11,007 | [Bug] [Master] Recovery failed and stuck after successful enforcement of failed tasks in sub workflow | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
Recovery failed and stuck after successful enforcement of failed tasks in sub workflow
### What you expected to happen
Sub workflow succeeded
### How to reproduce
1. AA workflow have three tasks A, B and C. A and B run successfully, while C fails
2. AA is a sub workflow of BB
3. Run BB.
4. Forced successfully C task
5. Execute on BB recovery Failed
### Anything else
_No response_
### Version
2.0.5
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/11007 | https://github.com/apache/dolphinscheduler/pull/11088 | bfff3a7c5d58429dd14cb81f91931687b236a069 | e5cca0e79bfe16d07e931bcc68c279643ad45fab | 2022-07-16T09:21:52Z | java | 2022-07-30T15:28:31Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java | Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> checkResult = projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_INSTANCE);
Status status = (Status) checkResult.get(Constants.STATUS);
if (status != Status.SUCCESS) {
putMsg(result,status);
return result;
}
int[] statusArray = null;
if (stateType != null) {
statusArray = new int[]{stateType.ordinal()};
}
Map<String, Object> checkAndParseDateResult = checkAndParseDateParameters(startDate, endDate);
status = (Status) checkAndParseDateResult.get(Constants.STATUS);
if (status != Status.SUCCESS) {
putMsg(result,status);
return result;
}
Date start = (Date) checkAndParseDateResult.get(Constants.START_TIME);
Date end = (Date) checkAndParseDateResult.get(Constants.END_TIME);
Page<TaskInstance> page = new Page<>(pageNo, pageSize);
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(pageNo, pageSize);
int executorId = usersService.getUserIdByName(executorName);
IPage<TaskInstance> taskInstanceIPage = taskInstanceMapper.queryTaskInstanceListPaging(
page, project.getCode(), processInstanceId, processInstanceName, searchVal, taskName, executorId, statusArray, host, start, end
);
Set<String> exclusionSet = new HashSet<>();
exclusionSet.add(Constants.CLASS);
exclusionSet.add("taskJson");
List<TaskInstance> taskInstanceList = taskInstanceIPage.getRecords(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.