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,483
[Bug][Api] Can't view variables
**Describe the bug** When I want to view the variables defined in process instance, it will throw an exception. **To Reproduce** Steps to reproduce the behavior, for example: 1. Create a process definition 2. Add localparams 3. Execute the process definition 4. View params in process instance **Screenshots** ![image](https://user-images.githubusercontent.com/22415594/118438653-4b46e400-b717-11eb-94d4-5e187a377d51.png) **Which version of Dolphin Scheduler:** -[dev] **Additional context** This issue caused by deserialize the taskParams in TaskDefinitionLog. https://github.com/apache/dolphinscheduler/blob/68301db6b914ff4002bfbc531c6810864d8e47c2/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java#L664-L666 For example, there exist list in the json attribute, so it cannot be deserialized as string. ```json { "resourceList":[ ], "localParams":[ { "prop":"BATCH_TIME", "direct":"IN", "type":"VARCHAR", "value":"20210517131849" } ], "rawScript":"echo "${BATCH_TIME}"", "conditionResult":"{"successNode":[""],"failedNode":[""]}", "dependence":"{}" } ``` And there are multiple places use different way to deserialize the` taskParams`. https://github.com/apache/dolphinscheduler/blob/68301db6b914ff4002bfbc531c6810864d8e47c2/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java#L1611 I think it is better to use the same way to do this transform, otherwise, once we make changes, we need to change many places. And the `taskParams` is transported by front-end and stored in database as a JSON string. We use Map to represent this field in backend, I think it is better to define a specific class to express the `taskParams`, this maybe helpful for deserialize and code maintain.
https://github.com/apache/dolphinscheduler/issues/5483
https://github.com/apache/dolphinscheduler/pull/5631
8bf042ae6ef7576209a0489e784684f4960ae6e0
0d5037e7c37d7903d9172f165b348058f1ddbf88
"2021-05-17T06:24:02Z"
java
"2021-06-13T03:43:53Z"
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/JSONUtilsTest.java
@Test public void parseObject() { String str = "{\"color\":\"yellow\",\"type\":\"renault\"}"; ObjectNode node = JSONUtils.parseObject(str); Assert.assertEquals("yellow", node.path("color").asText()); node.put("price", 100); Assert.assertEquals(100, node.path("price").asInt()); node.put("color", "red"); Assert.assertEquals("red", node.path("color").asText()); } @Test public void parseArray() { String str = "[{\"color\":\"yellow\",\"type\":\"renault\"}]"; ArrayNode node = JSONUtils.parseArray(str); Assert.assertEquals("yellow", node.path(0).path("color").asText()); } @Test public void jsonDataDeserializerTest() { String a = "{\"conditionResult\":\"{\\\"successNode\\\":[\\\"\\\"],\\\"failedNode\\\":[\\\"\\\"]}\"," + "\"conditionsTask\":false,\"depList\":[],\"dependence\":\"{}\",\"forbidden\":false," + "\"id\":\"tasks-86823\",\"maxRetryTimes\":1,\"name\":\"shell test\"," + "\"params\":\"{\\\"resourceList\\\":[],\\\"localParams\\\":[],\\\"rawScript\\\":\\\"echo " + "'yyc'\\\"}\",\"preTasks\":\"[]\",\"retryInterval\":1,\"runFlag\":\"NORMAL\"," + "\"taskInstancePriority\":\"HIGHEST\",\"taskTimeoutParameter\":{\"enable\":false,\"interval\":0}," + "\"timeout\":\"{}\",\"type\":\"SHELL\",\"workerGroup\":\"default\"}"; TaskNode taskNode = JSONUtils.parseObject(a, TaskNode.class); Assert.assertTrue(true); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,634
[Improvement][registry-plugin] Optimize registry plugin loading and initial installation
**Describe the question** Optimize registry plugin loading and initial installation **What are the current deficiencies and the benefits of improvement** - Registry Plugin install dir attribute assignment. - Add registry Plugin to initialize and install related properties **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5634
https://github.com/apache/dolphinscheduler/pull/5635
9d70c7e534aa10e729d564f14a1126f623cd1035
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
"2021-06-15T10:45:19Z"
java
"2021-06-15T12:51:52Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryCenter.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 *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,634
[Improvement][registry-plugin] Optimize registry plugin loading and initial installation
**Describe the question** Optimize registry plugin loading and initial installation **What are the current deficiencies and the benefits of improvement** - Registry Plugin install dir attribute assignment. - Add registry Plugin to initialize and install related properties **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5634
https://github.com/apache/dolphinscheduler/pull/5635
9d70c7e534aa10e729d564f14a1126f623cd1035
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
"2021-06-15T10:45:19Z"
java
"2021-06-15T12:51:52Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryCenter.java
* 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.service.registry; import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_DEAD_SERVERS; import org.apache.dolphinscheduler.common.IStoppable; import org.apache.dolphinscheduler.common.utils.PropertyUtils; import org.apache.dolphinscheduler.common.utils.StringUtils; import org.apache.dolphinscheduler.spi.plugin.DolphinPluginLoader; import org.apache.dolphinscheduler.spi.plugin.DolphinPluginManagerConfig; import org.apache.dolphinscheduler.spi.register.Registry; import org.apache.dolphinscheduler.spi.register.RegistryConnectListener; import org.apache.dolphinscheduler.spi.register.RegistryException; import org.apache.dolphinscheduler.spi.register.RegistryPluginManager; import org.apache.dolphinscheduler.spi.register.SubscribeListener; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.collect.ImmutableList; /** * All business parties use this class to access the registry */ public class RegistryCenter {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,634
[Improvement][registry-plugin] Optimize registry plugin loading and initial installation
**Describe the question** Optimize registry plugin loading and initial installation **What are the current deficiencies and the benefits of improvement** - Registry Plugin install dir attribute assignment. - Add registry Plugin to initialize and install related properties **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5634
https://github.com/apache/dolphinscheduler/pull/5635
9d70c7e534aa10e729d564f14a1126f623cd1035
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
"2021-06-15T10:45:19Z"
java
"2021-06-15T12:51:52Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryCenter.java
private static final Logger logger = LoggerFactory.getLogger(RegistryCenter.class); private final AtomicBoolean isStarted = new AtomicBoolean(false); private Registry registry; private IStoppable stoppable; /** * nodes namespace */ protected static String NODES; /** * master path */ protected static String MASTER_PATH = "/nodes/master"; private RegistryPluginManager registryPluginManager; /** * worker path */ protected static String WORKER_PATH = "/nodes/worker"; protected static final String EMPTY = ""; private static final String REGISTRY_PREFIX = "registry"; private static final String REGISTRY_PLUGIN_BINDING = "registry.plugin.binding"; private static final String REGISTRY_PLUGIN_DIR = "registry.plugin.dir"; private static final String MAVEN_LOCAL_REPOSITORY = "maven.local.repository"; private static final String REGISTRY_PLUGIN_NAME = "plugin.name"; /** * default registry plugin dir */ private static final String REGISTRY_PLUGIN_PATH = "lib/plugin/registry"; private static final String REGISTRY_CONFIG_FILE_PATH = "/registry.properties"; /** * init node persist
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,634
[Improvement][registry-plugin] Optimize registry plugin loading and initial installation
**Describe the question** Optimize registry plugin loading and initial installation **What are the current deficiencies and the benefits of improvement** - Registry Plugin install dir attribute assignment. - Add registry Plugin to initialize and install related properties **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5634
https://github.com/apache/dolphinscheduler/pull/5635
9d70c7e534aa10e729d564f14a1126f623cd1035
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
"2021-06-15T10:45:19Z"
java
"2021-06-15T12:51:52Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryCenter.java
*/ public void init() { if (isStarted.compareAndSet(false, true)) { PropertyUtils.loadPropertyFile(REGISTRY_CONFIG_FILE_PATH); Map<String, String> registryConfig = PropertyUtils.getPropertiesByPrefix(REGISTRY_PREFIX); if (null == registryConfig || registryConfig.isEmpty()) { throw new RegistryException("registry config param is null"); } if (null == registryPluginManager) { installRegistryPlugin(registryConfig.get(REGISTRY_PLUGIN_NAME)); registry = registryPluginManager.getRegistry(); } registry.init(registryConfig); initNodes(); } } /** * init nodes */ private void initNodes() { persist(MASTER_PATH, EMPTY); persist(WORKER_PATH, EMPTY); } /** * install registry plugin */ private void installRegistryPlugin(String registryPluginName) { DolphinPluginManagerConfig registryPluginManagerConfig = new DolphinPluginManagerConfig(); registryPluginManagerConfig.setPlugins(PropertyUtils.getString(REGISTRY_PLUGIN_BINDING)); if (StringUtils.isNotBlank(PropertyUtils.getString(REGISTRY_PLUGIN_DIR))) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,634
[Improvement][registry-plugin] Optimize registry plugin loading and initial installation
**Describe the question** Optimize registry plugin loading and initial installation **What are the current deficiencies and the benefits of improvement** - Registry Plugin install dir attribute assignment. - Add registry Plugin to initialize and install related properties **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5634
https://github.com/apache/dolphinscheduler/pull/5635
9d70c7e534aa10e729d564f14a1126f623cd1035
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
"2021-06-15T10:45:19Z"
java
"2021-06-15T12:51:52Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryCenter.java
registryPluginManagerConfig.setPlugins(PropertyUtils.getString(REGISTRY_PLUGIN_DIR, REGISTRY_PLUGIN_PATH).trim()); } if (StringUtils.isNotBlank(PropertyUtils.getString(MAVEN_LOCAL_REPOSITORY))) { registryPluginManagerConfig.setMavenLocalRepository(PropertyUtils.getString(MAVEN_LOCAL_REPOSITORY).trim()); } if (StringUtils.isNotBlank(PropertyUtils.getString(MAVEN_LOCAL_REPOSITORY))) { registryPluginManagerConfig.setMavenLocalRepository(PropertyUtils.getString(MAVEN_LOCAL_REPOSITORY).trim()); } registryPluginManager = new RegistryPluginManager(registryPluginName); DolphinPluginLoader registryPluginLoader = new DolphinPluginLoader(registryPluginManagerConfig, ImmutableList.of(registryPluginManager)); try { registryPluginLoader.loadPlugins(); } catch (Exception e) { throw new RuntimeException("Load registry Plugin Failed !", e); } } /** * close */ public void close() { if (isStarted.compareAndSet(true, false) && registry != null) { registry.close(); } } public void persist(String key, String value) { registry.persist(key, value); } public void persistEphemeral(String key, String value) { registry.persistEphemeral(key, value); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,634
[Improvement][registry-plugin] Optimize registry plugin loading and initial installation
**Describe the question** Optimize registry plugin loading and initial installation **What are the current deficiencies and the benefits of improvement** - Registry Plugin install dir attribute assignment. - Add registry Plugin to initialize and install related properties **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5634
https://github.com/apache/dolphinscheduler/pull/5635
9d70c7e534aa10e729d564f14a1126f623cd1035
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
"2021-06-15T10:45:19Z"
java
"2021-06-15T12:51:52Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryCenter.java
public void remove(String key) { registry.remove(key); } public void update(String key, String value) { registry.update(key, value); } public String get(String key) { return registry.get(key); } public void subscribe(String path, SubscribeListener subscribeListener) { registry.subscribe(path, subscribeListener); } public void addConnectionStateListener(RegistryConnectListener registryConnectListener) { registry.addConnectionStateListener(registryConnectListener); } public boolean isExisted(String key) { return registry.isExisted(key); } public boolean getLock(String key) { return registry.acquireLock(key); } public boolean releaseLock(String key) { return registry.releaseLock(key); } /** * @return get dead server node parent path */ public String getDeadZNodeParentPath() { return REGISTRY_DOLPHINSCHEDULER_DEAD_SERVERS; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,634
[Improvement][registry-plugin] Optimize registry plugin loading and initial installation
**Describe the question** Optimize registry plugin loading and initial installation **What are the current deficiencies and the benefits of improvement** - Registry Plugin install dir attribute assignment. - Add registry Plugin to initialize and install related properties **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5634
https://github.com/apache/dolphinscheduler/pull/5635
9d70c7e534aa10e729d564f14a1126f623cd1035
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
"2021-06-15T10:45:19Z"
java
"2021-06-15T12:51:52Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryCenter.java
public void setStoppable(IStoppable stoppable) { this.stoppable = stoppable; } public IStoppable getStoppable() { return stoppable; } /** * get master path * * @return master path */ public String getMasterPath() { return MASTER_PATH; } /** * whether master path * * @param path path * @return result */ public boolean isMasterPath(String path) { return path != null && path.contains(MASTER_PATH); } /** * get worker path * * @return worker path */ public String getWorkerPath() { return WORKER_PATH;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,634
[Improvement][registry-plugin] Optimize registry plugin loading and initial installation
**Describe the question** Optimize registry plugin loading and initial installation **What are the current deficiencies and the benefits of improvement** - Registry Plugin install dir attribute assignment. - Add registry Plugin to initialize and install related properties **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5634
https://github.com/apache/dolphinscheduler/pull/5635
9d70c7e534aa10e729d564f14a1126f623cd1035
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
"2021-06-15T10:45:19Z"
java
"2021-06-15T12:51:52Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryCenter.java
} /** * get worker group path * * @param workerGroup workerGroup * @return worker group path */ public String getWorkerGroupPath(String workerGroup) { return WORKER_PATH + "/" + workerGroup; } /** * whether worker path * * @param path path * @return result */ public boolean isWorkerPath(String path) { return path != null && path.contains(WORKER_PATH); } /** * get children nodes * * @param key key * @return children nodes */ public List<String> getChildrenKeys(final String key) { return registry.getChildren(key); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlParameters.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.task.sql; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.AbstractParameters; import org.apache.dolphinscheduler.common.utils.StringUtils; import java.util.ArrayList; import java.util.List; /** * Sql/Hql parameter */ public class SqlParameters extends AbstractParameters {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlParameters.java
/** * data source type,eg MYSQL, POSTGRES, HIVE ... */ private String type; /** * datasource id */ private int datasource; /** * sql */ private String sql; /** * sql type
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlParameters.java
* 0 query * 1 NON_QUERY */ private int sqlType; /** * send email */ private Boolean sendEmail; /** * display rows */ private int displayRows; /** * udf list */ private String udfs; /** * show type * 0 TABLE * 1 TEXT * 2 attachment * 3 TABLE+attachment */ private String showType; /** * SQL connection parameters */ private String connParams; /** * Pre Statements
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlParameters.java
*/ private List<String> preStatements; /** * Post Statements */ private List<String> postStatements; /** * groupId */ private int groupId; /** * title */ private String title; public String getType() { return type; } public void setType(String type) { this.type = type; } public int getDatasource() { return datasource; } public void setDatasource(int datasource) { this.datasource = datasource; } public String getSql() { return sql; } public void setSql(String sql) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlParameters.java
this.sql = sql; } public String getUdfs() { return udfs; } public void setUdfs(String udfs) { this.udfs = udfs; } public int getSqlType() { return sqlType; } public void setSqlType(int sqlType) { this.sqlType = sqlType; } public Boolean getSendEmail() { return sendEmail; } public void setSendEmail(Boolean sendEmail) { this.sendEmail = sendEmail; } public int getDisplayRows() { return displayRows; } public void setDisplayRows(int displayRows) { this.displayRows = displayRows; } public String getShowType() { return showType; } public void setShowType(String showType) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlParameters.java
this.showType = showType; } public String getConnParams() { return connParams; } public void setConnParams(String connParams) { this.connParams = connParams; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public List<String> getPreStatements() { return preStatements; } public void setPreStatements(List<String> preStatements) { this.preStatements = preStatements; } public List<String> getPostStatements() { return postStatements; } public void setPostStatements(List<String> postStatements) { this.postStatements = postStatements; } public int getGroupId() { return groupId; } public void setGroupId(int groupId) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlParameters.java
this.groupId = groupId; } @Override public boolean checkParameters() { return datasource != 0 && StringUtils.isNotEmpty(type) && StringUtils.isNotEmpty(sql); } @Override public List<ResourceInfo> getResourceFilesList() { return new ArrayList<>(); } @Override public String toString() { return "SqlParameters{" + "type='" + type + '\'' + ", datasource=" + datasource + ", sql='" + sql + '\'' + ", sqlType=" + sqlType + ", sendEmail=" + sendEmail + ", displayRows=" + displayRows + ", udfs='" + udfs + '\'' + ", showType='" + showType + '\'' + ", connParams='" + connParams + '\'' + ", groupId='" + groupId + '\'' + ", title='" + title + '\'' + ", preStatements=" + preStatements + ", postStatements=" + postStatements + '}'; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/task/SqlParametersTest.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.task; import org.apache.dolphinscheduler.common.task.sql.SqlParameters; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.junit.Assert; import org.junit.Test; public class SqlParametersTest { private final String type = "MYSQL"; private final String sql = "select * from t_ds_user"; private final String udfs = "test-udfs-1.0.0-SNAPSHOT.jar"; private final int datasource = 1; private final int sqlType = 0; private final Boolean sendEmail = true; private final int displayRows = 10; private final String showType = "TABLE";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/task/SqlParametersTest.java
private final String title = "sql test"; private final int groupId = 0; @Test public void testSqlParameters() { SqlParameters sqlParameters = new SqlParameters(); Assert.assertTrue(CollectionUtils.isEmpty(sqlParameters.getResourceFilesList())); sqlParameters.setType(type); sqlParameters.setSql(sql); sqlParameters.setUdfs(udfs); sqlParameters.setDatasource(datasource); sqlParameters.setSqlType(sqlType); sqlParameters.setSendEmail(sendEmail); sqlParameters.setDisplayRows(displayRows); sqlParameters.setShowType(showType); sqlParameters.setTitle(title); sqlParameters.setGroupId(groupId); Assert.assertEquals(type, sqlParameters.getType()); Assert.assertEquals(sql, sqlParameters.getSql()); Assert.assertEquals(udfs, sqlParameters.getUdfs()); Assert.assertEquals(datasource, sqlParameters.getDatasource()); Assert.assertEquals(sqlType, sqlParameters.getSqlType()); Assert.assertEquals(sendEmail, sqlParameters.getSendEmail()); Assert.assertEquals(displayRows, sqlParameters.getDisplayRows()); Assert.assertEquals(showType, sqlParameters.getShowType()); Assert.assertEquals(title, sqlParameters.getTitle()); Assert.assertEquals(groupId, sqlParameters.getGroupId()); Assert.assertTrue(sqlParameters.checkParameters()); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.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.sql; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.datasource.BaseConnectionParam; import org.apache.dolphinscheduler.common.datasource.DatasourceUtil; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.DbType; import org.apache.dolphinscheduler.common.enums.Direct; import org.apache.dolphinscheduler.common.enums.TaskTimeoutStrategy; import org.apache.dolphinscheduler.common.process.Property;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
import org.apache.dolphinscheduler.common.task.AbstractParameters; import org.apache.dolphinscheduler.common.task.sql.SqlBinds; import org.apache.dolphinscheduler.common.task.sql.SqlParameters; import org.apache.dolphinscheduler.common.task.sql.SqlType; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.common.utils.StringUtils; import org.apache.dolphinscheduler.dao.AlertDao; import org.apache.dolphinscheduler.remote.command.alert.AlertSendResponseCommand; import org.apache.dolphinscheduler.server.entity.SQLTaskExecutionContext; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.utils.ParamUtils; import org.apache.dolphinscheduler.server.utils.UDFUtils; import org.apache.dolphinscheduler.server.worker.task.AbstractTask; import org.apache.dolphinscheduler.service.alert.AlertClientService; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
import java.util.stream.Collectors; import org.slf4j.Logger; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; /** * sql task */ public class SqlTask extends AbstractTask { /** * sql parameters */ private SqlParameters sqlParameters; /** * alert dao */ private AlertDao alertDao; /** * base datasource */ private BaseConnectionParam baseConnectionParam; /** * taskExecutionContext */ private TaskExecutionContext taskExecutionContext; /** * default query sql limit */ private static final int LIMIT = 10000; private AlertClientService alertClientService; public SqlTask(TaskExecutionContext taskExecutionContext, Logger logger, AlertClientService alertClientService) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
super(taskExecutionContext, logger); this.taskExecutionContext = taskExecutionContext; logger.info("sql task params {}", taskExecutionContext.getTaskParams()); this.sqlParameters = JSONUtils.parseObject(taskExecutionContext.getTaskParams(), SqlParameters.class); if (!sqlParameters.checkParameters()) { throw new RuntimeException("sql task params is not valid"); } this.alertClientService = alertClientService; this.alertDao = SpringApplicationContext.getBean(AlertDao.class); } @Override public void handle() throws Exception { String threadLoggerInfoName = String.format(Constants.TASK_LOG_INFO_FORMAT, taskExecutionContext.getTaskAppId()); Thread.currentThread().setName(threadLoggerInfoName); logger.info("Full sql parameters: {}", sqlParameters); logger.info("sql type : {}, datasource : {}, sql : {} , localParams : {},udfs : {},showType : {},connParams : {}", sqlParameters.getType(), sqlParameters.getDatasource(), sqlParameters.getSql(), sqlParameters.getLocalParams(), sqlParameters.getUdfs(), sqlParameters.getShowType(), sqlParameters.getConnParams()); try { SQLTaskExecutionContext sqlTaskExecutionContext = taskExecutionContext.getSqlTaskExecutionContext(); baseConnectionParam = (BaseConnectionParam) DatasourceUtil.buildConnectionParams( DbType.valueOf(sqlParameters.getType()), sqlTaskExecutionContext.getConnectionParams());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
SqlBinds mainSqlBinds = getSqlAndSqlParamsMap(sqlParameters.getSql()); List<SqlBinds> preStatementSqlBinds = Optional.ofNullable(sqlParameters.getPreStatements()) .orElse(new ArrayList<>()) .stream() .map(this::getSqlAndSqlParamsMap) .collect(Collectors.toList()); List<SqlBinds> postStatementSqlBinds = Optional.ofNullable(sqlParameters.getPostStatements()) .orElse(new ArrayList<>()) .stream() .map(this::getSqlAndSqlParamsMap) .collect(Collectors.toList()); List<String> createFuncs = UDFUtils.createFuncs(sqlTaskExecutionContext.getUdfFuncTenantCodeMap(), logger); executeFuncAndSql(mainSqlBinds, preStatementSqlBinds, postStatementSqlBinds, createFuncs); setExitStatusCode(Constants.EXIT_CODE_SUCCESS); } catch (Exception e) { setExitStatusCode(Constants.EXIT_CODE_FAILURE); logger.error("sql task error: {}", e.toString()); throw e; } } /** * ready to execute SQL and parameter entity Map * * @return SqlBinds */ private SqlBinds getSqlAndSqlParamsMap(String sql) { Map<Integer, Property> sqlParamsMap = new HashMap<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
StringBuilder sqlBuilder = new StringBuilder(); Map<String, Property> paramsMap = ParamUtils.convert(ParamUtils.getUserDefParamsMap(taskExecutionContext.getDefinedParams()), taskExecutionContext.getDefinedParams(), sqlParameters.getLocalParametersMap(), CommandType.of(taskExecutionContext.getCmdTypeIfComplement()), taskExecutionContext.getScheduleTime()); if (paramsMap == null) { sqlBuilder.append(sql); return new SqlBinds(sqlBuilder.toString(), sqlParamsMap); } if (StringUtils.isNotEmpty(sqlParameters.getTitle())) { String title = ParameterUtils.convertParameterPlaceholders(sqlParameters.getTitle(), ParamUtils.convert(paramsMap)); logger.info("SQL title : {}", title); sqlParameters.setTitle(title); } sql = ParameterUtils.replaceScheduleTime(sql, taskExecutionContext.getScheduleTime()); String rgex = "['\"]*\\$\\{(.*?)\\}['\"]*"; setSqlParamsMap(sql, rgex, sqlParamsMap, paramsMap); String rgexo = "['\"]*\\!\\{(.*?)\\}['\"]*"; sql = replaceOriginalValue(sql, rgexo, paramsMap); // r String formatSql = sql.replaceAll(rgex, "?"); sqlBuilder.append(formatSql);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
// p printReplacedSql(sql, formatSql, rgex, sqlParamsMap); return new SqlBinds(sqlBuilder.toString(), sqlParamsMap); } public String replaceOriginalValue(String content, String rgex, Map<String, Property> sqlParamsMap) { Pattern pattern = Pattern.compile(rgex); while (true) { Matcher m = pattern.matcher(content); if (!m.find()) { break; } String paramName = m.group(1); String paramValue = sqlParamsMap.get(paramName).getValue(); content = m.replaceFirst(paramValue); } return content; } @Override public AbstractParameters getParameters() { return this.sqlParameters; } /** * execute function and sql * * @param mainSqlBinds main sql binds * @param preStatementsBinds pre statements binds * @param postStatementsBinds post statements binds * @param createFuncs create functions */ public void executeFuncAndSql(SqlBinds mainSqlBinds,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
List<SqlBinds> preStatementsBinds, List<SqlBinds> postStatementsBinds, List<String> createFuncs) throws Exception { Connection connection = null; PreparedStatement stmt = null; ResultSet resultSet = null; try { // c connection = DatasourceUtil.getConnection(DbType.valueOf(sqlParameters.getType()), baseConnectionParam); // c if (CollectionUtils.isNotEmpty(createFuncs)) { createTempFunction(connection, createFuncs); } // p preSql(connection, preStatementsBinds); stmt = prepareStatementAndBind(connection, mainSqlBinds); String result = null; // d if (sqlParameters.getSqlType() == SqlType.QUERY.ordinal()) { // q resultSet = stmt.executeQuery(); result = resultProcess(resultSet); } else if (sqlParameters.getSqlType() == SqlType.NON_QUERY.ordinal()) { // n String updateResult = String.valueOf(stmt.executeUpdate()); result = setNonQuerySqlReturn(updateResult, sqlParameters.getLocalParams()); } postSql(connection, postStatementsBinds); this.setResultString(result); } catch (Exception e) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
logger.error("execute sql error: {}", e.getMessage()); throw e; } finally { close(resultSet, stmt, connection); } } public String setNonQuerySqlReturn(String updateResult, List<Property> properties) { String result = null; for (Property info :properties) { if (Direct.OUT == info.getDirect()) { List<Map<String,String>> updateRL = new ArrayList<>(); Map<String,String> updateRM = new HashMap<>(); updateRM.put(info.getProp(),updateResult); updateRL.add(updateRM); result = JSONUtils.toJsonString(updateRL); break; } } return result; } /** * result process * * @param resultSet resultSet * @throws Exception Exception */ private String resultProcess(ResultSet resultSet) throws Exception { ArrayNode resultJSONArray = JSONUtils.createArrayNode(); if (resultSet != null) { ResultSetMetaData md = resultSet.getMetaData();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
int num = md.getColumnCount(); int rowCount = 0; while (rowCount < LIMIT && resultSet.next()) { ObjectNode mapOfColValues = JSONUtils.createObjectNode(); for (int i = 1; i <= num; i++) { mapOfColValues.set(md.getColumnLabel(i), JSONUtils.toJsonNode(resultSet.getObject(i))); } resultJSONArray.add(mapOfColValues); rowCount++; } int displayRows = sqlParameters.getDisplayRows() > 0 ? sqlParameters.getDisplayRows() : Constants.DEFAULT_DISPLAY_ROWS; displayRows = Math.min(displayRows, resultJSONArray.size()); logger.info("display sql result {} rows as follows:", displayRows); for (int i = 0; i < displayRows; i++) { String row = JSONUtils.toJsonString(resultJSONArray.get(i)); logger.info("row {} : {}", i + 1, row); } } String result = JSONUtils.toJsonString(resultJSONArray); if (sqlParameters.getSendEmail() == null || sqlParameters.getSendEmail()) { sendAttachment(sqlParameters.getGroupId(), StringUtils.isNotEmpty(sqlParameters.getTitle()) ? sqlParameters.getTitle() : taskExecutionContext.getTaskName() + " query result sets", result); } logger.debug("execute sql result : {}", result); return result; } /** * p *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
* @param connection connection * @param preStatementsBinds preStatementsBinds */ private void preSql(Connection connection, List<SqlBinds> preStatementsBinds) throws Exception { for (SqlBinds sqlBind : preStatementsBinds) { try (PreparedStatement pstmt = prepareStatementAndBind(connection, sqlBind)) { int result = pstmt.executeUpdate(); logger.info("pre statement execute result: {}, for sql: {}", result, sqlBind.getSql()); } } } /** * post sql * * @param connection connection * @param postStatementsBinds postStatementsBinds */ private void postSql(Connection connection, List<SqlBinds> postStatementsBinds) throws Exception { for (SqlBinds sqlBind : postStatementsBinds) { try (PreparedStatement pstmt = prepareStatementAndBind(connection, sqlBind)) { int result = pstmt.executeUpdate(); logger.info("post statement execute result: {},for sql: {}", result, sqlBind.getSql()); } } } /** * c *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
* @param connection connection * @param createFuncs createFuncs */ private void createTempFunction(Connection connection, List<String> createFuncs) throws Exception { try (Statement funcStmt = connection.createStatement()) { for (String createFunc : createFuncs) { logger.info("hive create function sql: {}", createFunc); funcStmt.execute(createFunc); } } } /** * close jdbc resource * * @param resultSet resultSet * @param pstmt pstmt * @param connection connection */ private void close(ResultSet resultSet, PreparedStatement pstmt, Connection connection) { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { logger.error("close result set error : {}", e.getMessage(), e); } } if (pstmt != null) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
try { pstmt.close(); } catch (SQLException e) { logger.error("close prepared statement error : {}", e.getMessage(), e); } } if (connection != null) { try { connection.close(); } catch (SQLException e) { logger.error("close connection error : {}", e.getMessage(), e); } } } /** * preparedStatement bind * * @param connection connection * @param sqlBinds sqlBinds * @return PreparedStatement * @throws Exception Exception */ private PreparedStatement prepareStatementAndBind(Connection connection, SqlBinds sqlBinds) throws Exception { // i boolean timeoutFlag = taskExecutionContext.getTaskTimeoutStrategy() == TaskTimeoutStrategy.FAILED || taskExecutionContext.getTaskTimeoutStrategy() == TaskTimeoutStrategy.WARNFAILED; PreparedStatement stmt = connection.prepareStatement(sqlBinds.getSql()); if (timeoutFlag) { stmt.setQueryTimeout(taskExecutionContext.getTaskTimeout()); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
Map<Integer, Property> params = sqlBinds.getParamsMap(); if (params != null) { for (Map.Entry<Integer, Property> entry : params.entrySet()) { Property prop = entry.getValue(); ParameterUtils.setInParameter(entry.getKey(), stmt, prop.getType(), prop.getValue()); } } logger.info("prepare statement replace sql : {} ", stmt); return stmt; } /** * send mail as an attachment * * @param title title * @param content content */ public void sendAttachment(int groupId, String title, String content) { AlertSendResponseCommand alertSendResponseCommand = alertClientService.sendAlert(groupId, title, content); if (!alertSendResponseCommand.getResStatus()) { throw new RuntimeException("send mail failed!"); } } /** * regular expressions match the contents between two specified strings * * @param content content * @param rgex rgex * @param sqlParamsMap sql params map * @param paramsPropsMap params props map */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
public void setSqlParamsMap(String content, String rgex, Map<Integer, Property> sqlParamsMap, Map<String, Property> paramsPropsMap) { Pattern pattern = Pattern.compile(rgex); Matcher m = pattern.matcher(content); int index = 1; while (m.find()) { String paramName = m.group(1); Property prop = paramsPropsMap.get(paramName); sqlParamsMap.put(index, prop); index++; } } /** * print replace sql * * @param content content * @param formatSql format sql * @param rgex rgex * @param sqlParamsMap sql params map */ public void printReplacedSql(String content, String formatSql, String rgex, Map<Integer, Property> sqlParamsMap) { //pa logger.info("after replace sql , preparing : {}", formatSql); StringBuilder logPrint = new StringBuilder("replaced sql , parameters:"); for (int i = 1; i <= sqlParamsMap.size(); i++) { logPrint.append(sqlParamsMap.get(i).getValue() + "(" + sqlParamsMap.get(i).getType() + ")"); } logger.info("Sql Params are {}", logPrint); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTaskTest.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.sql;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTaskTest.java
import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.datasource.DatasourceUtil; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.dao.AlertDao; import org.apache.dolphinscheduler.remote.command.alert.AlertSendResponseCommand; import org.apache.dolphinscheduler.server.entity.SQLTaskExecutionContext; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.worker.task.TaskProps; import org.apache.dolphinscheduler.service.alert.AlertClientService; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.util.Date; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.reflect.Whitebox; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * sql task test */ @RunWith(PowerMockRunner.class)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTaskTest.java
@PrepareForTest(value = {SqlTask.class, DatasourceUtil.class, SpringApplicationContext.class, ParameterUtils.class, AlertSendResponseCommand.class}) public class SqlTaskTest { private static final Logger logger = LoggerFactory.getLogger(SqlTaskTest.class); private static final String CONNECTION_PARAMS = "{\"user\":\"root\",\"password\":\"123456\",\"address\":\"jdbc:mysql://127.0.0.1:3306\"," + "\"database\":\"test\",\"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\"}"; private SqlTask sqlTask; private TaskExecutionContext taskExecutionContext; private AlertClientService alertClientService; @Before public void before() throws Exception { taskExecutionContext = new TaskExecutionContext(); TaskProps props = new TaskProps(); props.setExecutePath("/tmp"); props.setTaskAppId(String.valueOf(System.currentTimeMillis())); props.setTaskInstanceId(1); props.setTenantCode("1"); props.setEnvFile(".dolphinscheduler_env.sh"); props.setTaskStartTime(new Date()); props.setTaskTimeout(0); props.setTaskParams( "{\"localParams\":[{\"prop\":\"ret\", \"direct\":\"OUT\", \"type\":\"VARCHAR\", \"value\":\"\"}]," + "\"type\":\"POSTGRESQL\",\"datasource\":1,\"sql\":\"insert into tb_1 values('1','2')\"," + "\"sqlType\":1}");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTaskTest.java
taskExecutionContext = PowerMockito.mock(TaskExecutionContext.class); PowerMockito.when(taskExecutionContext.getTaskParams()).thenReturn(props.getTaskParams()); PowerMockito.when(taskExecutionContext.getExecutePath()).thenReturn("/tmp"); PowerMockito.when(taskExecutionContext.getTaskAppId()).thenReturn("1"); PowerMockito.when(taskExecutionContext.getTenantCode()).thenReturn("root"); PowerMockito.when(taskExecutionContext.getStartTime()).thenReturn(new Date()); PowerMockito.when(taskExecutionContext.getTaskTimeout()).thenReturn(10000); PowerMockito.when(taskExecutionContext.getLogPath()).thenReturn("/tmp/dx"); SQLTaskExecutionContext sqlTaskExecutionContext = new SQLTaskExecutionContext(); sqlTaskExecutionContext.setConnectionParams(CONNECTION_PARAMS); PowerMockito.when(taskExecutionContext.getSqlTaskExecutionContext()).thenReturn(sqlTaskExecutionContext); PowerMockito.mockStatic(SpringApplicationContext.class); PowerMockito.when(SpringApplicationContext.getBean(Mockito.any())).thenReturn(new AlertDao()); alertClientService = PowerMockito.mock(AlertClientService.class); sqlTask = new SqlTask(taskExecutionContext, logger, alertClientService); sqlTask.init(); } @Test public void testGetParameters() { Assert.assertNotNull(sqlTask.getParameters()); } @Test public void testHandle() throws Exception { Connection connection = PowerMockito.mock(Connection.class); PreparedStatement preparedStatement = PowerMockito.mock(PreparedStatement.class); PowerMockito.when(connection.prepareStatement(Mockito.any())).thenReturn(preparedStatement); PowerMockito.mockStatic(ParameterUtils.class); PowerMockito.when(ParameterUtils.replaceScheduleTime(Mockito.any(), Mockito.any())).thenReturn("insert into tb_1 values('1','2')"); PowerMockito.mockStatic(DatasourceUtil.class); PowerMockito.when(DatasourceUtil.getConnection(Mockito.any(), Mockito.any())).thenReturn(connection);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,580
[Improvement][SQL] Query return number should be configurable
**Describe the question** The SQL query result can only return 10,000 records, which are currently hard-coded **Which version of DolphinScheduler:** -[1.3.6-Release] **Describe alternatives you've considered** I think it should be configurable.
https://github.com/apache/dolphinscheduler/issues/5580
https://github.com/apache/dolphinscheduler/pull/5632
e2d6265e26b27abdf0a212289cca9c0cdad1e0a6
67711442d5add82164a916452020a68a84693000
"2021-06-02T04:11:42Z"
java
"2021-06-16T01:40:21Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTaskTest.java
sqlTask.handle(); Assert.assertEquals(Constants.EXIT_CODE_SUCCESS, sqlTask.getExitStatusCode()); } @Test public void testResultProcess() throws Exception { AlertSendResponseCommand mockResponseCommand = PowerMockito.mock(AlertSendResponseCommand.class); PowerMockito.when(mockResponseCommand.getResStatus()).thenReturn(true); PowerMockito.when(alertClientService.sendAlert(0, "null query result sets", "[]")).thenReturn(mockResponseCommand); String result = Whitebox.invokeMethod(sqlTask, "resultProcess", null); Assert.assertNotNull(result); } @Test public void testResultProcess02() throws Exception { ResultSet resultSet = PowerMockito.mock(ResultSet.class); ResultSetMetaData mockResultMetaData = PowerMockito.mock(ResultSetMetaData.class); PowerMockito.when(resultSet.getMetaData()).thenReturn(mockResultMetaData); PowerMockito.when(mockResultMetaData.getColumnCount()).thenReturn(2); PowerMockito.when(resultSet.next()).thenReturn(true); PowerMockito.when(resultSet.getObject(Mockito.anyInt())).thenReturn(1); PowerMockito.when(mockResultMetaData.getColumnLabel(Mockito.anyInt())).thenReturn("a"); AlertSendResponseCommand mockResponseCommand = PowerMockito.mock(AlertSendResponseCommand.class); PowerMockito.when(mockResponseCommand.getResStatus()).thenReturn(true); PowerMockito.when(alertClientService.sendAlert(Mockito.anyInt(), Mockito.anyString(), Mockito.anyString())).thenReturn(mockResponseCommand); String result = Whitebox.invokeMethod(sqlTask, "resultProcess", resultSet); Assert.assertNotNull(result); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
throw new UnsupportedOperationException("Construct Constants"); } /** * 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String QUARTZ_THREADPRIORITY = "5"; 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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* resource storage type */ 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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS = "/lock/failover/workers"; /** * 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 = "//"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* SINGLE_QUOTES "'" */ 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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String YYYYMMDDHHMMSSSSS = "yyyyMMddHHmmssSSS"; /** * 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"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* user name regex */ 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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final int ALL_PERMISSIONS = READ_PERMISSION | WRITE_PERMISSION | EXECUTE_PERMISSION; /** * 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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String CMD_PARAM_RECOVER_PROCESS_ID_STRING = "ProcessInstanceId"; 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String SPRING_DATASOURCE_TIME_BETWEEN_EVICTION_RUNS_MILLIS = "spring.datasource.timeBetweenEvictionRunsMillis"; 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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* --driver-memory MEM */ 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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final int EXIT_CODE_KILL = 137; /** * 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"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* ACCEPTED */ 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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String RUNNING = "RUNNING"; /** * 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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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 = ')';
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String ADD_STRING = "+"; 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String CONTENT = "content"; 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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE = "hadoop.security.authentication.startup.state"; /** * 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String FLINK_JOB_MANAGE_MEM = "-yjm"; 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 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.WAITTING_THREAD.ordinal(), ExecutionStatus.WAITTING_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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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 = "(?<=(\"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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
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,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.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 org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ProgramType; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.flink.FlinkParameters; import org.apache.dolphinscheduler.common.utils.StringUtils; import java.util.ArrayList; import java.util.List; /** * flink args utils */ public class FlinkArgsUtils {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
private static final String LOCAL_DEPLOY_MODE = "local"; private static final String FLINK_VERSION_BEFORE_1_10 = "<1.10"; private FlinkArgsUtils() { throw new IllegalStateException("Utility class"); } /** * build args * @param param flink parameters * @return argument list */ public static List<String> buildArgs(FlinkParameters param) { List<String> args = new ArrayList<>(); String deployMode = "cluster"; String tmpDeployMode = param.getDeployMode(); if (StringUtils.isNotEmpty(tmpDeployMode)) { deployMode = tmpDeployMode; } String others = param.getOthers(); if (!LOCAL_DEPLOY_MODE.equals(deployMode)) { args.add(Constants.FLINK_RUN_MODE); args.add(Constants.FLINK_YARN_CLUSTER); int slot = param.getSlot(); if (slot > 0) { args.add(Constants.FLINK_YARN_SLOT); args.add(String.format("%d", slot)); } String appName = param.getAppName(); if (StringUtils.isNotEmpty(appName)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
args.add(Constants.FLINK_APP_NAME); args.add(ArgsUtils.escape(appName)); } String flinkVersion = param.getFlinkVersion(); if (flinkVersion == null || FLINK_VERSION_BEFORE_1_10.equals(flinkVersion)) { int taskManager = param.getTaskManager(); if (taskManager > 0) { args.add(Constants.FLINK_TASK_MANAGE); args.add(String.format("%d", taskManager)); } } String jobManagerMemory = param.getJobManagerMemory(); if (StringUtils.isNotEmpty(jobManagerMemory)) { args.add(Constants.FLINK_JOB_MANAGE_MEM); args.add(jobManagerMemory); } String taskManagerMemory = param.getTaskManagerMemory(); if (StringUtils.isNotEmpty(taskManagerMemory)) { args.add(Constants.FLINK_TASK_MANAGE_MEM); args.add(taskManagerMemory); } if (StringUtils.isEmpty(others) || !others.contains(Constants.FLINK_QUEUE)) { String queue = param.getQueue(); if (StringUtils.isNotEmpty(queue)) { args.add(Constants.FLINK_QUEUE); args.add(queue); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,452
[Improvement][Task] ds flink task support submit a PyFlink job via the CLI
**Describe the question** ds flink task support submit a PyFlink job via the CLI ``` $ ./bin/flink run --python examples/python/table/batch/word_count.py ``` **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5452
https://github.com/apache/dolphinscheduler/pull/5453
b05957db419bcf05e17b0a6f309d23382b0a95ec
3026f04d8528a63f26d9b62da00a495c8e9f47ab
"2021-05-12T07:43:56Z"
java
"2021-06-17T07:19:25Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
int parallelism = param.getParallelism(); if (parallelism > 0) { args.add(Constants.FLINK_PARALLELISM); args.add(String.format("%d", parallelism)); } args.add(Constants.FLINK_SHUTDOWN_ON_ATTACHED_EXIT); if (StringUtils.isNotEmpty(others)) { args.add(others); } ProgramType programType = param.getProgramType(); String mainClass = param.getMainClass(); if (programType != null && programType != ProgramType.PYTHON && StringUtils.isNotEmpty(mainClass)) { args.add(Constants.FLINK_MAIN_CLASS); args.add(param.getMainClass()); } ResourceInfo mainJar = param.getMainJar(); if (mainJar != null) { args.add(mainJar.getRes()); } String mainArgs = param.getMainArgs(); if (StringUtils.isNotEmpty(mainArgs)) { args.add(mainArgs); } return args; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,655
[Bug][Master] Task always failed.
Currently, if we have to two tasks A and in one DAG with A -> B. The execution result of A will always be judged as `Failure` by line 919 ![image](https://user-images.githubusercontent.com/13628428/122369780-15548400-cf91-11eb-9888-15a297042a63.png) since the task id is alway 0. This mistake is releated to this [PR](https://github.com/apache/dolphinscheduler/pull/5572/files?file-filters%5B%5D=.java#diff-8e3989af7cb0208a57e34d7797a5fd4b84b96eb4a1f5064ec0cb0482fcf322ccL80). ![image](https://user-images.githubusercontent.com/13628428/122370375-9744ad00-cf91-11eb-9c70-743b569554ea.png) where we didn't set the `id` of cached TaskInstance. **Which version of Dolphin Scheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5655
https://github.com/apache/dolphinscheduler/pull/5656
3026f04d8528a63f26d9b62da00a495c8e9f47ab
0d7c32a1e829202d8359f112383b1b56eec6653d
"2021-06-17T09:30:01Z"
java
"2021-06-17T10:45:34Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/cache/impl/TaskInstanceCacheManagerImpl.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 *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,655
[Bug][Master] Task always failed.
Currently, if we have to two tasks A and in one DAG with A -> B. The execution result of A will always be judged as `Failure` by line 919 ![image](https://user-images.githubusercontent.com/13628428/122369780-15548400-cf91-11eb-9888-15a297042a63.png) since the task id is alway 0. This mistake is releated to this [PR](https://github.com/apache/dolphinscheduler/pull/5572/files?file-filters%5B%5D=.java#diff-8e3989af7cb0208a57e34d7797a5fd4b84b96eb4a1f5064ec0cb0482fcf322ccL80). ![image](https://user-images.githubusercontent.com/13628428/122370375-9744ad00-cf91-11eb-9c70-743b569554ea.png) where we didn't set the `id` of cached TaskInstance. **Which version of Dolphin Scheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5655
https://github.com/apache/dolphinscheduler/pull/5656
3026f04d8528a63f26d9b62da00a495c8e9f47ab
0d7c32a1e829202d8359f112383b1b56eec6653d
"2021-06-17T09:30:01Z"
java
"2021-06-17T10:45:34Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/cache/impl/TaskInstanceCacheManagerImpl.java
* http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.master.cache.impl; import static org.apache.dolphinscheduler.common.Constants.CACHE_REFRESH_TIME_MILLIS; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.remote.command.TaskExecuteAckCommand; import org.apache.dolphinscheduler.remote.command.TaskExecuteResponseCommand; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.master.cache.TaskInstanceCacheManager; import org.apache.dolphinscheduler.service.process.ProcessService; import java.util.Map; import java.util.Map.Entry; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.ConcurrentHashMap; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * taskInstance state manager */ @Component
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,655
[Bug][Master] Task always failed.
Currently, if we have to two tasks A and in one DAG with A -> B. The execution result of A will always be judged as `Failure` by line 919 ![image](https://user-images.githubusercontent.com/13628428/122369780-15548400-cf91-11eb-9888-15a297042a63.png) since the task id is alway 0. This mistake is releated to this [PR](https://github.com/apache/dolphinscheduler/pull/5572/files?file-filters%5B%5D=.java#diff-8e3989af7cb0208a57e34d7797a5fd4b84b96eb4a1f5064ec0cb0482fcf322ccL80). ![image](https://user-images.githubusercontent.com/13628428/122370375-9744ad00-cf91-11eb-9c70-743b569554ea.png) where we didn't set the `id` of cached TaskInstance. **Which version of Dolphin Scheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5655
https://github.com/apache/dolphinscheduler/pull/5656
3026f04d8528a63f26d9b62da00a495c8e9f47ab
0d7c32a1e829202d8359f112383b1b56eec6653d
"2021-06-17T09:30:01Z"
java
"2021-06-17T10:45:34Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/cache/impl/TaskInstanceCacheManagerImpl.java
public class TaskInstanceCacheManagerImpl implements TaskInstanceCacheManager { /** * taskInstance cache */ private Map<Integer,TaskInstance> taskInstanceCache = new ConcurrentHashMap<>(); /** * process service */ @Autowired private ProcessService processService; /** * taskInstance cache refresh timer */ private Timer refreshTaskInstanceTimer = null; @PostConstruct public void init() { this.refreshTaskInstanceTimer = new Timer(true); refreshTaskInstanceTimer.scheduleAtFixedRate( new RefreshTaskInstanceTimerTask(), CACHE_REFRESH_TIME_MILLIS, CACHE_REFRESH_TIME_MILLIS ); } @PreDestroy public void close() { this.refreshTaskInstanceTimer.cancel(); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,655
[Bug][Master] Task always failed.
Currently, if we have to two tasks A and in one DAG with A -> B. The execution result of A will always be judged as `Failure` by line 919 ![image](https://user-images.githubusercontent.com/13628428/122369780-15548400-cf91-11eb-9888-15a297042a63.png) since the task id is alway 0. This mistake is releated to this [PR](https://github.com/apache/dolphinscheduler/pull/5572/files?file-filters%5B%5D=.java#diff-8e3989af7cb0208a57e34d7797a5fd4b84b96eb4a1f5064ec0cb0482fcf322ccL80). ![image](https://user-images.githubusercontent.com/13628428/122370375-9744ad00-cf91-11eb-9c70-743b569554ea.png) where we didn't set the `id` of cached TaskInstance. **Which version of Dolphin Scheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5655
https://github.com/apache/dolphinscheduler/pull/5656
3026f04d8528a63f26d9b62da00a495c8e9f47ab
0d7c32a1e829202d8359f112383b1b56eec6653d
"2021-06-17T09:30:01Z"
java
"2021-06-17T10:45:34Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/cache/impl/TaskInstanceCacheManagerImpl.java
* get taskInstance by taskInstance id * * @param taskInstanceId taskInstanceId * @return taskInstance */ @Override public TaskInstance getByTaskInstanceId(Integer taskInstanceId) { return taskInstanceCache.computeIfAbsent(taskInstanceId, k -> processService.findTaskInstanceById(taskInstanceId)); } /** * cache taskInstance * * @param taskExecutionContext taskExecutionContext */ @Override public void cacheTaskInstance(TaskExecutionContext taskExecutionContext) { TaskInstance taskInstance = new TaskInstance(); taskInstance.setId(taskExecutionContext.getTaskInstanceId()); taskInstance.setName(taskExecutionContext.getTaskName()); taskInstance.setStartTime(taskExecutionContext.getStartTime()); taskInstance.setTaskType(taskExecutionContext.getTaskType()); taskInstance.setExecutePath(taskExecutionContext.getExecutePath()); taskInstanceCache.put(taskExecutionContext.getTaskInstanceId(), taskInstance); } /** * cache taskInstance * * @param taskAckCommand taskAckCommand */ @Override
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,655
[Bug][Master] Task always failed.
Currently, if we have to two tasks A and in one DAG with A -> B. The execution result of A will always be judged as `Failure` by line 919 ![image](https://user-images.githubusercontent.com/13628428/122369780-15548400-cf91-11eb-9888-15a297042a63.png) since the task id is alway 0. This mistake is releated to this [PR](https://github.com/apache/dolphinscheduler/pull/5572/files?file-filters%5B%5D=.java#diff-8e3989af7cb0208a57e34d7797a5fd4b84b96eb4a1f5064ec0cb0482fcf322ccL80). ![image](https://user-images.githubusercontent.com/13628428/122370375-9744ad00-cf91-11eb-9c70-743b569554ea.png) where we didn't set the `id` of cached TaskInstance. **Which version of Dolphin Scheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5655
https://github.com/apache/dolphinscheduler/pull/5656
3026f04d8528a63f26d9b62da00a495c8e9f47ab
0d7c32a1e829202d8359f112383b1b56eec6653d
"2021-06-17T09:30:01Z"
java
"2021-06-17T10:45:34Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/cache/impl/TaskInstanceCacheManagerImpl.java
public void cacheTaskInstance(TaskExecuteAckCommand taskAckCommand) { TaskInstance taskInstance = new TaskInstance(); taskInstance.setState(ExecutionStatus.of(taskAckCommand.getStatus())); taskInstance.setStartTime(taskAckCommand.getStartTime()); taskInstance.setHost(taskAckCommand.getHost()); taskInstance.setExecutePath(taskAckCommand.getExecutePath()); taskInstance.setLogPath(taskAckCommand.getLogPath()); taskInstanceCache.put(taskAckCommand.getTaskInstanceId(), taskInstance); } /** * cache taskInstance * * @param taskExecuteResponseCommand taskExecuteResponseCommand */ @Override public void cacheTaskInstance(TaskExecuteResponseCommand taskExecuteResponseCommand) { TaskInstance taskInstance = getByTaskInstanceId(taskExecuteResponseCommand.getTaskInstanceId()); taskInstance.setState(ExecutionStatus.of(taskExecuteResponseCommand.getStatus())); taskInstance.setEndTime(taskExecuteResponseCommand.getEndTime()); taskInstanceCache.put(taskExecuteResponseCommand.getTaskInstanceId(), taskInstance); } /** * remove taskInstance by taskInstanceId * @param taskInstanceId taskInstanceId */ @Override public void removeByTaskInstanceId(Integer taskInstanceId) { taskInstanceCache.remove(taskInstanceId); } class RefreshTaskInstanceTimerTask extends TimerTask {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,655
[Bug][Master] Task always failed.
Currently, if we have to two tasks A and in one DAG with A -> B. The execution result of A will always be judged as `Failure` by line 919 ![image](https://user-images.githubusercontent.com/13628428/122369780-15548400-cf91-11eb-9888-15a297042a63.png) since the task id is alway 0. This mistake is releated to this [PR](https://github.com/apache/dolphinscheduler/pull/5572/files?file-filters%5B%5D=.java#diff-8e3989af7cb0208a57e34d7797a5fd4b84b96eb4a1f5064ec0cb0482fcf322ccL80). ![image](https://user-images.githubusercontent.com/13628428/122370375-9744ad00-cf91-11eb-9c70-743b569554ea.png) where we didn't set the `id` of cached TaskInstance. **Which version of Dolphin Scheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/5655
https://github.com/apache/dolphinscheduler/pull/5656
3026f04d8528a63f26d9b62da00a495c8e9f47ab
0d7c32a1e829202d8359f112383b1b56eec6653d
"2021-06-17T09:30:01Z"
java
"2021-06-17T10:45:34Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/cache/impl/TaskInstanceCacheManagerImpl.java
@Override public void run() { for (Entry<Integer, TaskInstance> taskInstanceEntry : taskInstanceCache.entrySet()) { TaskInstance taskInstance = processService.findTaskInstanceById(taskInstanceEntry.getKey()); if (null != taskInstance && taskInstance.getState() == ExecutionStatus.NEED_FAULT_TOLERANCE) { taskInstanceCache.computeIfPresent(taskInstanceEntry.getKey(), (k, v) -> taskInstance); } } } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.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; import static org.apache.dolphinscheduler.common.Constants.EXIT_CODE_FAILURE; import static org.apache.dolphinscheduler.common.Constants.EXIT_CODE_KILL; import static org.apache.dolphinscheduler.common.Constants.EXIT_CODE_SUCCESS; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.common.thread.ThreadUtils; import org.apache.dolphinscheduler.common.utils.CommonUtils;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
import org.apache.dolphinscheduler.common.utils.HadoopUtils; import org.apache.dolphinscheduler.common.utils.LoggerUtils; import org.apache.dolphinscheduler.common.utils.OSUtils; import org.apache.dolphinscheduler.common.utils.StringUtils; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.utils.ProcessUtils; import org.apache.dolphinscheduler.server.worker.cache.TaskExecutionContextCacheManager; import org.apache.dolphinscheduler.server.worker.cache.impl.TaskExecutionContextCacheManagerImpl; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.slf4j.Logger; /** * abstract command executor */ public abstract class AbstractCommandExecutor {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
/** * rules for extracting application ID */ protected static final Pattern APPLICATION_REGEX = Pattern.compile(Constants.APPLICATION_REGEX); protected StringBuilder varPool = new StringBuilder(); /** * process
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
*/ private Process process; /** * log handler */ protected Consumer<List<String>> logHandler; /** * logger */ protected Logger logger; /** * log list */ protected final List<String> logBuffer; protected boolean logOutputIsScuccess = false; /** * SHELL result string */ protected String taskResultString; /** * taskExecutionContext */ protected TaskExecutionContext taskExecutionContext; /** * taskExecutionContextCacheManager */ private TaskExecutionContextCacheManager taskExecutionContextCacheManager; public AbstractCommandExecutor(Consumer<List<String>> logHandler, TaskExecutionContext taskExecutionContext, Logger logger) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
this.logHandler = logHandler; this.taskExecutionContext = taskExecutionContext; this.logger = logger; this.logBuffer = Collections.synchronizedList(new ArrayList<>()); this.taskExecutionContextCacheManager = SpringApplicationContext.getBean(TaskExecutionContextCacheManagerImpl.class); } protected AbstractCommandExecutor(List<String> logBuffer) { this.logBuffer = logBuffer; } /** * build process * * @param commandFile command file * @throws IOException IO Exception */ private void buildProcess(String commandFile) throws IOException { List<String> command = new LinkedList<>(); ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.directory(new File(taskExecutionContext.getExecutePath())); processBuilder.redirectErrorStream(true); if (!OSUtils.isWindows() && CommonUtils.isSudoEnable()) { command.add("sudo"); command.add("-u"); command.add(taskExecutionContext.getTenantCode()); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
command.add(commandInterpreter()); command.addAll(commandOptions()); command.add(commandFile); processBuilder.command(command); process = processBuilder.start(); printCommand(command); } /** * task specific execution logic * * @param execCommand execCommand * @return CommandExecuteResult * @throws Exception if error throws Exception */ public CommandExecuteResult run(String execCommand) throws Exception { CommandExecuteResult result = new CommandExecuteResult(); int taskInstanceId = taskExecutionContext.getTaskInstanceId(); if (null == taskExecutionContextCacheManager.getByTaskInstanceId(taskInstanceId)) { result.setExitStatusCode(EXIT_CODE_KILL); return result; } if (StringUtils.isEmpty(execCommand)) { taskExecutionContextCacheManager.removeByTaskInstanceId(taskInstanceId); return result; } String commandFilePath = buildCommandFilePath();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
createCommandFileIfNotExists(execCommand, commandFilePath); buildProcess(commandFilePath); parseProcessOutput(process); Integer processId = getProcessId(process); result.setProcessId(processId); taskExecutionContext.setProcessId(processId); boolean updateTaskExecutionContextStatus = taskExecutionContextCacheManager.updateTaskExecutionContext(taskExecutionContext); if (Boolean.FALSE.equals(updateTaskExecutionContextStatus)) { ProcessUtils.kill(taskExecutionContext); result.setExitStatusCode(EXIT_CODE_KILL); return result; } logger.info("process start, process id is: {}", processId); long remainTime = getRemaintime(); boolean status = process.waitFor(remainTime, TimeUnit.SECONDS); logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); if (status) { List<String> appIds = getAppIds(taskExecutionContext.getLogPath()); result.setAppIds(String.join(Constants.COMMA, appIds)); result.setExitStatusCode(process.exitValue());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
if (process.exitValue() == 0) { result.setExitStatusCode(isSuccessOfYarnState(appIds) ? EXIT_CODE_SUCCESS : EXIT_CODE_FAILURE); } } else { logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ProcessUtils.kill(taskExecutionContext); result.setExitStatusCode(EXIT_CODE_FAILURE); } return result; } public String getVarPool() { return varPool.toString(); } /** * cancel application * * @throws Exception exception */ public void cancelApplication() throws Exception { if (process == null) { return; } clear(); int processId = getProcessId(process); logger.info("cancel process: {}", processId); boolean killed = softKill(processId); if (!killed) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
hardKill(processId); process.destroy(); process = null; } } /** * soft kill * * @param processId process id * @return process is alive * @throws InterruptedException interrupted exception */ private boolean softKill(int processId) { if (processId != 0 && process.isAlive()) { try { String cmd = String.format("kill %d", processId); cmd = OSUtils.getSudoCmd(taskExecutionContext.getTenantCode(), cmd); logger.info("soft kill task:{}, process id:{}, cmd:{}", taskExecutionContext.getTaskAppId(), processId, cmd); Runtime.getRuntime().exec(cmd); } catch (IOException e) { logger.info("kill attempt failed", e); } } return !process.isAlive(); } /** * hard kill
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
* * @param processId process id */ private void hardKill(int processId) { if (processId != 0 && process.isAlive()) { try { String cmd = String.format("kill -9 %d", processId); cmd = OSUtils.getSudoCmd(taskExecutionContext.getTenantCode(), cmd); logger.info("hard kill task:{}, process id:{}, cmd:{}", taskExecutionContext.getTaskAppId(), processId, cmd); Runtime.getRuntime().exec(cmd); } catch (IOException e) { logger.error("kill attempt failed ", e); } } } /** * print command * * @param commands process builder */ private void printCommand(List<String> commands) { String cmdStr; try { cmdStr = ProcessUtils.buildCommandStr(commands); logger.info("task run command:\n{}", cmdStr); } catch (Exception e) { logger.error(e.getMessage(), e); } } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
* clear */ private void clear() { List<String> markerList = new ArrayList<>(); markerList.add(ch.qos.logback.classic.ClassicConstants.FINALIZE_SESSION_MARKER.toString()); if (!logBuffer.isEmpty()) { logHandler.accept(logBuffer); logBuffer.clear(); } logHandler.accept(markerList); } /** * get the standard output of the process * * @param process process */ private void parseProcessOutput(Process process) { String threadLoggerInfoName = String.format(LoggerUtils.TASK_LOGGER_THREAD_NAME + "-%s", taskExecutionContext.getTaskAppId()); ExecutorService getOutputLogService = ThreadUtils.newDaemonSingleThreadExecutor(threadLoggerInfoName + "-" + "getOutputLogService"); getOutputLogService.submit(() -> { BufferedReader inReader = null; try { inReader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; logBuffer.add("welcome to use bigdata scheduling system..."); while ((line = inReader.readLine()) != null) { if (line.startsWith("${setValue(")) { varPool.append(line.substring("${setValue(".length(), line.length() - 2)); varPool.append("$VarPool$");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
} else { logBuffer.add(line); taskResultString = line; } } } catch (Exception e) { logger.error(e.getMessage(), e); } finally { logOutputIsScuccess = true; close(inReader); } }); getOutputLogService.shutdown(); ExecutorService parseProcessOutputExecutorService = ThreadUtils.newDaemonSingleThreadExecutor(threadLoggerInfoName); parseProcessOutputExecutorService.submit(() -> { try { long lastFlushTime = System.currentTimeMillis(); while (logBuffer.size() > 0 || !logOutputIsScuccess) { if (logBuffer.size() > 0) { lastFlushTime = flush(lastFlushTime); } else { Thread.sleep(Constants.DEFAULT_LOG_FLUSH_INTERVAL); } } } catch (Exception e) { logger.error(e.getMessage(), e); } finally { clear(); } });
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
parseProcessOutputExecutorService.shutdown(); } /** * check yarn state * * @param appIds application id list * @return is success of yarn task state */ public boolean isSuccessOfYarnState(List<String> appIds) { boolean result = true; try { for (String appId : appIds) { logger.info("check yarn application status, appId:{}", appId); while (Stopper.isRunning()) { ExecutionStatus applicationStatus = HadoopUtils.getInstance().getApplicationStatus(appId); if (logger.isDebugEnabled()) { logger.debug("check yarn application status, appId:{}, final state:{}", appId, applicationStatus.name()); } if (applicationStatus.equals(ExecutionStatus.FAILURE) || applicationStatus.equals(ExecutionStatus.KILL)) { return false; } if (applicationStatus.equals(ExecutionStatus.SUCCESS)) { break; } ThreadUtils.sleep(Constants.SLEEP_TIME_MILLIS); } } } catch (Exception e) { logger.error("yarn applications: {} , query status failed, exception:{}", StringUtils.join(appIds, ","), e);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
result = false; } return result; } public int getProcessId() { return getProcessId(process); } /** * get app links * * @param logPath log path * @return app id list */ private List<String> getAppIds(String logPath) { List<String> logs = convertFile2List(logPath); List<String> appIds = new ArrayList<>(); /** * analysis log?get submited yarn application id */ for (String log : logs) { String appId = findAppId(log); if (StringUtils.isNotEmpty(appId) && !appIds.contains(appId)) { logger.info("find app id: {}", appId); appIds.add(appId); } } return appIds; } /** * convert file to list
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
* * @param filename file name * @return line list */ private List<String> convertFile2List(String filename) { List lineList = new ArrayList<String>(100); File file = new File(filename); if (!file.exists()) { return lineList; } BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(new FileInputStream(filename), StandardCharsets.UTF_8)); String line = null; while ((line = br.readLine()) != null) { lineList.add(line); } } catch (Exception e) { logger.error(String.format("read file: %s failed : ", filename), e); } finally { if (br != null) { try { br.close(); } catch (IOException e) { logger.error(e.getMessage(), e); } } } return lineList; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
/** * find app id * * @param line line * @return appid */ private String findAppId(String line) { Matcher matcher = APPLICATION_REGEX.matcher(line); if (matcher.find()) { return matcher.group(); } return null; } /** * get remain time(s) * * @return remain time */ private long getRemaintime() { long usedTime = (System.currentTimeMillis() - taskExecutionContext.getStartTime().getTime()) / 1000; long remainTime = taskExecutionContext.getTaskTimeout() - usedTime; if (remainTime < 0) { throw new RuntimeException("task execution time out"); } return remainTime; } /** * get process id * * @param process process
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
* @return process id */ private int getProcessId(Process process) { int processId = 0; try { Field f = process.getClass().getDeclaredField(Constants.PID); f.setAccessible(true); processId = f.getInt(process); } catch (Throwable e) { logger.error(e.getMessage(), e); } return processId; } /** * when log buffer siz or flush time reach condition , then flush * * @param lastFlushTime last flush time * @return last flush time */ private long flush(long lastFlushTime) { long now = System.currentTimeMillis(); /** * when log buffer siz or flush time reach condition , then flush */ if (logBuffer.size() >= Constants.DEFAULT_LOG_ROWS_NUM || now - lastFlushTime > Constants.DEFAULT_LOG_FLUSH_INTERVAL) { lastFlushTime = now; /** logHandler.accept(logBuffer); logBuffer.clear(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,469
[Improvement][Task] Improved shell task execution result log information
**Describe the question** Improved shell task execution result log information, adding process.waitFor() and process.exitValue() information to the original log ``` logger.info("process has exited, execute path:{}, processId:{} ,exitStatusCode:{}", taskExecutionContext.getExecutePath(), processId, result.getExitStatusCode()); ``` ``` logger.error("process has failure , exitStatusCode : {} , ready to kill ...", result.getExitStatusCode()); ``` **Which version of DolphinScheduler:** -[dev] easy to improvement #4124
https://github.com/apache/dolphinscheduler/issues/5469
https://github.com/apache/dolphinscheduler/pull/5691
bae047e4a38e4d0e985fad2fcc0d184cf9ca8b53
3b80760c42e4d3208349969a9ec9d5ee1ed86222
"2021-05-14T05:09:44Z"
java
"2021-06-25T01:13:26Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java
return lastFlushTime; } /** * close buffer reader * * @param inReader in reader */ private void close(BufferedReader inReader) { if (inReader != null) { try { inReader.close(); } catch (IOException e) { logger.error(e.getMessage(), e); } } } protected List<String> commandOptions() { return Collections.emptyList(); } protected abstract String buildCommandFilePath(); protected abstract String commandInterpreter(); protected abstract void createCommandFileIfNotExists(String execCommand, String commandFile) throws IOException; public String getTaskResultString() { return taskResultString; } public void setTaskResultString(String taskResultString) { this.taskResultString = taskResultString; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,702
[Improvement] [APIServer] When update the existing alarm plug-in instance, the api should use POST instead of GET
When update the existing alarm plug-in instance, the front-end and back-end interaction should use POST method instead of GET. ![image](https://user-images.githubusercontent.com/52202080/123516818-9bc73f00-d6d0-11eb-9186-4f3b2f8dad00.png)
https://github.com/apache/dolphinscheduler/issues/5702
https://github.com/apache/dolphinscheduler/pull/5703
b31ba7e18b89885c37c2129bf9b4816001f09e51
2d71930837092c52dc63a76941b19051ae38cc2e
"2021-06-26T14:53:59Z"
java
"2021-06-27T10:58:22Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.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.controller; import static org.apache.dolphinscheduler.api.enums.Status.CREATE_ALERT_PLUGIN_INSTANCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.DELETE_ALERT_PLUGIN_INSTANCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.GET_ALERT_PLUGIN_INSTANCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.LIST_PAGING_ALERT_PLUGIN_INSTANCE_ERROR;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,702
[Improvement] [APIServer] When update the existing alarm plug-in instance, the api should use POST instead of GET
When update the existing alarm plug-in instance, the front-end and back-end interaction should use POST method instead of GET. ![image](https://user-images.githubusercontent.com/52202080/123516818-9bc73f00-d6d0-11eb-9186-4f3b2f8dad00.png)
https://github.com/apache/dolphinscheduler/issues/5702
https://github.com/apache/dolphinscheduler/pull/5703
b31ba7e18b89885c37c2129bf9b4816001f09e51
2d71930837092c52dc63a76941b19051ae38cc2e
"2021-06-26T14:53:59Z"
java
"2021-06-27T10:58:22Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ALERT_PLUGIN_INSTANCE_ERROR; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.AlertPluginInstanceService; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import springfox.documentation.annotations.ApiIgnore; /** * alert plugin instance controller */ @Api(tags = "ALERT_PLUGIN_INSTANCE_TAG")
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,702
[Improvement] [APIServer] When update the existing alarm plug-in instance, the api should use POST instead of GET
When update the existing alarm plug-in instance, the front-end and back-end interaction should use POST method instead of GET. ![image](https://user-images.githubusercontent.com/52202080/123516818-9bc73f00-d6d0-11eb-9186-4f3b2f8dad00.png)
https://github.com/apache/dolphinscheduler/issues/5702
https://github.com/apache/dolphinscheduler/pull/5703
b31ba7e18b89885c37c2129bf9b4816001f09e51
2d71930837092c52dc63a76941b19051ae38cc2e
"2021-06-26T14:53:59Z"
java
"2021-06-27T10:58:22Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java
@RestController @RequestMapping("alert-plugin-instance") public class AlertPluginInstanceController extends BaseController { private static final Logger logger = LoggerFactory.getLogger(AlertPluginInstanceController.class); @Autowired private AlertPluginInstanceService alertPluginInstanceService; /** * create alert plugin instance * * @param loginUser login user * @param pluginDefineId alert plugin define id * @param instanceName instance name * @param pluginInstanceParams instance params * @return result */ @ApiOperation(value = "createAlertPluginInstance", notes = "CREATE_ALERT_PLUGIN_INSTANCE_NOTES") @ApiImplicitParams({
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,702
[Improvement] [APIServer] When update the existing alarm plug-in instance, the api should use POST instead of GET
When update the existing alarm plug-in instance, the front-end and back-end interaction should use POST method instead of GET. ![image](https://user-images.githubusercontent.com/52202080/123516818-9bc73f00-d6d0-11eb-9186-4f3b2f8dad00.png)
https://github.com/apache/dolphinscheduler/issues/5702
https://github.com/apache/dolphinscheduler/pull/5703
b31ba7e18b89885c37c2129bf9b4816001f09e51
2d71930837092c52dc63a76941b19051ae38cc2e
"2021-06-26T14:53:59Z"
java
"2021-06-27T10:58:22Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java
@ApiImplicitParam(name = "pluginDefineId", value = "ALERT_PLUGIN_DEFINE_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "instanceName", value = "ALERT_PLUGIN_INSTANCE_NAME", required = true, dataType = "String", example = "DING TALK"), @ApiImplicitParam(name = "pluginInstanceParams", value = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, dataType = "String", example = "ALERT_PLUGIN_INSTANCE_PARAMS") }) @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_ALERT_PLUGIN_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "pluginDefineId") int pluginDefineId, @RequestParam(value = "instanceName") String instanceName, @RequestParam(value = "pluginInstanceParams") String pluginInstanceParams) { Map<String, Object> result = alertPluginInstanceService.create(loginUser, pluginDefineId, instanceName, pluginInstanceParams); return returnDataList(result); } /** * updateAlertPluginInstance * * @param loginUser login user * @param alertPluginInstanceId alert plugin instance id * @param instanceName instance name * @param pluginInstanceParams instance params * @return result */ @ApiOperation(value = "update", notes = "UPDATE_ALERT_PLUGIN_INSTANCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "alertPluginInstanceId", value = "ALERT_PLUGIN_INSTANCE_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "instanceName", value = "ALERT_PLUGIN_INSTANCE_NAME", required = true, dataType = "String", example = "DING TALK"), @ApiImplicitParam(name = "pluginInstanceParams", value = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, dataType = "String", example = "ALERT_PLUGIN_INSTANCE_PARAMS") })
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,702
[Improvement] [APIServer] When update the existing alarm plug-in instance, the api should use POST instead of GET
When update the existing alarm plug-in instance, the front-end and back-end interaction should use POST method instead of GET. ![image](https://user-images.githubusercontent.com/52202080/123516818-9bc73f00-d6d0-11eb-9186-4f3b2f8dad00.png)
https://github.com/apache/dolphinscheduler/issues/5702
https://github.com/apache/dolphinscheduler/pull/5703
b31ba7e18b89885c37c2129bf9b4816001f09e51
2d71930837092c52dc63a76941b19051ae38cc2e
"2021-06-26T14:53:59Z"
java
"2021-06-27T10:58:22Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java
@GetMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_ALERT_PLUGIN_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "alertPluginInstanceId") int alertPluginInstanceId, @RequestParam(value = "instanceName") String instanceName, @RequestParam(value = "pluginInstanceParams") String pluginInstanceParams) { Map<String, Object> result = alertPluginInstanceService.update(loginUser, alertPluginInstanceId, instanceName, pluginInstanceParams); return returnDataList(result); } /** * deleteAlertPluginInstance * * @param loginUser login user * @param id id * @return result */ @ApiOperation(value = "delete", notes = "DELETE_ALERT_PLUGIN_INSTANCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "ALERT_PLUGIN_ID", required = true, dataType = "Int", example = "100") }) @GetMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_ALERT_PLUGIN_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id) { Map<String, Object> result = alertPluginInstanceService.delete(loginUser, id); return returnDataList(result);