Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wk1234123
DolphinScheduler
提交
24120a46
DolphinScheduler
项目概览
wk1234123
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
5
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,发现更多精彩内容 >>
提交
24120a46
编写于
6月 12, 2020
作者:
S
simon824
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the bad code smell
上级
cfecfb79
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
22 addition
and
34 deletion
+22
-34
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtils.java
...e/dolphinscheduler/alert/utils/EnterpriseWeChatUtils.java
+0
-1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java
...pache/dolphinscheduler/api/service/DataSourceService.java
+1
-1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
...olphinscheduler/api/service/ProcessDefinitionService.java
+0
-1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java
.../dolphinscheduler/api/service/ProcessInstanceService.java
+1
-3
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
...apache/dolphinscheduler/api/service/ResourcesService.java
+2
-2
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
...org/apache/dolphinscheduler/common/utils/HadoopUtils.java
+4
-3
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AlertGroup.java
...va/org/apache/dolphinscheduler/dao/entity/AlertGroup.java
+0
-1
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessDefinition.java
...apache/dolphinscheduler/dao/entity/ProcessDefinition.java
+1
-9
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/entity/ProcessDefinitionTest.java
...he/dolphinscheduler/dao/entity/ProcessDefinitionTest.java
+1
-1
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/utils/JsonSerializer.java
.../apache/dolphinscheduler/remote/utils/JsonSerializer.java
+3
-0
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
...phinscheduler/server/worker/runner/TaskExecuteThread.java
+0
-2
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java
.../dolphinscheduler/server/worker/task/datax/DataxTask.java
+5
-5
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
...ache/dolphinscheduler/server/worker/task/sql/SqlTask.java
+4
-3
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
...ache/dolphinscheduler/service/process/ProcessService.java
+0
-2
未找到文件。
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtils.java
浏览文件 @
24120a46
...
...
@@ -20,7 +20,6 @@ import org.apache.dolphinscheduler.common.enums.ShowType;
import
org.apache.dolphinscheduler.common.utils.StringUtils
;
import
org.apache.dolphinscheduler.common.utils.*
;
import
com.google.common.reflect.TypeToken
;
import
org.apache.dolphinscheduler.plugin.model.AlertData
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
...
...
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java
浏览文件 @
24120a46
...
...
@@ -539,7 +539,7 @@ public class DataSourceService extends BaseService{
}
if
(
logger
.
isDebugEnabled
()){
logger
.
info
(
"parameters map
-----"
+
JSONUtils
.
toJsonString
(
parameterMap
));
logger
.
info
(
"parameters map
:{}"
,
JSONUtils
.
toJsonString
(
parameterMap
));
}
return
JSONUtils
.
toJsonString
(
parameterMap
);
...
...
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
浏览文件 @
24120a46
...
...
@@ -19,7 +19,6 @@ package org.apache.dolphinscheduler.api.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.node.ArrayNode
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
...
...
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java
浏览文件 @
24120a46
...
...
@@ -18,7 +18,6 @@ package org.apache.dolphinscheduler.api.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
org.apache.dolphinscheduler.api.dto.gantt.GanttDto
;
import
org.apache.dolphinscheduler.api.dto.gantt.Task
;
import
org.apache.dolphinscheduler.api.enums.Status
;
...
...
@@ -554,8 +553,7 @@ public class ProcessInstanceService extends BaseDAGService {
String
localParams
=
map
.
get
(
LOCAL_PARAMS
);
if
(
localParams
!=
null
&&
!
localParams
.
isEmpty
())
{
localParams
=
ParameterUtils
.
convertParameterPlaceholders
(
localParams
,
timeParams
);
List
<
Property
>
localParamsList
=
new
ArrayList
<>();
localParamsList
=
JSONUtils
.
toList
(
localParams
,
Property
.
class
);
List
<
Property
>
localParamsList
=
JSONUtils
.
toList
(
localParams
,
Property
.
class
);
Map
<
String
,
Object
>
localParamsMap
=
new
HashMap
<>();
localParamsMap
.
put
(
"taskType"
,
taskNode
.
getType
());
...
...
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
浏览文件 @
24120a46
...
...
@@ -543,7 +543,6 @@ public class ResourcesService extends BaseService {
}
List
<
Resource
>
allResourceList
=
resourcesMapper
.
queryResourceListAuthored
(
userId
,
type
.
ordinal
(),
0
);
Visitor
resourceTreeVisitor
=
new
ResourceTreeVisitor
(
allResourceList
);
//JSONArray jsonArray = JSONUtils.toList(JSONUtils.toJsonString(resourceTreeVisitor.visit().getChildren(), SerializerFeature.SortField));
result
.
put
(
Constants
.
DATA_LIST
,
resourceTreeVisitor
.
visit
().
getChildren
());
putMsg
(
result
,
Status
.
SUCCESS
);
...
...
@@ -1127,7 +1126,8 @@ public class ResourcesService extends BaseService {
}
List
<
Resource
>
authedResources
=
resourcesMapper
.
queryAuthorizedResourceList
(
userId
);
Visitor
visitor
=
new
ResourceTreeVisitor
(
authedResources
);
logger
.
info
(
JSONUtils
.
toJsonString
(
visitor
.
visit
(),
SerializationFeature
.
ORDER_MAP_ENTRIES_BY_KEYS
));
String
visit
=
JSONUtils
.
toJsonString
(
visitor
.
visit
(),
SerializationFeature
.
ORDER_MAP_ENTRIES_BY_KEYS
);
logger
.
info
(
visit
);
String
jsonTreeStr
=
JSONUtils
.
toJsonString
(
visitor
.
visit
().
getChildren
(),
SerializationFeature
.
ORDER_MAP_ENTRIES_BY_KEYS
);
logger
.
info
(
jsonTreeStr
);
result
.
put
(
Constants
.
DATA_LIST
,
visitor
.
visit
().
getChildren
());
...
...
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
浏览文件 @
24120a46
...
...
@@ -16,7 +16,8 @@
*/
package
org.apache.dolphinscheduler.common.utils
;
import
com.fasterxml.jackson.core.io.JsonEOFException
;
import
com.fasterxml.jackson.core.JsonParseException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.google.common.cache.CacheBuilder
;
import
com.google.common.cache.CacheLoader
;
...
...
@@ -408,7 +409,7 @@ public class HadoopUtils implements Closeable {
* @param applicationId application id
* @return the return may be null or there may be other parse exceptions
*/
public
ExecutionStatus
getApplicationStatus
(
String
applicationId
)
throws
NullPointerException
{
public
ExecutionStatus
getApplicationStatus
(
String
applicationId
)
{
if
(
StringUtils
.
isEmpty
(
applicationId
))
{
return
null
;
}
...
...
@@ -428,7 +429,7 @@ public class HadoopUtils implements Closeable {
responseContent
=
HttpUtils
.
get
(
jobHistoryUrl
);
ObjectNode
jsonObject
=
JSONUtils
.
parseObject
(
responseContent
);
if
(!
jsonObject
.
has
(
"job"
)){
throw
new
NullPointerException
()
;
return
ExecutionStatus
.
FAILURE
;
}
result
=
jsonObject
.
path
(
"job"
).
path
(
"state"
).
asText
();
}
...
...
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AlertGroup.java
浏览文件 @
24120a46
...
...
@@ -17,7 +17,6 @@
package
org.apache.dolphinscheduler.dao.entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.apache.dolphinscheduler.common.enums.AlertType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
...
...
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessDefinition.java
浏览文件 @
24120a46
...
...
@@ -22,21 +22,16 @@ import com.baomidou.mybatisplus.annotation.TableId;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
org.apache.dolphinscheduler.common.enums.Flag
;
import
org.apache.dolphinscheduler.common.enums.ReleaseState
;
import
org.apache.dolphinscheduler.common.process.Property
;
import
org.apache.dolphinscheduler.common.utils.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
...
...
@@ -44,7 +39,6 @@ import java.util.stream.Stream;
*/
@TableName
(
"t_ds_process_definition"
)
public
class
ProcessDefinition
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProcessDefinition
.
class
);
/**
* id
...
...
@@ -300,10 +294,8 @@ public class ProcessDefinition {
}
public
Map
<
String
,
String
>
getGlobalParamMap
()
{
List
<
Property
>
propList
=
new
ArrayList
<>
();
if
(
globalParamMap
==
null
&&
StringUtils
.
isNotEmpty
(
globalParams
))
{
propList
=
JSONUtils
.
toList
(
globalParams
,
Property
.
class
);
List
<
Property
>
propList
=
JSONUtils
.
toList
(
globalParams
,
Property
.
class
);
globalParamMap
=
propList
.
stream
().
collect
(
Collectors
.
toMap
(
Property:
:
getProp
,
Property:
:
getValue
));
}
...
...
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/entity/ProcessDefinitionTest.java
浏览文件 @
24120a46
...
...
@@ -32,7 +32,7 @@ public class ProcessDefinitionTest {
taskInstance
.
setGlobalParams
(
"[{\"prop\":\"selenium_global_parameters_1\",\"direct\":\"IN\",\"type\":\"VARCHAR\",\"value\":\"selenium_global_parameters_value_1\"}]"
);
taskInstance
.
getGlobalParamMap
();
Assert
.
assertEquals
(
taskInstance
.
getGlobalParamMap
().
toString
(),
"{selenium_global_parameters_1=selenium_global_parameters_value_1}"
);
Assert
.
assertEquals
(
"{selenium_global_parameters_1=selenium_global_parameters_value_1}"
,
taskInstance
.
getGlobalParamMap
().
toString
()
);
...
...
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/utils/JsonSerializer.java
浏览文件 @
24120a46
...
...
@@ -31,6 +31,9 @@ public class JsonSerializer {
private
static
final
ObjectMapper
objectMapper
=
new
ObjectMapper
();
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
JsonSerializer
.
class
);
private
JsonSerializer
(){
}
/**
* serialize to byte
*
...
...
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
浏览文件 @
24120a46
...
...
@@ -16,7 +16,6 @@
*/
package
org.apache.dolphinscheduler.server.worker.runner
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
org.apache.dolphinscheduler.common.utils.*
;
import
org.apache.dolphinscheduler.common.Constants
;
...
...
@@ -25,7 +24,6 @@ import org.apache.dolphinscheduler.common.model.TaskNode;
import
org.apache.dolphinscheduler.common.process.Property
;
import
org.apache.dolphinscheduler.common.task.TaskTimeoutParameter
;
import
org.apache.dolphinscheduler.common.thread.ThreadUtils
;
import
org.apache.dolphinscheduler.common.utils.*
;
import
org.apache.dolphinscheduler.remote.command.TaskExecuteResponseCommand
;
import
org.apache.dolphinscheduler.server.entity.TaskExecutionContext
;
import
org.apache.dolphinscheduler.server.worker.processor.TaskCallbackService
;
...
...
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java
浏览文件 @
24120a46
...
...
@@ -223,7 +223,7 @@ public class DataxTask extends AbstractTask {
* @return collection of datax job config JSONObject
* @throws SQLException if error throws SQLException
*/
private
List
<
ObjectNode
>
buildDataxJobContentJson
()
throws
SQLException
{
private
List
<
ObjectNode
>
buildDataxJobContentJson
()
{
DataxTaskExecutionContext
dataxTaskExecutionContext
=
taskExecutionContext
.
getDataxTaskExecutionContext
();
...
...
@@ -304,8 +304,8 @@ public class DataxTask extends AbstractTask {
List
<
ObjectNode
>
contentList
=
new
ArrayList
<>();
ObjectNode
content
=
JSONUtils
.
createObjectNode
();
content
.
put
(
"reader"
,
reader
);
content
.
put
(
"writer"
,
writer
);
content
.
put
(
"reader"
,
reader
.
toString
()
);
content
.
put
(
"writer"
,
reader
.
toString
()
);
contentList
.
add
(
content
);
return
contentList
;
...
...
@@ -335,8 +335,8 @@ public class DataxTask extends AbstractTask {
errorLimit
.
put
(
"percentage"
,
0
);
ObjectNode
setting
=
JSONUtils
.
createObjectNode
();
setting
.
put
(
"speed"
,
speed
);
setting
.
put
(
"errorLimit"
,
errorLimit
);
setting
.
put
(
"speed"
,
speed
.
toString
()
);
setting
.
put
(
"errorLimit"
,
errorLimit
.
toString
()
);
return
setting
;
}
...
...
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
浏览文件 @
24120a46
...
...
@@ -269,16 +269,17 @@ public class SqlTask extends AbstractTask {
resultJSONArray
.
add
(
mapOfColValues
);
rowCount
++;
}
logger
.
debug
(
"execute sql : {}"
,
JSONUtils
.
toJsonString
(
resultJSONArray
,
SerializationFeature
.
WRITE_NULL_MAP_VALUES
));
String
result
=
JSONUtils
.
toJsonString
(
resultJSONArray
);
logger
.
debug
(
"execute sql : {}"
,
result
);
// if there is a result set
if
(!
resultJSONArray
.
isEmpty
(
null
)
)
{
if
(
StringUtils
.
isNotEmpty
(
sqlParameters
.
getTitle
()))
{
sendAttachment
(
sqlParameters
.
getTitle
(),
JSONUtils
.
toJsonString
(
resultJSONArray
,
SerializationFeature
.
WRITE_NULL_MAP_VALUES
));
JSONUtils
.
toJsonString
(
resultJSONArray
));
}
else
{
sendAttachment
(
taskExecutionContext
.
getTaskName
()
+
" query resultsets "
,
JSONUtils
.
toJsonString
(
resultJSONArray
,
SerializationFeature
.
WRITE_NULL_MAP_VALUES
));
JSONUtils
.
toJsonString
(
resultJSONArray
));
}
}
}
...
...
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
浏览文件 @
24120a46
...
...
@@ -17,7 +17,6 @@
package
org.apache.dolphinscheduler.service.process
;
import
com.cronutils.model.Cron
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
org.apache.commons.lang.ArrayUtils
;
import
org.apache.dolphinscheduler.common.Constants
;
...
...
@@ -37,7 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录