Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pentaLiker
DolphinScheduler
提交
4c7743f3
DolphinScheduler
项目概览
pentaLiker
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
1
Star
1
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,发现更多精彩内容 >>
提交
4c7743f3
编写于
11月 13, 2020
作者:
江
江蓠
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code style
上级
f4ef86c5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
20 addition
and
15 deletion
+20
-15
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/OSUtils.java
.../apache/dolphinscheduler/plugin/alert/script/OSUtils.java
+3
-0
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ProcessUtils.java
...he/dolphinscheduler/plugin/alert/script/ProcessUtils.java
+11
-1
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptAlertChannelFactory.java
...eduler/plugin/alert/script/ScriptAlertChannelFactory.java
+3
-3
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptSender.java
...he/dolphinscheduler/plugin/alert/script/ScriptSender.java
+0
-2
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptType.java
...ache/dolphinscheduler/plugin/alert/script/ScriptType.java
+0
-1
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/StreamGobbler.java
...e/dolphinscheduler/plugin/alert/script/StreamGobbler.java
+0
-2
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/test/script/shell/example.sh
...inscheduler-alert-script/src/test/script/shell/example.sh
+3
-6
未找到文件。
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/OSUtils.java
浏览文件 @
4c7743f3
...
...
@@ -17,6 +17,9 @@
package
org.apache.dolphinscheduler.plugin.alert.script
;
/**
* OSUtils
*/
public
class
OSUtils
{
public
static
Boolean
isWindows
()
{
...
...
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ProcessUtils.java
浏览文件 @
4c7743f3
...
...
@@ -22,12 +22,22 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* ProcessUtils
*/
public
class
ProcessUtils
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProcessUtils
.
class
);
/**
* executeScript
*
* @param cmd cmd params
* @return exit code
*/
public
static
Integer
executeScript
(
String
...
cmd
)
{
int
exitCode
=
-
1
;
...
...
@@ -49,7 +59,7 @@ public class ProcessUtils {
return
process
.
waitFor
();
}
catch
(
IOException
|
InterruptedException
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
"execute alert script error"
,
e
.
getMessage
()
);
}
return
exitCode
;
...
...
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptAlertChannelFactory.java
浏览文件 @
4c7743f3
...
...
@@ -17,9 +17,6 @@
package
org.apache.dolphinscheduler.plugin.alert.script
;
import
java.util.Arrays
;
import
java.util.List
;
import
org.apache.dolphinscheduler.spi.alert.AlertChannel
;
import
org.apache.dolphinscheduler.spi.alert.AlertChannelFactory
;
import
org.apache.dolphinscheduler.spi.params.InputParam
;
...
...
@@ -28,6 +25,9 @@ import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import
org.apache.dolphinscheduler.spi.params.base.PluginParams
;
import
org.apache.dolphinscheduler.spi.params.base.Validate
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* ScriptAlertChannelFactory
*/
...
...
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptSender.java
浏览文件 @
4c7743f3
...
...
@@ -31,7 +31,6 @@ public class ScriptSender {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ScriptSender
.
class
);
private
String
scriptPath
;
private
Integer
scriptType
;
...
...
@@ -44,7 +43,6 @@ public class ScriptSender {
userParams
=
config
.
get
(
ScriptParamsConstants
.
NAME_SCRIPT_USER_PARAMS
);
}
public
AlertResult
sendScriptAlert
(
String
msg
)
{
AlertResult
alertResult
=
new
AlertResult
();
if
(
ScriptType
.
of
(
scriptType
).
equals
(
ScriptType
.
SHELL
))
{
...
...
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptType.java
浏览文件 @
4c7743f3
...
...
@@ -53,7 +53,6 @@ public enum ScriptType {
}
}
public
static
ScriptType
of
(
Integer
code
)
{
if
(
SCRIPT_TYPE_MAP
.
containsKey
(
code
))
{
return
SCRIPT_TYPE_MAP
.
get
(
code
);
...
...
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/StreamGobbler.java
浏览文件 @
4c7743f3
...
...
@@ -34,12 +34,10 @@ public class StreamGobbler extends Thread {
InputStream
inputStream
;
StreamGobbler
(
InputStream
inputStream
)
{
this
.
inputStream
=
inputStream
;
}
public
void
run
()
{
InputStreamReader
inputStreamReader
=
new
InputStreamReader
(
inputStream
);
BufferedReader
inputBufferReader
=
new
BufferedReader
(
inputStreamReader
);
...
...
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/test/script/shell/example.sh
浏览文件 @
4c7743f3
...
...
@@ -15,14 +15,11 @@
# limitations under the License.
#
content
=
$1
msg
=
$2
msg
=
$1
content
=
$2
# Write your specific logic here
echo
$content
echo
$msg
# Set the exit code according to your execution result, and alert needs to use it to judge the status of this alarm result
exit
888
exit
0
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录