Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
#法外狂徒张三
DolphinScheduler
提交
caa9ba48
DolphinScheduler
项目概览
#法外狂徒张三
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
12
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,发现更多精彩内容 >>
提交
caa9ba48
编写于
7月 10, 2019
作者:
leon-baoliang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
check tenant is available
上级
fd89dff3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
7 deletion
+30
-7
escheduler-api/src/main/java/cn/escheduler/api/enums/Status.java
...ler-api/src/main/java/cn/escheduler/api/enums/Status.java
+1
-0
escheduler-api/src/main/java/cn/escheduler/api/service/ExecutorService.java
.../main/java/cn/escheduler/api/service/ExecutorService.java
+24
-7
escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java
...a/cn/escheduler/server/worker/runner/FetchTaskThread.java
+5
-0
未找到文件。
escheduler-api/src/main/java/cn/escheduler/api/enums/Status.java
浏览文件 @
caa9ba48
...
...
@@ -211,6 +211,7 @@ public enum Status {
DELETE_SCHEDULE_CRON_BY_ID_ERROR
(
50024
,
"delete schedule by id error"
),
BATCH_DELETE_PROCESS_DEFINE_ERROR
(
50025
,
"batch delete process definition error"
),
BATCH_DELETE_PROCESS_DEFINE_BY_IDS_ERROR
(
50026
,
"batch delete process definition by ids {0} error"
),
TENANT_NOT_SUITABLE
(
50027
,
"there is not any tenant suitable, please choose a tenant available."
),
HDFS_NOT_STARTUP
(
60001
,
"hdfs not startup"
),
HDFS_TERANT_RESOURCES_FILE_EXISTS
(
60002
,
"resource file exists,please delete resource first"
),
...
...
escheduler-api/src/main/java/cn/escheduler/api/service/ExecutorService.java
浏览文件 @
caa9ba48
...
...
@@ -110,6 +110,13 @@ public class ExecutorService extends BaseService{
return
result
;
}
if
(!
checkTenantSuitable
(
processDefinition
)){
logger
.
error
(
"there is not any vaild tenant for the process definition: id:{},name:{}, "
,
processDefinition
.
getId
(),
processDefinition
.
getName
());
putMsg
(
result
,
Status
.
TENANT_NOT_SUITABLE
);
return
result
;
}
/**
* create command
*/
...
...
@@ -190,15 +197,10 @@ public class ExecutorService extends BaseService{
if
(
status
!=
Status
.
SUCCESS
)
{
return
checkResult
;
}
// checkTenantExists();
Tenant
tenant
=
processDao
.
getTenantForProcess
(
processDefinition
.
getTenantId
(),
processDefinition
.
getUserId
());
if
(
tenant
==
null
){
if
(!
checkTenantSuitable
(
processDefinition
)){
logger
.
error
(
"there is not any vaild tenant for the process definition: id:{},name:{}, "
,
processDefinition
.
getId
(),
processDefinition
.
getName
());
putMsg
(
result
,
Status
.
PROCESS_INSTANCE_NOT_EXIST
,
processInstanceId
);
return
result
;
putMsg
(
result
,
Status
.
TENANT_NOT_SUITABLE
);
}
switch
(
executeType
)
{
...
...
@@ -240,6 +242,21 @@ public class ExecutorService extends BaseService{
return
result
;
}
/**
* check tenant suitable
* @param processDefinition
* @return
*/
private
boolean
checkTenantSuitable
(
ProcessDefinition
processDefinition
)
{
// checkTenantExists();
Tenant
tenant
=
processDao
.
getTenantForProcess
(
processDefinition
.
getTenantId
(),
processDefinition
.
getUserId
());
if
(
tenant
==
null
){
return
false
;
}
return
true
;
}
/**
* Check the state of process instance and the type of operation match
*
...
...
escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java
浏览文件 @
caa9ba48
...
...
@@ -210,6 +210,11 @@ public class FetchTaskThread implements Runnable{
Tenant
tenant
=
processDao
.
getTenantForProcess
(
processInstance
.
getTenantId
(),
processDefine
.
getUserId
());
if
(
tenant
==
null
){
logger
.
error
(
"cannot find suitable tenant for the task:{}, process instance tenant:{}, process definition tenant:{}"
,
taskInstance
.
getName
(),
processInstance
.
getTenantId
(),
processDefine
.
getTenantId
());
continue
;
}
// check and create Linux users
FileUtils
.
createWorkDirAndUserIfAbsent
(
execLocalPath
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录