Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaowei
dlink
Commits
308bc440
Commit
308bc440
authored
Nov 22, 2021
by
godkaikai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
savepoint改进
parent
f9d7cdd8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
8 deletions
+31
-8
Job2MysqlHandler.java
...k-admin/src/main/java/com/dlink/job/Job2MysqlHandler.java
+1
-1
Cluster.java
dlink-admin/src/main/java/com/dlink/model/Cluster.java
+2
-2
StudioServiceImpl.java
...c/main/java/com/dlink/service/impl/StudioServiceImpl.java
+1
-0
ClusterConfig.java
...src/main/java/com/dlink/gateway/config/ClusterConfig.java
+11
-0
YarnGateway.java
...way/src/main/java/com/dlink/gateway/yarn/YarnGateway.java
+10
-2
index.tsx
...mponents/Studio/StudioRightTool/StudioSavePoint/index.tsx
+6
-3
No files found.
dlink-admin/src/main/java/com/dlink/job/Job2MysqlHandler.java
View file @
308bc440
...
...
@@ -75,7 +75,7 @@ public class Job2MysqlHandler implements JobHandler {
// history.setResult(JSONUtil.toJsonStr(job.getResult()));
if
(
job
.
isUseGateway
()){
Cluster
cluster
=
clusterService
.
registersCluster
(
Cluster
.
autoRegistersCluster
(
job
.
getJobManagerAddress
(),
job
.
getJobConfig
().
getJobName
()+
LocalDateTime
.
now
(),
job
.
getType
().
getLongValue
(),
job
.
getJob
Id
(),
job
.
getJob
Config
().
getJobName
()+
LocalDateTime
.
now
(),
job
.
getType
().
getLongValue
(),
job
.
getJobConfig
().
getClusterConfigurationId
(),
job
.
getJobConfig
().
getClusterConfigurationId
()));
if
(
Asserts
.
isNotNull
(
cluster
)){
history
.
setClusterId
(
cluster
.
getId
());
...
...
dlink-admin/src/main/java/com/dlink/model/Cluster.java
View file @
308bc440
...
...
@@ -41,10 +41,10 @@ public class Cluster extends SuperEntity {
private
Integer
taskId
;
public
static
Cluster
autoRegistersCluster
(
String
hosts
,
String
name
,
String
type
,
Integer
clusterConfigurationId
,
Integer
taskId
){
public
static
Cluster
autoRegistersCluster
(
String
hosts
,
String
name
,
String
alias
,
String
type
,
Integer
clusterConfigurationId
,
Integer
taskId
){
Cluster
cluster
=
new
Cluster
();
cluster
.
setName
(
name
);
cluster
.
setAlias
(
name
);
cluster
.
setAlias
(
alias
);
cluster
.
setHosts
(
hosts
);
cluster
.
setType
(
type
);
cluster
.
setClusterConfigurationId
(
clusterConfigurationId
);
...
...
dlink-admin/src/main/java/com/dlink/service/impl/StudioServiceImpl.java
View file @
308bc440
...
...
@@ -175,6 +175,7 @@ public class StudioServiceImpl implements StudioService {
if
(
Asserts
.
isNotNull
(
cluster
.
getClusterConfigurationId
())){
Map
<
String
,
String
>
gatewayConfig
=
clusterConfigurationService
.
getGatewayConfig
(
cluster
.
getClusterConfigurationId
());
jobConfig
.
buildGatewayConfig
(
gatewayConfig
);
jobConfig
.
getGatewayConfig
().
getClusterConfig
().
setAppId
(
cluster
.
getName
());
}
jobConfig
.
setUseRestAPI
(
SystemConfiguration
.
getInstances
().
isUseRestAPI
());
JobManager
jobManager
=
JobManager
.
build
(
jobConfig
);
...
...
dlink-gateway/src/main/java/com/dlink/gateway/config/ClusterConfig.java
View file @
308bc440
...
...
@@ -15,6 +15,7 @@ public class ClusterConfig {
private
String
flinkConfigPath
;
private
String
flinkLibPath
;
private
String
yarnConfigPath
;
private
String
appId
;
public
ClusterConfig
()
{
}
...
...
@@ -28,4 +29,14 @@ public class ClusterConfig {
public
static
ClusterConfig
build
(
String
flinkConfigPath
,
String
flinkLibPath
,
String
yarnConfigPath
){
return
new
ClusterConfig
(
flinkConfigPath
,
flinkLibPath
,
yarnConfigPath
);
}
@Override
public
String
toString
()
{
return
"ClusterConfig{"
+
"flinkConfigPath='"
+
flinkConfigPath
+
'\''
+
", flinkLibPath='"
+
flinkLibPath
+
'\''
+
", yarnConfigPath='"
+
yarnConfigPath
+
'\''
+
", appId='"
+
appId
+
'\''
+
'}'
;
}
}
dlink-gateway/src/main/java/com/dlink/gateway/yarn/YarnGateway.java
View file @
308bc440
...
...
@@ -57,13 +57,17 @@ public abstract class YarnGateway extends AbstractGateway {
private
void
initConfig
(){
configuration
=
GlobalConfiguration
.
loadConfiguration
(
config
.
getClusterConfig
().
getFlinkConfigPath
());
addConfigParas
(
config
.
getFlinkConfig
().
getConfigParas
());
if
(
Asserts
.
isNotNull
(
config
.
getFlinkConfig
().
getConfigParas
()))
{
addConfigParas
(
config
.
getFlinkConfig
().
getConfigParas
());
}
configuration
.
set
(
DeploymentOptions
.
TARGET
,
getType
().
getLongValue
());
if
(
Asserts
.
isNotNullString
(
config
.
getFlinkConfig
().
getSavePoint
()))
{
configuration
.
setString
(
SavepointConfigOptions
.
SAVEPOINT_PATH
,
config
.
getFlinkConfig
().
getSavePoint
());
}
configuration
.
set
(
YarnConfigOptions
.
PROVIDED_LIB_DIRS
,
Collections
.
singletonList
(
config
.
getClusterConfig
().
getFlinkLibPath
()));
configuration
.
set
(
YarnConfigOptions
.
APPLICATION_NAME
,
config
.
getFlinkConfig
().
getJobName
());
if
(
Asserts
.
isNotNullString
(
config
.
getFlinkConfig
().
getJobName
()))
{
configuration
.
set
(
YarnConfigOptions
.
APPLICATION_NAME
,
config
.
getFlinkConfig
().
getJobName
());
}
YarnLogConfigUtil
.
setLogConfigFileInConfig
(
configuration
,
config
.
getClusterConfig
().
getFlinkConfigPath
());
}
...
...
@@ -91,6 +95,7 @@ public abstract class YarnGateway extends AbstractGateway {
}
SavePointResult
result
=
SavePointResult
.
build
(
getType
());
YarnClusterClientFactory
clusterClientFactory
=
new
YarnClusterClientFactory
();
configuration
.
set
(
YarnConfigOptions
.
APPLICATION_ID
,
config
.
getClusterConfig
().
getAppId
());
ApplicationId
applicationId
=
clusterClientFactory
.
getClusterId
(
configuration
);
if
(
applicationId
==
null
){
throw
new
GatewayException
(
...
...
@@ -123,12 +128,15 @@ public abstract class YarnGateway extends AbstractGateway {
if
(
Asserts
.
isNull
(
yarnClient
)){
init
();
}
System
.
out
.
println
(
config
.
getClusterConfig
().
toString
());
logger
.
warn
(
config
.
getClusterConfig
().
toString
());
if
(
Asserts
.
isNull
(
config
.
getFlinkConfig
().
getJobId
())){
throw
new
GatewayException
(
"No job id was specified. Please specify a job to which you would like to savepont."
);
}
SavePointResult
result
=
SavePointResult
.
build
(
getType
());
YarnClusterClientFactory
clusterClientFactory
=
new
YarnClusterClientFactory
();
configuration
.
set
(
YarnConfigOptions
.
APPLICATION_ID
,
config
.
getClusterConfig
().
getAppId
());
ApplicationId
applicationId
=
clusterClientFactory
.
getClusterId
(
configuration
);
if
(
Asserts
.
isNull
(
applicationId
)){
throw
new
GatewayException
(
...
...
dlink-web/src/components/Studio/StudioRightTool/StudioSavePoint/index.tsx
View file @
308bc440
...
...
@@ -21,9 +21,10 @@ const StudioSavePoint: React.FC<{}> = (props: any) => {
title
:
'名称'
,
dataIndex
:
'name'
,
sorter
:
true
,
render
:
(
dom
,
entity
)
=>
{
hideInTable
:
true
,
/*render: (dom, entity) => {
return <a onClick={() => setRow(entity)}>{dom}</a>;
},
},
*/
},
{
title
:
'id'
,
...
...
@@ -58,7 +59,9 @@ const StudioSavePoint: React.FC<{}> = (props: any) => {
dataIndex
:
'createTime'
,
sorter
:
true
,
valueType
:
'dateTime'
,
hideInTable
:
true
,
render
:
(
dom
,
entity
)
=>
{
return
<
a
onClick=
{
()
=>
setRow
(
entity
)
}
>
{
dom
}
</
a
>;
},
},
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment