Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yanghaoyuan.sh
DolphinScheduler
提交
4bb044a4
DolphinScheduler
项目概览
yanghaoyuan.sh
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4bb044a4
编写于
2月 11, 2020
作者:
S
samz406
提交者:
GitHub
2月 11, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3 from apache/dev
update
上级
1172abee
95d62133
变更
35
隐藏空白更改
内联
并排
Showing
35 changed file
with
466 addition
and
204 deletion
+466
-204
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/MailUtils.java
...va/org/apache/dolphinscheduler/alert/utils/MailUtils.java
+4
-4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/BaseController.java
...pache/dolphinscheduler/api/controller/BaseController.java
+3
-6
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java
...scheduler/api/controller/ProcessDefinitionController.java
+8
-8
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
...inscheduler/api/controller/ProcessInstanceController.java
+5
-5
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
...olphinscheduler/api/service/ProcessDefinitionService.java
+2
-0
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
...apache/dolphinscheduler/api/service/ResourcesService.java
+1
-1
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionServiceTest.java
...inscheduler/api/service/ProcessDefinitionServiceTest.java
+27
-0
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ResInfo.java
...ava/org/apache/dolphinscheduler/common/utils/ResInfo.java
+6
-6
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ScriptRunner.java
...rg/apache/dolphinscheduler/common/utils/ScriptRunner.java
+2
-2
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/StringUtils.java
...org/apache/dolphinscheduler/common/utils/StringUtils.java
+5
-120
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/placeholder/BusinessTimeUtils.java
...scheduler/common/utils/placeholder/BusinessTimeUtils.java
+3
-1
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/BaseTaskQueueTest.java
...ache/dolphinscheduler/common/queue/BaseTaskQueueTest.java
+6
-2
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/ResInfoTest.java
...org/apache/dolphinscheduler/common/utils/ResInfoTest.java
+43
-0
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/ScriptRunnerTest.java
...pache/dolphinscheduler/common/utils/ScriptRunnerTest.java
+2
-2
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/StringUtilsTest.java
...apache/dolphinscheduler/common/utils/StringUtilsTest.java
+66
-0
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessDefinition.java
...apache/dolphinscheduler/dao/entity/ProcessDefinition.java
+32
-16
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
...rc/js/conf/home/pages/dag/_source/formModel/formModel.vue
+18
-2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
...conf/home/pages/dag/_source/formModel/tasks/dependent.vue
+16
-1
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
.../js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
+1
-1
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
...src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
+29
-0
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue
...conf/home/pages/dag/_source/formModel/tasks/procedure.vue
+21
-4
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
...js/conf/home/pages/dag/_source/formModel/tasks/python.vue
+28
-4
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
.../js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
+29
-5
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
.../js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
+1
-1
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue
...nf/home/pages/dag/_source/formModel/tasks/sub_process.vue
+8
-2
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue
...ges/projects/pages/definition/pages/list/_source/list.vue
+7
-0
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+1
-0
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+1
-0
pom.xml
pom.xml
+1
-0
sql/dolphinscheduler-postgre.sql
sql/dolphinscheduler-postgre.sql
+1
-0
sql/dolphinscheduler_mysql.sql
sql/dolphinscheduler_mysql.sql
+1
-0
sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_ddl.sql
sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_ddl.sql
+37
-0
sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_dml.sql
sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_dml.sql
+1
-11
sql/upgrade/1.2.2_schema/postgresql/dolphinscheduler_ddl.sql
sql/upgrade/1.2.2_schema/postgresql/dolphinscheduler_ddl.sql
+34
-0
sql/upgrade/1.2.2_schema/postgresql/dolphinscheduler_dml.sql
sql/upgrade/1.2.2_schema/postgresql/dolphinscheduler_dml.sql
+16
-0
未找到文件。
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/MailUtils.java
浏览文件 @
4bb044a4
...
...
@@ -90,14 +90,14 @@ public class MailUtils {
public
static
Map
<
String
,
Object
>
sendMails
(
Collection
<
String
>
receivers
,
Collection
<
String
>
receiversCc
,
String
title
,
String
content
,
ShowType
showType
)
{
Map
<
String
,
Object
>
retMap
=
new
HashMap
<>();
retMap
.
put
(
Constants
.
STATUS
,
false
);
// if there is no receivers && no receiversCc, no need to process
if
(
CollectionUtils
.
isEmpty
(
receivers
)
&&
CollectionUtils
.
isEmpty
(
receiversCc
))
{
return
retMap
;
}
receivers
.
removeIf
(
StringUtils:
:
isEmpty
);
if
(
showType
==
ShowType
.
TABLE
||
showType
==
ShowType
.
TEXT
){
// send email
HtmlEmail
email
=
new
HtmlEmail
();
...
...
@@ -335,7 +335,7 @@ public class MailUtils {
*/
private
static
void
handleException
(
Collection
<
String
>
receivers
,
Map
<
String
,
Object
>
retMap
,
Exception
e
)
{
logger
.
error
(
"Send email to {} failed {}"
,
receivers
,
e
);
retMap
.
put
(
Constants
.
MESSAGE
,
"Send email to {"
+
String
Utils
.
join
(
receivers
,
","
)
+
"} failed,"
+
e
.
toString
());
retMap
.
put
(
Constants
.
MESSAGE
,
"Send email to {"
+
String
.
join
(
","
,
receivers
)
+
"} failed,"
+
e
.
toString
());
}
}
\ No newline at end of file
}
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/BaseController.java
浏览文件 @
4bb044a4
...
...
@@ -157,8 +157,7 @@ public class BaseController {
* @return success result code
*/
public
Result
success
(
String
msg
,
Object
list
)
{
Result
result
=
getResult
(
msg
,
list
);
return
result
;
return
getResult
(
msg
,
list
);
}
/**
...
...
@@ -168,8 +167,7 @@ public class BaseController {
* @return success result code
*/
public
Result
success
(
Object
list
)
{
Result
result
=
getResult
(
Status
.
SUCCESS
.
getMsg
(),
list
);
return
result
;
return
getResult
(
Status
.
SUCCESS
.
getMsg
(),
list
);
}
/**
...
...
@@ -181,8 +179,7 @@ public class BaseController {
* @return success result code
*/
public
Result
success
(
String
msg
,
Map
<
String
,
Object
>
object
)
{
Result
result
=
getResult
(
msg
,
object
);
return
result
;
return
getResult
(
msg
,
object
);
}
/**
...
...
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java
浏览文件 @
4bb044a4
...
...
@@ -53,7 +53,7 @@ public class ProcessDefinitionController extends BaseController{
/**
* create process definition
*
*
* @param loginUser login user
* @param projectName project name
* @param name process definition name
...
...
@@ -96,7 +96,7 @@ public class ProcessDefinitionController extends BaseController{
/**
* verify process definition name unique
*
*
* @param loginUser login user
* @param projectName project name
* @param name name
...
...
@@ -328,9 +328,9 @@ public class ProcessDefinitionController extends BaseController{
/**
*
*
* get tasks list by process definition id
*
*
*
* @param loginUser login user
* @param projectName project name
...
...
@@ -442,7 +442,7 @@ public class ProcessDefinitionController extends BaseController{
loginUser
.
getUserName
(),
projectName
,
processDefinitionIds
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
List
<
Integer
>
deleteFailedIdList
=
new
ArrayList
<
Integer
>();
List
<
String
>
deleteFailedIdList
=
new
ArrayList
<
>();
if
(
StringUtils
.
isNotEmpty
(
processDefinitionIds
)){
String
[]
processDefinitionIdArray
=
processDefinitionIds
.
split
(
","
);
...
...
@@ -451,17 +451,17 @@ public class ProcessDefinitionController extends BaseController{
try
{
Map
<
String
,
Object
>
deleteResult
=
processDefinitionService
.
deleteProcessDefinitionById
(
loginUser
,
projectName
,
processDefinitionId
);
if
(!
Status
.
SUCCESS
.
equals
(
deleteResult
.
get
(
Constants
.
STATUS
))){
deleteFailedIdList
.
add
(
p
rocessDefinitionId
);
deleteFailedIdList
.
add
(
strP
rocessDefinitionId
);
logger
.
error
((
String
)
deleteResult
.
get
(
Constants
.
MSG
));
}
}
catch
(
Exception
e
)
{
deleteFailedIdList
.
add
(
p
rocessDefinitionId
);
deleteFailedIdList
.
add
(
strP
rocessDefinitionId
);
}
}
}
if
(!
deleteFailedIdList
.
isEmpty
()){
putMsg
(
result
,
Status
.
BATCH_DELETE_PROCESS_DEFINE_BY_IDS_ERROR
,
StringUtils
.
join
(
deleteFailedIdList
,
","
));
putMsg
(
result
,
Status
.
BATCH_DELETE_PROCESS_DEFINE_BY_IDS_ERROR
,
String
.
join
(
","
,
deleteFailedIdList
));
}
else
{
putMsg
(
result
,
Status
.
SUCCESS
);
}
...
...
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
浏览文件 @
4bb044a4
...
...
@@ -58,7 +58,7 @@ public class ProcessInstanceController extends BaseController{
/**
* query process instance list paging
*
*
* @param loginUser login user
* @param projectName project name
* @param pageNo page number
...
...
@@ -372,7 +372,7 @@ public class ProcessInstanceController extends BaseController{
// task queue
ITaskQueue
tasksQueue
=
TaskQueueFactory
.
getTaskQueueInstance
();
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
List
<
Integer
>
deleteFailedIdList
=
new
ArrayList
<
Integer
>();
List
<
String
>
deleteFailedIdList
=
new
ArrayList
<
>();
if
(
StringUtils
.
isNotEmpty
(
processInstanceIds
)){
String
[]
processInstanceIdArray
=
processInstanceIds
.
split
(
","
);
...
...
@@ -381,16 +381,16 @@ public class ProcessInstanceController extends BaseController{
try
{
Map
<
String
,
Object
>
deleteResult
=
processInstanceService
.
deleteProcessInstanceById
(
loginUser
,
projectName
,
processInstanceId
,
tasksQueue
);
if
(!
Status
.
SUCCESS
.
equals
(
deleteResult
.
get
(
Constants
.
STATUS
))){
deleteFailedIdList
.
add
(
p
rocessInstanceId
);
deleteFailedIdList
.
add
(
strP
rocessInstanceId
);
logger
.
error
((
String
)
deleteResult
.
get
(
Constants
.
MSG
));
}
}
catch
(
Exception
e
)
{
deleteFailedIdList
.
add
(
p
rocessInstanceId
);
deleteFailedIdList
.
add
(
strP
rocessInstanceId
);
}
}
}
if
(
deleteFailedIdList
.
size
()
>
0
){
putMsg
(
result
,
Status
.
BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_ERROR
,
StringUtils
.
join
(
deleteFailedIdList
,
","
));
putMsg
(
result
,
Status
.
BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_ERROR
,
String
.
join
(
","
,
deleteFailedIdList
));
}
else
{
putMsg
(
result
,
Status
.
SUCCESS
);
}
...
...
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
浏览文件 @
4bb044a4
...
...
@@ -143,6 +143,7 @@ public class ProcessDefinitionService extends BaseDAGService {
processDefine
.
setConnects
(
connects
);
processDefine
.
setTimeout
(
processData
.
getTimeout
());
processDefine
.
setTenantId
(
processData
.
getTenantId
());
processDefine
.
setModifyBy
(
loginUser
.
getUserName
());
//custom global params
List
<
Property
>
globalParamsList
=
processData
.
getGlobalParams
();
...
...
@@ -308,6 +309,7 @@ public class ProcessDefinitionService extends BaseDAGService {
processDefine
.
setConnects
(
connects
);
processDefine
.
setTimeout
(
processData
.
getTimeout
());
processDefine
.
setTenantId
(
processData
.
getTenantId
());
processDefine
.
setModifyBy
(
loginUser
.
getUserName
());
//custom global params
List
<
Property
>
globalParamsList
=
new
ArrayList
<>();
...
...
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
浏览文件 @
4bb044a4
...
...
@@ -539,7 +539,7 @@ public class ResourcesService extends BaseService {
putMsg
(
result
,
Status
.
SUCCESS
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
ALIAS
,
resource
.
getAlias
());
map
.
put
(
CONTENT
,
String
Utils
.
join
(
content
,
"\n"
));
map
.
put
(
CONTENT
,
String
.
join
(
"\n"
,
content
));
result
.
setData
(
map
);
}
else
{
logger
.
error
(
"read file {} not exist in hdfs"
,
hdfsFileName
);
...
...
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionServiceTest.java
浏览文件 @
4bb044a4
...
...
@@ -27,6 +27,7 @@ import org.apache.dolphinscheduler.common.enums.*;
import
org.apache.dolphinscheduler.common.utils.DateUtils
;
import
org.apache.dolphinscheduler.common.utils.FileUtils
;
import
org.apache.dolphinscheduler.common.utils.JSONUtils
;
import
org.apache.dolphinscheduler.dao.ProcessDao
;
import
org.apache.dolphinscheduler.dao.entity.*
;
import
org.apache.dolphinscheduler.dao.mapper.*
;
import
org.apache.http.entity.ContentType
;
...
...
@@ -77,6 +78,9 @@ public class ProcessDefinitionServiceTest {
@Mock
private
WorkerGroupMapper
workerGroupMapper
;
@Mock
private
ProcessDao
processDao
;
private
String
sqlDependentJson
=
"{\"globalParams\":[],"
+
"\"tasks\":[{\"type\":\"SQL\",\"id\":\"tasks-27297\",\"name\":\"sql\","
+
"\"params\":{\"type\":\"MYSQL\",\"datasource\":1,\"sql\":\"select * from test\","
+
...
...
@@ -422,6 +426,27 @@ public class ProcessDefinitionServiceTest {
Assert
.
assertTrue
(
deleteFlag
);
}
@Test
public
void
testUpdateProcessDefinition
()
{
User
loginUser
=
new
User
();
loginUser
.
setId
(
1
);
loginUser
.
setUserType
(
UserType
.
ADMIN_USER
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
putMsg
(
result
,
Status
.
SUCCESS
);
String
projectName
=
"project_test1"
;
Project
project
=
getProject
(
projectName
);
Mockito
.
when
(
projectMapper
.
queryByName
(
projectName
)).
thenReturn
(
getProject
(
projectName
));
Mockito
.
when
(
projectService
.
checkProjectAndAuth
(
loginUser
,
project
,
projectName
)).
thenReturn
(
result
);
Mockito
.
when
(
processDao
.
findProcessDefineById
(
1
)).
thenReturn
(
getProcessDefinition
());
Map
<
String
,
Object
>
updateResult
=
processDefinitionService
.
updateProcessDefinition
(
loginUser
,
projectName
,
1
,
"test"
,
sqlDependentJson
,
""
,
""
,
""
);
Assert
.
assertEquals
(
Status
.
UPDATE_PROCESS_DEFINITION_ERROR
,
updateResult
.
get
(
Constants
.
STATUS
));
}
/**
* get mock datasource
...
...
@@ -443,6 +468,8 @@ public class ProcessDefinitionServiceTest {
processDefinition
.
setId
(
46
);
processDefinition
.
setName
(
"testProject"
);
processDefinition
.
setProjectId
(
2
);
processDefinition
.
setTenantId
(
1
);
processDefinition
.
setDescription
(
""
);
return
processDefinition
;
}
...
...
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ResInfo.java
浏览文件 @
4bb044a4
...
...
@@ -15,7 +15,6 @@
* limitations under the License.
*/
package
org.apache.dolphinscheduler.common.utils
;
import
org.apache.dolphinscheduler.common.Constants
;
import
org.apache.dolphinscheduler.common.model.Server
;
...
...
@@ -135,14 +134,15 @@ public class ResInfo {
* @return heartbeat info to Server
*/
public
static
Server
parseHeartbeatForZKInfo
(
String
heartBeatInfo
){
Server
masterServer
=
null
;
if
(
StringUtils
.
isEmpty
(
heartBeatInfo
))
{
return
null
;
}
String
[]
masterArray
=
heartBeatInfo
.
split
(
Constants
.
COMMA
);
if
(
masterArray
==
null
||
masterArray
.
length
!=
Constants
.
HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH
){
return
masterServer
;
if
(
masterArray
.
length
!=
Constants
.
HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH
){
return
null
;
}
masterServer
=
new
Server
();
Server
masterServer
=
new
Server
();
masterServer
.
setHost
(
masterArray
[
0
]);
masterServer
.
setPort
(
Integer
.
parseInt
(
masterArray
[
1
]));
masterServer
.
setResInfo
(
getResInfoJson
(
Double
.
parseDouble
(
masterArray
[
2
]),
...
...
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ScriptRunner.java
浏览文件 @
4bb044a4
...
...
@@ -169,13 +169,13 @@ public class ScriptRunner {
if
(
stopOnError
&&
rs
!=
null
)
{
ResultSetMetaData
md
=
rs
.
getMetaData
();
int
cols
=
md
.
getColumnCount
();
for
(
int
i
=
0
;
i
<
cols
;
i
++)
{
for
(
int
i
=
1
;
i
<
cols
;
i
++)
{
String
name
=
md
.
getColumnLabel
(
i
);
logger
.
info
(
"{} \t"
,
name
);
}
logger
.
info
(
""
);
while
(
rs
.
next
())
{
for
(
int
i
=
0
;
i
<
cols
;
i
++)
{
for
(
int
i
=
1
;
i
<
cols
;
i
++)
{
String
value
=
rs
.
getString
(
i
);
logger
.
info
(
"{} \t"
,
value
);
}
...
...
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/StringUtils.java
浏览文件 @
4bb044a4
...
...
@@ -16,17 +16,7 @@
*/
package
org.apache.dolphinscheduler.common.utils
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Iterator
;
import
java.util.Objects
;
import
java.util.regex.Pattern
;
public
class
StringUtils
{
public
static
final
int
INDEX_NOT_FOUND
=
-
1
;
public
static
final
String
EMPTY
=
""
;
public
static
boolean
isEmpty
(
final
CharSequence
cs
)
{
...
...
@@ -37,119 +27,14 @@ public class StringUtils {
return
!
isEmpty
(
cs
);
}
public
static
boolean
isBlank
(
CharSequence
cs
){
int
strLen
;
if
(
cs
==
null
||
(
strLen
=
cs
.
length
())
==
0
)
{
public
static
boolean
isBlank
(
String
s
){
if
(
isEmpty
(
s
))
{
return
true
;
}
for
(
int
i
=
0
;
i
<
strLen
;
i
++)
{
if
(
Character
.
isWhitespace
(
cs
.
charAt
(
i
))
==
false
)
{
return
false
;
}
}
return
true
;
}
public
static
boolean
isNotBlank
(
CharSequence
str
){
return
!
isBlank
(
str
);
}
public
static
String
substringBefore
(
final
String
str
,
final
String
separator
)
{
if
(
isBlank
(
str
)
||
separator
==
null
)
{
return
str
;
}
if
(
separator
.
isEmpty
())
{
return
EMPTY
;
}
final
int
pos
=
str
.
indexOf
(
separator
);
if
(
pos
==
INDEX_NOT_FOUND
)
{
return
str
;
}
return
str
.
substring
(
0
,
pos
);
}
public
static
String
substringAfter
(
final
String
str
,
final
String
separator
)
{
if
(
isBlank
(
str
))
{
return
str
;
}
if
(
separator
==
null
)
{
return
EMPTY
;
}
final
int
pos
=
str
.
indexOf
(
separator
);
if
(
pos
==
INDEX_NOT_FOUND
)
{
return
EMPTY
;
}
return
str
.
substring
(
pos
+
separator
.
length
());
return
s
.
trim
().
length
()
==
0
;
}
public
static
String
substringAfterLast
(
final
String
str
,
final
String
separator
)
{
if
(
isEmpty
(
str
))
{
return
str
;
}
if
(
isEmpty
(
separator
))
{
return
EMPTY
;
}
final
int
pos
=
str
.
lastIndexOf
(
separator
);
if
(
pos
==
INDEX_NOT_FOUND
||
pos
==
str
.
length
()
-
separator
.
length
())
{
return
EMPTY
;
}
return
str
.
substring
(
pos
+
separator
.
length
());
}
public
static
String
getUtf8String
(
byte
[]
bytes
){
return
new
String
(
bytes
,
StandardCharsets
.
UTF_8
);
}
public
static
byte
[]
getUtf8Bytes
(
String
str
){
return
str
.
getBytes
(
StandardCharsets
.
UTF_8
);
}
public
static
boolean
hasChinese
(
String
str
)
{
if
(
str
==
null
)
{
return
false
;
}
Pattern
pattern
=
Pattern
.
compile
(
"[\\u4E00-\\u9FBF]+"
);
return
pattern
.
matcher
(
str
).
find
();
}
public
static
boolean
hasSpace
(
String
str
)
{
if
(
str
==
null
)
{
return
false
;
}
int
len
=
str
.
length
();
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
if
(
str
.
charAt
(
i
)
==
' '
)
{
return
true
;
}
}
return
false
;
}
public
static
String
join
(
final
Iterable
<?>
iterable
,
final
String
separator
){
Iterator
<?>
iterator
=
iterable
.
iterator
();
if
(
iterator
==
null
)
{
return
null
;
}
if
(!
iterator
.
hasNext
())
{
return
EMPTY
;
}
final
Object
first
=
iterator
.
next
();
if
(!
iterable
.
iterator
().
hasNext
())
{
return
Objects
.
toString
(
first
,
""
);
}
final
StringBuilder
buf
=
new
StringBuilder
(
64
);
if
(
first
!=
null
)
{
buf
.
append
(
first
);
}
while
(
iterator
.
hasNext
())
{
if
(
separator
!=
null
)
{
buf
.
append
(
separator
);
}
final
Object
obj
=
iterator
.
next
();
if
(
obj
!=
null
)
{
buf
.
append
(
obj
);
}
}
return
buf
.
toString
();
public
static
boolean
isNotBlank
(
String
s
){
return
!
isBlank
(
s
);
}
}
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/placeholder/BusinessTimeUtils.java
浏览文件 @
4bb044a4
...
...
@@ -33,7 +33,9 @@ import static org.apache.commons.lang.time.DateUtils.addDays;
* business time utils
*/
public
class
BusinessTimeUtils
{
private
BusinessTimeUtils
()
{
throw
new
IllegalStateException
(
"BusinessTimeUtils class"
);
}
/**
* get business time in parameters by different command types
*
...
...
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/BaseTaskQueueTest.java
浏览文件 @
4bb044a4
...
...
@@ -17,12 +17,12 @@
package
org.apache.dolphinscheduler.common.queue
;
import
org.apache.dolphinscheduler.common.zk.ZKServer
;
import
org.junit.AfterClass
;
import
org.junit.BeforeClass
;
import
org.junit.*
;
/**
* base task queue test for only start zk server once
*/
@Ignore
public
class
BaseTaskQueueTest
{
protected
static
ITaskQueue
tasksQueue
=
null
;
...
...
@@ -40,4 +40,8 @@ public class BaseTaskQueueTest {
tasksQueue
.
delete
();
ZKServer
.
stop
();
}
@Test
public
void
tasksQueueNotNull
(){
Assert
.
assertNotNull
(
tasksQueue
);
}
}
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/ResInfoTest.java
0 → 100644
浏览文件 @
4bb044a4
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.dolphinscheduler.common.utils
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
java.util.Date
;
import
org.apache.dolphinscheduler.common.model.Server
;
public
class
ResInfoTest
{
@Test
public
void
testGetHeartBeatInfo
()
{
String
info
=
ResInfo
.
getHeartBeatInfo
(
new
Date
());
Assert
.
assertEquals
(
7
,
info
.
split
(
","
).
length
);
}
@Test
public
void
testParseHeartbeatForZKInfo
()
{
//normal info
String
info
=
ResInfo
.
getHeartBeatInfo
(
new
Date
());
Server
s
=
ResInfo
.
parseHeartbeatForZKInfo
(
info
);
Assert
.
assertNotNull
(
s
);
Assert
.
assertNotNull
(
s
.
getResInfo
());
//null param
s
=
ResInfo
.
parseHeartbeatForZKInfo
(
null
);
Assert
.
assertNull
(
s
);
}
}
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/ScriptRunnerTest.java
浏览文件 @
4bb044a4
...
...
@@ -48,7 +48,7 @@ public class ScriptRunnerTest {
Mockito
.
when
(
st
.
getResultSet
()).
thenReturn
(
rs
);
ResultSetMetaData
md
=
Mockito
.
mock
(
ResultSetMetaData
.
class
);
Mockito
.
when
(
rs
.
getMetaData
()).
thenReturn
(
md
);
Mockito
.
when
(
md
.
getColumnCount
()).
thenReturn
(
1
);
Mockito
.
when
(
md
.
getColumnCount
()).
thenReturn
(
2
);
Mockito
.
when
(
rs
.
next
()).
thenReturn
(
true
,
false
);
ScriptRunner
s
=
new
ScriptRunner
(
conn
,
true
,
true
);
if
(
dbName
.
isEmpty
())
{
...
...
@@ -56,7 +56,7 @@ public class ScriptRunnerTest {
}
else
{
s
.
runScript
(
new
StringReader
(
"select 1;"
),
dbName
);
}
Mockito
.
verify
(
md
).
getColumnLabel
(
0
);
Mockito
.
verify
(
md
).
getColumnLabel
(
1
);
}
catch
(
Exception
e
)
{
Assert
.
assertNotNull
(
e
);
}
...
...
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/StringUtilsTest.java
0 → 100644
浏览文件 @
4bb044a4
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.dolphinscheduler.common.utils
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
java.util.ArrayList
;
public
class
StringUtilsTest
{
@Test
public
void
testIsNotEmpty
()
{
//null string
boolean
b
=
StringUtils
.
isNotEmpty
(
null
);
Assert
.
assertFalse
(
b
);
//"" string
b
=
StringUtils
.
isNotEmpty
(
""
);
Assert
.
assertFalse
(
b
);
//" " string
b
=
StringUtils
.
isNotEmpty
(
" "
);
Assert
.
assertTrue
(
b
);
//"test" string
b
=
StringUtils
.
isNotEmpty
(
"test"
);
Assert
.
assertTrue
(
b
);
}
@Test
public
void
testIsNotBlank
()
{
//null string
boolean
b
=
StringUtils
.
isNotBlank
(
null
);
Assert
.
assertFalse
(
b
);
//"" string
b
=
StringUtils
.
isNotBlank
(
""
);
Assert
.
assertFalse
(
b
);
//" " string
b
=
StringUtils
.
isNotBlank
(
" "
);
Assert
.
assertFalse
(
b
);
//" test " string
b
=
StringUtils
.
isNotBlank
(
" test "
);
Assert
.
assertTrue
(
b
);
//"test" string
b
=
StringUtils
.
isNotBlank
(
"test"
);
Assert
.
assertTrue
(
b
);
}
}
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessDefinition.java
浏览文件 @
4bb044a4
...
...
@@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
...
...
@@ -158,6 +159,11 @@ public class ProcessDefinition {
*/
private
int
tenantId
;
/**
* modify user name
*/
private
String
modifyBy
;
public
String
getName
()
{
return
name
;
...
...
@@ -337,6 +343,30 @@ public class ProcessDefinition {
this
.
timeout
=
timeout
;
}
public
int
getTenantId
()
{
return
tenantId
;
}
public
void
setTenantId
(
int
tenantId
)
{
this
.
tenantId
=
tenantId
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getModifyBy
()
{
return
modifyBy
;
}
public
void
setModifyBy
(
String
modifyBy
)
{
this
.
modifyBy
=
modifyBy
;
}
@Override
public
String
toString
()
{
return
"ProcessDefinition{"
+
...
...
@@ -346,6 +376,7 @@ public class ProcessDefinition {
", releaseState="
+
releaseState
+
", projectId="
+
projectId
+
", processDefinitionJson='"
+
processDefinitionJson
+
'\''
+
", description='"
+
description
+
'\''
+
", globalParams='"
+
globalParams
+
'\''
+
", globalParamList="
+
globalParamList
+
", globalParamMap="
+
globalParamMap
+
...
...
@@ -362,22 +393,7 @@ public class ProcessDefinition {
", scheduleReleaseState="
+
scheduleReleaseState
+
", timeout="
+
timeout
+
", tenantId="
+
tenantId
+
", modifyBy='"
+
modifyBy
+
'\''
+
'}'
;
}
public
int
getTenantId
()
{
return
tenantId
;
}
public
void
setTenantId
(
int
tenantId
)
{
this
.
tenantId
=
tenantId
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
}
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
浏览文件 @
4bb044a4
...
...
@@ -121,6 +121,7 @@
<m-shell
v-if=
"taskType === 'SHELL'"
@
on-params=
"_onParams"
@
on-cache-params=
"_onCacheParams"
ref=
"SHELL"
:backfill-item=
"backfillItem"
>
</m-shell>
...
...
@@ -128,6 +129,7 @@
<m-sub-process
v-if=
"taskType === 'SUB_PROCESS'"
@
on-params=
"_onParams"
@
on-cache-params=
"_onCacheParams"
@
on-set-process-name=
"_onSetProcessName"
ref=
"SUB_PROCESS"
:backfill-item=
"backfillItem"
>
...
...
@@ -136,6 +138,7 @@
<m-procedure
v-if=
"taskType === 'PROCEDURE'"
@
on-params=
"_onParams"
@
on-cache-params=
"_onCacheParams"
ref=
"PROCEDURE"
:backfill-item=
"backfillItem"
>
</m-procedure>
...
...
@@ -167,6 +170,7 @@
<m-mr
v-if=
"taskType === 'MR'"
@
on-params=
"_onParams"
@
on-cache-params=
"_onCacheParams"
ref=
"MR"
:backfill-item=
"backfillItem"
>
</m-mr>
...
...
@@ -174,6 +178,7 @@
<m-python
v-if=
"taskType === 'PYTHON'"
@
on-params=
"_onParams"
@
on-cache-params=
"_onCacheParams"
ref=
"PYTHON"
:backfill-item=
"backfillItem"
>
</m-python>
...
...
@@ -181,6 +186,7 @@
<m-dependent
v-if=
"taskType === 'DEPENDENT'"
@
on-dependent=
"_onDependent"
@
on-cache-dependent=
"_onCacheDependent"
ref=
"DEPENDENT"
:backfill-item=
"backfillItem"
>
</m-dependent>
...
...
@@ -248,6 +254,8 @@
resourcesList
:
[],
// dependence
dependence
:
{},
// cache dependence
cacheDependence
:
{},
// Current node params data
params
:
{},
// Running sign
...
...
@@ -283,6 +291,12 @@
_onDependent
(
o
)
{
this
.
dependence
=
Object
.
assign
(
this
.
dependence
,
{},
o
)
},
/**
* cache dependent
*/
_onCacheDependent
(
o
)
{
this
.
cacheDependence
=
Object
.
assign
(
this
.
cacheDependence
,
{},
o
)
},
/**
* Task timeout alarm
*/
...
...
@@ -356,9 +370,10 @@
type
:
this
.
taskType
,
id
:
this
.
id
,
name
:
this
.
name
,
params
:
this
.
params
,
description
:
this
.
description
,
runFlag
:
this
.
runFlag
,
dependence
:
this
.
d
ependence
,
dependence
:
this
.
cacheD
ependence
,
maxRetryTimes
:
this
.
maxRetryTimes
,
retryInterval
:
this
.
retryInterval
,
timeout
:
this
.
timeout
,
...
...
@@ -522,6 +537,7 @@
this
.
params
=
o
.
params
||
{}
this
.
dependence
=
o
.
dependence
||
{}
this
.
cacheDependence
=
o
.
dependence
||
{}
}
this
.
isContentBox
=
true
...
...
@@ -551,7 +567,7 @@
name
:
this
.
name
,
description
:
this
.
description
,
runFlag
:
this
.
runFlag
,
dependence
:
this
.
d
ependence
,
dependence
:
this
.
cacheD
ependence
,
maxRetryTimes
:
this
.
maxRetryTimes
,
retryInterval
:
this
.
retryInterval
,
timeout
:
this
.
timeout
,
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
浏览文件 @
4bb044a4
...
...
@@ -131,6 +131,9 @@
setTimeout
(()
=>
{
this
.
isLoading
=
false
},
600
)
},
cacheDependence
(
val
)
{
this
.
$emit
(
'
on-cache-dependent
'
,
val
)
}
},
beforeCreate
()
{
...
...
@@ -151,7 +154,19 @@
},
destroyed
()
{
},
computed
:
{},
computed
:
{
cacheDependence
()
{
return
{
relation
:
this
.
relation
,
dependTaskList
:
_
.
map
(
this
.
dependTaskList
,
v
=>
{
return
{
relation
:
v
.
relation
,
dependItemList
:
_
.
map
(
v
.
dependItemList
,
v1
=>
_
.
omit
(
v1
,
[
'
depTasksList
'
,
'
state
'
,
'
dateValueList
'
]))
}
})
}
}
},
components
:
{
mListBox
,
mDependItemList
}
}
</
script
>
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
浏览文件 @
4bb044a4
...
...
@@ -379,7 +379,7 @@
// Non-null objects represent backfill
if
(
!
_
.
isEmpty
(
o
))
{
this
.
mainClass
=
o
.
params
.
mainClass
||
''
this
.
mainJar
=
o
.
params
.
mainJar
.
res
||
''
this
.
mainJar
=
o
.
params
.
mainJar
&&
o
.
params
.
mainJar
.
res
?
o
.
params
.
mainJar
.
res
:
''
this
.
deployMode
=
o
.
params
.
deployMode
||
''
this
.
slot
=
o
.
params
.
slot
||
1
this
.
taskManager
=
o
.
params
.
taskManager
||
'
2
'
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
浏览文件 @
4bb044a4
...
...
@@ -91,6 +91,7 @@
<m-resources
ref=
"refResources"
@
on-resourcesData=
"_onResourcesData"
@
on-cache-resourcesData=
"_onCacheResourcesData"
:resource-list=
"resourceList"
>
</m-resources>
</div>
...
...
@@ -127,6 +128,8 @@
mainJarList
:
[],
// Resource(list)
resourceList
:
[],
// Cache ResourceList
cacheResourceList
:
[],
// Custom parameter
localParams
:
[],
// Command line argument
...
...
@@ -156,6 +159,12 @@
_onResourcesData
(
a
)
{
this
.
resourceList
=
a
},
/**
* cache resourceList
*/
_onCacheResourcesData
(
a
)
{
this
.
cacheResourceList
=
a
},
/**
* verification
*/
...
...
@@ -220,6 +229,25 @@
if
(
type
===
'
PYTHON
'
)
{
this
.
mainClass
=
''
}
},
//Watch the cacheParams
cacheParams
(
val
)
{
this
.
$emit
(
'
on-cache-params
'
,
val
);
}
},
computed
:
{
cacheParams
()
{
return
{
mainClass
:
this
.
mainClass
,
mainJar
:
{
res
:
this
.
mainJar
},
resourceList
:
this
.
cacheResourceList
,
localParams
:
this
.
localParams
,
mainArgs
:
this
.
mainArgs
,
others
:
this
.
others
,
programType
:
this
.
programType
}
}
},
created
()
{
...
...
@@ -238,6 +266,7 @@
let
resourceList
=
o
.
params
.
resourceList
||
[]
if
(
resourceList
.
length
)
{
this
.
resourceList
=
resourceList
this
.
cacheResourceList
=
resourceList
}
// backfill localParams
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue
浏览文件 @
4bb044a4
...
...
@@ -70,7 +70,9 @@
// Data source type
type
:
''
,
// data source
datasource
:
''
datasource
:
''
,
// Return to the selected data source
rtDatasource
:
''
}
},
mixins
:
[
disabledState
],
...
...
@@ -83,7 +85,7 @@
*/
_onDsData
(
o
)
{
this
.
type
=
o
.
type
this
.
d
atasource
=
o
.
datasource
this
.
rtD
atasource
=
o
.
datasource
},
/**
* return udp
...
...
@@ -112,14 +114,29 @@
// storage
this
.
$emit
(
'
on-params
'
,
{
type
:
this
.
type
,
datasource
:
this
.
d
atasource
,
datasource
:
this
.
rtD
atasource
,
method
:
this
.
method
,
localParams
:
this
.
localParams
})
return
true
}
},
watch
:
{},
watch
:
{
//Watch the cacheParams
cacheParams
(
val
)
{
this
.
$emit
(
'
on-cache-params
'
,
val
);
}
},
computed
:
{
cacheParams
()
{
return
{
type
:
this
.
type
,
datasource
:
this
.
rtDatasource
,
method
:
this
.
method
,
localParams
:
this
.
localParams
}
}
},
created
()
{
let
o
=
this
.
backfillItem
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
浏览文件 @
4bb044a4
...
...
@@ -31,6 +31,7 @@
<m-resources
ref=
"refResources"
@
on-resourcesData=
"_onResourcesData"
@
on-cache-resourcesData=
"_onCacheResourcesData"
:resource-list=
"resourceList"
>
</m-resources>
</div>
...
...
@@ -69,7 +70,9 @@
// Custom parameter
localParams
:
[],
// resource(list)
resourceList
:
[]
resourceList
:
[],
// Cache ResourceList
cacheResourceList
:
[]
}
},
mixins
:
[
disabledState
],
...
...
@@ -89,6 +92,12 @@
_onResourcesData
(
a
)
{
this
.
resourceList
=
a
},
/**
* cache resourceList
*/
_onCacheResourcesData
(
a
)
{
this
.
cacheResourceList
=
a
},
/**
* verification
*/
...
...
@@ -142,18 +151,33 @@
return
editor
}
},
watch
:
{},
watch
:
{
//Watch the cacheParams
cacheParams
(
val
)
{
this
.
$emit
(
'
on-cache-params
'
,
val
);
}
},
computed
:
{
cacheParams
()
{
return
{
resourceList
:
this
.
cacheResourceList
,
localParams
:
this
.
localParams
,
rawScript
:
editor
?
editor
.
getValue
()
:
''
}
}
},
created
()
{
let
o
=
this
.
backfillItem
// Non-null objects represent backfill
if
(
!
_
.
isEmpty
(
o
))
{
this
.
rawScript
=
o
.
params
.
rawScript
this
.
rawScript
=
o
.
params
.
rawScript
||
''
// backfill resourceList
let
resourceList
=
o
.
params
.
resourceList
||
[]
if
(
resourceList
.
length
)
{
this
.
resourceList
=
resourceList
this
.
cacheResourceList
=
resourceList
}
// backfill localParams
...
...
@@ -174,4 +198,4 @@
},
components
:
{
mLocalParams
,
mListBox
,
mResources
}
}
</
script
>
\ No newline at end of file
</
script
>
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
浏览文件 @
4bb044a4
...
...
@@ -37,6 +37,7 @@
<m-resources
ref=
"refResources"
@
on-resourcesData=
"_onResourcesData"
@
on-cache-resourcesData=
"_onCacheResourcesData"
:resource-list=
"resourceList"
>
</m-resources>
</div>
...
...
@@ -75,7 +76,9 @@
// Custom parameter
localParams
:
[],
// resource(list)
resourceList
:
[]
resourceList
:
[],
// Cache ResourceList
cacheResourceList
:
[]
}
},
mixins
:
[
disabledState
],
...
...
@@ -119,11 +122,17 @@
},
/**
* return resourceList
*
*
*/
_onResourcesData
(
a
)
{
this
.
resourceList
=
a
},
/**
* cache resourceList
*/
_onCacheResourcesData
(
a
)
{
this
.
cacheResourceList
=
a
},
/**
* verification
*/
...
...
@@ -175,18 +184,33 @@
return
editor
}
},
watch
:
{},
watch
:
{
//Watch the cacheParams
cacheParams
(
val
)
{
this
.
$emit
(
'
on-cache-params
'
,
val
);
}
},
computed
:
{
cacheParams
()
{
return
{
resourceList
:
this
.
cacheResourceList
,
localParams
:
this
.
localParams
,
rawScript
:
editor
?
editor
.
getValue
()
:
''
}
}
},
created
()
{
let
o
=
this
.
backfillItem
// Non-null objects represent backfill
if
(
!
_
.
isEmpty
(
o
))
{
this
.
rawScript
=
o
.
params
.
rawScript
this
.
rawScript
=
o
.
params
.
rawScript
||
''
// backfill resourceList
let
resourceList
=
o
.
params
.
resourceList
||
[]
if
(
resourceList
.
length
)
{
this
.
resourceList
=
resourceList
this
.
cacheResourceList
=
resourceList
}
// backfill localParams
...
...
@@ -229,5 +253,5 @@
right
:
-12px
;
top
:
-16px
;
}
</
style
>
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
浏览文件 @
4bb044a4
...
...
@@ -412,7 +412,7 @@
// Non-null objects represent backfill
if
(
!
_
.
isEmpty
(
o
))
{
this
.
mainClass
=
o
.
params
.
mainClass
||
''
this
.
mainJar
=
o
.
params
.
mainJar
.
res
||
''
this
.
mainJar
=
o
.
params
.
mainJar
&&
o
.
params
.
mainJar
.
res
?
o
.
params
.
mainJar
.
res
:
''
this
.
deployMode
=
o
.
params
.
deployMode
||
''
this
.
driverCores
=
o
.
params
.
driverCores
||
1
this
.
driverMemory
=
o
.
params
.
driverMemory
||
'
512M
'
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue
浏览文件 @
4bb044a4
...
...
@@ -86,7 +86,13 @@
return
_
.
filter
(
this
.
processDefinitionList
,
v
=>
id
===
v
.
id
)[
0
].
code
}
},
watch
:
{},
watch
:
{
wdiCurr
(
val
)
{
this
.
$emit
(
'
on-cache-params
'
,
{
processDefinitionId
:
this
.
wdiCurr
})
}
},
created
()
{
let
processListS
=
_
.
cloneDeep
(
this
.
store
.
state
.
dag
.
processListS
)
let
id
=
this
.
router
.
history
.
current
.
params
.
id
||
null
...
...
@@ -115,4 +121,4 @@
mounted
()
{
}
}
</
script
>
\ No newline at end of file
</
script
>
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue
浏览文件 @
4bb044a4
...
...
@@ -40,6 +40,9 @@
<th
scope=
"col"
>
<span>
{{
$t
(
'
Description
'
)
}}
</span>
</th>
<th
scope=
"col"
width=
"130"
>
<span>
{{
$t
(
'
Modify User
'
)
}}
</span>
</th>
<th
scope=
"col"
width=
"90"
>
<span>
{{
$t
(
'
Timing state
'
)
}}
</span>
</th>
...
...
@@ -72,6 +75,10 @@
<span
v-if=
"item.description"
class=
"ellipsis"
v-tooltip.large.top.start.light=
"
{text: item.description, maxWidth: '500px'}">
{{
item
.
description
}}
</span>
<span
v-else
>
-
</span>
</td>
<td>
<span
v-if=
"item.modifyBy"
>
{{
item
.
modifyBy
}}
</span>
<span
v-else
>
-
</span>
</td>
<td>
<span
v-if=
"item.scheduleReleaseState === 'OFFLINE'"
>
{{
$t
(
'
offline
'
)
}}
</span>
<span
v-if=
"item.scheduleReleaseState === 'ONLINE'"
>
{{
$t
(
'
online
'
)
}}
</span>
...
...
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
浏览文件 @
4bb044a4
...
...
@@ -518,4 +518,5 @@ export default {
'
SpeedRecord
'
:
'
speed(record count)
'
,
'
0 means unlimited by byte
'
:
'
0 means unlimited
'
,
'
0 means unlimited by count
'
:
'
0 means unlimited
'
,
'
Modify User
'
:
'
Modify User
'
}
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
浏览文件 @
4bb044a4
...
...
@@ -518,4 +518,5 @@ export default {
'
SpeedRecord
'
:
'
限流(记录数)
'
,
'
0 means unlimited by byte
'
:
'
KB,0代表不限制
'
,
'
0 means unlimited by count
'
:
'
0代表不限制
'
,
'
Modify User
'
:
'
修改用户
'
}
pom.xml
浏览文件 @
4bb044a4
...
...
@@ -343,6 +343,7 @@
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
${mysql.connector.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
...
...
sql/dolphinscheduler-postgre.sql
浏览文件 @
4bb044a4
...
...
@@ -319,6 +319,7 @@ CREATE TABLE t_ds_process_definition (
timeout
int
DEFAULT
'0'
,
tenant_id
int
NOT
NULL
DEFAULT
'-1'
,
update_time
timestamp
DEFAULT
NULL
,
modify_by
varchar
(
36
)
DEFAULT
''
,
PRIMARY
KEY
(
id
)
)
;
...
...
sql/dolphinscheduler_mysql.sql
浏览文件 @
4bb044a4
...
...
@@ -366,6 +366,7 @@ CREATE TABLE `t_ds_process_definition` (
`timeout`
int
(
11
)
DEFAULT
'0'
COMMENT
'time out'
,
`tenant_id`
int
(
11
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'tenant id'
,
`update_time`
datetime
DEFAULT
NULL
COMMENT
'update time'
,
`modify_by`
varchar
(
36
)
DEFAULT
''
COMMENT
'modify user'
,
PRIMARY
KEY
(
`id`
),
KEY
`process_definition_index`
(
`project_id`
,
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
...
...
sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_ddl.sql
0 → 100644
浏览文件 @
4bb044a4
/*
* 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.
*/
SET
sql_mode
=
(
SELECT
REPLACE
(
@@
sql_mode
,
'ONLY_FULL_GROUP_BY'
,
''
));
-- uc_dolphin_T_t_ds_process_definition_A_modify_by
drop
PROCEDURE
if
EXISTS
uc_dolphin_T_t_ds_process_definition_A_modify_by
;
delimiter
d
//
CREATE
PROCEDURE
uc_dolphin_T_t_ds_process_definition_A_modify_by
()
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_process_definition'
AND
TABLE_SCHEMA
=
(
SELECT
DATABASE
())
AND
COLUMN_NAME
=
'modify_by'
)
THEN
ALTER
TABLE
t_ds_process_definition
ADD
`modify_by`
varchar
(
36
)
DEFAULT
''
COMMENT
'modify user'
;
END
IF
;
END
;
d
//
delimiter
;
CALL
uc_dolphin_T_t_ds_process_definition_A_modify_by
;
DROP
PROCEDURE
uc_dolphin_T_t_ds_process_definition_A_modify_by
;
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ArrayUtils.java
→
sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_dml.sql
浏览文件 @
4bb044a4
...
...
@@ -13,14 +13,4 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.dolphinscheduler.common.utils
;
public
class
ArrayUtils
{
public
static
boolean
isEmpty
(
final
int
[]
array
)
{
return
array
==
null
||
array
.
length
==
0
;
}
}
*/
\ No newline at end of file
sql/upgrade/1.2.2_schema/postgresql/dolphinscheduler_ddl.sql
0 → 100644
浏览文件 @
4bb044a4
/*
* 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.
*/
-- uc_dolphin_T_t_ds_process_definition_A_modify_by
delimiter
d
//
CREATE
OR
REPLACE
FUNCTION
uc_dolphin_T_t_ds_process_definition_A_modify_by
()
RETURNS
void
AS
$$
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_process_definition'
AND
COLUMN_NAME
=
'modify_by'
)
THEN
ALTER
TABLE
t_ds_process_definition
ADD
COLUMN
modify_by
varchar
(
36
)
DEFAULT
''
;
END
IF
;
END
;
$$
LANGUAGE
plpgsql
;
d
//
delimiter
;
SELECT
uc_dolphin_T_t_ds_process_definition_A_modify_by
();
DROP
FUNCTION
IF
EXISTS
uc_dolphin_T_t_ds_process_definition_A_modify_by
();
sql/upgrade/1.2.2_schema/postgresql/dolphinscheduler_dml.sql
0 → 100644
浏览文件 @
4bb044a4
/*
* 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.
*/
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录