Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
DolphinScheduler
提交
eebd0c73
DolphinScheduler
项目概览
apache
/
DolphinScheduler
上一次同步 1 年多
通知
704
Star
9572
Fork
3514
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
eebd0c73
编写于
6月 13, 2020
作者:
S
Simon
提交者:
GitHub
6月 13, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3 from apache/dev
merge
上级
6c5b0706
f56ae9e6
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
473 addition
and
41 deletion
+473
-41
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/flink/FlinkParameters.java
...e/dolphinscheduler/common/task/flink/FlinkParameters.java
+13
-0
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/http/HttpParameters.java
...che/dolphinscheduler/common/task/http/HttpParameters.java
+27
-0
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/task/HttpParametersTest.java
...ache/dolphinscheduler/common/task/HttpParametersTest.java
+91
-0
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
.../apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
+11
-7
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/http/HttpTask.java
...he/dolphinscheduler/server/worker/task/http/HttpTask.java
+1
-8
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtilsTest.java
...che/dolphinscheduler/server/utils/FlinkArgsUtilsTest.java
+3
-1
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/http/HttpTaskTest.java
...olphinscheduler/server/worker/task/http/HttpTaskTest.java
+208
-0
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
.../js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
+46
-21
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/http.vue
...c/js/conf/home/pages/dag/_source/formModel/tasks/http.vue
+56
-2
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+8
-1
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+8
-1
pom.xml
pom.xml
+1
-0
未找到文件。
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/flink/FlinkParameters.java
浏览文件 @
eebd0c73
...
...
@@ -90,6 +90,11 @@ public class FlinkParameters extends AbstractParameters {
*/
private
String
others
;
/**
* flink version
*/
private
String
flinkVersion
;
/**
* program type
* 0 JAVA,1 SCALA,2 PYTHON
...
...
@@ -200,6 +205,14 @@ public class FlinkParameters extends AbstractParameters {
this
.
programType
=
programType
;
}
public
String
getFlinkVersion
()
{
return
flinkVersion
;
}
public
void
setFlinkVersion
(
String
flinkVersion
)
{
this
.
flinkVersion
=
flinkVersion
;
}
@Override
public
boolean
checkParameters
()
{
return
mainJar
!=
null
&&
programType
!=
null
;
...
...
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/http/HttpParameters.java
浏览文件 @
eebd0c73
...
...
@@ -56,6 +56,17 @@ public class HttpParameters extends AbstractParameters {
private
String
condition
;
/**
* Connect Timeout
* Unit: ms
*/
private
int
connectTimeout
;
/**
* Socket Timeout
* Unit: ms
*/
private
int
socketTimeout
;
@Override
public
boolean
checkParameters
()
{
...
...
@@ -106,4 +117,20 @@ public class HttpParameters extends AbstractParameters {
public
void
setCondition
(
String
condition
)
{
this
.
condition
=
condition
;
}
public
int
getConnectTimeout
()
{
return
connectTimeout
;
}
public
void
setConnectTimeout
(
int
connectTimeout
)
{
this
.
connectTimeout
=
connectTimeout
;
}
public
int
getSocketTimeout
()
{
return
socketTimeout
;
}
public
void
setSocketTimeout
(
int
socketTimeout
)
{
this
.
socketTimeout
=
socketTimeout
;
}
}
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/task/HttpParametersTest.java
0 → 100644
浏览文件 @
eebd0c73
/*
* 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.task
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.dolphinscheduler.common.enums.HttpCheckCondition
;
import
org.apache.dolphinscheduler.common.enums.HttpMethod
;
import
org.apache.dolphinscheduler.common.process.HttpProperty
;
import
org.apache.dolphinscheduler.common.process.ResourceInfo
;
import
org.apache.dolphinscheduler.common.task.http.HttpParameters
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
com.alibaba.fastjson.JSON
;
/**
* http parameter
*/
public
class
HttpParametersTest
{
@Test
public
void
testGenerator
(){
String
paramData
=
"{\"localParams\":[],\"httpParams\":[],\"url\":\"https://www.baidu.com/\","
+
"\"httpMethod\":\"GET\",\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"\",\"connectTimeout\":\"10000\",\"socketTimeout\":\"10000\"}"
;
HttpParameters
httpParameters
=
JSON
.
parseObject
(
paramData
,
HttpParameters
.
class
);
Assert
.
assertEquals
(
10000
,
httpParameters
.
getConnectTimeout
()
);
Assert
.
assertEquals
(
10000
,
httpParameters
.
getSocketTimeout
());
Assert
.
assertEquals
(
"https://www.baidu.com/"
,
httpParameters
.
getUrl
());
Assert
.
assertEquals
(
HttpMethod
.
GET
,
httpParameters
.
getHttpMethod
());
Assert
.
assertEquals
(
HttpCheckCondition
.
STATUS_CODE_DEFAULT
,
httpParameters
.
getHttpCheckCondition
());
Assert
.
assertEquals
(
""
,
httpParameters
.
getCondition
());
}
@Test
public
void
testCheckParameters
(){
String
paramData
=
"{\"localParams\":[],\"httpParams\":[],\"url\":\"https://www.baidu.com/\","
+
"\"httpMethod\":\"GET\",\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"\",\"connectTimeout\":\"10000\",\"socketTimeout\":\"10000\"}"
;
HttpParameters
httpParameters
=
JSON
.
parseObject
(
paramData
,
HttpParameters
.
class
);
Assert
.
assertTrue
(
httpParameters
.
checkParameters
());
Assert
.
assertEquals
(
10000
,
httpParameters
.
getConnectTimeout
()
);
Assert
.
assertEquals
(
10000
,
httpParameters
.
getSocketTimeout
());
Assert
.
assertEquals
(
"https://www.baidu.com/"
,
httpParameters
.
getUrl
());
Assert
.
assertEquals
(
HttpMethod
.
GET
,
httpParameters
.
getHttpMethod
());
Assert
.
assertEquals
(
HttpCheckCondition
.
STATUS_CODE_DEFAULT
,
httpParameters
.
getHttpCheckCondition
());
Assert
.
assertEquals
(
""
,
httpParameters
.
getCondition
());
}
@Test
public
void
testCheckValues
()
{
String
paramData
=
"{\"localParams\":[],\"httpParams\":[],\"url\":\"https://www.baidu.com/\","
+
"\"httpMethod\":\"GET\",\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"\",\"connectTimeout\":\"10000\",\"socketTimeout\":\"10000\"}"
;
HttpParameters
httpParameters
=
JSON
.
parseObject
(
paramData
,
HttpParameters
.
class
);
Assert
.
assertTrue
(
httpParameters
.
checkParameters
());
Assert
.
assertEquals
(
10000
,
httpParameters
.
getConnectTimeout
()
);
Assert
.
assertEquals
(
10000
,
httpParameters
.
getSocketTimeout
());
Assert
.
assertEquals
(
"https://www.baidu.com/"
,
httpParameters
.
getUrl
());
Assert
.
assertEquals
(
HttpMethod
.
GET
,
httpParameters
.
getHttpMethod
());
Assert
.
assertEquals
(
HttpCheckCondition
.
STATUS_CODE_DEFAULT
,
httpParameters
.
getHttpCheckCondition
());
Assert
.
assertEquals
(
""
,
httpParameters
.
getCondition
());
Assert
.
assertEquals
(
0
,
httpParameters
.
getLocalParametersMap
().
size
());
Assert
.
assertEquals
(
0
,
httpParameters
.
getResourceFilesList
().
size
());
}
}
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
浏览文件 @
eebd0c73
...
...
@@ -28,10 +28,12 @@ import java.util.List;
/**
*
spar
k args utils
*
flin
k args utils
*/
public
class
FlinkArgsUtils
{
private
static
final
String
LOCAL_DEPLOY_MODE
=
"local"
;
private
static
final
String
FLINK_VERSION_BEFORE_1_10
=
"<1.10"
;
/**
* build args
* @param param flink parameters
...
...
@@ -44,7 +46,6 @@ public class FlinkArgsUtils {
String
tmpDeployMode
=
param
.
getDeployMode
();
if
(
StringUtils
.
isNotEmpty
(
tmpDeployMode
))
{
deployMode
=
tmpDeployMode
;
}
if
(!
LOCAL_DEPLOY_MODE
.
equals
(
deployMode
))
{
args
.
add
(
Constants
.
FLINK_RUN_MODE
);
//-m
...
...
@@ -63,12 +64,15 @@ public class FlinkArgsUtils {
args
.
add
(
appName
);
}
int
taskManager
=
param
.
getTaskManager
();
if
(
taskManager
!=
0
)
{
//-yn
args
.
add
(
Constants
.
FLINK_TASK_MANAGE
);
args
.
add
(
String
.
format
(
"%d"
,
taskManager
));
// judgy flink version,from flink1.10,the parameter -yn removed
String
flinkVersion
=
param
.
getFlinkVersion
();
if
(
FLINK_VERSION_BEFORE_1_10
.
equals
(
flinkVersion
))
{
int
taskManager
=
param
.
getTaskManager
();
if
(
taskManager
!=
0
)
{
//-yn
args
.
add
(
Constants
.
FLINK_TASK_MANAGE
);
args
.
add
(
String
.
format
(
"%d"
,
taskManager
));
}
}
String
jobManagerMemory
=
param
.
getJobManagerMemory
();
if
(
StringUtils
.
isNotEmpty
(
jobManagerMemory
))
{
args
.
add
(
Constants
.
FLINK_JOB_MANAGE_MEM
);
...
...
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/http/HttpTask.java
浏览文件 @
eebd0c73
...
...
@@ -61,13 +61,6 @@ public class HttpTask extends AbstractTask {
*/
private
HttpParameters
httpParameters
;
/**
* Convert mill seconds to second unit
*/
protected
static
final
int
MAX_CONNECTION_MILLISECONDS
=
60000
;
/**
* application json
*/
...
...
@@ -298,7 +291,7 @@ public class HttpTask extends AbstractTask {
* @return RequestConfig
*/
private
RequestConfig
requestConfig
()
{
return
RequestConfig
.
custom
().
setSocketTimeout
(
MAX_CONNECTION_MILLISECONDS
).
setConnectTimeout
(
MAX_CONNECTION_MILLISECONDS
).
build
();
return
RequestConfig
.
custom
().
setSocketTimeout
(
httpParameters
.
getSocketTimeout
()).
setConnectTimeout
(
httpParameters
.
getConnectTimeout
()
).
build
();
}
/**
...
...
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtilsTest.java
浏览文件 @
eebd0c73
...
...
@@ -49,6 +49,7 @@ public class FlinkArgsUtilsTest {
public
String
mainArgs
=
"testArgs"
;
public
String
queue
=
"queue1"
;
public
String
others
=
"--input file:///home"
;
public
String
flinkVersion
=
"<1.10"
;
@Before
...
...
@@ -79,6 +80,7 @@ public class FlinkArgsUtilsTest {
param
.
setMainArgs
(
mainArgs
);
param
.
setQueue
(
queue
);
param
.
setOthers
(
others
);
param
.
setFlinkVersion
(
flinkVersion
);
//Invoke buildArgs
List
<
String
>
result
=
FlinkArgsUtils
.
buildArgs
(
param
);
...
...
@@ -128,4 +130,4 @@ public class FlinkArgsUtilsTest {
assertEquals
(
5
,
result
.
size
());
}
}
\ No newline at end of file
}
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/http/HttpTaskTest.java
0 → 100644
浏览文件 @
eebd0c73
/*
* 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.http
;
import
static
org
.
apache
.
dolphinscheduler
.
common
.
enums
.
CommandType
.*;
import
java.io.IOException
;
import
java.util.Date
;
import
org.apache.dolphinscheduler.common.enums.HttpCheckCondition
;
import
org.apache.dolphinscheduler.common.enums.HttpMethod
;
import
org.apache.dolphinscheduler.common.task.http.HttpParameters
;
import
org.apache.dolphinscheduler.common.utils.OSUtils
;
import
org.apache.dolphinscheduler.dao.entity.ProcessInstance
;
import
org.apache.dolphinscheduler.server.entity.TaskExecutionContext
;
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
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.RequestBuilder
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.Mockito
;
import
org.powermock.api.mockito.PowerMockito
;
import
org.powermock.core.classloader.annotations.PowerMockIgnore
;
import
org.powermock.core.classloader.annotations.PrepareForTest
;
import
org.powermock.modules.junit4.PowerMockRunner
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.context.ApplicationContext
;
import
com.alibaba.fastjson.JSON
;
@RunWith
(
PowerMockRunner
.
class
)
@PrepareForTest
(
OSUtils
.
class
)
@PowerMockIgnore
({
"javax.management.*"
,
"javax.net.ssl.*"
})
public
class
HttpTaskTest
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
HttpTaskTest
.
class
);
private
HttpTask
httpTask
;
private
ProcessService
processService
;
private
ShellCommandExecutor
shellCommandExecutor
;
private
ApplicationContext
applicationContext
;
private
TaskExecutionContext
taskExecutionContext
;
@Before
public
void
before
()
throws
Exception
{
taskExecutionContext
=
new
TaskExecutionContext
();
PowerMockito
.
mockStatic
(
OSUtils
.
class
);
processService
=
PowerMockito
.
mock
(
ProcessService
.
class
);
shellCommandExecutor
=
PowerMockito
.
mock
(
ShellCommandExecutor
.
class
);
applicationContext
=
PowerMockito
.
mock
(
ApplicationContext
.
class
);
SpringApplicationContext
springApplicationContext
=
new
SpringApplicationContext
();
springApplicationContext
.
setApplicationContext
(
applicationContext
);
PowerMockito
.
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
);
props
.
setTaskParams
(
"{\"localParams\":[],\"httpParams\":[],\"url\":\"https://github.com/\",\"httpMethod\":\"GET\","
+
"\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"https://github.com/\","
+
"\"connectTimeout\":\"1000\",\"socketTimeout\":\"1000\"}"
);
taskExecutionContext
=
Mockito
.
mock
(
TaskExecutionContext
.
class
);
Mockito
.
when
(
taskExecutionContext
.
getTaskParams
()).
thenReturn
(
props
.
getTaskParams
());
Mockito
.
when
(
taskExecutionContext
.
getExecutePath
()).
thenReturn
(
"/tmp"
);
Mockito
.
when
(
taskExecutionContext
.
getTaskAppId
()).
thenReturn
(
"1"
);
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"
);
httpTask
=
new
HttpTask
(
taskExecutionContext
,
logger
);
httpTask
.
init
();
}
@Test
public
void
testGetParameters
()
{
Assert
.
assertNotNull
(
httpTask
.
getParameters
());
}
@Test
public
void
testCheckParameters
()
{
Assert
.
assertTrue
(
httpTask
.
getParameters
().
checkParameters
());
}
@Test
public
void
testGenerator
(){
String
paramJson
=
"{\"localParams\":[],\"httpParams\":[],\"url\":\"https://github.com/\","
+
"\"httpMethod\":\"GET\",\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"\",\"connectTimeout\":\"10000\",\"socketTimeout\":\"10000\"}"
;
HttpParameters
httpParameters
=
JSON
.
parseObject
(
paramJson
,
HttpParameters
.
class
);
Assert
.
assertEquals
(
10000
,
httpParameters
.
getConnectTimeout
()
);
Assert
.
assertEquals
(
10000
,
httpParameters
.
getSocketTimeout
());
Assert
.
assertEquals
(
"https://github.com/"
,
httpParameters
.
getUrl
());
Assert
.
assertEquals
(
HttpMethod
.
GET
,
httpParameters
.
getHttpMethod
());
Assert
.
assertEquals
(
HttpCheckCondition
.
STATUS_CODE_DEFAULT
,
httpParameters
.
getHttpCheckCondition
());
Assert
.
assertEquals
(
""
,
httpParameters
.
getCondition
());
}
@Test
public
void
testHandle
(){
boolean
flag
=
true
;
try
{
httpTask
.
handle
();
}
catch
(
Exception
e
)
{
flag
=
false
;
e
.
printStackTrace
();
}
Assert
.
assertTrue
(
flag
);
}
@Test
public
void
testSendRequest
(){
CloseableHttpClient
client
=
httpTask
.
createHttpClient
();
String
statusCode
=
null
;
String
body
=
null
;
try
{
CloseableHttpResponse
response
=
httpTask
.
sendRequest
(
client
)
;
statusCode
=
String
.
valueOf
(
httpTask
.
getStatusCode
(
response
));
body
=
httpTask
.
getResponseBody
(
response
);
int
exitStatusCode
=
httpTask
.
validResponse
(
body
,
statusCode
);
Assert
.
assertNotEquals
(-
1
,
exitStatusCode
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
};
}
@Test
public
void
testValidResponse
(){
String
body
=
"body"
;
String
statusCode
=
"200"
;
int
exitStatusCode
=
httpTask
.
validResponse
(
body
,
statusCode
);
Assert
.
assertNotEquals
(-
1
,
exitStatusCode
);
}
@Test
public
void
testAppendMessage
(){
httpTask
.
appendMessage
(
"message"
);
Assert
.
assertEquals
(
"message"
,
httpTask
.
getOutput
());
}
@Test
public
void
testCreateHttpClient
(){
Assert
.
assertNotNull
(
httpTask
.
createHttpClient
());
}
@Test
public
void
testCreateRequestBuilder
(){
RequestBuilder
requestBuilder
=
httpTask
.
createRequestBuilder
();
Assert
.
assertEquals
(
RequestBuilder
.
get
().
getMethod
(),
requestBuilder
.
getMethod
());
}
private
ProcessInstance
getProcessInstance
()
{
ProcessInstance
processInstance
=
new
ProcessInstance
();
processInstance
.
setCommandType
(
START_PROCESS
);
processInstance
.
setScheduleTime
(
new
Date
());
return
processInstance
;
}
}
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
浏览文件 @
eebd0c73
...
...
@@ -62,56 +62,73 @@
</x-radio-group>
</div>
</m-list-box>
<m-list-box>
<div
slot=
"text"
>
{{
$t
(
'
Flink Version
'
)
}}
</div>
<div
slot=
"content"
>
<x-select
style=
"width: 100px;"
v-model=
"flinkVersion"
:disabled=
"isDetails"
>
<x-option
v-for=
"version in flinkVersionList"
:key=
"version.code"
:value=
"version.code"
:label=
"version.code"
>
</x-option>
</x-select>
</div>
</m-list-box>
<div
class=
"list-box-4p"
>
<div
class=
"clearfix list"
>
<span
class=
"sp1"
>
{{
$t
(
'
slot
'
)
}}
</span>
<span
class=
"sp1"
style=
"word-break:break-all"
>
{{
$t
(
'
jobManagerMemory
'
)
}}
</span>
<span
class=
"sp2"
>
<x-input
:disabled=
"isDetails"
type=
"input"
v-model=
"slot
"
:placeholder=
"$t('Please enter driver core numbe
r')"
style=
"width: 200px;"
autocomplete=
"off"
>
:disabled=
"isDetails"
type=
"input"
v-model=
"jobManagerMemory
"
:placeholder=
"$t('Please enter the number of Executo
r')"
style=
"width: 200px;"
autocomplete=
"off"
>
</x-input>
</span>
<span
class=
"sp1 sp3"
>
{{
$t
(
'
taskManager
'
)
}}
</span>
<span
class=
"sp1 sp3"
>
{{
$t
(
'
taskManager
Memory
'
)
}}
</span>
<span
class=
"sp2"
>
<x-input
:disabled=
"isDetails"
type=
"input"
v-model=
"taskManager
"
:placeholder=
"$t('Please enter driver memory use
')"
style=
"width: 186px;"
autocomplete=
"off"
>
:disabled=
"isDetails"
type=
"input"
v-model=
"taskManagerMemory
"
:placeholder=
"$t('Please enter the Executor memory
')"
style=
"width: 186px;"
autocomplete=
"off"
>
</x-input>
</span>
</div>
<div
class=
"clearfix list"
>
<span
class=
"sp1"
style=
"word-break:break-all"
>
{{
$t
(
'
jobManagerMemory
'
)
}}
</span>
<span
class=
"sp1"
>
{{
$t
(
'
slot
'
)
}}
</span>
<span
class=
"sp2"
>
<x-input
:disabled=
"isDetails"
type=
"input"
v-model=
"
jobManagerMemory
"
:placeholder=
"$t('Please enter
the number of Executo
r')"
v-model=
"
slot
"
:placeholder=
"$t('Please enter
driver core numbe
r')"
style=
"width: 200px;"
autocomplete=
"off"
>
</x-input>
</span>
<span
class=
"sp1 sp3"
>
{{
$t
(
'
taskManagerMemory
'
)
}}
</span>
<div
v-if=
"flinkVersion !== '>=1.10'"
>
<span
class=
"sp1 sp3"
>
{{
$t
(
'
taskManager
'
)
}}
</span>
<span
class=
"sp2"
>
<x-input
:disabled=
"isDetails"
type=
"input"
v-model=
"taskManager
Memory
"
:placeholder=
"$t('Please enter
the Executor memory
')"
v-model=
"taskManager"
:placeholder=
"$t('Please enter
driver memory use
')"
style=
"width: 186px;"
autocomplete=
"off"
>
</x-input>
</span>
</div>
</div>
</div>
<m-list-box>
<div
slot=
"text"
>
{{
$t
(
'
Command-line parameters
'
)
}}
</div>
...
...
@@ -207,6 +224,11 @@
programType
:
'
SCALA
'
,
// Program type(List)
programTypeList
:
[{
code
:
'
JAVA
'
},
{
code
:
'
SCALA
'
},
{
code
:
'
PYTHON
'
}],
flinkVersion
:
'
<1.10
'
,
// Flink Versions(List)
flinkVersionList
:
[{
code
:
'
<1.10
'
},
{
code
:
'
>=1.10
'
}],
normalizer
(
node
)
{
return
{
label
:
node
.
name
...
...
@@ -324,6 +346,7 @@
return
{
id
:
v
}
}),
localParams
:
this
.
localParams
,
flinkVersion
:
this
.
flinkVersion
,
slot
:
this
.
slot
,
taskManager
:
this
.
taskManager
,
jobManagerMemory
:
this
.
jobManagerMemory
,
...
...
@@ -485,11 +508,13 @@
this
.
mainJar
=
o
.
params
.
mainJar
.
id
||
''
}
this
.
deployMode
=
o
.
params
.
deployMode
||
''
this
.
flinkVersion
=
o
.
params
.
flinkVersion
||
'
<1.10
'
this
.
slot
=
o
.
params
.
slot
||
1
this
.
taskManager
=
o
.
params
.
taskManager
||
'
2
'
this
.
jobManagerMemory
=
o
.
params
.
jobManagerMemory
||
'
1G
'
this
.
taskManagerMemory
=
o
.
params
.
taskManagerMemory
||
'
2G
'
this
.
mainArgs
=
o
.
params
.
mainArgs
||
''
this
.
others
=
o
.
params
.
others
this
.
programType
=
o
.
params
.
programType
||
'
SCALA
'
...
...
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/http.vue
浏览文件 @
eebd0c73
...
...
@@ -85,6 +85,39 @@
</x-input>
</div>
</m-list-box>
<m-list-box
>
<div
slot=
"text"
>
{{
$t
(
'
Timeout Settings
'
)
}}
</div>
<div
slot=
"content"
>
<label
class=
"label-box"
>
<div
style=
"padding-top: 5px;"
>
<x-switch
v-model=
"timeoutSettings"
:disabled=
"isDetails"
></x-switch>
</div>
</label>
</div>
</m-list-box>
<div
class=
"clearfix list"
v-if =
"timeoutSettings"
>
<div
class=
"text-box"
>
<span>
{{
$t
(
'
Connect Timeout
'
)
}}
</span>
</div>
<div
class=
"cont-box"
>
<span
class=
"label-box"
style=
"width: 193px;display: inline-block;"
>
<x-input
v-model=
'connectTimeout'
maxlength=
"7"
/>
</span>
<span>
{{
$t
(
'
ms
'
)
}}
</span>
<span
class=
"text-b"
>
{{
$t
(
'
Socket Timeout
'
)
}}
</span>
<span
class=
"label-box"
style=
"width: 193px;display: inline-block;"
>
<x-input
v-model=
'socketTimeout'
maxlength=
"7"
/>
</span>
<span>
{{
$t
(
'
ms
'
)
}}
</span>
</div>
</div>
<m-list-box>
<div
slot=
"text"
>
{{
$t
(
'
Custom Parameters
'
)
}}
</div>
<div
slot=
"content"
>
...
...
@@ -110,6 +143,10 @@
name
:
'
http
'
,
data
()
{
return
{
timeoutSettings
:
false
,
connectTimeout
:
60000
,
socketTimeout
:
60000
,
url
:
''
,
condition
:
''
,
localParams
:
[],
...
...
@@ -152,6 +189,14 @@
if
(
!
this
.
$refs
.
refHttpParams
.
_verifValue
())
{
return
false
}
if
(
!
_
.
isNumber
(
parseInt
(
this
.
socketTimeout
)))
{
this
.
$message
.
warning
(
`
${
i18n
.
$t
(
'
Socket Timeout be a positive integer
'
)}
`
)
return
false
}
if
(
!
_
.
isNumber
(
parseInt
(
this
.
connectTimeout
)))
{
this
.
$message
.
warning
(
`
${
i18n
.
$t
(
'
Connect timeout be a positive integer
'
)}
`
)
return
false
}
// storage
this
.
$emit
(
'
on-params
'
,
{
localParams
:
this
.
localParams
,
...
...
@@ -159,7 +204,9 @@
url
:
this
.
url
,
httpMethod
:
this
.
httpMethod
,
httpCheckCondition
:
this
.
httpCheckCondition
,
condition
:
this
.
condition
condition
:
this
.
condition
,
connectTimeout
:
this
.
connectTimeout
,
socketTimeout
:
this
.
socketTimeout
})
return
true
}
...
...
@@ -172,7 +219,9 @@
url
:
this
.
url
,
httpMethod
:
this
.
httpMethod
,
httpCheckCondition
:
this
.
httpCheckCondition
,
condition
:
this
.
condition
condition
:
this
.
condition
,
connectTimeout
:
this
.
connectTimeout
,
socketTimeout
:
this
.
socketTimeout
}
}
},
...
...
@@ -193,6 +242,11 @@
this
.
httpMethod
=
o
.
params
.
httpMethod
||
'
GET
'
this
.
httpCheckCondition
=
o
.
params
.
httpCheckCondition
||
'
DEFAULT
'
this
.
condition
=
o
.
params
.
condition
||
''
this
.
connectTimeout
=
o
.
params
.
connectTimeout
this
.
socketTimeout
=
o
.
params
.
socketTimeout
if
(
this
.
connectTimeout
!=
60000
||
this
.
socketTimeout
!=
60000
){
this
.
timeoutSettings
=
true
}
// backfill localParams
let
localParams
=
o
.
params
.
localParams
||
[]
if
(
localParams
.
length
)
{
...
...
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
浏览文件 @
eebd0c73
...
...
@@ -98,6 +98,7 @@ export default {
Script
:
'
Script
'
,
'
Please enter script(required)
'
:
'
Please enter script(required)
'
,
'
Deploy Mode
'
:
'
Deploy Mode
'
,
'
Flink Version
'
:
'
Flink Version
'
,
'
Driver core number
'
:
'
Driver core number
'
,
'
Please enter driver core number
'
:
'
Please enter driver core number
'
,
'
Driver memory use
'
:
'
Driver memory use
'
,
...
...
@@ -599,5 +600,11 @@ export default {
'
Unauthorized or deleted resources
'
:
'
Unauthorized or deleted resources
'
,
'
Please delete all non-existent resources
'
:
'
Please delete all non-existent resources
'
,
'
Enable
'
:
'
Enable
'
,
'
Disable
'
:
'
Disable
'
'
Disable
'
:
'
Disable
'
,
'
Timeout Settings
'
:
'
Timeout Settings
'
,
'
Connect Timeout
'
:
'
Connect Timeout
'
,
'
Socket Timeout
'
:
'
Socket Timeout
'
,
'
Connect timeout be a positive integer
'
:
'
Connect timeout be a positive integer
'
,
'
Socket Timeout be a positive integer
'
:
'
Socket Timeout be a positive integer
'
,
'
ms
'
:
'
ms
'
}
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
浏览文件 @
eebd0c73
...
...
@@ -99,6 +99,7 @@ export default {
Script
:
'
脚本
'
,
'
Please enter script(required)
'
:
'
请输入脚本(必填)
'
,
'
Deploy Mode
'
:
'
部署方式
'
,
'
Flink Version
'
:
'
Flink版本
'
,
'
Driver core number
'
:
'
Driver内核数
'
,
'
Please enter driver core number
'
:
'
请输入Driver内核数
'
,
'
Driver memory use
'
:
'
Driver内存数
'
,
...
...
@@ -599,5 +600,11 @@ export default {
'
Unauthorized or deleted resources
'
:
'
未授权或已删除资源
'
,
'
Please delete all non-existent resources
'
:
'
请删除所有未授权或已删除资源
'
,
'
Enable
'
:
'
启用
'
,
'
Disable
'
:
'
停用
'
'
Disable
'
:
'
停用
'
,
'
Timeout Settings
'
:
'
超时设置
'
,
'
Connect Timeout
'
:
'
连接超时
'
,
'
Socket Timeout
'
:
'
Socket超时
'
,
'
Connect timeout be a positive integer
'
:
'
连接超时必须为数字
'
,
'
Socket Timeout be a positive integer
'
:
'
Socket超时必须为数字
'
,
'
ms
'
:
'
毫秒
'
}
pom.xml
浏览文件 @
eebd0c73
...
...
@@ -743,6 +743,7 @@
<include>
**/common/shell/ShellExecutorTest.java
</include>
<include>
**/common/task/EntityTestUtils.java
</include>
<include>
**/common/task/FlinkParametersTest.java
</include>
<include>
**/common/task/HttpParametersTest.java
</include>
<include>
**/common/task/SqoopParameterEntityTest.java
</include>
<include>
**/common/threadutils/ThreadPoolExecutorsTest.java
</include>
<include>
**/common/threadutils/ThreadUtilsTest.java
</include>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录