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
unknown | language
stringclasses 5
values | commit_datetime
unknown | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java | * @param projectName project name
* @param scheduleId scheule id
* @return delete result code
*/
@ApiOperation(value = "deleteScheduleById", notes = "OFFLINE_SCHEDULE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "scheduleId", value = "SCHEDULE_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/delete")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_SCHEDULE_CRON_BY_ID_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result deleteScheduleById(@RequestAttribute(value = SESSION_USER) User loginUser,
@PathVariable String projectName,
@RequestParam("scheduleId") Integer scheduleId
) {
Map<String, Object> result = schedulerService.deleteScheduleById(loginUser, projectName, scheduleId);
return returnDataList(result);
}
/**
* query schedule list
*
* @param loginUser login user
* @param projectName project name
* @return schedule list
*/
@ApiOperation(value = "queryScheduleList", notes = "QUERY_SCHEDULE_LIST_NOTES")
@PostMapping("/list")
@ApiException(QUERY_SCHEDULE_LIST_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java | public Result queryScheduleList(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser,
@ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName) {
Map<String, Object> result = schedulerService.queryScheduleList(loginUser, projectName);
return returnDataList(result);
}
/**
* preview schedule
*
* @param loginUser login user
* @param projectName project name
* @param schedule schedule expression
* @return the next five fire time
*/
@ApiOperation(value = "previewSchedule", notes = "PREVIEW_SCHEDULE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "schedule", value = "SCHEDULE", dataType = "String", example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}"),
})
@PostMapping("/preview")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(PREVIEW_SCHEDULE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result previewSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser,
@ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName,
@RequestParam(value = "schedule") String schedule
) {
Map<String, Object> result = schedulerService.previewSchedule(loginUser, projectName, schedule);
return returnDataList(result);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.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;
import org.apache.dolphinscheduler.common.enums.FailureStrategy;
import org.apache.dolphinscheduler.common.enums.Priority;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.WarningType;
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
/**
* scheduler service
*/
public interface SchedulerService { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java | /**
* save schedule
*
* @param loginUser login user
* @param projectCode project code
* @param processDefineCode process definition code
* @param schedule scheduler
* @param warningType warning type
* @param warningGroupId warning group id
* @param failureStrategy failure strategy
* @param processInstancePriority process instance priority
* @param workerGroup worker group
* @return create result code
*/
Map<String, Object> insertSchedule(User loginUser,
long projectCode,
long processDefineCode, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java | String schedule,
WarningType warningType,
int warningGroupId,
FailureStrategy failureStrategy,
Priority processInstancePriority,
String workerGroup);
/**
* updateProcessInstance schedule
*
* @param loginUser login user
* @param projectCode project code
* @param id scheduler id
* @param scheduleExpression scheduler
* @param warningType warning type
* @param warningGroupId warning group id
* @param failureStrategy failure strategy
* @param workerGroup worker group
* @param processInstancePriority process instance priority
* @return update result code
*/
Map<String, Object> updateSchedule(User loginUser,
long projectCode,
Integer id,
String scheduleExpression,
WarningType warningType,
int warningGroupId,
FailureStrategy failureStrategy,
Priority processInstancePriority,
String workerGroup);
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java | * set schedule online or offline
*
* @param loginUser login user
* @param projectCode project code
* @param id scheduler id
* @param scheduleStatus schedule status
* @return publish result code
*/
Map<String, Object> setScheduleState(User loginUser,
long projectCode,
Integer id,
ReleaseState scheduleStatus);
/**
* query schedule
*
* @param loginUser login user
* @param projectName project name
* @param processDefineId process definition id
* @param pageNo page number
* @param pageSize page size
* @param searchVal search value
* @return schedule list page
*/
Map<String, Object> querySchedule(User loginUser, String projectName, Integer processDefineId, String searchVal, Integer pageNo, Integer pageSize);
/**
* query schedule list
*
* @param loginUser login user
* @param projectName project name
* @return schedule list |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java | */
Map<String, Object> queryScheduleList(User loginUser, String projectName);
/**
* delete schedule
*
* @param projectId project id
* @param scheduleId schedule id
* @throws RuntimeException runtime exception
*/
void deleteSchedule(int projectId, int scheduleId);
/**
* delete schedule by id
*
* @param loginUser login user
* @param projectName project name
* @param scheduleId scheule id
* @return delete result code
*/
Map<String, Object> deleteScheduleById(User loginUser, String projectName, Integer scheduleId);
/**
* preview schedule
*
* @param loginUser login user
* @param projectName project name
* @param schedule schedule expression
* @return the next five fire time
*/
Map<String, Object> previewSchedule(User loginUser, String projectName, String schedule);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.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. |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | * 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.dto.ScheduleParam;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ServiceException;
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.api.service.SchedulerService;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.FailureStrategy;
import org.apache.dolphinscheduler.common.enums.Priority;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.UserType;
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; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.Schedule;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.ScheduleMapper;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.service.quartz.ProcessScheduleJob;
import org.apache.dolphinscheduler.service.quartz.QuartzExecutors;
import org.apache.dolphinscheduler.service.quartz.cron.CronUtils;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.quartz.CronExpression;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* scheduler service impl
*/
@Service |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerService {
private static final Logger logger = LoggerFactory.getLogger(SchedulerServiceImpl.class);
@Autowired
private ProjectService projectService;
@Autowired
private ExecutorService executorService;
@Autowired
private MonitorService monitorService;
@Autowired
private ProcessService processService;
@Autowired
private ScheduleMapper scheduleMapper;
@Autowired
private ProjectMapper projectMapper;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
/**
* save schedule
*
* @param loginUser login user
* @param projectCode project name
* @param processDefineCode process definition code
* @param schedule scheduler
* @param warningType warning type
* @param warningGroupId warning group id
* @param failureStrategy failure strategy
* @param processInstancePriority process instance priority
* @param workerGroup worker group |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | * @return create result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> insertSchedule(User loginUser,
long projectCode,
long processDefineCode,
String schedule,
WarningType warningType,
int warningGroupId,
FailureStrategy failureStrategy,
Priority processInstancePriority,
String workerGroup) {
Map<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByCode(projectCode);
boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result);
if (!hasProjectAndPerm) {
return result;
}
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefineCode);
result = executorService.checkProcessDefinitionValid(processDefinition, processDefineCode);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
Schedule scheduleObj = new Schedule();
Date now = new Date();
scheduleObj.setProjectName(project.getName());
scheduleObj.setProcessDefinitionId(processDefinition.getId()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | scheduleObj.setProcessDefinitionName(processDefinition.getName());
ScheduleParam scheduleParam = JSONUtils.parseObject(schedule, ScheduleParam.class);
if (DateUtils.differSec(scheduleParam.getStartTime(), scheduleParam.getEndTime()) == 0) {
logger.warn("The start time must not be the same as the end");
putMsg(result, Status.SCHEDULE_START_TIME_END_TIME_SAME);
return result;
}
scheduleObj.setStartTime(scheduleParam.getStartTime());
scheduleObj.setEndTime(scheduleParam.getEndTime());
if (!org.quartz.CronExpression.isValidExpression(scheduleParam.getCrontab())) {
logger.error("{} verify failure", scheduleParam.getCrontab());
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, scheduleParam.getCrontab());
return result;
}
scheduleObj.setCrontab(scheduleParam.getCrontab());
scheduleObj.setTimezoneId(scheduleParam.getTimezoneId());
scheduleObj.setWarningType(warningType);
scheduleObj.setWarningGroupId(warningGroupId);
scheduleObj.setFailureStrategy(failureStrategy);
scheduleObj.setCreateTime(now);
scheduleObj.setUpdateTime(now);
scheduleObj.setUserId(loginUser.getId());
scheduleObj.setUserName(loginUser.getUserName());
scheduleObj.setReleaseState(ReleaseState.OFFLINE);
scheduleObj.setProcessInstancePriority(processInstancePriority);
scheduleObj.setWorkerGroup(workerGroup);
scheduleMapper.insert(scheduleObj);
/**
* updateProcessInstance receivers and cc by process definition id
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | processDefinition.setWarningGroupId(warningGroupId);
processDefinitionMapper.updateById(processDefinition);
result.put(Constants.DATA_LIST, scheduleMapper.selectById(scheduleObj.getId()));
putMsg(result, Status.SUCCESS);
result.put("scheduleId", scheduleObj.getId());
return result;
}
/**
* updateProcessInstance schedule
*
* @param loginUser login user
* @param projectCode project code
* @param id scheduler id
* @param scheduleExpression scheduler
* @param warningType warning type
* @param warningGroupId warning group id
* @param failureStrategy failure strategy
* @param workerGroup worker group
* @param processInstancePriority process instance priority
* @param scheduleStatus schedule status
* @return update result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> updateSchedule(User loginUser,
long projectCode,
Integer id,
String scheduleExpression,
WarningType warningType, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | int warningGroupId,
FailureStrategy failureStrategy,
Priority processInstancePriority,
String workerGroup) {
Map<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByCode(projectCode);
boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result);
if (!hasProjectAndPerm) {
return result;
}
Schedule schedule = scheduleMapper.selectById(id);
if (schedule == null) {
putMsg(result, Status.SCHEDULE_CRON_NOT_EXISTS, id);
return result;
}
ProcessDefinition processDefinition = processService.findProcessDefineById(schedule.getProcessDefinitionId());
if (processDefinition == null) {
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, schedule.getProcessDefinitionId());
return result;
}
/**
* scheduling on-line status forbid modification
*/
if (checkValid(result, schedule.getReleaseState() == ReleaseState.ONLINE, Status.SCHEDULE_CRON_ONLINE_FORBID_UPDATE)) {
return result;
}
Date now = new Date(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | if (StringUtils.isNotEmpty(scheduleExpression)) {
ScheduleParam scheduleParam = JSONUtils.parseObject(scheduleExpression, ScheduleParam.class);
if (DateUtils.differSec(scheduleParam.getStartTime(), scheduleParam.getEndTime()) == 0) {
logger.warn("The start time must not be the same as the end");
putMsg(result, Status.SCHEDULE_START_TIME_END_TIME_SAME);
return result;
}
schedule.setStartTime(scheduleParam.getStartTime());
schedule.setEndTime(scheduleParam.getEndTime());
if (!org.quartz.CronExpression.isValidExpression(scheduleParam.getCrontab())) {
putMsg(result, Status.SCHEDULE_CRON_CHECK_FAILED, scheduleParam.getCrontab());
return result;
}
schedule.setCrontab(scheduleParam.getCrontab());
schedule.setTimezoneId(scheduleParam.getTimezoneId());
}
if (warningType != null) {
schedule.setWarningType(warningType);
}
schedule.setWarningGroupId(warningGroupId);
if (failureStrategy != null) {
schedule.setFailureStrategy(failureStrategy);
}
schedule.setWorkerGroup(workerGroup);
schedule.setUpdateTime(now);
schedule.setProcessInstancePriority(processInstancePriority);
scheduleMapper.updateById(schedule);
/**
* updateProcessInstance recipients and cc by process definition ID
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | processDefinition.setWarningGroupId(warningGroupId);
processDefinitionMapper.updateById(processDefinition);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* set schedule online or offline
*
* @param loginUser login user
* @param projectCode project code
* @param id scheduler id
* @param scheduleStatus schedule status
* @return publish result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> setScheduleState(User loginUser,
long projectCode,
Integer id,
ReleaseState scheduleStatus) {
Map<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByCode(projectCode);
boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result);
if (!hasProjectAndPerm) {
return result;
}
Schedule scheduleObj = scheduleMapper.selectById(id);
if (scheduleObj == null) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | putMsg(result, Status.SCHEDULE_CRON_NOT_EXISTS, id);
return result;
}
if (scheduleObj.getReleaseState() == scheduleStatus) {
logger.info("schedule release is already {},needn't to change schedule id: {} from {} to {}",
scheduleObj.getReleaseState(), scheduleObj.getId(), scheduleObj.getReleaseState(), scheduleStatus);
putMsg(result, Status.SCHEDULE_CRON_REALEASE_NEED_NOT_CHANGE, scheduleStatus);
return result;
}
ProcessDefinition processDefinition = processService.findProcessDefineById(scheduleObj.getProcessDefinitionId());
if (processDefinition == null) {
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, scheduleObj.getProcessDefinitionId());
return result;
}
if (scheduleStatus == ReleaseState.ONLINE) {
if (processDefinition.getReleaseState() != ReleaseState.ONLINE) {
logger.info("not release process definition id: {} , name : {}",
processDefinition.getId(), processDefinition.getName());
putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, processDefinition.getName());
return result;
}
List<Integer> subProcessDefineIds = new ArrayList<>();
processService.recurseFindSubProcessId(scheduleObj.getProcessDefinitionId(), subProcessDefineIds);
Integer[] idArray = subProcessDefineIds.toArray(new Integer[subProcessDefineIds.size()]);
if (!subProcessDefineIds.isEmpty()) {
List<ProcessDefinition> subProcessDefinitionList =
processDefinitionMapper.queryDefinitionListByIdList(idArray); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | if (subProcessDefinitionList != null && !subProcessDefinitionList.isEmpty()) {
for (ProcessDefinition subProcessDefinition : subProcessDefinitionList) {
/**
* if there is no online process, exit directly
*/
if (subProcessDefinition.getReleaseState() != ReleaseState.ONLINE) {
logger.info("not release process definition id: {} , name : {}",
subProcessDefinition.getId(), subProcessDefinition.getName());
putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, subProcessDefinition.getId());
return result;
}
}
}
}
}
List<Server> masterServers = monitorService.getServerListFromRegistry(true);
if (masterServers.isEmpty()) {
putMsg(result, Status.MASTER_NOT_EXISTS);
return result;
}
scheduleObj.setReleaseState(scheduleStatus);
scheduleMapper.updateById(scheduleObj);
try {
switch (scheduleStatus) {
case ONLINE:
logger.info("Call master client set schedule online, project id: {}, flow id: {},host: {}", project.getId(), processDefinition.getId(), masterServers);
setSchedule(project.getId(), scheduleObj);
break; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | case OFFLINE:
logger.info("Call master client set schedule offline, project id: {}, flow id: {},host: {}", project.getId(), processDefinition.getId(), masterServers);
deleteSchedule(project.getId(), id);
break;
default:
putMsg(result, Status.SCHEDULE_STATUS_UNKNOWN, scheduleStatus.toString());
return result;
}
} catch (Exception e) {
result.put(Constants.MSG, scheduleStatus == ReleaseState.ONLINE ? "set online failure" : "set offline failure");
throw new ServiceException(result.get(Constants.MSG).toString());
}
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query schedule
*
* @param loginUser login user
* @param projectName project name
* @param processDefineId process definition id
* @param pageNo page number
* @param pageSize page size
* @param searchVal search value
* @return schedule list page
*/
@Override
public Map<String, Object> querySchedule(User loginUser, String projectName, Integer processDefineId, String searchVal, Integer pageNo, Integer pageSize) {
HashMap<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByName(projectName); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result);
if (!hasProjectAndPerm) {
return result;
}
ProcessDefinition processDefinition = processService.findProcessDefineById(processDefineId);
if (processDefinition == null) {
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processDefineId);
return result;
}
Page<Schedule> page = new Page<>(pageNo, pageSize);
IPage<Schedule> scheduleIPage = scheduleMapper.queryByProcessDefineIdPaging(
page, processDefineId, searchVal
);
PageInfo<Schedule> pageInfo = new PageInfo<>(pageNo, pageSize);
pageInfo.setTotalCount((int) scheduleIPage.getTotal());
pageInfo.setLists(scheduleIPage.getRecords());
result.put(Constants.DATA_LIST, pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query schedule list
*
* @param loginUser login user
* @param projectName project name
* @return schedule list
*/
@Override
public Map<String, Object> queryScheduleList(User loginUser, String projectName) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | Map<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByName(projectName);
boolean hasProjectAndPerm = projectService.hasProjectAndPerm(loginUser, project, result);
if (!hasProjectAndPerm) {
return result;
}
List<Schedule> schedules = scheduleMapper.querySchedulerListByProjectName(projectName);
result.put(Constants.DATA_LIST, schedules);
putMsg(result, Status.SUCCESS);
return result;
}
public void setSchedule(int projectId, Schedule schedule) {
logger.info("set schedule, project id: {}, scheduleId: {}", projectId, schedule.getId());
QuartzExecutors.getInstance().addJob(ProcessScheduleJob.class, projectId, schedule);
}
/**
* delete schedule
*
* @param projectId project id
* @param scheduleId schedule id
* @throws RuntimeException runtime exception
*/
@Override
public void deleteSchedule(int projectId, int scheduleId) {
logger.info("delete schedules of project id:{}, schedule id:{}", projectId, scheduleId);
String jobName = QuartzExecutors.buildJobName(scheduleId);
String jobGroupName = QuartzExecutors.buildJobGroupName(projectId);
if (!QuartzExecutors.getInstance().deleteJob(jobName, jobGroupName)) {
logger.warn("set offline failure:projectId:{},scheduleId:{}", projectId, scheduleId); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | throw new ServiceException("set offline failure");
}
}
/**
* check valid
*
* @param result result
* @param bool bool
* @param status status
* @return check result code
*/
private boolean checkValid(Map<String, Object> result, boolean bool, Status status) {
if (bool) {
putMsg(result, status);
return true;
}
return false;
}
/**
* delete schedule by id
*
* @param loginUser login user
* @param projectName project name
* @param scheduleId scheule id
* @return delete result code
*/
@Override
public Map<String, Object> deleteScheduleById(User loginUser, String projectName, Integer scheduleId) {
Map<String, Object> result = new HashMap<>(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | Project project = projectMapper.queryByName(projectName);
Map<String, Object> checkResult = projectService.checkProjectAndAuth(loginUser, project, projectName);
Status resultEnum = (Status) checkResult.get(Constants.STATUS);
if (resultEnum != Status.SUCCESS) {
return checkResult;
}
Schedule schedule = scheduleMapper.selectById(scheduleId);
if (schedule == null) {
putMsg(result, Status.SCHEDULE_CRON_NOT_EXISTS, scheduleId);
return result;
}
if (loginUser.getId() != schedule.getUserId()
&& loginUser.getUserType() != UserType.ADMIN_USER) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
if (schedule.getReleaseState() == ReleaseState.ONLINE) {
putMsg(result, Status.SCHEDULE_CRON_STATE_ONLINE, schedule.getId());
return result;
}
int delete = scheduleMapper.deleteById(scheduleId);
if (delete > 0) {
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.DELETE_SCHEDULE_CRON_BY_ID_ERROR);
}
return result;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java | /**
* preview schedule
*
* @param loginUser login user
* @param projectName project name
* @param schedule schedule expression
* @return the next five fire time
*/
@Override
public Map<String, Object> previewSchedule(User loginUser, String projectName, String schedule) {
Map<String, Object> result = new HashMap<>();
CronExpression cronExpression;
ScheduleParam scheduleParam = JSONUtils.parseObject(schedule, ScheduleParam.class);
Date now = new Date();
Date startTime = now.after(scheduleParam.getStartTime()) ? now : scheduleParam.getStartTime();
Date endTime = scheduleParam.getEndTime();
try {
cronExpression = CronUtils.parse2CronExpression(scheduleParam.getCrontab());
} catch (ParseException e) {
logger.error(e.getMessage(), e);
putMsg(result, Status.PARSE_TO_CRON_EXPRESSION_ERROR);
return result;
}
List<Date> selfFireDateList = CronUtils.getSelfFireDateList(startTime, endTime, cronExpression, Constants.PREVIEW_SCHEDULE_EXECUTE_COUNT);
result.put(Constants.DATA_LIST, selfFireDateList.stream().map(DateUtils::dateToString));
putMsg(result, Status.SUCCESS);
return result;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/AbstractControllerTest.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 |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/AbstractControllerTest.java | * limitations under the License.
*/
package org.apache.dolphinscheduler.api.controller;
import static org.mockito.Mockito.doNothing;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import org.apache.dolphinscheduler.api.ApiApplicationServer;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.SessionService;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.service.registry.RegistryClient;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
/**
* abstract controller test
*/
@RunWith(SpringRunner.class) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/AbstractControllerTest.java | @SpringBootTest(classes = ApiApplicationServer.class)
public class AbstractControllerTest {
public static final String SESSION_ID = "sessionId";
protected MockMvc mockMvc;
@Autowired
private WebApplicationContext webApplicationContext;
@Autowired
private SessionService sessionService;
protected User user;
protected String sessionId;
@MockBean
RegistryClient registryClient;
@Before
public void setUp() {
doNothing().when(registryClient).init();
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
createSession(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/AbstractControllerTest.java | }
@After
public void after() throws Exception {
sessionService.signOut("127.0.0.1", user);
}
private void createSession() {
User loginUser = new User();
loginUser.setId(1);
loginUser.setUserType(UserType.GENERAL_USER);
user = loginUser;
String session = sessionService.createSession(loginUser, "127.0.0.1");
sessionId = session;
Assert.assertTrue(StringUtils.isNotEmpty(session));
}
public Map<String, Object> successResult() {
Map<String, Object> serviceResult = new HashMap<>();
putMsg(serviceResult, Status.SUCCESS);
serviceResult.put(Constants.DATA_LIST, "{}");
return serviceResult;
}
public void putMsg(Map<String, Object> result, Status status, Object... statusParams) {
result.put(Constants.STATUS, status);
if (statusParams != null && statusParams.length > 0) {
result.put(Constants.MSG, MessageFormat.format(status.getMsg(), statusParams));
} else {
result.put(Constants.MSG, status.getMsg());
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/SchedulerControllerTest.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. |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/SchedulerControllerTest.java | */
package org.apache.dolphinscheduler.api.controller;
import static org.mockito.ArgumentMatchers.isA;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.SchedulerService;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.enums.FailureStrategy;
import org.apache.dolphinscheduler.common.enums.Priority;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.WarningType;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.entity.User;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
/**
* scheduler controller test
*/
public class SchedulerControllerTest extends AbstractControllerTest { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/SchedulerControllerTest.java | private static Logger logger = LoggerFactory.getLogger(SchedulerControllerTest.class);
@MockBean
private SchedulerService schedulerService;
@Test
public void testCreateSchedule() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("processDefinitionCode","40");
paramsMap.add("schedule","{'startTime':'2019-12-16 00:00:00','endTime':'2019-12-17 00:00:00','crontab':'0 0 6 * * ? *'}");
paramsMap.add("warningType",String.valueOf(WarningType.NONE));
paramsMap.add("warningGroupId","1");
paramsMap.add("failureStrategy",String.valueOf(FailureStrategy.CONTINUE));
paramsMap.add("receivers","");
paramsMap.add("receiversCc","");
paramsMap.add("workerGroupId","1");
paramsMap.add("processInstancePriority",String.valueOf(Priority.HIGH));
Mockito.when(schedulerService.insertSchedule(isA(User.class), isA(Long.class), isA(Long.class),
isA(String.class), isA(WarningType.class), isA(int.class), isA(FailureStrategy.class),
isA(Priority.class), isA(String.class))).thenReturn(successResult());
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/schedule/create",123)
.header(SESSION_ID, sessionId)
.params(paramsMap)) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/SchedulerControllerTest.java | .andExpect(status().isCreated())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testUpdateSchedule() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("id","37");
paramsMap.add("schedule","{'startTime':'2019-12-16 00:00:00','endTime':'2019-12-17 00:00:00','crontab':'0 0 7 * * ? *'}");
paramsMap.add("warningType",String.valueOf(WarningType.NONE));
paramsMap.add("warningGroupId","1");
paramsMap.add("failureStrategy",String.valueOf(FailureStrategy.CONTINUE));
paramsMap.add("receivers","");
paramsMap.add("receiversCc","");
paramsMap.add("workerGroupId","1");
paramsMap.add("processInstancePriority",String.valueOf(Priority.HIGH));
Mockito.when(schedulerService.updateSchedule(isA(User.class), isA(Long.class), isA(Integer.class),
isA(String.class), isA(WarningType.class), isA(Integer.class), isA(FailureStrategy.class),
isA(Priority.class), isA(String.class))).thenReturn(successResult());
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/schedule/update",123)
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/SchedulerControllerTest.java | logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testOnline() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("id","37");
Mockito.when(schedulerService.setScheduleState(isA(User.class), isA(Long.class), isA(Integer.class),
isA(ReleaseState.class))).thenReturn(successResult());
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/schedule/online",123)
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testOffline() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("id","28");
Mockito.when(schedulerService.setScheduleState(isA(User.class), isA(Long.class), isA(Integer.class),
isA(ReleaseState.class))).thenReturn(successResult());
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/schedule/offline",123)
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/SchedulerControllerTest.java | Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryScheduleListPaging() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("processDefinitionId","40");
paramsMap.add("searchVal","test");
paramsMap.add("pageNo","1");
paramsMap.add("pageSize","30");
MvcResult mvcResult = mockMvc.perform(get("/projects/{projectName}/schedule/list-paging","cxc_1113")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryScheduleList() throws Exception {
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectName}/schedule/list","cxc_1113")
.header(SESSION_ID, sessionId))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,510 | [Feature][JsonSplit-api]schedule list-paging interface | from #5498
Change the request parameter processDefinitionId to processDefinitionCode,including the front end and controller interface | https://github.com/apache/dolphinscheduler/issues/5510 | https://github.com/apache/dolphinscheduler/pull/5771 | e4f427a8d8bf99754698e054845291a5223c2ea6 | 72535a47e3dafc68c457996ea6e01b8da17685aa | "2021-05-18T13:57:34Z" | java | "2021-07-09T02:13:00Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/SchedulerControllerTest.java | logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testPreviewSchedule() throws Exception {
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectName}/schedule/preview","cxc_1113")
.header(SESSION_ID, sessionId)
.param("schedule","{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}"))
.andExpect(status().isCreated())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testDeleteScheduleById() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("scheduleId","37");
MvcResult mvcResult = mockMvc.perform(get("/projects/{projectName}/schedule/delete","cxc_1113")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.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;
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.common.utils.StringUtils;
import java.util.regex.Pattern;
/**
* Constants
*/
public final class Constants {
private Constants() {
throw new UnsupportedOperationException("Construct Constants"); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | }
/**
* quartz config
*/
public static final String ORG_QUARTZ_JOBSTORE_DRIVERDELEGATECLASS = "org.quartz.jobStore.driverDelegateClass";
public static final String ORG_QUARTZ_SCHEDULER_INSTANCENAME = "org.quartz.scheduler.instanceName";
public static final String ORG_QUARTZ_SCHEDULER_INSTANCEID = "org.quartz.scheduler.instanceId";
public static final String ORG_QUARTZ_SCHEDULER_MAKESCHEDULERTHREADDAEMON = "org.quartz.scheduler.makeSchedulerThreadDaemon";
public static final String ORG_QUARTZ_JOBSTORE_USEPROPERTIES = "org.quartz.jobStore.useProperties";
public static final String ORG_QUARTZ_THREADPOOL_CLASS = "org.quartz.threadPool.class";
public static final String ORG_QUARTZ_THREADPOOL_THREADCOUNT = "org.quartz.threadPool.threadCount";
public static final String ORG_QUARTZ_THREADPOOL_MAKETHREADSDAEMONS = "org.quartz.threadPool.makeThreadsDaemons";
public static final String ORG_QUARTZ_THREADPOOL_THREADPRIORITY = "org.quartz.threadPool.threadPriority";
public static final String ORG_QUARTZ_JOBSTORE_CLASS = "org.quartz.jobStore.class";
public static final String ORG_QUARTZ_JOBSTORE_TABLEPREFIX = "org.quartz.jobStore.tablePrefix";
public static final String ORG_QUARTZ_JOBSTORE_ISCLUSTERED = "org.quartz.jobStore.isClustered";
public static final String ORG_QUARTZ_JOBSTORE_MISFIRETHRESHOLD = "org.quartz.jobStore.misfireThreshold";
public static final String ORG_QUARTZ_JOBSTORE_CLUSTERCHECKININTERVAL = "org.quartz.jobStore.clusterCheckinInterval";
public static final String ORG_QUARTZ_JOBSTORE_ACQUIRETRIGGERSWITHINLOCK = "org.quartz.jobStore.acquireTriggersWithinLock";
public static final String ORG_QUARTZ_JOBSTORE_DATASOURCE = "org.quartz.jobStore.dataSource";
public static final String ORG_QUARTZ_DATASOURCE_MYDS_CONNECTIONPROVIDER_CLASS = "org.quartz.dataSource.myDs.connectionProvider.class";
/**
* quartz config default value
*/
public static final String QUARTZ_TABLE_PREFIX = "QRTZ_";
public static final String QUARTZ_MISFIRETHRESHOLD = "60000";
public static final String QUARTZ_CLUSTERCHECKININTERVAL = "5000";
public static final String QUARTZ_DATASOURCE = "myDs";
public static final String QUARTZ_THREADCOUNT = "25";
public static final String QUARTZ_THREADPRIORITY = "5"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String QUARTZ_INSTANCENAME = "DolphinScheduler";
public static final String QUARTZ_INSTANCEID = "AUTO";
public static final String QUARTZ_ACQUIRETRIGGERSWITHINLOCK = "true";
/**
* common properties path
*/
public static final String COMMON_PROPERTIES_PATH = "/common.properties";
/**
* fs.defaultFS
*/
public static final String FS_DEFAULTFS = "fs.defaultFS";
/**
* fs s3a endpoint
*/
public static final String FS_S3A_ENDPOINT = "fs.s3a.endpoint";
/**
* fs s3a access key
*/
public static final String FS_S3A_ACCESS_KEY = "fs.s3a.access.key";
/**
* fs s3a secret key
*/
public static final String FS_S3A_SECRET_KEY = "fs.s3a.secret.key";
/**
* hadoop configuration
*/
public static final String HADOOP_RM_STATE_ACTIVE = "ACTIVE";
public static final String HADOOP_RM_STATE_STANDBY = "STANDBY";
public static final String HADOOP_RESOURCE_MANAGER_HTTPADDRESS_PORT = "resource.manager.httpaddress.port";
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | * yarn.resourcemanager.ha.rm.ids
*/
public static final String YARN_RESOURCEMANAGER_HA_RM_IDS = "yarn.resourcemanager.ha.rm.ids";
/**
* yarn.application.status.address
*/
public static final String YARN_APPLICATION_STATUS_ADDRESS = "yarn.application.status.address";
/**
* yarn.job.history.status.address
*/
public static final String YARN_JOB_HISTORY_STATUS_ADDRESS = "yarn.job.history.status.address";
/**
* hdfs configuration
* hdfs.root.user
*/
public static final String HDFS_ROOT_USER = "hdfs.root.user";
/**
* hdfs/s3 configuration
* resource.upload.path
*/
public static final String RESOURCE_UPLOAD_PATH = "resource.upload.path";
/**
* data basedir path
*/
public static final String DATA_BASEDIR_PATH = "data.basedir.path";
/**
* dolphinscheduler.env.path
*/
public static final String DOLPHINSCHEDULER_ENV_PATH = "dolphinscheduler.env.path";
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | * environment properties default path
*/
public static final String ENV_PATH = "env/dolphinscheduler_env.sh";
/**
* python home
*/
public static final String PYTHON_HOME = "PYTHON_HOME";
/**
* resource.view.suffixs
*/
public static final String RESOURCE_VIEW_SUFFIXS = "resource.view.suffixs";
public static final String RESOURCE_VIEW_SUFFIXS_DEFAULT_VALUE = "txt,log,sh,bat,conf,cfg,py,java,sql,xml,hql,properties,json,yml,yaml,ini,js";
/**
* development.state
*/
public static final String DEVELOPMENT_STATE = "development.state";
/**
* sudo enable
*/
public static final String SUDO_ENABLE = "sudo.enable";
/**
* string true
*/
public static final String STRING_TRUE = "true";
/**
* string false
*/
public static final String STRING_FALSE = "false";
/**
* resource storage type |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | */
public static final String RESOURCE_STORAGE_TYPE = "resource.storage.type";
/**
* MasterServer directory registered in zookeeper
*/
public static final String REGISTRY_DOLPHINSCHEDULER_MASTERS = "/nodes/master";
/**
* WorkerServer directory registered in zookeeper
*/
public static final String REGISTRY_DOLPHINSCHEDULER_WORKERS = "/nodes/worker";
/**
* all servers directory registered in zookeeper
*/
public static final String REGISTRY_DOLPHINSCHEDULER_DEAD_SERVERS = "/dead-servers";
/**
* registry node prefix
*/
public static final String REGISTRY_DOLPHINSCHEDULER_NODE = "/nodes";
/**
* MasterServer lock directory registered in zookeeper
*/
public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_MASTERS = "/lock/masters";
/**
* MasterServer failover directory registered in zookeeper
*/
public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS = "/lock/failover/masters";
/**
* WorkerServer failover directory registered in zookeeper
*/
public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS = "/lock/failover/workers"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* MasterServer startup failover runing and fault tolerance process
*/
public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS = "/lock/failover/startup-masters";
/**
* comma ,
*/
public static final String COMMA = ",";
/**
* slash /
*/
public static final String SLASH = "/";
/**
* COLON :
*/
public static final String COLON = ":";
/**
* SPACE " "
*/
public static final String SPACE = " ";
/**
* SINGLE_SLASH /
*/
public static final String SINGLE_SLASH = "/";
/**
* DOUBLE_SLASH //
*/
public static final String DOUBLE_SLASH = "//";
/**
* SINGLE_QUOTES "'" |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | */
public static final String SINGLE_QUOTES = "'";
/**
* DOUBLE_QUOTES "\""
*/
public static final String DOUBLE_QUOTES = "\"";
/**
* SEMICOLON ;
*/
public static final String SEMICOLON = ";";
/**
* EQUAL SIGN
*/
public static final String EQUAL_SIGN = "=";
/**
* AT SIGN
*/
public static final String AT_SIGN = "@";
/**
* date format of yyyy-MM-dd HH:mm:ss
*/
public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
/**
* date format of yyyyMMddHHmmss
*/
public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
/**
* date format of yyyyMMddHHmmssSSS
*/
public static final String YYYYMMDDHHMMSSSSS = "yyyyMMddHHmmssSSS"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* http connect time out
*/
public static final int HTTP_CONNECT_TIMEOUT = 60 * 1000;
/**
* http connect request time out
*/
public static final int HTTP_CONNECTION_REQUEST_TIMEOUT = 60 * 1000;
/**
* httpclient soceket time out
*/
public static final int SOCKET_TIMEOUT = 60 * 1000;
/**
* http header
*/
public static final String HTTP_HEADER_UNKNOWN = "unKnown";
/**
* http X-Forwarded-For
*/
public static final String HTTP_X_FORWARDED_FOR = "X-Forwarded-For";
/**
* http X-Real-IP
*/
public static final String HTTP_X_REAL_IP = "X-Real-IP";
/**
* UTF-8
*/
public static final String UTF_8 = "UTF-8";
/**
* user name regex |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | */
public static final Pattern REGEX_USER_NAME = Pattern.compile("^[a-zA-Z0-9._-]{3,39}$");
/**
* email regex
*/
public static final Pattern REGEX_MAIL_NAME = Pattern.compile("^([a-z0-9A-Z]+[_|\\-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
/**
* default display rows
*/
public static final int DEFAULT_DISPLAY_ROWS = 10;
/**
* read permission
*/
public static final int READ_PERMISSION = 2 * 1;
/**
* write permission
*/
public static final int WRITE_PERMISSION = 2 * 2;
/**
* execute permission
*/
public static final int EXECUTE_PERMISSION = 1;
/**
* default admin permission
*/
public static final int DEFAULT_ADMIN_PERMISSION = 7;
/**
* all permissions
*/
public static final int ALL_PERMISSIONS = READ_PERMISSION | WRITE_PERMISSION | EXECUTE_PERMISSION; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* max task timeout
*/
public static final int MAX_TASK_TIMEOUT = 24 * 3600;
/**
* master cpu load
*/
public static final int DEFAULT_MASTER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2;
/**
* worker cpu load
*/
public static final int DEFAULT_WORKER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2;
/**
* worker host weight
*/
public static final int DEFAULT_WORKER_HOST_WEIGHT = 100;
/**
* default log cache rows num,output when reach the number
*/
public static final int DEFAULT_LOG_ROWS_NUM = 4 * 16;
/**
* log flush interval?output when reach the interval
*/
public static final int DEFAULT_LOG_FLUSH_INTERVAL = 1000;
/**
* time unit secong to minutes
*/
public static final int SEC_2_MINUTES_TIME_UNIT = 60;
/***
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | * rpc port
*/
public static final int RPC_PORT = 50051;
/***
* alert rpc port
*/
public static final int ALERT_RPC_PORT = 50052;
/**
* forbid running task
*/
public static final String FLOWNODE_RUN_FLAG_FORBIDDEN = "FORBIDDEN";
/**
* normal running task
*/
public static final String FLOWNODE_RUN_FLAG_NORMAL = "NORMAL";
/**
* datasource configuration path
*/
public static final String DATASOURCE_PROPERTIES = "/datasource.properties";
public static final String DEFAULT = "Default";
public static final String USER = "user";
public static final String PASSWORD = "password";
public static final String XXXXXX = "******";
public static final String NULL = "NULL";
public static final String THREAD_NAME_MASTER_SERVER = "Master-Server";
public static final String THREAD_NAME_WORKER_SERVER = "Worker-Server";
/**
* command parameter keys
*/
public static final String CMD_PARAM_RECOVER_PROCESS_ID_STRING = "ProcessInstanceId"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String CMD_PARAM_RECOVERY_START_NODE_STRING = "StartNodeIdList";
public static final String CMD_PARAM_RECOVERY_WAITING_THREAD = "WaitingThreadInstanceId";
public static final String CMD_PARAM_SUB_PROCESS = "processInstanceId";
public static final String CMD_PARAM_EMPTY_SUB_PROCESS = "0";
public static final String CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID = "parentProcessInstanceId";
public static final String CMD_PARAM_SUB_PROCESS_DEFINE_ID = "processDefinitionId";
public static final String CMD_PARAM_START_NODE_NAMES = "StartNodeNameList";
public static final String CMD_PARAM_START_PARAMS = "StartParams";
public static final String CMD_PARAM_FATHER_PARAMS = "fatherParams";
/**
* complement data start date
*/
public static final String CMDPARAM_COMPLEMENT_DATA_START_DATE = "complementStartDate";
/**
* complement data end date
*/
public static final String CMDPARAM_COMPLEMENT_DATA_END_DATE = "complementEndDate";
/**
* data source config
*/
public static final String SPRING_DATASOURCE_DRIVER_CLASS_NAME = "spring.datasource.driver-class-name";
public static final String SPRING_DATASOURCE_URL = "spring.datasource.url";
public static final String SPRING_DATASOURCE_USERNAME = "spring.datasource.username";
public static final String SPRING_DATASOURCE_PASSWORD = "spring.datasource.password";
public static final String SPRING_DATASOURCE_VALIDATION_QUERY_TIMEOUT = "spring.datasource.validationQueryTimeout";
public static final String SPRING_DATASOURCE_INITIAL_SIZE = "spring.datasource.initialSize";
public static final String SPRING_DATASOURCE_MIN_IDLE = "spring.datasource.minIdle";
public static final String SPRING_DATASOURCE_MAX_ACTIVE = "spring.datasource.maxActive";
public static final String SPRING_DATASOURCE_MAX_WAIT = "spring.datasource.maxWait";
public static final String SPRING_DATASOURCE_TIME_BETWEEN_EVICTION_RUNS_MILLIS = "spring.datasource.timeBetweenEvictionRunsMillis"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String SPRING_DATASOURCE_TIME_BETWEEN_CONNECT_ERROR_MILLIS = "spring.datasource.timeBetweenConnectErrorMillis";
public static final String SPRING_DATASOURCE_MIN_EVICTABLE_IDLE_TIME_MILLIS = "spring.datasource.minEvictableIdleTimeMillis";
public static final String SPRING_DATASOURCE_VALIDATION_QUERY = "spring.datasource.validationQuery";
public static final String SPRING_DATASOURCE_TEST_WHILE_IDLE = "spring.datasource.testWhileIdle";
public static final String SPRING_DATASOURCE_TEST_ON_BORROW = "spring.datasource.testOnBorrow";
public static final String SPRING_DATASOURCE_TEST_ON_RETURN = "spring.datasource.testOnReturn";
public static final String SPRING_DATASOURCE_POOL_PREPARED_STATEMENTS = "spring.datasource.poolPreparedStatements";
public static final String SPRING_DATASOURCE_DEFAULT_AUTO_COMMIT = "spring.datasource.defaultAutoCommit";
public static final String SPRING_DATASOURCE_KEEP_ALIVE = "spring.datasource.keepAlive";
public static final String SPRING_DATASOURCE_MAX_POOL_PREPARED_STATEMENT_PER_CONNECTION_SIZE = "spring.datasource.maxPoolPreparedStatementPerConnectionSize";
public static final String DEVELOPMENT = "development";
public static final String QUARTZ_PROPERTIES_PATH = "quartz.properties";
/**
* sleep time
*/
public static final int SLEEP_TIME_MILLIS = 1000;
/**
* master task instance cache-database refresh interval
*/
public static final int CACHE_REFRESH_TIME_MILLIS = 20 * 1000;
/**
* heartbeat for zk info length
*/
public static final int HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH = 10;
public static final int HEARTBEAT_WITH_WEIGHT_FOR_ZOOKEEPER_INFO_LENGTH = 11;
/**
* jar
*/
public static final String JAR = "jar";
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | * hadoop
*/
public static final String HADOOP = "hadoop";
/**
* -D <property>=<value>
*/
public static final String D = "-D";
/**
* -D mapreduce.job.name=name
*/
public static final String MR_NAME = "mapreduce.job.name";
/**
* -D mapreduce.job.queuename=queuename
*/
public static final String MR_QUEUE = "mapreduce.job.queuename";
/**
* spark params constant
*/
public static final String MASTER = "--master";
public static final String DEPLOY_MODE = "--deploy-mode";
/**
* --class CLASS_NAME
*/
public static final String MAIN_CLASS = "--class";
/**
* --driver-cores NUM
*/
public static final String DRIVER_CORES = "--driver-cores";
/**
* --driver-memory MEM |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | */
public static final String DRIVER_MEMORY = "--driver-memory";
/**
* --num-executors NUM
*/
public static final String NUM_EXECUTORS = "--num-executors";
/**
* --executor-cores NUM
*/
public static final String EXECUTOR_CORES = "--executor-cores";
/**
* --executor-memory MEM
*/
public static final String EXECUTOR_MEMORY = "--executor-memory";
/**
* --name NAME
*/
public static final String SPARK_NAME = "--name";
/**
* --queue QUEUE
*/
public static final String SPARK_QUEUE = "--queue";
/**
* exit code success
*/
public static final int EXIT_CODE_SUCCESS = 0;
/**
* exit code kill
*/
public static final int EXIT_CODE_KILL = 137; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* exit code failure
*/
public static final int EXIT_CODE_FAILURE = -1;
/**
* process or task definition failure
*/
public static final int DEFINITION_FAILURE = -1;
/**
* date format of yyyyMMdd
*/
public static final String PARAMETER_FORMAT_DATE = "yyyyMMdd";
/**
* date format of yyyyMMddHHmmss
*/
public static final String PARAMETER_FORMAT_TIME = "yyyyMMddHHmmss";
/**
* system date(yyyyMMddHHmmss)
*/
public static final String PARAMETER_DATETIME = "system.datetime";
/**
* system date(yyyymmdd) today
*/
public static final String PARAMETER_CURRENT_DATE = "system.biz.curdate";
/**
* system date(yyyymmdd) yesterday
*/
public static final String PARAMETER_BUSINESS_DATE = "system.biz.date";
/**
* ACCEPTED |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | */
public static final String ACCEPTED = "ACCEPTED";
/**
* SUCCEEDED
*/
public static final String SUCCEEDED = "SUCCEEDED";
/**
* NEW
*/
public static final String NEW = "NEW";
/**
* NEW_SAVING
*/
public static final String NEW_SAVING = "NEW_SAVING";
/**
* SUBMITTED
*/
public static final String SUBMITTED = "SUBMITTED";
/**
* FAILED
*/
public static final String FAILED = "FAILED";
/**
* KILLED
*/
public static final String KILLED = "KILLED";
/**
* RUNNING
*/
public static final String RUNNING = "RUNNING"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* underline "_"
*/
public static final String UNDERLINE = "_";
/**
* quartz job prifix
*/
public static final String QUARTZ_JOB_PRIFIX = "job";
/**
* quartz job group prifix
*/
public static final String QUARTZ_JOB_GROUP_PRIFIX = "jobgroup";
/**
* projectId
*/
public static final String PROJECT_ID = "projectId";
/**
* processId
*/
public static final String SCHEDULE_ID = "scheduleId";
/**
* schedule
*/
public static final String SCHEDULE = "schedule";
/**
* application regex
*/
public static final String APPLICATION_REGEX = "application_\\d+_\\d+";
public static final String PID = OSUtils.isWindows() ? "handle" : "pid";
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | * month_begin
*/
public static final String MONTH_BEGIN = "month_begin";
/**
* add_months
*/
public static final String ADD_MONTHS = "add_months";
/**
* month_end
*/
public static final String MONTH_END = "month_end";
/**
* week_begin
*/
public static final String WEEK_BEGIN = "week_begin";
/**
* week_end
*/
public static final String WEEK_END = "week_end";
/**
* timestamp
*/
public static final String TIMESTAMP = "timestamp";
public static final char SUBTRACT_CHAR = '-';
public static final char ADD_CHAR = '+';
public static final char MULTIPLY_CHAR = '*';
public static final char DIVISION_CHAR = '/';
public static final char LEFT_BRACE_CHAR = '(';
public static final char RIGHT_BRACE_CHAR = ')';
public static final String ADD_STRING = "+"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String MULTIPLY_STRING = "*";
public static final String DIVISION_STRING = "/";
public static final String LEFT_BRACE_STRING = "(";
public static final char P = 'P';
public static final char N = 'N';
public static final String SUBTRACT_STRING = "-";
public static final String GLOBAL_PARAMS = "globalParams";
public static final String LOCAL_PARAMS = "localParams";
public static final String LOCAL_PARAMS_LIST = "localParamsList";
public static final String SUBPROCESS_INSTANCE_ID = "subProcessInstanceId";
public static final String PROCESS_INSTANCE_STATE = "processInstanceState";
public static final String PARENT_WORKFLOW_INSTANCE = "parentWorkflowInstance";
public static final String CONDITION_RESULT = "conditionResult";
public static final String DEPENDENCE = "dependence";
public static final String TASK_TYPE = "taskType";
public static final String TASK_LIST = "taskList";
public static final String RWXR_XR_X = "rwxr-xr-x";
public static final String QUEUE = "queue";
public static final String QUEUE_NAME = "queueName";
public static final int LOG_QUERY_SKIP_LINE_NUMBER = 0;
public static final int LOG_QUERY_LIMIT = 4096;
/**
* master/worker server use for zk
*/
public static final String MASTER_TYPE = "master";
public static final String WORKER_TYPE = "worker";
public static final String DELETE_OP = "delete";
public static final String ADD_OP = "add";
public static final String ALIAS = "alias";
public static final String CONTENT = "content"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String DEPENDENT_SPLIT = ":||";
public static final String DEPENDENT_ALL = "ALL";
/**
* preview schedule execute count
*/
public static final int PREVIEW_SCHEDULE_EXECUTE_COUNT = 5;
/**
* kerberos
*/
public static final String KERBEROS = "kerberos";
/**
* kerberos expire time
*/
public static final String KERBEROS_EXPIRE_TIME = "kerberos.expire.time";
/**
* java.security.krb5.conf
*/
public static final String JAVA_SECURITY_KRB5_CONF = "java.security.krb5.conf";
/**
* java.security.krb5.conf.path
*/
public static final String JAVA_SECURITY_KRB5_CONF_PATH = "java.security.krb5.conf.path";
/**
* hadoop.security.authentication
*/
public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
/**
* hadoop.security.authentication
*/
public static final String HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE = "hadoop.security.authentication.startup.state"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* com.amazonaws.services.s3.enableV4
*/
public static final String AWS_S3_V4 = "com.amazonaws.services.s3.enableV4";
/**
* loginUserFromKeytab user
*/
public static final String LOGIN_USER_KEY_TAB_USERNAME = "login.user.keytab.username";
/**
* loginUserFromKeytab path
*/
public static final String LOGIN_USER_KEY_TAB_PATH = "login.user.keytab.path";
/**
* task log info format
*/
public static final String TASK_LOG_INFO_FORMAT = "TaskLogInfo-%s";
/**
* hive conf
*/
public static final String HIVE_CONF = "hiveconf:";
/**
* flink
*/
public static final String FLINK_YARN_CLUSTER = "yarn-cluster";
public static final String FLINK_RUN_MODE = "-m";
public static final String FLINK_YARN_SLOT = "-ys";
public static final String FLINK_APP_NAME = "-ynm";
public static final String FLINK_QUEUE = "-yqu";
public static final String FLINK_TASK_MANAGE = "-yn";
public static final String FLINK_JOB_MANAGE_MEM = "-yjm"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String FLINK_TASK_MANAGE_MEM = "-ytm";
public static final String FLINK_MAIN_CLASS = "-c";
public static final String FLINK_PARALLELISM = "-p";
public static final String FLINK_SHUTDOWN_ON_ATTACHED_EXIT = "-sae";
public static final String FLINK_PYTHON = "-py";
public static final int[] NOT_TERMINATED_STATES = new int[] {
ExecutionStatus.SUBMITTED_SUCCESS.ordinal(),
ExecutionStatus.RUNNING_EXECUTION.ordinal(),
ExecutionStatus.DELAY_EXECUTION.ordinal(),
ExecutionStatus.READY_PAUSE.ordinal(),
ExecutionStatus.READY_STOP.ordinal(),
ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal(),
ExecutionStatus.WAITING_THREAD.ordinal(),
ExecutionStatus.WAITING_DEPEND.ordinal()
};
/**
* status
*/
public static final String STATUS = "status";
/**
* message
*/
public static final String MSG = "msg";
/**
* data total
*/
public static final String COUNT = "count";
/**
* page size
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String PAGE_SIZE = "pageSize";
/**
* current page no
*/
public static final String PAGE_NUMBER = "pageNo";
/**
*
*/
public static final String DATA_LIST = "data";
public static final String TOTAL_LIST = "totalList";
public static final String CURRENT_PAGE = "currentPage";
public static final String TOTAL_PAGE = "totalPage";
public static final String TOTAL = "total";
/**
* workflow
*/
public static final String WORKFLOW_LIST = "workFlowList";
public static final String WORKFLOW_RELATION_LIST = "workFlowRelationList";
/**
* session user
*/
public static final String SESSION_USER = "session.user";
public static final String SESSION_ID = "sessionId";
public static final String PASSWORD_DEFAULT = "******";
/**
* locale
*/
public static final String LOCALE_LANGUAGE = "language";
/**
* driver |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | */
public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver";
public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver";
public static final String COM_CLICKHOUSE_JDBC_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver";
public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver";
public static final String COM_SQLSERVER_JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
public static final String COM_DB2_JDBC_DRIVER = "com.ibm.db2.jcc.DB2Driver";
public static final String COM_PRESTO_JDBC_DRIVER = "com.facebook.presto.jdbc.PrestoDriver";
/**
* database type
*/
public static final String MYSQL = "MYSQL";
public static final String POSTGRESQL = "POSTGRESQL";
public static final String HIVE = "HIVE";
public static final String SPARK = "SPARK";
public static final String CLICKHOUSE = "CLICKHOUSE";
public static final String ORACLE = "ORACLE";
public static final String SQLSERVER = "SQLSERVER";
public static final String DB2 = "DB2";
public static final String PRESTO = "PRESTO";
/**
* jdbc url
*/
public static final String JDBC_MYSQL = "jdbc:mysql://";
public static final String JDBC_POSTGRESQL = "jdbc:postgresql://";
public static final String JDBC_HIVE_2 = "jdbc:hive2://";
public static final String JDBC_CLICKHOUSE = "jdbc:clickhouse://";
public static final String JDBC_ORACLE_SID = "jdbc:oracle:thin:@";
public static final String JDBC_ORACLE_SERVICE_NAME = "jdbc:oracle:thin:@//"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String JDBC_SQLSERVER = "jdbc:sqlserver://";
public static final String JDBC_DB2 = "jdbc:db2://";
public static final String JDBC_PRESTO = "jdbc:presto://";
public static final String ADDRESS = "address";
public static final String DATABASE = "database";
public static final String JDBC_URL = "jdbcUrl";
public static final String PRINCIPAL = "principal";
public static final String OTHER = "other";
public static final String ORACLE_DB_CONNECT_TYPE = "connectType";
public static final String KERBEROS_KRB5_CONF_PATH = "javaSecurityKrb5Conf";
public static final String KERBEROS_KEY_TAB_USERNAME = "loginUserKeytabUsername";
public static final String KERBEROS_KEY_TAB_PATH = "loginUserKeytabPath";
/**
* session timeout
*/
public static final int SESSION_TIME_OUT = 7200;
public static final int MAX_FILE_SIZE = 1024 * 1024 * 1024;
public static final String UDF = "UDF";
public static final String CLASS = "class";
public static final String RECEIVERS = "receivers";
public static final String RECEIVERS_CC = "receiversCc";
/**
* dataSource sensitive param
*/
public static final String DATASOURCE_PASSWORD_REGEX = "(?<=((?i)password((\\\\\":\\\\\")|(=')))).*?(?=((\\\\\")|(')))";
/**
* default worker group
*/
public static final String DEFAULT_WORKER_GROUP = "default";
public static final Integer TASK_INFO_LENGTH = 5; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* new
* schedule time
*/
public static final String PARAMETER_SHECDULE_TIME = "schedule.time";
/**
* authorize writable perm
*/
public static final int AUTHORIZE_WRITABLE_PERM = 7;
/**
* authorize readable perm
*/
public static final int AUTHORIZE_READABLE_PERM = 4;
/**
* plugin configurations
*/
public static final String PLUGIN_JAR_SUFFIX = ".jar";
public static final int NORMAL_NODE_STATUS = 0;
public static final int ABNORMAL_NODE_STATUS = 1;
public static final String START_TIME = "start time";
public static final String END_TIME = "end time";
public static final String START_END_DATE = "startDate,endDate";
/**
* system line separator
*/
public static final String SYSTEM_LINE_SEPARATOR = System.getProperty("line.separator");
public static final String EXCEL_SUFFIX_XLS = ".xls";
/**
* datasource encryption salt
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String DATASOURCE_ENCRYPTION_SALT_DEFAULT = "!@#$%^&*";
public static final String DATASOURCE_ENCRYPTION_ENABLE = "datasource.encryption.enable";
public static final String DATASOURCE_ENCRYPTION_SALT = "datasource.encryption.salt";
/**
* network interface preferred
*/
public static final String DOLPHIN_SCHEDULER_NETWORK_INTERFACE_PREFERRED = "dolphin.scheduler.network.interface.preferred";
/**
* network IP gets priority, default inner outer
*/
public static final String DOLPHIN_SCHEDULER_NETWORK_PRIORITY_STRATEGY = "dolphin.scheduler.network.priority.strategy";
/**
* exec shell scripts
*/
public static final String SH = "sh";
/**
* pstree, get pud and sub pid
*/
public static final String PSTREE = "pstree";
/**
* snow flake, data center id, this id must be greater than 0 and less than 32
*/
public static final String SNOW_FLAKE_DATA_CENTER_ID = "data.center.id";
/**
* docker & kubernetes
*/
public static final boolean DOCKER_MODE = StringUtils.isNotEmpty(System.getenv("DOCKER"));
public static final boolean KUBERNETES_MODE = StringUtils.isNotEmpty(System.getenv("KUBERNETES_SERVICE_HOST")) && StringUtils.isNotEmpty(System.getenv("KUBERNETES_SERVICE_PORT"));
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.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 java.nio.charset.StandardCharsets.UTF_8;
import static com.fasterxml.jackson.databind.DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT;
import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | import static com.fasterxml.jackson.databind.DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL;
import static com.fasterxml.jackson.databind.MapperFeature.REQUIRE_SETTERS_FOR_GETTERS;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.TextNode;
import com.fasterxml.jackson.databind.type.CollectionType;
/**
* json utils
*/
public class JSONUtils { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | private static final Logger logger = LoggerFactory.getLogger(JSONUtils.class);
/**
* can use static singleton, inject: just make sure to reuse!
*/
private static final ObjectMapper objectMapper = new ObjectMapper()
.configure(FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT, true)
.configure(READ_UNKNOWN_ENUM_VALUES_AS_NULL, true)
.configure(REQUIRE_SETTERS_FOR_GETTERS, true)
.setTimeZone(TimeZone.getDefault());
private JSONUtils() {
throw new UnsupportedOperationException("Construct JSONUtils");
}
public static ArrayNode createArrayNode() {
return objectMapper.createArrayNode();
}
public static ObjectNode createObjectNode() {
return objectMapper.createObjectNode();
}
public static JsonNode toJsonNode(Object obj) {
return objectMapper.valueToTree(obj);
}
/**
* json representation of object |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | *
* @param object object
* @param feature feature
* @return object to json string
*/
public static String toJsonString(Object object, SerializationFeature feature) {
try {
ObjectWriter writer = objectMapper.writer(feature);
return writer.writeValueAsString(object);
} catch (Exception e) {
logger.error("object to json exception!", e);
}
return null;
}
/**
* This method deserializes the specified Json into an object of the specified class. It is not
* suitable to use if the specified class is a generic type since it will not have the generic
* type information because of the Type Erasure feature of Java. Therefore, this method should not
* be used if the desired type is a generic type. Note that this method works fine if the any of
* the fields of the specified object are generics, just the object itself should not be a
* generic type.
*
* @param json the string from which the object is to be deserialized
* @param clazz the class of T
* @param <T> T
* @return an object of type T from the string
* classOfT
*/
public static <T> T parseObject(String json, Class<T> clazz) {
if (StringUtils.isEmpty(json)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | return null;
}
try {
return objectMapper.readValue(json, clazz);
} catch (Exception e) {
logger.error("parse object exception!", e);
}
return null;
}
/**
* deserialize
*
* @param src byte array
* @param clazz class
* @param <T> deserialize type
* @return deserialize type
*/
public static <T> T parseObject(byte[] src, Class<T> clazz) {
if (src == null) {
return null;
}
String json = new String(src, UTF_8);
return parseObject(json, clazz);
}
/**
* json to list
*
* @param json json string
* @param clazz class
* @param <T> T |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | * @return list
*/
public static <T> List<T> toList(String json, Class<T> clazz) {
if (StringUtils.isEmpty(json)) {
return Collections.emptyList();
}
try {
CollectionType listType = objectMapper.getTypeFactory().constructCollectionType(ArrayList.class, clazz);
return objectMapper.readValue(json, listType);
} catch (Exception e) {
logger.error("parse list exception!", e);
}
return Collections.emptyList();
}
/**
* check json object valid
*
* @param json json
* @return true if valid
*/
public static boolean checkJsonValid(String json) {
if (StringUtils.isEmpty(json)) {
return false;
}
try {
objectMapper.readTree(json);
return true;
} catch (IOException e) {
logger.error("check json object valid exception!", e);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | return false;
}
/**
* Method for finding a JSON Object field with specified name in this
* node or its child nodes, and returning value it has.
* If no matching field is found in this node or its descendants, returns null.
*
* @param jsonNode json node
* @param fieldName Name of field to look for
* @return Value of first matching node found, if any; null if none
*/
public static String findValue(JsonNode jsonNode, String fieldName) {
JsonNode node = jsonNode.findValue(fieldName);
if (node == null) {
return null;
}
return node.asText();
}
/**
* json to map
* {@link #toMap(String, Class, Class)}
*
* @param json json
* @return json to map
*/
public static Map<String, String> toMap(String json) {
return parseObject(json, new TypeReference<Map<String, String>>() {});
}
/**
* from the key-value generated json to get the str value no matter the real type of value |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | * @param json the json str
* @param nodeName key
* @return the str value of key
*/
public static String getNodeString(String json, String nodeName) {
try {
JsonNode rootNode = objectMapper.readTree(json);
return rootNode.has(nodeName) ? rootNode.get(nodeName).toString() : "";
} catch (JsonProcessingException e) {
return "";
}
}
/**
* json to map
*
* @param json json
* @param classK classK
* @param classV classV
* @param <K> K
* @param <V> V
* @return to map
*/
public static <K, V> Map<K, V> toMap(String json, Class<K> classK, Class<V> classV) {
return parseObject(json, new TypeReference<Map<K, V>>() {});
}
/**
* json to object
*
* @param json json string |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | * @param type type reference
* @param <T>
* @return return parse object
*/
public static <T> T parseObject(String json, TypeReference<T> type) {
if (StringUtils.isEmpty(json)) {
return null;
}
try {
return objectMapper.readValue(json, type);
} catch (Exception e) {
logger.error("json to map exception!", e);
}
return null;
}
/**
* object to json string
*
* @param object object
* @return json string
*/
public static String toJsonString(Object object) {
try {
return objectMapper.writeValueAsString(object);
} catch (Exception e) {
throw new RuntimeException("Object json deserialization exception.", e);
}
}
/**
* serialize to json byte |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | *
* @param obj object
* @param <T> object type
* @return byte array
*/
public static <T> byte[] toJsonByteArray(T obj) {
if (obj == null) {
return null;
}
String json = "";
try {
json = toJsonString(obj);
} catch (Exception e) {
logger.error("json serialize exception.", e);
}
return json.getBytes(UTF_8);
}
public static ObjectNode parseObject(String text) {
try {
if (text.isEmpty()) {
return parseObject(text, ObjectNode.class);
} else {
return (ObjectNode) objectMapper.readTree(text);
}
} catch (Exception e) {
throw new RuntimeException("String json deserialization exception.", e);
}
}
public static ArrayNode parseArray(String text) {
try { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java | return (ArrayNode) objectMapper.readTree(text);
} catch (Exception e) {
throw new RuntimeException("Json deserialization exception.", e);
}
}
/**
* json serializer
*/
public static class JsonDataSerializer extends JsonSerializer<String> {
@Override
public void serialize(String value, JsonGenerator gen, SerializerProvider provider) throws IOException {
gen.writeRawValue(value);
}
}
/**
* json data deserializer
*/
public static class JsonDataDeserializer extends JsonDeserializer<String> {
@Override
public String deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
JsonNode node = p.getCodec().readTree(p);
if (node instanceof TextNode) {
return node.asText();
} else {
return node.toString();
}
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.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 | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.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.common.utils;
import org.apache.dolphinscheduler.common.Constants;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* logger utils
*/
public class LoggerUtils {
private LoggerUtils() {
throw new UnsupportedOperationException("Construct LoggerUtils");
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java | private static final Logger logger = LoggerFactory.getLogger(LoggerUtils.class);
/**
* rules for extracting application ID
*/
private static final Pattern APPLICATION_REGEX = Pattern.compile(Constants.APPLICATION_REGEX);
/**
* Task Logger's prefix
*/
public static final String TASK_LOGGER_INFO_PREFIX = "TASK";
/**
* Task Logger Thread's name
*/
public static final String TASK_LOGGER_THREAD_NAME = "TaskLogInfo";
/**
* Task Logger Thread's name
*/
public static final String TASK_APPID_LOG_FORMAT = "[taskAppId=";
/**
* build job id
*
* @param affix Task Logger's prefix
* @param processInstId process instance id
* @param taskId task id
* @return task id format
*/
public static String buildTaskId(String affix,
Long processDefineCode,
int processDefineVersion,
int processInstId,
int taskId) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java | return String.format(" - %s%s-%s_%s-%s-%s]", TASK_APPID_LOG_FORMAT, affix, processDefineCode, processDefineVersion, processInstId, taskId);
}
/**
* processing log
* get yarn application id list
*
* @param log log content
* @param logger logger
* @return app id list
*/
public static List<String> getAppIds(String log, Logger logger) {
List<String> appIds = new ArrayList<>();
Matcher matcher = APPLICATION_REGEX.matcher(log);
while (matcher.find()) {
String appId = matcher.group();
if (!appIds.contains(appId)) {
logger.info("find app id: {}", appId);
appIds.add(appId);
}
}
return appIds;
}
/**
* read whole file content
*
* @param filePath file path
* @return whole file content
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java | public static String readWholeFileContent(String filePath) {
String line;
StringBuilder sb = new StringBuilder();
try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath)))) {
while ((line = br.readLine()) != null) {
sb.append(line + "\r\n");
}
return sb.toString();
} catch (IOException e) {
logger.error("read file error", e);
}
return "";
}
public static void logError(Optional<Logger> optionalLogger
, String error) {
optionalLogger.ifPresent((Logger logger) -> logger.error(error));
}
public static void logError(Optional<Logger> optionalLogger
, Throwable e) {
optionalLogger.ifPresent((Logger logger) -> logger.error(e.getMessage(), e));
}
public static void logError(Optional<Logger> optionalLogger
, String error, Throwable e) {
optionalLogger.ifPresent((Logger logger) -> logger.error(error, e));
}
public static void logInfo(Optional<Logger> optionalLogger
, String info) {
optionalLogger.ifPresent((Logger logger) -> logger.info(info));
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ParamUtils.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ParamUtils.java | * 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.utils;
import org.apache.dolphinscheduler.common.enums.CommandType;
import org.apache.dolphinscheduler.common.enums.DataType;
import org.apache.dolphinscheduler.common.enums.Direct;
import org.apache.dolphinscheduler.common.process.Property;
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.apache.dolphinscheduler.common.utils.placeholder.BusinessTimeUtils;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* param utils
*/
public class ParamUtils {
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ParamUtils.java | * parameter conversion
* @param globalParams global params
* @param globalParamsMap global params map
* @param localParams local params
* @param commandType command type
* @param scheduleTime schedule time
* @return global params
*/
public static Map<String,Property> convert(Map<String,Property> globalParams,
Map<String,String> globalParamsMap,
Map<String,Property> localParams,
Map<String,Property> varParams,
CommandType commandType,
Date scheduleTime) {
if (globalParams == null && localParams == null) {
return null;
}
Map<String,String> timeParams = BusinessTimeUtils
.getBusinessTime(commandType,
scheduleTime);
if (globalParamsMap != null) {
timeParams.putAll(globalParamsMap);
}
if (globalParams != null && localParams != null) {
localParams.putAll(globalParams);
globalParams = localParams;
} else if (globalParams == null && localParams != null) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ParamUtils.java | globalParams = localParams;
}
if (varParams != null) {
varParams.putAll(globalParams);
globalParams = varParams;
}
Iterator<Map.Entry<String, Property>> iter = globalParams.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry<String, Property> en = iter.next();
Property property = en.getValue();
if (StringUtils.isNotEmpty(property.getValue())
&& property.getValue().startsWith("$")) {
/**
* local parameter refers to global parameter with the same name
* note: the global parameters of the process instance here are solidified parameters,
* and there are no variables in them.
*/
String val = property.getValue();
val = ParameterUtils.convertParameterPlaceholders(val, timeParams);
property.setValue(val);
}
}
return globalParams;
}
/**
* format convert
* @param paramsMap params map
* @return Map of converted
*/
public static Map<String,String> convert(Map<String,Property> paramsMap) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ParamUtils.java | if (paramsMap == null) {
return null;
}
Map<String,String> map = new HashMap<>();
Iterator<Map.Entry<String, Property>> iter = paramsMap.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry<String, Property> en = iter.next();
map.put(en.getKey(),en.getValue().getValue());
}
return map;
}
/**
* get parameters map
* @param definedParams definedParams
* @return parameters map
*/
public static Map<String,Property> getUserDefParamsMap(Map<String,String> definedParams) {
if (definedParams != null) {
Map<String,Property> userDefParamsMaps = new HashMap<>();
Iterator<Map.Entry<String, String>> iter = definedParams.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry<String, String> en = iter.next();
Property property = new Property(en.getKey(), Direct.IN, DataType.VARCHAR, en.getValue());
userDefParamsMaps.put(property.getProp(),property);
}
return userDefParamsMaps;
}
return null;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/ShellCommandExecutor.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.
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/ShellCommandExecutor.java | package org.apache.dolphinscheduler.server.worker.task;
import org.apache.commons.io.FileUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.server.entity.TaskExecutionContext;
import org.slf4j.Logger;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.function.Consumer;
/**
* shell command executor
*/
public class ShellCommandExecutor extends AbstractCommandExecutor {
/**
* For Unix-like, using sh
*/
public static final String SH = "sh";
/**
* For Windows, using cmd.exe
*/
public static final String CMD = "cmd.exe";
/**
* constructor
* @param logHandler logHandler
* @param taskExecutionContext taskExecutionContext
* @param logger logger
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/ShellCommandExecutor.java | public ShellCommandExecutor(Consumer<List<String>> logHandler,
TaskExecutionContext taskExecutionContext,
Logger logger) {
super(logHandler,taskExecutionContext,logger);
}
public ShellCommandExecutor(List<String> logBuffer) {
super(logBuffer);
}
@Override
protected String buildCommandFilePath() {
return String.format("%s/%s.%s"
, taskExecutionContext.getExecutePath()
, taskExecutionContext.getTaskAppId()
, OSUtils.isWindows() ? "bat" : "command");
}
/**
* get command type
* @return command type
*/
@Override
protected String commandInterpreter() {
return OSUtils.isWindows() ? CMD : SH;
}
/**
* create command file if not exists
* @param execCommand exec command
* @param commandFile command file
* @throws IOException io exception
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/ShellCommandExecutor.java | @Override
protected void createCommandFileIfNotExists(String execCommand, String commandFile) throws IOException {
logger.info("tenantCode user:{}, task dir:{}", taskExecutionContext.getTenantCode(),
taskExecutionContext.getTaskAppId());
if (!Files.exists(Paths.get(commandFile))) {
logger.info("create command file:{}", commandFile);
StringBuilder sb = new StringBuilder();
if (OSUtils.isWindows()) {
sb.append("@echo off\n");
sb.append("cd /d %~dp0\n");
if (taskExecutionContext.getEnvFile() != null) {
sb.append("call ").append(taskExecutionContext.getEnvFile()).append("\n");
}
} else {
sb.append("#!/bin/sh\n");
sb.append("BASEDIR=$(cd `dirname $0`; pwd)\n");
sb.append("cd $BASEDIR\n");
if (taskExecutionContext.getEnvFile() != null) {
sb.append("source ").append(taskExecutionContext.getEnvFile()).append("\n");
}
}
sb.append(execCommand);
logger.info("command : {}", sb.toString());
FileUtils.writeStringToFile(new File(commandFile), sb.toString(), StandardCharsets.UTF_8);
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.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.worker.task.shell;
import static java.util.Calendar.DAY_OF_MONTH;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.CommandType;
import org.apache.dolphinscheduler.common.enums.Direct; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java | import org.apache.dolphinscheduler.common.process.Property;
import org.apache.dolphinscheduler.common.task.AbstractParameters;
import org.apache.dolphinscheduler.common.task.shell.ShellParameters;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
import org.apache.dolphinscheduler.server.entity.TaskExecutionContext;
import org.apache.dolphinscheduler.server.utils.ParamUtils;
import org.apache.dolphinscheduler.server.worker.task.AbstractTask;
import org.apache.dolphinscheduler.server.worker.task.CommandExecuteResult;
import org.apache.dolphinscheduler.server.worker.task.ShellCommandExecutor;
import org.slf4j.Logger;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* shell task
*/
public class ShellTask extends AbstractTask { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java | /**
* shell parameters
*/
private ShellParameters shellParameters;
/**
* shell command executor
*/
private ShellCommandExecutor shellCommandExecutor;
/**
* taskExecutionContext
*/
private TaskExecutionContext taskExecutionContext;
/**
* constructor
*
* @param taskExecutionContext taskExecutionContext
* @param logger logger
*/
public ShellTask(TaskExecutionContext taskExecutionContext, Logger logger) {
super(taskExecutionContext, logger);
this.taskExecutionContext = taskExecutionContext;
this.shellCommandExecutor = new ShellCommandExecutor(this::logHandle,
taskExecutionContext,
logger); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java | }
@Override
public void init() {
logger.info("shell task params {}", taskExecutionContext.getTaskParams());
shellParameters = JSONUtils.parseObject(taskExecutionContext.getTaskParams(), ShellParameters.class);
if (!shellParameters.checkParameters()) {
throw new RuntimeException("shell task params is not valid");
}
}
@Override
public void handle() throws Exception {
try {
CommandExecuteResult commandExecuteResult = shellCommandExecutor.run(buildCommand());
setExitStatusCode(commandExecuteResult.getExitStatusCode());
setAppIds(commandExecuteResult.getAppIds());
setProcessId(commandExecuteResult.getProcessId());
shellParameters.dealOutParam(shellCommandExecutor.getVarPool());
} catch (Exception e) {
logger.error("shell task error", e);
setExitStatusCode(Constants.EXIT_CODE_FAILURE);
throw e;
}
}
@Override
public void cancelApplication(boolean cancelApplication) throws Exception {
shellCommandExecutor.cancelApplication();
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java | * create command
*
* @return file name
* @throws Exception exception
*/
private String buildCommand() throws Exception {
String fileName = String.format("%s/%s_node.%s",
taskExecutionContext.getExecutePath(),
taskExecutionContext.getTaskAppId(), OSUtils.isWindows() ? "bat" : "sh");
Path path = new File(fileName).toPath();
if (Files.exists(path)) {
return fileName;
}
String script = shellParameters.getRawScript().replaceAll("\\r\\n", "\n");
script = parseScript(script);
shellParameters.setRawScript(script);
logger.info("raw script : {}", shellParameters.getRawScript());
logger.info("task execute path : {}", taskExecutionContext.getExecutePath());
Set<PosixFilePermission> perms = PosixFilePermissions.fromString(Constants.RWXR_XR_X);
FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions.asFileAttribute(perms);
if (OSUtils.isWindows()) {
Files.createFile(path);
} else {
Files.createFile(path, attr);
}
Files.write(path, shellParameters.getRawScript().getBytes(), StandardOpenOption.APPEND);
return fileName;
}
@Override |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java | public AbstractParameters getParameters() {
return shellParameters;
}
private String parseScript(String script) {
Map<String, Property> paramsMap = ParamUtils.convert(ParamUtils.getUserDefParamsMap(taskExecutionContext.getDefinedParams()),
taskExecutionContext.getDefinedParams(),
shellParameters.getLocalParametersMap(),
shellParameters.getVarPoolMap(),
CommandType.of(taskExecutionContext.getCmdTypeIfComplement()),
taskExecutionContext.getScheduleTime());
if (taskExecutionContext.getScheduleTime() != null) {
if (paramsMap == null) {
paramsMap = new HashMap<>();
}
Date date = taskExecutionContext.getScheduleTime();
if (CommandType.COMPLEMENT_DATA.getCode() == taskExecutionContext.getCmdTypeIfComplement()) {
date = DateUtils.add(taskExecutionContext.getScheduleTime(), DAY_OF_MONTH, 1);
}
String dateTime = DateUtils.format(date, Constants.PARAMETER_FORMAT_TIME);
Property p = new Property();
p.setValue(dateTime);
p.setProp(Constants.PARAMETER_DATETIME);
paramsMap.put(Constants.PARAMETER_DATETIME, p);
}
return ParameterUtils.convertParameterPlaceholders(script, ParamUtils.convert(paramsMap));
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/ParamUtilsTest.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.utils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.apache.dolphinscheduler.common.enums.CommandType;
import org.apache.dolphinscheduler.common.enums.DataType;
import org.apache.dolphinscheduler.common.enums.Direct;
import org.apache.dolphinscheduler.common.process.Property;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.junit.Before;
import org.junit.Test; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/ParamUtilsTest.java | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Test ParamUtils
*/
public class ParamUtilsTest {
private static final Logger logger = LoggerFactory.getLogger(ParamUtilsTest.class);
public Map<String, Property> globalParams = new HashMap<>();
public Map<String, String> globalParamsMap = new HashMap<>();
public Map<String, Property> localParams = new HashMap<>();
public Map<String, Property> varPoolParams = new HashMap<>();
/**
* Init params
*
* @throws Exception
*/
@Before
public void setUp() throws Exception {
Property property = new Property();
property.setProp("global_param");
property.setDirect(Direct.IN);
property.setType(DataType.VARCHAR);
property.setValue("${system.biz.date}");
globalParams.put("global_param", property);
globalParamsMap.put("global_param", "${system.biz.date}");
Property localProperty = new Property();
localProperty.setProp("local_param");
localProperty.setDirect(Direct.IN);
localProperty.setType(DataType.VARCHAR); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/ParamUtilsTest.java | localProperty.setValue("${global_param}");
localParams.put("local_param", localProperty);
Property varProperty = new Property();
varProperty.setProp("local_param");
varProperty.setDirect(Direct.IN);
varProperty.setType(DataType.VARCHAR);
varProperty.setValue("${global_param}");
varPoolParams.put("varPool", varProperty);
}
/**
* Test convert
*/
@Test
public void testConvert() {
String expected = "{\"varPool\":{\"prop\":\"local_param\",\"direct\":\"IN\",\"type\":\"VARCHAR\",\"value\":\"20191229\"},"
+ "\"global_param\":{\"prop\":\"global_param\",\"direct\":\"IN\",\"type\":\"VARCHAR\",\"value\":\"20191229\"},"
+ "\"local_param\":{\"prop\":\"local_param\",\"direct\":\"IN\",\"type\":\"VARCHAR\",\"value\":\"20191229\"}}";
String expected1 = "{\"varPool\":{\"prop\":\"local_param\",\"direct\":\"IN\",\"type\":\"VARCHAR\",\"value\":\"20191229\"},"
+ "\"global_param\":{\"prop\":\"global_param\",\"direct\":\"IN\",\"type\":\"VARCHAR\",\"value\":\"20191229\"},"
+ "\"local_param\":{\"prop\":\"local_param\",\"direct\":\"IN\",\"type\":\"VARCHAR\",\"value\":\"20191229\"}}";
Calendar calendar = Calendar.getInstance();
calendar.set(2019, 11, 30);
Date date = calendar.getTime();
Map<String, Property> paramsMap = ParamUtils.convert(globalParams, globalParamsMap, localParams, varPoolParams,CommandType.START_PROCESS, date);
String result = JSONUtils.toJsonString(paramsMap);
assertEquals(expected, result); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,773 | [Improvement][server] need to support two parameters related to task | **Describe the question**
When I'm using the shell task ,I need the instance id of task and the absolute path of task.
**What are the current deficiencies and the benefits of improvement**
**Which version of DolphinScheduler:**
-[dev]
**Describe alternatives you've considered**
| https://github.com/apache/dolphinscheduler/issues/5773 | https://github.com/apache/dolphinscheduler/pull/5774 | ab527a5e5abd04243305a50f184d8009b9edf21a | 9fd5145b66646f3df847ea3c81bb272621ee86ca | "2021-07-08T10:01:12Z" | java | "2021-07-09T09:00:32Z" | dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/ParamUtilsTest.java | for (Map.Entry<String, Property> entry : paramsMap.entrySet()) {
String key = entry.getKey();
Property prop = entry.getValue();
logger.info(key + " : " + prop.getValue());
}
Map<String, Property> paramsMap1 = ParamUtils.convert(null, globalParamsMap, localParams,varPoolParams, CommandType.START_PROCESS, date);
String result1 = JSONUtils.toJsonString(paramsMap1);
assertEquals(expected1, result1);
Map<String, Property> paramsMap2 = ParamUtils.convert(null, globalParamsMap, null, varPoolParams,CommandType.START_PROCESS, date);
assertNull(paramsMap2);
}
/**
* Test the overload method of convert
*/
@Test
public void testConvert1() {
String expected = "{\"global_param\":\"${system.biz.date}\"}";
Map<String, String> paramsMap = ParamUtils.convert(globalParams);
String result = JSONUtils.toJsonString(paramsMap);
assertEquals(expected, result);
logger.info(result);
Map<String, String> paramsMap1 = ParamUtils.convert(null);
assertNull(paramsMap1);
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.