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,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/DataxUtilsTest.java
/** * * Method: convertKeywordsColumns(DbType dbType, String[] columns) * */ @Test public void testConvertKeywordsColumns() throws Exception { String[] fromColumns = new String[]{"`select`", "from", "\"where\"", " table "}; String[] targetColumns = new String[]{"`select`", "`from`", "`where`", "`table`"}; String[] toColumns = DataxUtils.convertKeywordsColumns(DbType.MYSQL, fromColumns); assertTrue(fromColumns.length == toColumns.length); for (int i = 0; i < toColumns.length; i++) { assertEquals(targetColumns[i], toColumns[i]); } } /** * * Method: doConvertKeywordsColumn(DbType dbType, String column) * */ @Test public void testDoConvertKeywordsColumn() throws Exception { assertEquals("`select`", DataxUtils.doConvertKeywordsColumn(DbType.MYSQL, " \"`select`\" ")); assertEquals("\"select\"", DataxUtils.doConvertKeywordsColumn(DbType.POSTGRESQL, " \"`select`\" ")); assertEquals("`select`", DataxUtils.doConvertKeywordsColumn(DbType.SQLSERVER, " \"`select`\" ")); assertEquals("\"select\"", DataxUtils.doConvertKeywordsColumn(DbType.ORACLE, " \"`select`\" ")); assertEquals("select", DataxUtils.doConvertKeywordsColumn(DbType.DB2, " \"`select`\" ")); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.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.datax; import static org.apache.dolphinscheduler.common.enums.CommandType.START_PROCESS; import org.apache.dolphinscheduler.common.enums.DbType; import org.apache.dolphinscheduler.common.task.datax.DataxParameters; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.dao.datasource.BaseDataSource;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
import org.apache.dolphinscheduler.dao.datasource.DataSourceFactory; import org.apache.dolphinscheduler.dao.entity.DataSource; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.server.entity.DataxTaskExecutionContext; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.utils.DataxUtils; import org.apache.dolphinscheduler.server.worker.task.ShellCommandExecutor; import org.apache.dolphinscheduler.server.worker.task.TaskProps; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.service.process.ProcessService; import java.lang.reflect.Method; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.UUID; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; /** * DataxTask Tester. */ public class DataxTaskTest {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
private static final Logger logger = LoggerFactory.getLogger(DataxTaskTest.class); private static final String CONNECTION_PARAMS = " {\n" + " \"user\":\"root\",\n" + " \"password\":\"123456\",\n" + " \"address\":\"jdbc:mysql://127.0.0.1:3306\",\n" + " \"database\":\"test\",\n" + " \"jdbcUrl\":\"jdbc:mysql://127.0.0.1:3306/test\"\n" + "}"; private DataxTask dataxTask; private ProcessService processService; private ShellCommandExecutor shellCommandExecutor; private ApplicationContext applicationContext; private TaskExecutionContext taskExecutionContext; private final TaskProps props = new TaskProps(); @Before public void before() throws Exception { setTaskParems(0);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
} private void setTaskParems(Integer customConfig) { processService = Mockito.mock(ProcessService.class); shellCommandExecutor = Mockito.mock(ShellCommandExecutor.class); applicationContext = Mockito.mock(ApplicationContext.class); SpringApplicationContext springApplicationContext = new SpringApplicationContext(); springApplicationContext.setApplicationContext(applicationContext); Mockito.when(applicationContext.getBean(ProcessService.class)).thenReturn(processService); 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); if (customConfig == 1) { props.setTaskParams( "{\n" + " \"customConfig\":1,\n" + " \"localParams\":[\n" + " {\n" + " \"prop\":\"test\",\n" + " \"value\":\"38294729\"\n" + " }\n" + " ],\n" + " \"json\":\"" + "{\"job\":{\"setting\":{\"speed\":{\"byte\":1048576},\"errorLimit\":{\"record\":0,\"percentage\":0.02}},\"content\":[" + "{\"reader\":{\"name\":\"rdbmsreader\",\"parameter\":{\"username\":\"xxx\",\"password\":\"${test}\",\"column\":[\"id\",\"name\"],\"splitPk\":\"pk\",\"" + "connection\":[{\"querySql\":[\"SELECT * from dual\"],\"jdbcUrl\":[\"jdbc:dm://ip:port/database\"]}],\"fetchSize\":1024,\"where\":\"1 = 1\"}},\""
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
+ "writer\":{\"name\":\"streamwriter\",\"parameter\":{\"print\":true}}}]}}\"\n" + "}"); } else { props.setTaskParams( "{\n" + " \"customConfig\":0,\n" + " \"targetTable\":\"test\",\n" + " \"postStatements\":[\n" + " \"delete from test\"\n" + " ],\n" + " \"jobSpeedByte\":0,\n" + " \"jobSpeedRecord\":1000,\n" + " \"dtType\":\"MYSQL\",\n" + " \"dataSource\":1,\n" + " \"dsType\":\"MYSQL\",\n" + " \"dataTarget\":2,\n" + " \"sql\":\"select 1 as test from dual\",\n" + " \"preStatements\":[\n" + " \"delete from test\"\n" + " ]\n" + "}"); } taskExecutionContext = Mockito.mock(TaskExecutionContext.class); Mockito.when(taskExecutionContext.getTaskParams()).thenReturn(props.getTaskParams()); Mockito.when(taskExecutionContext.getExecutePath()).thenReturn("/tmp"); Mockito.when(taskExecutionContext.getTaskAppId()).thenReturn(UUID.randomUUID().toString()); Mockito.when(taskExecutionContext.getTenantCode()).thenReturn("root"); Mockito.when(taskExecutionContext.getStartTime()).thenReturn(new Date()); Mockito.when(taskExecutionContext.getTaskTimeout()).thenReturn(10000); Mockito.when(taskExecutionContext.getLogPath()).thenReturn("/tmp/dx");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
DataxTaskExecutionContext dataxTaskExecutionContext = new DataxTaskExecutionContext(); dataxTaskExecutionContext.setSourcetype(0); dataxTaskExecutionContext.setTargetType(0); dataxTaskExecutionContext.setSourceConnectionParams(CONNECTION_PARAMS); dataxTaskExecutionContext.setTargetConnectionParams(CONNECTION_PARAMS); Mockito.when(taskExecutionContext.getDataxTaskExecutionContext()).thenReturn(dataxTaskExecutionContext); dataxTask = PowerMockito.spy(new DataxTask(taskExecutionContext, logger)); dataxTask.init(); props.setCmdTypeIfComplement(START_PROCESS); Mockito.when(processService.findDataSourceById(1)).thenReturn(getDataSource()); Mockito.when(processService.findDataSourceById(2)).thenReturn(getDataSource()); Mockito.when(processService.findProcessInstanceByTaskId(1)).thenReturn(getProcessInstance()); String fileName = String.format("%s/%s_node.sh", props.getExecutePath(), props.getTaskAppId()); try { Mockito.when(shellCommandExecutor.run(fileName)).thenReturn(null); } catch (Exception e) { e.printStackTrace(); } dataxTask = PowerMockito.spy(new DataxTask(taskExecutionContext, logger)); dataxTask.init(); } private DataSource getDataSource() { DataSource dataSource = new DataSource(); dataSource.setType(DbType.MYSQL); dataSource.setConnectionParams(CONNECTION_PARAMS); dataSource.setUserId(1); return dataSource; } private ProcessInstance getProcessInstance() { ProcessInstance processInstance = new ProcessInstance();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
processInstance.setCommandType(START_PROCESS); processInstance.setScheduleTime(new Date()); return processInstance; } @After public void after() throws Exception { } /** * Method: DataxTask() */ @Test public void testDataxTask() throws Exception { TaskProps props = new TaskProps(); props.setExecutePath("/tmp"); props.setTaskAppId(String.valueOf(System.currentTimeMillis())); props.setTaskInstanceId(1); props.setTenantCode("1"); Assert.assertNotNull(new DataxTask(null, logger)); } /** * Method: init */ @Test public void testInit() throws Exception { try { dataxTask.init(); } catch (Exception e) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
Assert.fail(e.getMessage()); } } /** * Method: handle() */ @Test public void testHandle() throws Exception { } /** * Method: cancelApplication() */ @Test public void testCancelApplication() throws Exception { try { dataxTask.cancelApplication(true); } catch (Exception e) { Assert.fail(e.getMessage()); } } /** * Method: parsingSqlColumnNames(DbType dsType, DbType dtType, BaseDataSource * dataSourceCfg, String sql) */ @Test public void testParsingSqlColumnNames() throws Exception { try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
BaseDataSource dataSource = DataSourceFactory.getDatasource(getDataSource().getType(), getDataSource().getConnectionParams()); Method method = DataxTask.class.getDeclaredMethod("parsingSqlColumnNames", DbType.class, DbType.class, BaseDataSource.class, String.class); method.setAccessible(true); String[] columns = (String[]) method.invoke(dataxTask, DbType.MYSQL, DbType.MYSQL, dataSource, "select 1 as a, 2 as `table` from dual"); Assert.assertNotNull(columns); Assert.assertTrue(columns.length == 2); Assert.assertEquals("[`a`, `table`]", Arrays.toString(columns)); } catch (Exception e) { Assert.fail(e.getMessage()); } } /** * Method: tryGrammaticalParsingSqlColumnNames(DbType dbType, String sql) */ @Test public void testTryGrammaticalAnalysisSqlColumnNames() throws Exception { try { Method method = DataxTask.class.getDeclaredMethod("tryGrammaticalAnalysisSqlColumnNames", DbType.class, String.class); method.setAccessible(true); String[] columns = (String[]) method.invoke(dataxTask, DbType.MYSQL, "select t1.a, t1.b from test t1 union all select a, t2.b from (select a, b from test) t2"); Assert.assertNotNull(columns); Assert.assertTrue(columns.length == 2); Assert.assertEquals("[a, b]", Arrays.toString(columns)); } catch (Exception e) { Assert.fail(e.getMessage()); } } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
* Method: tryExecuteSqlResolveColumnNames(BaseDataSource baseDataSource, * String sql) */ @Test public void testTryExecuteSqlResolveColumnNames() throws Exception { } /** * Method: buildDataxJsonFile() */ @Test public void testBuildDataxJsonFile() throws Exception { try { setTaskParems(1); Method method = DataxTask.class.getDeclaredMethod("buildDataxJsonFile"); method.setAccessible(true); String filePath = (String) method.invoke(dataxTask, null); Assert.assertNotNull(filePath); } catch (Exception e) { Assert.fail(e.getMessage()); } } /** * Method: buildDataxJsonFile() */ @Test public void testBuildDataxJsonFile0() throws Exception {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
try { setTaskParems(0); Method method = DataxTask.class.getDeclaredMethod("buildDataxJsonFile"); method.setAccessible(true); String filePath = (String) method.invoke(dataxTask, null); Assert.assertNotNull(filePath); } catch (Exception e) { Assert.fail(e.getMessage()); } } /** * Method: buildDataxJobContentJson() */ @Test public void testBuildDataxJobContentJson() throws Exception { try { Method method = DataxTask.class.getDeclaredMethod("buildDataxJobContentJson"); method.setAccessible(true); List<ObjectNode> contentList = (List<ObjectNode>) method.invoke(dataxTask, null); Assert.assertNotNull(contentList); ObjectNode content = contentList.get(0); JsonNode reader = JSONUtils.parseObject(content.path("reader").asText()); Assert.assertNotNull(reader); String readerPluginName = reader.path("name").asText(); Assert.assertEquals(DataxUtils.DATAX_READER_PLUGIN_MYSQL, readerPluginName); JsonNode writer = JSONUtils.parseObject(content.path("writer").asText()); Assert.assertNotNull(writer); String writerPluginName = writer.path("name").asText(); Assert.assertEquals(DataxUtils.DATAX_WRITER_PLUGIN_MYSQL, writerPluginName);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
} catch (Exception e) { Assert.fail(e.getMessage()); } } /** * Method: buildDataxJobSettingJson() */ @Test public void testBuildDataxJobSettingJson() throws Exception { try { Method method = DataxTask.class.getDeclaredMethod("buildDataxJobSettingJson"); method.setAccessible(true); JsonNode setting = (JsonNode) method.invoke(dataxTask, null); Assert.assertNotNull(setting); Assert.assertNotNull(setting.get("speed")); Assert.assertNotNull(setting.get("errorLimit")); } catch (Exception e) { Assert.fail(e.getMessage()); } } /** * Method: buildDataxCoreJson() */ @Test public void testBuildDataxCoreJson() throws Exception { try { Method method = DataxTask.class.getDeclaredMethod("buildDataxCoreJson"); method.setAccessible(true);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
ObjectNode coreConfig = (ObjectNode) method.invoke(dataxTask, null); Assert.assertNotNull(coreConfig); Assert.assertNotNull(coreConfig.get("transport")); } catch (Exception e) { Assert.fail(e.getMessage()); } } /** * Method: buildShellCommandFile(String jobConfigFilePath) */ @Test public void testBuildShellCommandFile() throws Exception { try { Method method = DataxTask.class.getDeclaredMethod("buildShellCommandFile", String.class); method.setAccessible(true); Assert.assertNotNull(method.invoke(dataxTask, "test.json")); } catch (Exception e) { Assert.fail(e.getMessage()); } } /** * Method: getParameters */ @Test public void testGetParameters() throws Exception { Assert.assertTrue(dataxTask.getParameters() != null); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,180
[Improvement][Module Name] DataX Node doesn't Support Clickhouse as the datasource
**Describe the question** When I create a DataX node, I can't use a Clickhouse Datasource as the source or the target in a DataX task. Currently, I can only select from Mysql, Postgresql,Oracle ans Sqlserver. ![image](https://user-images.githubusercontent.com/23460917/112953652-3d8dcd00-9170-11eb-87e2-029ab4d56939.png) **Describe alternatives you've considered** I hope I can't use Clickhouse as my datasource.
https://github.com/apache/dolphinscheduler/issues/5180
https://github.com/apache/dolphinscheduler/pull/5243
faa111674fb77bc8e4486e62a578b129e403012b
cc7a4446f50a247f054a9671648e948c654dfe65
"2021-03-30T07:54:54Z"
java
"2021-04-14T03:31:40Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java
* Method: notNull(Object obj, String message) */ @Test public void testNotNull() throws Exception { try { Method method = DataxTask.class.getDeclaredMethod("notNull", Object.class, String.class); method.setAccessible(true); method.invoke(dataxTask, "abc", "test throw RuntimeException"); } catch (Exception e) { Assert.fail(e.getMessage()); } } @Test public void testLoadJvmEnv() { DataxTask dataxTask = new DataxTask(null,null); DataxParameters dataxParameters = new DataxParameters(); dataxParameters.setXms(0); dataxParameters.setXmx(-100); String actual = dataxTask.loadJvmEnv(dataxParameters); String except = " --jvm=\"-Xms1G -Xmx1G\" "; Assert.assertEquals(except,actual); dataxParameters.setXms(13); dataxParameters.setXmx(14); actual = dataxTask.loadJvmEnv(dataxParameters); except = " --jvm=\"-Xms13G -Xmx14G\" "; Assert.assertEquals(except,actual); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,235
[Improvement][ApiServer] Traffic limit
**Describe the question** After support OpenAPI, it is necessary to control the traffic, otherwise the service may be breakdown. **What are the current deficiencies and the benefits of improvement** - Maybe we can add global request rate limit. And in the future, we can consider to support tenant-level rate control **Which version of DolphinScheduler:** -[1.3.6-preview]
https://github.com/apache/dolphinscheduler/issues/5235
https://github.com/apache/dolphinscheduler/pull/5307
07e612c8777447349ed074ec7bb4384c647df1d8
7843ed40873bcb4b7f2e1b05f5773e1fc2efa51f
"2021-04-08T13:44:34Z"
java
"2021-04-16T14:41:02Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,235
[Improvement][ApiServer] Traffic limit
**Describe the question** After support OpenAPI, it is necessary to control the traffic, otherwise the service may be breakdown. **What are the current deficiencies and the benefits of improvement** - Maybe we can add global request rate limit. And in the future, we can consider to support tenant-level rate control **Which version of DolphinScheduler:** -[1.3.6-preview]
https://github.com/apache/dolphinscheduler/issues/5235
https://github.com/apache/dolphinscheduler/pull/5307
07e612c8777447349ed074ec7bb4384c647df1d8
7843ed40873bcb4b7f2e1b05f5773e1fc2efa51f
"2021-04-08T13:44:34Z"
java
"2021-04-16T14:41:02Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java
* limitations under the License. */ package org.apache.dolphinscheduler.api.configuration; import org.apache.dolphinscheduler.api.interceptor.LocaleChangeInterceptor; import org.apache.dolphinscheduler.api.interceptor.LoginHandlerInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.CorsFilter; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.i18n.CookieLocaleResolver; import java.util.Locale; /** * application configuration */ @Configuration public class AppConfiguration implements WebMvcConfigurer { public static final String LOGIN_INTERCEPTOR_PATH_PATTERN = "/**/*"; public static final String LOGIN_PATH_PATTERN = "/login"; public static final String REGISTER_PATH_PATTERN = "/users/register"; public static final String PATH_PATTERN = "/**"; public static final String LOCALE_LANGUAGE_COOKIE = "language"; @Bean public CorsFilter corsFilter() { CorsConfiguration config = new CorsConfiguration(); config.addAllowedOrigin("*"); config.addAllowedMethod("*"); config.addAllowedHeader("*");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,235
[Improvement][ApiServer] Traffic limit
**Describe the question** After support OpenAPI, it is necessary to control the traffic, otherwise the service may be breakdown. **What are the current deficiencies and the benefits of improvement** - Maybe we can add global request rate limit. And in the future, we can consider to support tenant-level rate control **Which version of DolphinScheduler:** -[1.3.6-preview]
https://github.com/apache/dolphinscheduler/issues/5235
https://github.com/apache/dolphinscheduler/pull/5307
07e612c8777447349ed074ec7bb4384c647df1d8
7843ed40873bcb4b7f2e1b05f5773e1fc2efa51f
"2021-04-08T13:44:34Z"
java
"2021-04-16T14:41:02Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource(); configSource.registerCorsConfiguration(PATH_PATTERN, config); return new CorsFilter(configSource); } @Bean public LoginHandlerInterceptor loginInterceptor() { return new LoginHandlerInterceptor(); } /** * Cookie * @return local resolver */ @Bean(name = "localeResolver") public LocaleResolver localeResolver() { CookieLocaleResolver localeResolver = new CookieLocaleResolver(); localeResolver.setCookieName(LOCALE_LANGUAGE_COOKIE); localeResolver.setDefaultLocale(Locale.US); localeResolver.setLanguageTagCompliant(false); return localeResolver; } @Bean public LocaleChangeInterceptor localeChangeInterceptor() { return new LocaleChangeInterceptor(); } @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(localeChangeInterceptor());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,235
[Improvement][ApiServer] Traffic limit
**Describe the question** After support OpenAPI, it is necessary to control the traffic, otherwise the service may be breakdown. **What are the current deficiencies and the benefits of improvement** - Maybe we can add global request rate limit. And in the future, we can consider to support tenant-level rate control **Which version of DolphinScheduler:** -[1.3.6-preview]
https://github.com/apache/dolphinscheduler/issues/5235
https://github.com/apache/dolphinscheduler/pull/5307
07e612c8777447349ed074ec7bb4384c647df1d8
7843ed40873bcb4b7f2e1b05f5773e1fc2efa51f
"2021-04-08T13:44:34Z"
java
"2021-04-16T14:41:02Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java
registry.addInterceptor(loginInterceptor()) .addPathPatterns(LOGIN_INTERCEPTOR_PATH_PATTERN) .excludePathPatterns(LOGIN_PATH_PATTERN, REGISTER_PATH_PATTERN, "/swagger-resources/**", "/webjars/**", "/v2/**", "/doc.html", "/swagger-ui.html", "*.html", "/ui/**"); } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); registry.addResourceHandler("/ui/**").addResourceLocations("file:ui/"); } @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/ui/").setViewName("forward:/ui/index.html"); registry.addViewController("/").setViewName("forward:/ui/index.html"); } /** * Turn off suffix-based content negotiation * * @param configurer configurer */ @Override public void configureContentNegotiation(final ContentNegotiationConfigurer configurer) { configurer.favorPathExtension(false); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.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.service.process; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_EMPTY_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_FATHER_PARAMS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_DEFINE_ID; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID; import static org.apache.dolphinscheduler.common.Constants.LOCAL_PARAMS; import static org.apache.dolphinscheduler.common.Constants.YYYY_MM_DD_HH_MM_SS; import static java.util.stream.Collectors.toSet;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.AuthorizationType; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.CycleEnum; import org.apache.dolphinscheduler.common.enums.Direct; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.FailureStrategy; import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.ResourceType; import org.apache.dolphinscheduler.common.enums.TaskDependType; import org.apache.dolphinscheduler.common.enums.TaskType; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.model.DateInterval; import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.process.Property; import org.apache.dolphinscheduler.common.task.conditions.ConditionsParameters; import org.apache.dolphinscheduler.common.task.subprocess.SubProcessParameters; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.DateUtils; 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.entity.Command; import org.apache.dolphinscheduler.dao.entity.CycleDependency; import org.apache.dolphinscheduler.dao.entity.DataSource; import org.apache.dolphinscheduler.dao.entity.ErrorCommand; import org.apache.dolphinscheduler.dao.entity.ProcessData; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.ProcessInstanceMap;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.dao.entity.Project; import org.apache.dolphinscheduler.dao.entity.ProjectUser; import org.apache.dolphinscheduler.dao.entity.Resource; import org.apache.dolphinscheduler.dao.entity.Schedule; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.entity.Tenant; import org.apache.dolphinscheduler.dao.entity.UdfFunc; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.mapper.CommandMapper; import org.apache.dolphinscheduler.dao.mapper.DataSourceMapper; import org.apache.dolphinscheduler.dao.mapper.ErrorCommandMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper; import org.apache.dolphinscheduler.dao.mapper.ScheduleMapper; import org.apache.dolphinscheduler.dao.mapper.TaskInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.TenantMapper; import org.apache.dolphinscheduler.dao.mapper.UdfFuncMapper; import org.apache.dolphinscheduler.dao.mapper.UserMapper; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.service.log.LogClientService; import org.apache.dolphinscheduler.service.quartz.cron.CronUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Date; import java.util.EnumMap;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import org.quartz.CronExpression; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import com.cronutils.model.Cron; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; /** * process relative dao that some mappers in this. */ @Component public class ProcessService { private final Logger logger = LoggerFactory.getLogger(getClass()); private final int[] stateArray = new int[]{ExecutionStatus.SUBMITTED_SUCCESS.ordinal(), ExecutionStatus.RUNNING_EXECUTION.ordinal(), ExecutionStatus.DELAY_EXECUTION.ordinal(), ExecutionStatus.READY_PAUSE.ordinal(), ExecutionStatus.READY_STOP.ordinal()}; @Autowired
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
private UserMapper userMapper; @Autowired private ProcessDefinitionMapper processDefineMapper; @Autowired private ProcessInstanceMapper processInstanceMapper; @Autowired private DataSourceMapper dataSourceMapper; @Autowired private ProcessInstanceMapMapper processInstanceMapMapper; @Autowired private TaskInstanceMapper taskInstanceMapper; @Autowired private CommandMapper commandMapper; @Autowired private ScheduleMapper scheduleMapper; @Autowired private UdfFuncMapper udfFuncMapper; @Autowired private ResourceMapper resourceMapper; @Autowired private ResourceUserMapper resourceUserMapper; @Autowired private ErrorCommandMapper errorCommandMapper; @Autowired private TenantMapper tenantMapper; @Autowired private ProjectMapper projectMapper; /** * handle Command (construct ProcessInstance from Command) , wrapped in transaction *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param logger logger * @param host host * @param validThreadNum validThreadNum * @param command found command * @return process instance */ @Transactional(rollbackFor = Exception.class) public ProcessInstance handleCommand(Logger logger, String host, int validThreadNum, Command command) { ProcessInstance processInstance = constructProcessInstance(command, host); if (processInstance == null) { logger.error("scan command, command parameter is error: {}", command); moveToErrorCommand(command, "process instance is null"); return null; } if (!checkThreadNum(command, validThreadNum)) { logger.info("there is not enough thread for this command: {}", command); return setWaitingThreadProcess(command, processInstance); } processInstance.setCommandType(command.getCommandType()); processInstance.addHistoryCmd(command.getCommandType()); saveProcessInstance(processInstance); this.setSubProcessParam(processInstance); delCommandById(command.getId()); return processInstance; } /** * save error command, and delete original command * * @param command command
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param message message */ @Transactional(rollbackFor = Exception.class) public void moveToErrorCommand(Command command, String message) { ErrorCommand errorCommand = new ErrorCommand(command, message); this.errorCommandMapper.insert(errorCommand); delCommandById(command.getId()); } /** * set process waiting thread * * @param command command * @param processInstance processInstance * @return process instance */ private ProcessInstance setWaitingThreadProcess(Command command, ProcessInstance processInstance) { processInstance.setState(ExecutionStatus.WAITTING_THREAD); if (command.getCommandType() != CommandType.RECOVER_WAITTING_THREAD) { processInstance.addHistoryCmd(command.getCommandType()); } saveProcessInstance(processInstance); this.setSubProcessParam(processInstance); createRecoveryWaitingThreadCommand(command, processInstance); return null; } /** * check thread num * * @param command command * @param validThreadNum validThreadNum
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @return if thread is enough */ private boolean checkThreadNum(Command command, int validThreadNum) { int commandThreadCount = this.workProcessThreadNumCount(command.getProcessDefinitionId()); return validThreadNum >= commandThreadCount; } /** * insert one command * * @param command command * @return create result */ public int createCommand(Command command) { int result = 0; if (command != null) { result = commandMapper.insert(command); } return result; } /** * find one command from queue list * * @return command */ public Command findOneCommand() { return commandMapper.getOneToRun(); } /** * check the input command exists in queue list *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param command command * @return create command result */ public boolean verifyIsNeedCreateCommand(Command command) { boolean isNeedCreate = true; EnumMap<CommandType, Integer> cmdTypeMap = new EnumMap<>(CommandType.class); cmdTypeMap.put(CommandType.REPEAT_RUNNING, 1); cmdTypeMap.put(CommandType.RECOVER_SUSPENDED_PROCESS, 1); cmdTypeMap.put(CommandType.START_FAILURE_TASK_PROCESS, 1); CommandType commandType = command.getCommandType(); if (cmdTypeMap.containsKey(commandType)) { ObjectNode cmdParamObj = JSONUtils.parseObject(command.getCommandParam()); int processInstanceId = cmdParamObj.path(CMD_PARAM_RECOVER_PROCESS_ID_STRING).asInt(); List<Command> commands = commandMapper.selectList(null); for (Command tmpCommand : commands) { if (cmdTypeMap.containsKey(tmpCommand.getCommandType())) { ObjectNode tempObj = JSONUtils.parseObject(tmpCommand.getCommandParam()); if (tempObj != null && processInstanceId == tempObj.path(CMD_PARAM_RECOVER_PROCESS_ID_STRING).asInt()) { isNeedCreate = false; break; } } } } return isNeedCreate; } /** * find process instance detail by id *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param processId processId * @return process instance */ public ProcessInstance findProcessInstanceDetailById(int processId) { return processInstanceMapper.queryDetailById(processId); } /** * get task node list by definitionId */ public List<TaskNode> getTaskNodeListByDefinitionId(Integer defineId) { ProcessDefinition processDefinition = processDefineMapper.selectById(defineId); if (processDefinition == null) { logger.info("process define not exists"); return null; } String processDefinitionJson = processDefinition.getProcessDefinitionJson(); ProcessData processData = JSONUtils.parseObject(processDefinitionJson, ProcessData.class); if (null == processData) { logger.error("process data is null"); return new ArrayList<>(); } return processData.getTasks(); } /** * find process instance by id * * @param processId processId * @return process instance */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
public ProcessInstance findProcessInstanceById(int processId) { return processInstanceMapper.selectById(processId); } /** * find process define by id. * * @param processDefinitionId processDefinitionId * @return process definition */ public ProcessDefinition findProcessDefineById(int processDefinitionId) { return processDefineMapper.selectById(processDefinitionId); } /** * delete work process instance by id * * @param processInstanceId processInstanceId * @return delete process instance result */ public int deleteWorkProcessInstanceById(int processInstanceId) { return processInstanceMapper.deleteById(processInstanceId); } /** * delete all sub process by parent instance id * * @param processInstanceId processInstanceId * @return delete all sub process instance result */ public int deleteAllSubWorkProcessByParentId(int processInstanceId) { List<Integer> subProcessIdList = processInstanceMapMapper.querySubIdListByParentId(processInstanceId); for (Integer subId : subProcessIdList) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
deleteAllSubWorkProcessByParentId(subId); deleteWorkProcessMapByParentId(subId); removeTaskLogFile(subId); deleteWorkProcessInstanceById(subId); } return 1; } /** * remove task log file * * @param processInstanceId processInstanceId */ public void removeTaskLogFile(Integer processInstanceId) { LogClientService logClient = null; try { logClient = new LogClientService(); List<TaskInstance> taskInstanceList = findValidTaskListByProcessId(processInstanceId); if (CollectionUtils.isEmpty(taskInstanceList)) { return; } for (TaskInstance taskInstance : taskInstanceList) { String taskLogPath = taskInstance.getLogPath(); if (StringUtils.isEmpty(taskInstance.getHost())) { continue; } int port = Constants.RPC_PORT; String ip = ""; try { ip = Host.of(taskInstance.getHost()).getIp(); } catch (Exception e) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
ip = taskInstance.getHost(); } logClient.removeTaskLog(ip, port, taskLogPath); } } finally { if (logClient != null) { logClient.close(); } } } /** * calculate sub process number in the process define. * * @param processDefinitionId processDefinitionId * @return process thread num count */ private Integer workProcessThreadNumCount(Integer processDefinitionId) { List<Integer> ids = new ArrayList<>(); recurseFindSubProcessId(processDefinitionId, ids); return ids.size() + 1; } /** * recursive query sub process definition id by parent id. * * @param parentId parentId * @param ids ids */ public void recurseFindSubProcessId(int parentId, List<Integer> ids) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
ProcessDefinition processDefinition = processDefineMapper.selectById(parentId); String processDefinitionJson = processDefinition.getProcessDefinitionJson(); ProcessData processData = JSONUtils.parseObject(processDefinitionJson, ProcessData.class); List<TaskNode> taskNodeList = processData.getTasks(); if (taskNodeList != null && !taskNodeList.isEmpty()) { for (TaskNode taskNode : taskNodeList) { String parameter = taskNode.getParams(); ObjectNode parameterJson = JSONUtils.parseObject(parameter); if (parameterJson.get(CMD_PARAM_SUB_PROCESS_DEFINE_ID) != null) { SubProcessParameters subProcessParam = JSONUtils.parseObject(parameter, SubProcessParameters.class); ids.add(subProcessParam.getProcessDefinitionId()); recurseFindSubProcessId(subProcessParam.getProcessDefinitionId(), ids); } } } } /** * create recovery waiting thread command when thread pool is not enough for the process instance. * sub work process instance need not to create recovery command. * create recovery waiting thread command and delete origin command at the same time. * if the recovery command is exists, only update the field update_time * * @param originCommand originCommand * @param processInstance processInstance */ public void createRecoveryWaitingThreadCommand(Command originCommand, ProcessInstance processInstance) { if (processInstance.getIsSubProcess() == Flag.YES) { if (originCommand != null) { commandMapper.deleteById(originCommand.getId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} return; } Map<String, String> cmdParam = new HashMap<>(); cmdParam.put(Constants.CMD_PARAM_RECOVERY_WAITING_THREAD, String.valueOf(processInstance.getId())); if (originCommand == null) { Command command = new Command( CommandType.RECOVER_WAITTING_THREAD, processInstance.getTaskDependType(), processInstance.getFailureStrategy(), processInstance.getExecutorId(), processInstance.getProcessDefinitionId(), JSONUtils.toJsonString(cmdParam), processInstance.getWarningType(), processInstance.getWarningGroupId(), processInstance.getScheduleTime(), processInstance.getWorkerGroup(), processInstance.getProcessInstancePriority() ); saveCommand(command); return; } if (originCommand.getCommandType() == CommandType.RECOVER_WAITTING_THREAD) { originCommand.setUpdateTime(new Date()); saveCommand(originCommand); } else { commandMapper.deleteById(originCommand.getId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
originCommand.setId(0); originCommand.setCommandType(CommandType.RECOVER_WAITTING_THREAD); originCommand.setUpdateTime(new Date()); originCommand.setCommandParam(JSONUtils.toJsonString(cmdParam)); originCommand.setProcessInstancePriority(processInstance.getProcessInstancePriority()); saveCommand(originCommand); } } /** * get schedule time from command * * @param command command * @param cmdParam cmdParam map * @return date */ private Date getScheduleTime(Command command, Map<String, String> cmdParam) { Date scheduleTime = command.getScheduleTime(); if (scheduleTime == null && cmdParam != null && cmdParam.containsKey(CMDPARAM_COMPLEMENT_DATA_START_DATE)) { scheduleTime = DateUtils.stringToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE)); } return scheduleTime; } /** * generate a new work process instance from command. * * @param processDefinition processDefinition * @param command command * @param cmdParam cmdParam map * @return process instance */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
private ProcessInstance generateNewProcessInstance(ProcessDefinition processDefinition, Command command, Map<String, String> cmdParam) { ProcessInstance processInstance = new ProcessInstance(processDefinition); processInstance.setState(ExecutionStatus.RUNNING_EXECUTION); processInstance.setRecovery(Flag.NO); processInstance.setStartTime(new Date()); processInstance.setRunTimes(1); processInstance.setMaxTryTimes(0); processInstance.setProcessDefinitionId(command.getProcessDefinitionId()); processInstance.setCommandParam(command.getCommandParam()); processInstance.setCommandType(command.getCommandType()); processInstance.setIsSubProcess(Flag.NO); processInstance.setTaskDependType(command.getTaskDependType()); processInstance.setFailureStrategy(command.getFailureStrategy()); processInstance.setExecutorId(command.getExecutorId()); WarningType warningType = command.getWarningType() == null ? WarningType.NONE : command.getWarningType(); processInstance.setWarningType(warningType); Integer warningGroupId = command.getWarningGroupId() == null ? 0 : command.getWarningGroupId(); processInstance.setWarningGroupId(warningGroupId); Date scheduleTime = getScheduleTime(command, cmdParam); if (scheduleTime != null) { processInstance.setScheduleTime(scheduleTime); } processInstance.setCommandStartTime(command.getStartTime()); processInstance.setLocations(processDefinition.getLocations()); processInstance.setConnects(processDefinition.getConnects()); setGlobalParamIfCommanded(processDefinition,cmdParam);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
processInstance.setGlobalParams(ParameterUtils.curingGlobalParams( processDefinition.getGlobalParamMap(), processDefinition.getGlobalParamList(), getCommandTypeIfComplement(processInstance, command), processInstance.getScheduleTime())); processInstance.setProcessInstanceJson(processDefinition.getProcessDefinitionJson()); processInstance.setProcessInstancePriority(command.getProcessInstancePriority()); String workerGroup = StringUtils.isBlank(command.getWorkerGroup()) ? Constants.DEFAULT_WORKER_GROUP : command.getWorkerGroup(); processInstance.setWorkerGroup(workerGroup); processInstance.setTimeout(processDefinition.getTimeout()); processInstance.setTenantId(processDefinition.getTenantId()); return processInstance; } private void setGlobalParamIfCommanded(ProcessDefinition processDefinition, Map<String, String> cmdParam) { Map<String, String> startParamMap = new HashMap<>(); if (cmdParam != null && cmdParam.containsKey(Constants.CMD_PARAM_START_PARAMS)) { String startParamJson = cmdParam.get(Constants.CMD_PARAM_START_PARAMS); startParamMap = JSONUtils.toMap(startParamJson); } Map<String, String> fatherParamMap = new HashMap<>(); if (cmdParam != null && cmdParam.containsKey(Constants.CMD_PARAM_FATHER_PARAMS)) { String fatherParamJson = cmdParam.get(Constants.CMD_PARAM_FATHER_PARAMS); fatherParamMap = JSONUtils.toMap(fatherParamJson); } startParamMap.putAll(fatherParamMap);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (startParamMap.size() > 0 && processDefinition.getGlobalParamMap() != null) { for (Map.Entry<String, String> param : processDefinition.getGlobalParamMap().entrySet()) { String val = startParamMap.get(param.getKey()); if (val != null) { param.setValue(val); } } } } /** * get process tenant * there is tenant id in definition, use the tenant of the definition. * if there is not tenant id in the definiton or the tenant not exist * use definition creator's tenant. * * @param tenantId tenantId * @param userId userId * @return tenant */ public Tenant getTenantForProcess(int tenantId, int userId) { Tenant tenant = null; if (tenantId >= 0) { tenant = tenantMapper.queryById(tenantId); } if (userId == 0) { return null; } if (tenant == null) { User user = userMapper.selectById(userId);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
tenant = tenantMapper.queryById(user.getTenantId()); } return tenant; } /** * check command parameters is valid * * @param command command * @param cmdParam cmdParam map * @return whether command param is valid */ private Boolean checkCmdParam(Command command, Map<String, String> cmdParam) { if (command.getTaskDependType() == TaskDependType.TASK_ONLY || command.getTaskDependType() == TaskDependType.TASK_PRE) { if (cmdParam == null || !cmdParam.containsKey(Constants.CMD_PARAM_START_NODE_NAMES) || cmdParam.get(Constants.CMD_PARAM_START_NODE_NAMES).isEmpty()) { logger.error("command node depend type is {}, but start nodes is null ", command.getTaskDependType()); return false; } } return true; } /** * construct process instance according to one command. * * @param command command * @param host host * @return process instance */ private ProcessInstance constructProcessInstance(Command command, String host) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
ProcessInstance processInstance = null; CommandType commandType = command.getCommandType(); Map<String, String> cmdParam = JSONUtils.toMap(command.getCommandParam()); ProcessDefinition processDefinition = null; if (command.getProcessDefinitionId() != 0) { processDefinition = processDefineMapper.selectById(command.getProcessDefinitionId()); if (processDefinition == null) { logger.error("cannot find the work process define! define id : {}", command.getProcessDefinitionId()); return null; } } if (cmdParam != null) { Integer processInstanceId = 0; if (cmdParam.containsKey(Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING)) { String processId = cmdParam.get(Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING); processInstanceId = Integer.parseInt(processId); if (processInstanceId == 0) { logger.error("command parameter is error, [ ProcessInstanceId ] is 0"); return null; } } else if (cmdParam.containsKey(Constants.CMD_PARAM_SUB_PROCESS)) { String pId = cmdParam.get(Constants.CMD_PARAM_SUB_PROCESS); processInstanceId = Integer.parseInt(pId); } else if (cmdParam.containsKey(Constants.CMD_PARAM_RECOVERY_WAITING_THREAD)) { String pId = cmdParam.get(Constants.CMD_PARAM_RECOVERY_WAITING_THREAD); processInstanceId = Integer.parseInt(pId); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (processInstanceId == 0) { processInstance = generateNewProcessInstance(processDefinition, command, cmdParam); } else { processInstance = this.findProcessInstanceDetailById(processInstanceId); CommandType commandTypeIfComplement = getCommandTypeIfComplement(processInstance, command); if (commandTypeIfComplement == CommandType.REPEAT_RUNNING) { setGlobalParamIfCommanded(processDefinition, cmdParam); } processInstance.setGlobalParams(ParameterUtils.curingGlobalParams( processDefinition.getGlobalParamMap(), processDefinition.getGlobalParamList(), commandTypeIfComplement, processInstance.getScheduleTime())); } processDefinition = processDefineMapper.selectById(processInstance.getProcessDefinitionId()); processInstance.setProcessDefinition(processDefinition); if (processInstance.getCommandParam() != null) { Map<String, String> processCmdParam = JSONUtils.toMap(processInstance.getCommandParam()); for (Map.Entry<String, String> entry : processCmdParam.entrySet()) { if (!cmdParam.containsKey(entry.getKey())) { cmdParam.put(entry.getKey(), entry.getValue()); } } } if (cmdParam.containsKey(Constants.CMD_PARAM_SUB_PROCESS)) { processInstance.setCommandParam(command.getCommandParam());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} } else { processInstance = generateNewProcessInstance(processDefinition, command, cmdParam); } if (Boolean.FALSE.equals(checkCmdParam(command, cmdParam))) { logger.error("command parameter check failed!"); return null; } if (command.getScheduleTime() != null) { processInstance.setScheduleTime(command.getScheduleTime()); } processInstance.setHost(host); ExecutionStatus runStatus = ExecutionStatus.RUNNING_EXECUTION; int runTime = processInstance.getRunTimes(); switch (commandType) { case START_PROCESS: break; case START_FAILURE_TASK_PROCESS: List<Integer> failedList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.FAILURE); List<Integer> toleranceList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.NEED_FAULT_TOLERANCE); List<Integer> killedList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.KILL); cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); failedList.addAll(killedList); failedList.addAll(toleranceList); for (Integer taskId : failedList) { initTaskInstance(this.findTaskInstanceById(taskId)); } cmdParam.put(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
String.join(Constants.COMMA, convertIntListToString(failedList))); processInstance.setCommandParam(JSONUtils.toJsonString(cmdParam)); processInstance.setRunTimes(runTime + 1); break; case START_CURRENT_TASK_PROCESS: break; case RECOVER_WAITTING_THREAD: break; case RECOVER_SUSPENDED_PROCESS: cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); List<Integer> suspendedNodeList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.PAUSE); List<Integer> stopNodeList = findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.KILL); suspendedNodeList.addAll(stopNodeList); for (Integer taskId : suspendedNodeList) { initTaskInstance(this.findTaskInstanceById(taskId)); } cmdParam.put(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING, String.join(",", convertIntListToString(suspendedNodeList))); processInstance.setCommandParam(JSONUtils.toJsonString(cmdParam)); processInstance.setRunTimes(runTime + 1); break; case RECOVER_TOLERANCE_FAULT_PROCESS: processInstance.setRecovery(Flag.YES); runStatus = processInstance.getState(); break; case COMPLEMENT_DATA:
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
List<TaskInstance> taskInstanceList = this.findValidTaskListByProcessId(processInstance.getId()); for (TaskInstance taskInstance : taskInstanceList) { taskInstance.setFlag(Flag.NO); this.updateTaskInstance(taskInstance); } initComplementDataParam(processDefinition, processInstance, cmdParam); break; case REPEAT_RUNNING: if (cmdParam.containsKey(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING)) { cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); processInstance.setCommandParam(JSONUtils.toJsonString(cmdParam)); } List<TaskInstance> validTaskList = findValidTaskListByProcessId(processInstance.getId()); for (TaskInstance taskInstance : validTaskList) { taskInstance.setFlag(Flag.NO); updateTaskInstance(taskInstance); } processInstance.setStartTime(new Date()); processInstance.setEndTime(null); processInstance.setRunTimes(runTime + 1); initComplementDataParam(processDefinition, processInstance, cmdParam); break; case SCHEDULER: break; default: break; } processInstance.setState(runStatus);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return processInstance; } /** * return complement data if the process start with complement data * * @param processInstance processInstance * @param command command * @return command type */ private CommandType getCommandTypeIfComplement(ProcessInstance processInstance, Command command) { if (CommandType.COMPLEMENT_DATA == processInstance.getCmdTypeIfComplement()) { return CommandType.COMPLEMENT_DATA; } else { return command.getCommandType(); } } /** * initialize complement data parameters * * @param processDefinition processDefinition * @param processInstance processInstance * @param cmdParam cmdParam */ private void initComplementDataParam(ProcessDefinition processDefinition, ProcessInstance processInstance, Map<String, String> cmdParam) { if (!processInstance.isComplementData()) { return; } Date startComplementTime = DateUtils.parse(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
YYYY_MM_DD_HH_MM_SS); if (Flag.NO == processInstance.getIsSubProcess()) { processInstance.setScheduleTime(startComplementTime); } processInstance.setGlobalParams(ParameterUtils.curingGlobalParams( processDefinition.getGlobalParamMap(), processDefinition.getGlobalParamList(), CommandType.COMPLEMENT_DATA, processInstance.getScheduleTime())); } /** * set sub work process parameters. * handle sub work process instance, update relation table and command parameters * set sub work process flag, extends parent work process command parameters * * @param subProcessInstance subProcessInstance * @return process instance */ public ProcessInstance setSubProcessParam(ProcessInstance subProcessInstance) { String cmdParam = subProcessInstance.getCommandParam(); if (StringUtils.isEmpty(cmdParam)) { return subProcessInstance; } Map<String, String> paramMap = JSONUtils.toMap(cmdParam); if (paramMap.containsKey(CMD_PARAM_SUB_PROCESS) && CMD_PARAM_EMPTY_SUB_PROCESS.equals(paramMap.get(CMD_PARAM_SUB_PROCESS))) { paramMap.remove(CMD_PARAM_SUB_PROCESS); paramMap.put(CMD_PARAM_SUB_PROCESS, String.valueOf(subProcessInstance.getId())); subProcessInstance.setCommandParam(JSONUtils.toJsonString(paramMap)); subProcessInstance.setIsSubProcess(Flag.YES);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
this.saveProcessInstance(subProcessInstance); } String parentInstanceId = paramMap.get(CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID); if (StringUtils.isNotEmpty(parentInstanceId)) { ProcessInstance parentInstance = findProcessInstanceDetailById(Integer.parseInt(parentInstanceId)); if (parentInstance != null) { subProcessInstance.setGlobalParams( joinGlobalParams(parentInstance.getGlobalParams(), subProcessInstance.getGlobalParams())); this.saveProcessInstance(subProcessInstance); } else { logger.error("sub process command params error, cannot find parent instance: {} ", cmdParam); } } ProcessInstanceMap processInstanceMap = JSONUtils.parseObject(cmdParam, ProcessInstanceMap.class); if (processInstanceMap == null || processInstanceMap.getParentProcessInstanceId() == 0) { return subProcessInstance; } processInstanceMap.setProcessInstanceId(subProcessInstance.getId()); this.updateWorkProcessInstanceMap(processInstanceMap); return subProcessInstance; } /** * join parent global params into sub process. * only the keys doesn't in sub process global would be joined. * * @param parentGlobalParams parentGlobalParams * @param subGlobalParams subGlobalParams * @return global params join
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
*/ private String joinGlobalParams(String parentGlobalParams, String subGlobalParams) { List<Property> parentPropertyList = JSONUtils.toList(parentGlobalParams, Property.class); List<Property> subPropertyList = JSONUtils.toList(subGlobalParams, Property.class); Map<String, String> subMap = subPropertyList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); for (Property parent : parentPropertyList) { if (!subMap.containsKey(parent.getProp())) { subPropertyList.add(parent); } } return JSONUtils.toJsonString(subPropertyList); } /** * initialize task instance * * @param taskInstance taskInstance */ private void initTaskInstance(TaskInstance taskInstance) { if (!taskInstance.isSubProcess() && (taskInstance.getState().typeIsCancel() || taskInstance.getState().typeIsFailure())) { taskInstance.setFlag(Flag.NO); updateTaskInstance(taskInstance); return; } taskInstance.setState(ExecutionStatus.SUBMITTED_SUCCESS); updateTaskInstance(taskInstance); } /** * submit task to db * submit sub process to command
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* * @param taskInstance taskInstance * @return task instance */ @Transactional(rollbackFor = Exception.class) public TaskInstance submitTask(TaskInstance taskInstance) { ProcessInstance processInstance = this.findProcessInstanceDetailById(taskInstance.getProcessInstanceId()); logger.info("start submit task : {}, instance id:{}, state: {}", taskInstance.getName(), taskInstance.getProcessInstanceId(), processInstance.getState()); TaskInstance task = submitTaskInstanceToDB(taskInstance, processInstance); if (task == null) { logger.error("end submit task to db error, task name:{}, process id:{} state: {} ", taskInstance.getName(), taskInstance.getProcessInstance(), processInstance.getState()); return task; } if (!task.getState().typeIsFinished()) { createSubWorkProcess(processInstance, task); } logger.info("end submit task to db successfully:{} state:{} complete, instance id:{} state: {} ", taskInstance.getName(), task.getState(), processInstance.getId(), processInstance.getState()); return task; } /** * set work process instance map * consider o * repeat running does not generate new sub process instance * set map {parent instance id, task instance id, 0(child instance id)} * * @param parentInstance parentInstance
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param parentTask parentTask * @return process instance map */ private ProcessInstanceMap setProcessInstanceMap(ProcessInstance parentInstance, TaskInstance parentTask) { ProcessInstanceMap processMap = findWorkProcessMapByParent(parentInstance.getId(), parentTask.getId()); if (processMap != null) { return processMap; } if (parentInstance.getCommandType() == CommandType.REPEAT_RUNNING) { processMap = findPreviousTaskProcessMap(parentInstance, parentTask); if (processMap != null) { processMap.setParentTaskInstanceId(parentTask.getId()); updateWorkProcessInstanceMap(processMap); return processMap; } } processMap = new ProcessInstanceMap(); processMap.setParentProcessInstanceId(parentInstance.getId()); processMap.setParentTaskInstanceId(parentTask.getId()); createWorkProcessInstanceMap(processMap); return processMap; } /** * find previous task work process map. * * @param parentProcessInstance parentProcessInstance * @param parentTask parentTask * @return process instance map
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
*/ private ProcessInstanceMap findPreviousTaskProcessMap(ProcessInstance parentProcessInstance, TaskInstance parentTask) { Integer preTaskId = 0; List<TaskInstance> preTaskList = this.findPreviousTaskListByWorkProcessId(parentProcessInstance.getId()); for (TaskInstance task : preTaskList) { if (task.getName().equals(parentTask.getName())) { preTaskId = task.getId(); ProcessInstanceMap map = findWorkProcessMapByParent(parentProcessInstance.getId(), preTaskId); if (map != null) { return map; } } } logger.info("sub process instance is not found,parent task:{},parent instance:{}", parentTask.getId(), parentProcessInstance.getId()); return null; } /** * create sub work process command * * @param parentProcessInstance parentProcessInstance * @param task task */ public void createSubWorkProcess(ProcessInstance parentProcessInstance, TaskInstance task) { if (!task.isSubProcess()) { return; } ProcessInstanceMap instanceMap = findWorkProcessMapByParent(parentProcessInstance.getId(), task.getId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (null != instanceMap && CommandType.RECOVER_TOLERANCE_FAULT_PROCESS == parentProcessInstance.getCommandType()) { return; } instanceMap = setProcessInstanceMap(parentProcessInstance, task); ProcessInstance childInstance = null; if (instanceMap.getProcessInstanceId() != 0) { childInstance = findProcessInstanceById(instanceMap.getProcessInstanceId()); } Command subProcessCommand = createSubProcessCommand(parentProcessInstance, childInstance, instanceMap, task); updateSubProcessDefinitionByParent(parentProcessInstance, subProcessCommand.getProcessDefinitionId()); initSubInstanceState(childInstance); createCommand(subProcessCommand); logger.info("sub process command created: {} ", subProcessCommand); } /** * complement data needs transform parent parameter to child. */ private String getSubWorkFlowParam(ProcessInstanceMap instanceMap, ProcessInstance parentProcessInstance,Map<String,String> fatherParams) { String processMapStr = JSONUtils.toJsonString(instanceMap); Map<String, String> cmdParam = JSONUtils.toMap(processMapStr); if (parentProcessInstance.isComplementData()) { Map<String, String> parentParam = JSONUtils.toMap(parentProcessInstance.getCommandParam()); String endTime = parentParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE); String startTime = parentParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE); cmdParam.put(CMDPARAM_COMPLEMENT_DATA_END_DATE, endTime); cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, startTime); processMapStr = JSONUtils.toJsonString(cmdParam); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (fatherParams.size() != 0) { cmdParam.put(CMD_PARAM_FATHER_PARAMS, JSONUtils.toJsonString(fatherParams)); processMapStr = JSONUtils.toJsonString(cmdParam); } return processMapStr; } public Map<String, String> getGlobalParamMap(String globalParams) { List<Property> propList; Map<String, String> globalParamMap = new HashMap<>(); if (StringUtils.isNotEmpty(globalParams)) { propList = JSONUtils.toList(globalParams, Property.class); globalParamMap = propList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); } return globalParamMap; } /** * create sub work process command */ public Command createSubProcessCommand(ProcessInstance parentProcessInstance, ProcessInstance childInstance, ProcessInstanceMap instanceMap, TaskInstance task) { CommandType commandType = getSubCommandType(parentProcessInstance, childInstance); TaskNode taskNode = JSONUtils.parseObject(task.getTaskJson(), TaskNode.class); Map<String, Object> subProcessParam = JSONUtils.toMap(taskNode.getParams(), String.class, Object.class); Integer childDefineId = Integer.parseInt(String.valueOf(subProcessParam.get(Constants.CMD_PARAM_SUB_PROCESS_DEFINE_ID))); Object localParams = subProcessParam.get(Constants.LOCAL_PARAMS); List<Property> allParam = JSONUtils.toList(JSONUtils.toJsonString(localParams), Property.class); Map<String, String> globalMap = this.getGlobalParamMap(parentProcessInstance.getGlobalParams()); Map<String,String> fatherParams = new HashMap<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (CollectionUtils.isNotEmpty(allParam)) { for (Property info : allParam) { fatherParams.put(info.getProp(), globalMap.get(info.getProp())); } } String processParam = getSubWorkFlowParam(instanceMap, parentProcessInstance,fatherParams); return new Command( commandType, TaskDependType.TASK_POST, parentProcessInstance.getFailureStrategy(), parentProcessInstance.getExecutorId(), childDefineId, processParam, parentProcessInstance.getWarningType(), parentProcessInstance.getWarningGroupId(), parentProcessInstance.getScheduleTime(), task.getWorkerGroup(), parentProcessInstance.getProcessInstancePriority() ); } /** * initialize sub work flow state * child instance state would be initialized when 'recovery from pause/stop/failure' */ private void initSubInstanceState(ProcessInstance childInstance) { if (childInstance != null) { childInstance.setState(ExecutionStatus.RUNNING_EXECUTION); updateProcessInstance(childInstance); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
/** * get sub work flow command type * child instance exist: child command = fatherCommand * child instance not exists: child command = fatherCommand[0] */ private CommandType getSubCommandType(ProcessInstance parentProcessInstance, ProcessInstance childInstance) { CommandType commandType = parentProcessInstance.getCommandType(); if (childInstance == null) { String fatherHistoryCommand = parentProcessInstance.getHistoryCmd(); commandType = CommandType.valueOf(fatherHistoryCommand.split(Constants.COMMA)[0]); } return commandType; } /** * update sub process definition * * @param parentProcessInstance parentProcessInstance * @param childDefinitionId childDefinitionId */ private void updateSubProcessDefinitionByParent(ProcessInstance parentProcessInstance, int childDefinitionId) { ProcessDefinition fatherDefinition = this.findProcessDefineById(parentProcessInstance.getProcessDefinitionId()); ProcessDefinition childDefinition = this.findProcessDefineById(childDefinitionId); if (childDefinition != null && fatherDefinition != null) { childDefinition.setWarningGroupId(fatherDefinition.getWarningGroupId()); processDefineMapper.updateById(childDefinition); } } /** * submit task to mysql *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param taskInstance taskInstance * @param processInstance processInstance * @return task instance */ public TaskInstance submitTaskInstanceToDB(TaskInstance taskInstance, ProcessInstance processInstance) { ExecutionStatus processInstanceState = processInstance.getState(); if (taskInstance.getState().typeIsFailure()) { if (taskInstance.isSubProcess()) { taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1); } else { if (processInstanceState != ExecutionStatus.READY_STOP && processInstanceState != ExecutionStatus.READY_PAUSE) { taskInstance.setFlag(Flag.NO); updateTaskInstance(taskInstance); if (taskInstance.getState() != ExecutionStatus.NEED_FAULT_TOLERANCE) { taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1); } taskInstance.setSubmitTime(null); taskInstance.setStartTime(null); taskInstance.setEndTime(null); taskInstance.setFlag(Flag.YES); taskInstance.setHost(null); taskInstance.setId(0); } } } taskInstance.setExecutorId(processInstance.getExecutorId()); taskInstance.setProcessInstancePriority(processInstance.getProcessInstancePriority());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
taskInstance.setState(getSubmitTaskState(taskInstance, processInstanceState)); if (taskInstance.getSubmitTime() == null) { taskInstance.setSubmitTime(new Date()); } if (taskInstance.getFirstSubmitTime() == null) { taskInstance.setFirstSubmitTime(taskInstance.getSubmitTime()); } boolean saveResult = saveTaskInstance(taskInstance); if (!saveResult) { return null; } return taskInstance; } /** * get submit task instance state by the work process state * cannot modify the task state when running/kill/submit success, or this * task instance is already exists in task queue . * return pause if work process state is ready pause * return stop if work process state is ready stop * if all of above are not satisfied, return submit success * * @param taskInstance taskInstance * @param processInstanceState processInstanceState * @return process instance state */ public ExecutionStatus getSubmitTaskState(TaskInstance taskInstance, ExecutionStatus processInstanceState) { ExecutionStatus state = taskInstance.getState();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if ( state == ExecutionStatus.RUNNING_EXECUTION || state == ExecutionStatus.DELAY_EXECUTION || state == ExecutionStatus.KILL ) { return state; } if (processInstanceState == ExecutionStatus.READY_PAUSE) { state = ExecutionStatus.PAUSE; } else if (processInstanceState == ExecutionStatus.READY_STOP || !checkProcessStrategy(taskInstance)) { state = ExecutionStatus.KILL; } else { state = ExecutionStatus.SUBMITTED_SUCCESS; } return state; } /** * check process instance strategy * * @param taskInstance taskInstance * @return check strategy result */ private boolean checkProcessStrategy(TaskInstance taskInstance) { ProcessInstance processInstance = this.findProcessInstanceById(taskInstance.getProcessInstanceId()); FailureStrategy failureStrategy = processInstance.getFailureStrategy(); if (failureStrategy == FailureStrategy.CONTINUE) { return true;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} List<TaskInstance> taskInstances = this.findValidTaskListByProcessId(taskInstance.getProcessInstanceId()); for (TaskInstance task : taskInstances) { if (task.getState() == ExecutionStatus.FAILURE) { return false; } } return true; } /** * create a new process instance * * @param processInstance processInstance */ public void createProcessInstance(ProcessInstance processInstance) { if (processInstance != null) { processInstanceMapper.insert(processInstance); } } /** * insert or update work process instance to data base * * @param processInstance processInstance */ public void saveProcessInstance(ProcessInstance processInstance) { if (processInstance == null) { logger.error("save error, process instance is null!"); return; } if (processInstance.getId() != 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
processInstanceMapper.updateById(processInstance); } else { createProcessInstance(processInstance); } } /** * insert or update command * * @param command command * @return save command result */ public int saveCommand(Command command) { if (command.getId() != 0) { return commandMapper.updateById(command); } else { return commandMapper.insert(command); } } /** * insert or update task instance * * @param taskInstance taskInstance * @return save task instance result */ public boolean saveTaskInstance(TaskInstance taskInstance) { if (taskInstance.getId() != 0) { return updateTaskInstance(taskInstance); } else { return createTaskInstance(taskInstance); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} /** * insert task instance * * @param taskInstance taskInstance * @return create task instance result */ public boolean createTaskInstance(TaskInstance taskInstance) { int count = taskInstanceMapper.insert(taskInstance); return count > 0; } /** * update task instance * * @param taskInstance taskInstance * @return update task instance result */ public boolean updateTaskInstance(TaskInstance taskInstance) { int count = taskInstanceMapper.updateById(taskInstance); return count > 0; } /** * delete a command by id * * @param id id */ public void delCommandById(int id) { commandMapper.deleteById(id); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* find task instance by id * * @param taskId task id * @return task intance */ public TaskInstance findTaskInstanceById(Integer taskId) { return taskInstanceMapper.selectById(taskId); } /** * package task instance,associate processInstance and processDefine * * @param taskInstId taskInstId * @return task instance */ public TaskInstance getTaskInstanceDetailByTaskId(int taskInstId) { // TaskInstance taskInstance = findTaskInstanceById(taskInstId); if (taskInstance == null) { return taskInstance; } // ProcessInstance processInstance = findProcessInstanceDetailById(taskInstance.getProcessInstanceId()); // ProcessDefinition processDefine = findProcessDefineById(taskInstance.getProcessDefinitionId()); taskInstance.setProcessInstance(processInstance); taskInstance.setProcessDefine(processDefine); return taskInstance; } /** * get id list by task state
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* * @param instanceId instanceId * @param state state * @return task instance states */ public List<Integer> findTaskIdByInstanceState(int instanceId, ExecutionStatus state) { return taskInstanceMapper.queryTaskByProcessIdAndState(instanceId, state.ordinal()); } /** * find valid task list by process definition id * * @param processInstanceId processInstanceId * @return task instance list */ public List<TaskInstance> findValidTaskListByProcessId(Integer processInstanceId) { return taskInstanceMapper.findValidTaskListByProcessId(processInstanceId, Flag.YES); } /** * find previous task list by work process id * * @param processInstanceId processInstanceId * @return task instance list */ public List<TaskInstance> findPreviousTaskListByWorkProcessId(Integer processInstanceId) { return taskInstanceMapper.findValidTaskListByProcessId(processInstanceId, Flag.NO); } /** * update work process instance map * * @param processInstanceMap processInstanceMap
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @return update process instance result */ public int updateWorkProcessInstanceMap(ProcessInstanceMap processInstanceMap) { return processInstanceMapMapper.updateById(processInstanceMap); } /** * create work process instance map * * @param processInstanceMap processInstanceMap * @return create process instance result */ public int createWorkProcessInstanceMap(ProcessInstanceMap processInstanceMap) { int count = 0; if (processInstanceMap != null) { return processInstanceMapMapper.insert(processInstanceMap); } return count; } /** * find work process map by parent process id and parent task id. * * @param parentWorkProcessId parentWorkProcessId * @param parentTaskId parentTaskId * @return process instance map */ public ProcessInstanceMap findWorkProcessMapByParent(Integer parentWorkProcessId, Integer parentTaskId) { return processInstanceMapMapper.queryByParentId(parentWorkProcessId, parentTaskId); } /** * delete work process map by parent process id
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* * @param parentWorkProcessId parentWorkProcessId * @return delete process map result */ public int deleteWorkProcessMapByParentId(int parentWorkProcessId) { return processInstanceMapMapper.deleteByParentProcessId(parentWorkProcessId); } /** * find sub process instance * * @param parentProcessId parentProcessId * @param parentTaskId parentTaskId * @return process instance */ public ProcessInstance findSubProcessInstance(Integer parentProcessId, Integer parentTaskId) { ProcessInstance processInstance = null; ProcessInstanceMap processInstanceMap = processInstanceMapMapper.queryByParentId(parentProcessId, parentTaskId); if (processInstanceMap == null || processInstanceMap.getProcessInstanceId() == 0) { return processInstance; } processInstance = findProcessInstanceById(processInstanceMap.getProcessInstanceId()); return processInstance; } /** * find parent process instance * * @param subProcessId subProcessId * @return process instance */ public ProcessInstance findParentProcessInstance(Integer subProcessId) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
ProcessInstance processInstance = null; ProcessInstanceMap processInstanceMap = processInstanceMapMapper.queryBySubProcessId(subProcessId); if (processInstanceMap == null || processInstanceMap.getProcessInstanceId() == 0) { return processInstance; } processInstance = findProcessInstanceById(processInstanceMap.getParentProcessInstanceId()); return processInstance; } /** * change task state * * @param state state * @param startTime startTime * @param host host * @param executePath executePath * @param logPath logPath * @param taskInstId taskInstId */ public void changeTaskState(TaskInstance taskInstance, ExecutionStatus state, Date startTime, String host, String executePath, String logPath, int taskInstId) { taskInstance.setState(state); taskInstance.setStartTime(startTime); taskInstance.setHost(host); taskInstance.setExecutePath(executePath); taskInstance.setLogPath(logPath); saveTaskInstance(taskInstance); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* update process instance * * @param processInstance processInstance * @return update process instance result */ public int updateProcessInstance(ProcessInstance processInstance) { return processInstanceMapper.updateById(processInstance); } /** * update the process instance * * @param processInstanceId processInstanceId * @param processJson processJson * @param globalParams globalParams * @param scheduleTime scheduleTime * @param flag flag * @param locations locations * @param connects connects * @return update process instance result */ public int updateProcessInstance(Integer processInstanceId, String processJson, String globalParams, Date scheduleTime, Flag flag, String locations, String connects) { ProcessInstance processInstance = processInstanceMapper.queryDetailById(processInstanceId); if (processInstance != null) { processInstance.setProcessInstanceJson(processJson); processInstance.setGlobalParams(globalParams); processInstance.setScheduleTime(scheduleTime); processInstance.setLocations(locations); processInstance.setConnects(connects);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return processInstanceMapper.updateById(processInstance); } return 0; } /** * change task state * * @param state state * @param endTime endTime * @param taskInstId taskInstId * @param varPool varPool */ public void changeTaskState(TaskInstance taskInstance, ExecutionStatus state, Date endTime, int processId, String appIds, int taskInstId, String varPool, String result) { taskInstance.setPid(processId); taskInstance.setAppLink(appIds); taskInstance.setState(state); taskInstance.setEndTime(endTime); taskInstance.setVarPool(varPool); changeOutParam(result, taskInstance); saveTaskInstance(taskInstance); } public void changeOutParam(String result, TaskInstance taskInstance) { if (StringUtils.isEmpty(result)) { return;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} List<Map<String, String>> workerResultParam = getListMapByString(result); if (CollectionUtils.isEmpty(workerResultParam)) { return; } // Map<String, String> row = workerResultParam.get(0); if (row == null || row.size() == 0) { return; } TaskNode taskNode = JSONUtils.parseObject(taskInstance.getTaskJson(), TaskNode.class); Map<String, Object> taskParams = JSONUtils.toMap(taskNode.getParams(), String.class, Object.class); Object localParams = taskParams.get(LOCAL_PARAMS); if (localParams == null) { return; } ProcessInstance processInstance = this.processInstanceMapper.queryDetailById(taskInstance.getProcessInstanceId()); List<Property> params4Property = JSONUtils.toList(processInstance.getGlobalParams(), Property.class); Map<String, Property> allParamMap = params4Property.stream().collect(Collectors.toMap(Property::getProp, Property -> Property)); List<Property> allParam = JSONUtils.toList(JSONUtils.toJsonString(localParams), Property.class); for (Property info : allParam) { if (info.getDirect() == Direct.OUT) { String paramName = info.getProp(); Property property = allParamMap.get(paramName); if (property == null) { continue; } String value = String.valueOf(row.get(paramName)); if (StringUtils.isNotEmpty(value)) { property.setValue(value);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
info.setValue(value); } } } taskParams.put(LOCAL_PARAMS, allParam); taskNode.setParams(JSONUtils.toJsonString(taskParams)); // taskInstance.setTaskJson(JSONUtils.toJsonString(taskNode)); String params4ProcessString = JSONUtils.toJsonString(params4Property); int updateCount = this.processInstanceMapper.updateGlobalParamsById(params4ProcessString, processInstance.getId()); logger.info("updateCount:{}, params4Process:{}, processInstanceId:{}", updateCount, params4ProcessString, processInstance.getId()); } public List<Map<String, String>> getListMapByString(String json) { List<Map<String, String>> allParams = new ArrayList<>(); ArrayNode paramsByJson = JSONUtils.parseArray(json); Iterator<JsonNode> listIterator = paramsByJson.iterator(); while (listIterator.hasNext()) { Map<String, String> param = JSONUtils.toMap(listIterator.next().toString(), String.class, String.class); allParams.add(param); } return allParams; } /** * convert integer list to string list * * @param intList intList * @return string list */ public List<String> convertIntListToString(List<Integer> intList) { if (intList == null) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return new ArrayList<>(); } List<String> result = new ArrayList<>(intList.size()); for (Integer intVar : intList) { result.add(String.valueOf(intVar)); } return result; } /** * query schedule by id * * @param id id * @return schedule */ public Schedule querySchedule(int id) { return scheduleMapper.selectById(id); } /** * query Schedule by processDefinitionId * * @param processDefinitionId processDefinitionId * @see Schedule */ public List<Schedule> queryReleaseSchedulerListByProcessDefinitionId(int processDefinitionId) { return scheduleMapper.queryReleaseSchedulerListByProcessDefinitionId(processDefinitionId); } /** * query need failover process instance * * @param host host
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @return process instance list */ public List<ProcessInstance> queryNeedFailoverProcessInstances(String host) { return processInstanceMapper.queryByHostAndStatus(host, stateArray); } /** * process need failover process instance * * @param processInstance processInstance */ @Transactional(rollbackFor = RuntimeException.class) public void processNeedFailoverProcessInstances(ProcessInstance processInstance) { // processInstance.setHost(Constants.NULL); processInstanceMapper.updateById(processInstance); // Command cmd = new Command(); cmd.setProcessDefinitionId(processInstance.getProcessDefinitionId()); cmd.setCommandParam(String.format("{\"%s\":%d}", Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING, processInstance.getId())); cmd.setExecutorId(processInstance.getExecutorId()); cmd.setCommandType(CommandType.RECOVER_TOLERANCE_FAULT_PROCESS); createCommand(cmd); } /** * query all need failover task instances by host * * @param host host * @return task instance list */ public List<TaskInstance> queryNeedFailoverTaskInstances(String host) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return taskInstanceMapper.queryByHostAndStatus(host, stateArray); } /** * find data source by id * * @param id id * @return datasource */ public DataSource findDataSourceById(int id) { return dataSourceMapper.selectById(id); } /** * update process instance state by id * * @param processInstanceId processInstanceId * @param executionStatus executionStatus * @return update process result */ public int updateProcessInstanceState(Integer processInstanceId, ExecutionStatus executionStatus) { ProcessInstance instance = processInstanceMapper.selectById(processInstanceId); instance.setState(executionStatus); return processInstanceMapper.updateById(instance); } /** * find process instance by the task id * * @param taskId taskId * @return process instance */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
public ProcessInstance findProcessInstanceByTaskId(int taskId) { TaskInstance taskInstance = taskInstanceMapper.selectById(taskId); if (taskInstance != null) { return processInstanceMapper.selectById(taskInstance.getProcessInstanceId()); } return null; } /** * find udf function list by id list string * * @param ids ids * @return udf function list */ public List<UdfFunc> queryUdfFunListByIds(int[] ids) { return udfFuncMapper.queryUdfByIdStr(ids, null); } /** * find tenant code by resource name * * @param resName resource name * @param resourceType resource type * @return tenant code */ public String queryTenantCodeByResName(String resName, ResourceType resourceType) { // String fullName = resName.startsWith("/") ? resName : String.format("/%s", resName); List<Resource> resourceList = resourceMapper.queryResource(fullName, resourceType.ordinal()); if (CollectionUtils.isEmpty(resourceList)) { return StringUtils.EMPTY; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
int userId = resourceList.get(0).getUserId(); User user = userMapper.selectById(userId); if (Objects.isNull(user)) { return StringUtils.EMPTY; } Tenant tenant = tenantMapper.selectById(user.getTenantId()); if (Objects.isNull(tenant)) { return StringUtils.EMPTY; } return tenant.getTenantCode(); } /** * find schedule list by process define id. * * @param ids ids * @return schedule list */ public List<Schedule> selectAllByProcessDefineId(int[] ids) { return scheduleMapper.selectAllByProcessDefineArray( ids); } /** * get dependency cycle by work process define id and scheduler fire time * * @param masterId masterId * @param processDefinitionId processDefinitionId * @param scheduledFireTime the time the task schedule is expected to trigger * @return CycleDependency * @throws Exception if error throws Exception */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
public CycleDependency getCycleDependency(int masterId, int processDefinitionId, Date scheduledFireTime) throws Exception { List<CycleDependency> list = getCycleDependencies(masterId, new int[]{processDefinitionId}, scheduledFireTime); return !list.isEmpty() ? list.get(0) : null; } /** * get dependency cycle list by work process define id list and scheduler fire time * * @param masterId masterId * @param ids ids * @param scheduledFireTime the time the task schedule is expected to trigger * @return CycleDependency list * @throws Exception if error throws Exception */ public List<CycleDependency> getCycleDependencies(int masterId, int[] ids, Date scheduledFireTime) throws Exception { List<CycleDependency> cycleDependencyList = new ArrayList<>(); if (null == ids || ids.length == 0) { logger.warn("ids[] is empty!is invalid!"); return cycleDependencyList; } if (scheduledFireTime == null) { logger.warn("scheduledFireTime is null!is invalid!"); return cycleDependencyList; } String strCrontab = ""; CronExpression depCronExpression; Cron depCron; List<Date> list; List<Schedule> schedules = this.selectAllByProcessDefineId(ids); // for (Schedule depSchedule : schedules) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
strCrontab = depSchedule.getCrontab(); depCronExpression = CronUtils.parse2CronExpression(strCrontab); depCron = CronUtils.parse2Cron(strCrontab); CycleEnum cycleEnum = CronUtils.getMiniCycle(depCron); if (cycleEnum == null) { logger.error("{} is not valid", strCrontab); continue; } Calendar calendar = Calendar.getInstance(); switch (cycleEnum) { case HOUR: calendar.add(Calendar.HOUR, -25); break; case DAY: case WEEK: calendar.add(Calendar.DATE, -32); break; case MONTH: calendar.add(Calendar.MONTH, -13); break; default: String cycleName = cycleEnum.name(); logger.warn("Dependent process definition's cycleEnum is {},not support!!", cycleName); continue; } Date start = calendar.getTime(); if (depSchedule.getProcessDefinitionId() == masterId) { list = CronUtils.getSelfFireDateList(start, scheduledFireTime, depCronExpression); } else { list = CronUtils.getFireDateList(start, scheduledFireTime, depCronExpression);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} if (!list.isEmpty()) { start = list.get(list.size() - 1); CycleDependency dependency = new CycleDependency(depSchedule.getProcessDefinitionId(), start, CronUtils.getExpirationTime(start, cycleEnum), cycleEnum); cycleDependencyList.add(dependency); } } return cycleDependencyList; } /** * find last scheduler process instance in the date interval * * @param definitionId definitionId * @param dateInterval dateInterval * @return process instance */ public ProcessInstance findLastSchedulerProcessInterval(int definitionId, DateInterval dateInterval) { return processInstanceMapper.queryLastSchedulerProcess(definitionId, dateInterval.getStartTime(), dateInterval.getEndTime()); } /** * find last manual process instance interval * * @param definitionId process definition id * @param dateInterval dateInterval * @return process instance */ public ProcessInstance findLastManualProcessInterval(int definitionId, DateInterval dateInterval) { return processInstanceMapper.queryLastManualProcess(definitionId,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
dateInterval.getStartTime(), dateInterval.getEndTime()); } /** * find last running process instance * * @param definitionId process definition id * @param startTime start time * @param endTime end time * @return process instance */ public ProcessInstance findLastRunningProcess(int definitionId, Date startTime, Date endTime) { return processInstanceMapper.queryLastRunningProcess(definitionId, startTime, endTime, stateArray); } /** * query user queue by process instance id * * @param processInstanceId processInstanceId * @return queue */ public String queryUserQueueByProcessInstanceId(int processInstanceId) { String queue = ""; ProcessInstance processInstance = processInstanceMapper.selectById(processInstanceId); if (processInstance == null) { return queue; } User executor = userMapper.selectById(processInstance.getExecutorId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (executor != null) { queue = executor.getQueue(); } return queue; } /** * query project name and user name by processInstanceId. * * @param processInstanceId processInstanceId * @return projectName and userName */ public ProjectUser queryProjectWithUserByProcessInstanceId(int processInstanceId) { return projectMapper.queryProjectWithUserByProcessInstanceId(processInstanceId); } /** * get task worker group * * @param taskInstance taskInstance * @return workerGroupId */ public String getTaskWorkerGroup(TaskInstance taskInstance) { String workerGroup = taskInstance.getWorkerGroup(); if (StringUtils.isNotBlank(workerGroup)) { return workerGroup; } int processInstanceId = taskInstance.getProcessInstanceId(); ProcessInstance processInstance = findProcessInstanceById(processInstanceId); if (processInstance != null) { return processInstance.getWorkerGroup(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
logger.info("task : {} will use default worker group", taskInstance.getId()); return Constants.DEFAULT_WORKER_GROUP; } /** * get have perm project list * * @param userId userId * @return project list */ public List<Project> getProjectListHavePerm(int userId) { List<Project> createProjects = projectMapper.queryProjectCreatedByUser(userId); List<Project> authedProjects = projectMapper.queryAuthedProjectListByUserId(userId); if (createProjects == null) { createProjects = new ArrayList<>(); } if (authedProjects != null) { createProjects.addAll(authedProjects); } return createProjects; } /** * get have perm project ids * * @param userId userId * @return project ids */ public List<Integer> getProjectIdListHavePerm(int userId) { List<Integer> projectIdList = new ArrayList<>(); for (Project project : getProjectListHavePerm(userId)) { projectIdList.add(project.getId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} return projectIdList; } /** * list unauthorized udf function * * @param userId user id * @param needChecks data source id array * @return unauthorized udf function list */ public <T> List<T> listUnauthorized(int userId, T[] needChecks, AuthorizationType authorizationType) { List<T> resultList = new ArrayList<>(); if (Objects.nonNull(needChecks) && needChecks.length > 0) { Set<T> originResSet = new HashSet<>(Arrays.asList(needChecks)); switch (authorizationType) { case RESOURCE_FILE_ID: case UDF_FILE: List<Resource> ownUdfResources = resourceMapper.listAuthorizedResourceById(userId, needChecks); addAuthorizedResources(ownUdfResources, userId); Set<Integer> authorizedResourceFiles = ownUdfResources.stream().map(Resource::getId).collect(toSet()); originResSet.removeAll(authorizedResourceFiles); break; case RESOURCE_FILE_NAME: List<Resource> ownResources = resourceMapper.listAuthorizedResource(userId, needChecks); addAuthorizedResources(ownResources, userId); Set<String> authorizedResources = ownResources.stream().map(Resource::getFullName).collect(toSet()); originResSet.removeAll(authorizedResources); break; case DATASOURCE: Set<Integer> authorizedDatasources = dataSourceMapper.listAuthorizedDataSource(userId, needChecks).stream().map(DataSource::getId).collect(toSet());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
originResSet.removeAll(authorizedDatasources); break; case UDF: Set<Integer> authorizedUdfs = udfFuncMapper.listAuthorizedUdfFunc(userId, needChecks).stream().map(UdfFunc::getId).collect(toSet()); originResSet.removeAll(authorizedUdfs); break; default: break; } resultList.addAll(originResSet); } return resultList; } /** * get user by user id * * @param userId user id * @return User */ public User getUserById(int userId) { return userMapper.selectById(userId); } /** * get resource by resoruce id * * @param resoruceId resource id * @return Resource */ public Resource getResourceById(int resoruceId) { return resourceMapper.selectById(resoruceId);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} /** * list resources by ids * * @param resIds resIds * @return resource list */ public List<Resource> listResourceByIds(Integer[] resIds) { return resourceMapper.listResourceByIds(resIds); } /** * format task app id in task instance */ public String formatTaskAppId(TaskInstance taskInstance) { ProcessDefinition definition = this.findProcessDefineById(taskInstance.getProcessDefinitionId()); ProcessInstance processInstanceById = this.findProcessInstanceById(taskInstance.getProcessInstanceId()); if (definition == null || processInstanceById == null) { return ""; } return String.format("%s_%s_%s", definition.getId(), processInstanceById.getId(), taskInstance.getId()); } /** * solve the branch rename bug * * @param processData * @param oldJson * @return String
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
*/ public String changeJson(ProcessData processData, String oldJson) { ProcessData oldProcessData = JSONUtils.parseObject(oldJson, ProcessData.class); HashMap<String, String> oldNameTaskId = new HashMap<>(); List<TaskNode> oldTasks = oldProcessData.getTasks(); for (int i = 0; i < oldTasks.size(); i++) { TaskNode taskNode = oldTasks.get(i); String oldName = taskNode.getName(); String oldId = taskNode.getId(); oldNameTaskId.put(oldName, oldId); } // HashMap<String, String> newNameTaskId = new HashMap<>(); List<TaskNode> newTasks = processData.getTasks(); for (int i = 0; i < newTasks.size(); i++) { TaskNode taskNode = newTasks.get(i); String newId = taskNode.getId(); String newName = taskNode.getName(); newNameTaskId.put(newId, newName); } // List<TaskNode> tasks = processData.getTasks(); for (int i = 0; i < tasks.size(); i++) { TaskNode taskNode = newTasks.get(i); String type = taskNode.getType(); if (TaskType.CONDITIONS.getDescp().equalsIgnoreCase(type)) { ConditionsParameters conditionsParameters = JSONUtils.parseObject(taskNode.getConditionResult(), ConditionsParameters.class); String oldSuccessNodeName = conditionsParameters.getSuccessNode().get(0); String oldFailedNodeName = conditionsParameters.getFailedNode().get(0); String newSuccessNodeName = newNameTaskId.get(oldNameTaskId.get(oldSuccessNodeName));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,266
[Bug][master-server] If start a process instance form fail node or stop node ,the param will be init.
If start a process instance form fail node or stop node ,the param will be init. 如果从失败节点开始执行,或从暂定节点开始执行,已经执行过的节点处理过的参数会被初始化。
https://github.com/apache/dolphinscheduler/issues/5266
https://github.com/apache/dolphinscheduler/pull/5267
94a08c8f327bed2b53240de3f6ba9018fed74fa9
6dbbf6d55d105485b04d2b12533dbbc6e4c9a68f
"2021-04-13T07:22:38Z"
java
"2021-04-16T15:14:22Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
String newFailedNodeName = newNameTaskId.get(oldNameTaskId.get(oldFailedNodeName)); if (newSuccessNodeName != null) { ArrayList<String> successNode = new ArrayList<>(); successNode.add(newSuccessNodeName); conditionsParameters.setSuccessNode(successNode); } if (newFailedNodeName != null) { ArrayList<String> failedNode = new ArrayList<>(); failedNode.add(newFailedNodeName); conditionsParameters.setFailedNode(failedNode); } String conditionResultStr = conditionsParameters.getConditionResult(); taskNode.setConditionResult(conditionResultStr); tasks.set(i, taskNode); } } return JSONUtils.toJsonString(processData); } /** * add authorized resources * @param ownResources own resources * @param userId userId */ private void addAuthorizedResources(List<Resource> ownResources, int userId) { List<Integer> relationResourceIds = resourceUserMapper.queryResourcesIdListByUserIdAndPerm(userId, 7); List<Resource> relationResources = CollectionUtils.isNotEmpty(relationResourceIds) ? resourceMapper.queryResourceListById(relationResourceIds) : new ArrayList<>(); ownResources.addAll(relationResources); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.common; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.utils.OSUtils; import org.apache.dolphinscheduler.common.utils.StringUtils; import java.util.regex.Pattern; /** * Constants */ public final class Constants { private Constants() { throw new UnsupportedOperationException("Construct Constants"); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * quartz config */ public static final String ORG_QUARTZ_JOBSTORE_DRIVERDELEGATECLASS = "org.quartz.jobStore.driverDelegateClass"; public static final String ORG_QUARTZ_SCHEDULER_INSTANCENAME = "org.quartz.scheduler.instanceName"; public static final String ORG_QUARTZ_SCHEDULER_INSTANCEID = "org.quartz.scheduler.instanceId"; public static final String ORG_QUARTZ_SCHEDULER_MAKESCHEDULERTHREADDAEMON = "org.quartz.scheduler.makeSchedulerThreadDaemon"; public static final String ORG_QUARTZ_JOBSTORE_USEPROPERTIES = "org.quartz.jobStore.useProperties"; public static final String ORG_QUARTZ_THREADPOOL_CLASS = "org.quartz.threadPool.class"; public static final String ORG_QUARTZ_THREADPOOL_THREADCOUNT = "org.quartz.threadPool.threadCount"; public static final String ORG_QUARTZ_THREADPOOL_MAKETHREADSDAEMONS = "org.quartz.threadPool.makeThreadsDaemons"; public static final String ORG_QUARTZ_THREADPOOL_THREADPRIORITY = "org.quartz.threadPool.threadPriority"; public static final String ORG_QUARTZ_JOBSTORE_CLASS = "org.quartz.jobStore.class"; public static final String ORG_QUARTZ_JOBSTORE_TABLEPREFIX = "org.quartz.jobStore.tablePrefix"; public static final String ORG_QUARTZ_JOBSTORE_ISCLUSTERED = "org.quartz.jobStore.isClustered"; public static final String ORG_QUARTZ_JOBSTORE_MISFIRETHRESHOLD = "org.quartz.jobStore.misfireThreshold"; public static final String ORG_QUARTZ_JOBSTORE_CLUSTERCHECKININTERVAL = "org.quartz.jobStore.clusterCheckinInterval"; public static final String ORG_QUARTZ_JOBSTORE_ACQUIRETRIGGERSWITHINLOCK = "org.quartz.jobStore.acquireTriggersWithinLock"; public static final String ORG_QUARTZ_JOBSTORE_DATASOURCE = "org.quartz.jobStore.dataSource"; public static final String ORG_QUARTZ_DATASOURCE_MYDS_CONNECTIONPROVIDER_CLASS = "org.quartz.dataSource.myDs.connectionProvider.class"; /** * quartz config default value */ public static final String QUARTZ_TABLE_PREFIX = "QRTZ_"; public static final String QUARTZ_MISFIRETHRESHOLD = "60000"; public static final String QUARTZ_CLUSTERCHECKININTERVAL = "5000"; public static final String QUARTZ_DATASOURCE = "myDs"; public static final String QUARTZ_THREADCOUNT = "25"; public static final String QUARTZ_THREADPRIORITY = "5"; public static final String QUARTZ_INSTANCENAME = "DolphinScheduler";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
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"; /** * yarn.resourcemanager.ha.rm.ids */ public static final String YARN_RESOURCEMANAGER_HA_RM_IDS = "yarn.resourcemanager.ha.rm.ids"; public static final String YARN_RESOURCEMANAGER_HA_XX = "xx"; /** * yarn.application.status.address */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
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"; /** * environment properties default path */ public static final String ENV_PATH = "env/dolphinscheduler_env.sh"; /** * python home */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
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"; public static final String DEVELOPMENT_STATE_DEFAULT_VALUE = "true"; /** * sudo enable */ public static final String SUDO_ENABLE = "sudo.enable"; /** * string true */ public static final String STRING_TRUE = "true"; /** * string false */ public static final String STRING_FALSE = "false"; /** * resource storage type */ public static final String RESOURCE_STORAGE_TYPE = "resource.storage.type"; /** * MasterServer directory registered in zookeeper */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String ZOOKEEPER_DOLPHINSCHEDULER_MASTERS = "/nodes/master"; /** * WorkerServer directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_WORKERS = "/nodes/worker"; /** * all servers directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_DEAD_SERVERS = "/dead-servers"; /** * MasterServer lock directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_MASTERS = "/lock/masters"; /** * MasterServer failover directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS = "/lock/failover/masters"; /** * WorkerServer failover directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS = "/lock/failover/workers"; /** * MasterServer startup failover runing and fault tolerance process */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS = "/lock/failover/startup-masters"; /** * comma , */ public static final String COMMA = ","; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* slash / */ public static final String SLASH = "/"; /** * COLON : */ public static final String COLON = ":"; /** * SPACE " " */ public static final String SPACE = " "; /** * SINGLE_SLASH / */ public static final String SINGLE_SLASH = "/"; /** * DOUBLE_SLASH // */ public static final String DOUBLE_SLASH = "//"; /** * SINGLE_QUOTES "'" */ public static final String SINGLE_QUOTES = "'"; /** * DOUBLE_QUOTES "\"" */ public static final String DOUBLE_QUOTES = "\""; /** * SEMICOLON ; */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String SEMICOLON = ";"; /** * EQUAL SIGN */ public static final String EQUAL_SIGN = "="; /** * AT SIGN */ public static final String AT_SIGN = "@"; public static final String WORKER_MAX_CPULOAD_AVG = "worker.max.cpuload.avg"; public static final String WORKER_RESERVED_MEMORY = "worker.reserved.memory"; public static final String MASTER_MAX_CPULOAD_AVG = "master.max.cpuload.avg"; public static final String MASTER_RESERVED_MEMORY = "master.reserved.memory"; /** * date format of yyyy-MM-dd HH:mm:ss */ public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; /** * date format of yyyyMMddHHmmss */ public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; /** * date format of yyyyMMddHHmmssSSS */ public static final String YYYYMMDDHHMMSSSSS = "yyyyMMddHHmmssSSS"; /** * http connect time out */ public static final int HTTP_CONNECT_TIMEOUT = 60 * 1000; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* http connect request time out */ public static final int HTTP_CONNECTION_REQUEST_TIMEOUT = 60 * 1000; /** * httpclient soceket time out */ public static final int SOCKET_TIMEOUT = 60 * 1000; /** * http header */ public static final String HTTP_HEADER_UNKNOWN = "unKnown"; /** * http X-Forwarded-For */ public static final String HTTP_X_FORWARDED_FOR = "X-Forwarded-For"; /** * http X-Real-IP */ public static final String HTTP_X_REAL_IP = "X-Real-IP"; /** * UTF-8 */ public static final String UTF_8 = "UTF-8"; /** * user name regex */ public static final Pattern REGEX_USER_NAME = Pattern.compile("^[a-zA-Z0-9._-]{3,39}$"); /** * email regex */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final Pattern REGEX_MAIL_NAME = Pattern.compile("^([a-z0-9A-Z]+[_|\\-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"); /** * default display rows */ public static final int DEFAULT_DISPLAY_ROWS = 10; /** * read permission */ public static final int READ_PERMISSION = 2 * 1; /** * write permission */ public static final int WRITE_PERMISSION = 2 * 2; /** * execute permission */ public static final int EXECUTE_PERMISSION = 1; /** * default admin permission */ public static final int DEFAULT_ADMIN_PERMISSION = 7; /** * all permissions */ public static final int ALL_PERMISSIONS = READ_PERMISSION | WRITE_PERMISSION | EXECUTE_PERMISSION; /** * max task timeout */ public static final int MAX_TASK_TIMEOUT = 24 * 3600; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* master cpu load */ public static final int DEFAULT_MASTER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2; /** * master reserved memory */ public static final double DEFAULT_MASTER_RESERVED_MEMORY = OSUtils.totalMemorySize() / 10; /** * worker cpu load */ public static final int DEFAULT_WORKER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2; /** * worker reserved memory */ public static final double DEFAULT_WORKER_RESERVED_MEMORY = OSUtils.totalMemorySize() / 10; /** * 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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final int SEC_2_MINUTES_TIME_UNIT = 60; /*** * * 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"; /** * datasource configuration path */ public static final String DATASOURCE_PROPERTIES = "/datasource.properties"; public static final String TASK_RECORD_URL = "task.record.datasource.url"; public static final String TASK_RECORD_FLAG = "task.record.flag"; public static final String TASK_RECORD_USER = "task.record.datasource.username"; public static final String TASK_RECORD_PWD = "task.record.datasource.password"; 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"; public static final String TASK_RECORD_TABLE_HIVE_LOG = "eamp_hive_log_hd";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String TASK_RECORD_TABLE_HISTORY_HIVE_LOG = "eamp_hive_hist_log_hd"; /** * command parameter keys */ 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"; /** * 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"; /** * data source config
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,309
[Bug][Common] memoryUsage is `-33%`
**To Reproduce** `memoryUsage` is `-33%` **Expected behavior** Bug fixed **Screenshots** ![image](https://user-images.githubusercontent.com/4902714/115050583-779bf480-9f0e-11eb-8eed-4abcc8df3fc4.png) **Which version of Dolphin Scheduler:** -[1.3.x] -[dev]
https://github.com/apache/dolphinscheduler/issues/5309
https://github.com/apache/dolphinscheduler/pull/5312
5ef1f731b7f3b48915859b7a9595ec42df614c48
e92e29ef9a126d1d5660011545056d4dd806d105
"2021-04-16T15:51:04Z"
java
"2021-04-19T02:24:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final String SPRING_DATASOURCE_DRIVER_CLASS_NAME = "spring.datasource.driver-class-name"; public static final String SPRING_DATASOURCE_URL = "spring.datasource.url"; public static final String SPRING_DATASOURCE_USERNAME = "spring.datasource.username"; public static final String SPRING_DATASOURCE_PASSWORD = "spring.datasource.password"; public static final String SPRING_DATASOURCE_VALIDATION_QUERY_TIMEOUT = "spring.datasource.validationQueryTimeout"; public static final String SPRING_DATASOURCE_INITIAL_SIZE = "spring.datasource.initialSize"; public static final String SPRING_DATASOURCE_MIN_IDLE = "spring.datasource.minIdle"; public static final String SPRING_DATASOURCE_MAX_ACTIVE = "spring.datasource.maxActive"; public static final String SPRING_DATASOURCE_MAX_WAIT = "spring.datasource.maxWait"; public static final String SPRING_DATASOURCE_TIME_BETWEEN_EVICTION_RUNS_MILLIS = "spring.datasource.timeBetweenEvictionRunsMillis"; 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; /** * heartbeat for zk info length */