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
4006fdfa
Commit
4006fdfa
authored
Nov 22, 2021
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
savepoint触发bug解决
parent
308bc440
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
YarnGateway.java
...way/src/main/java/com/dlink/gateway/yarn/YarnGateway.java
+22
-7
index.tsx
...mponents/Studio/StudioRightTool/StudioSavePoint/index.tsx
+3
-5
No files found.
dlink-gateway/src/main/java/com/dlink/gateway/yarn/YarnGateway.java
View file @
4006fdfa
...
@@ -12,10 +12,12 @@ import com.dlink.gateway.result.GatewayResult;
...
@@ -12,10 +12,12 @@ import com.dlink.gateway.result.GatewayResult;
import
com.dlink.gateway.result.SavePointResult
;
import
com.dlink.gateway.result.SavePointResult
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.client.program.ClusterClient
;
import
org.apache.flink.client.program.ClusterClient
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.DeploymentOptions
;
import
org.apache.flink.configuration.DeploymentOptions
;
import
org.apache.flink.configuration.GlobalConfiguration
;
import
org.apache.flink.configuration.GlobalConfiguration
;
import
org.apache.flink.runtime.client.JobStatusMessage
;
import
org.apache.flink.runtime.client.JobStatusMessage
;
import
org.apache.flink.runtime.jobgraph.SavepointConfigOptions
;
import
org.apache.flink.runtime.jobgraph.SavepointConfigOptions
;
import
org.apache.flink.yarn.YarnClientYarnClusterInformationRetriever
;
import
org.apache.flink.yarn.YarnClusterClientFactory
;
import
org.apache.flink.yarn.YarnClusterClientFactory
;
import
org.apache.flink.yarn.YarnClusterDescriptor
;
import
org.apache.flink.yarn.YarnClusterDescriptor
;
import
org.apache.flink.yarn.configuration.YarnConfigOptions
;
import
org.apache.flink.yarn.configuration.YarnConfigOptions
;
...
@@ -24,7 +26,9 @@ import org.apache.hadoop.fs.Path;
...
@@ -24,7 +26,9 @@ import org.apache.hadoop.fs.Path;
import
org.apache.hadoop.yarn.api.records.ApplicationId
;
import
org.apache.hadoop.yarn.api.records.ApplicationId
;
import
org.apache.hadoop.yarn.client.api.YarnClient
;
import
org.apache.hadoop.yarn.client.api.YarnClient
;
import
org.apache.hadoop.yarn.conf.YarnConfiguration
;
import
org.apache.hadoop.yarn.conf.YarnConfiguration
;
import
org.apache.hadoop.yarn.exceptions.YarnException
;
import
java.io.IOException
;
import
java.net.URI
;
import
java.net.URI
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
...
@@ -93,6 +97,11 @@ public abstract class YarnGateway extends AbstractGateway {
...
@@ -93,6 +97,11 @@ public abstract class YarnGateway extends AbstractGateway {
if
(
Asserts
.
isNull
(
yarnClient
)){
if
(
Asserts
.
isNull
(
yarnClient
)){
init
();
init
();
}
}
/*if(Asserts.isNotNullString(config.getClusterConfig().getYarnConfigPath())) {
configuration = GlobalConfiguration.loadConfiguration(config.getClusterConfig().getYarnConfigPath());
}else {
configuration = new Configuration();
}*/
SavePointResult
result
=
SavePointResult
.
build
(
getType
());
SavePointResult
result
=
SavePointResult
.
build
(
getType
());
YarnClusterClientFactory
clusterClientFactory
=
new
YarnClusterClientFactory
();
YarnClusterClientFactory
clusterClientFactory
=
new
YarnClusterClientFactory
();
configuration
.
set
(
YarnConfigOptions
.
APPLICATION_ID
,
config
.
getClusterConfig
().
getAppId
());
configuration
.
set
(
YarnConfigOptions
.
APPLICATION_ID
,
config
.
getClusterConfig
().
getAppId
());
...
@@ -101,10 +110,11 @@ public abstract class YarnGateway extends AbstractGateway {
...
@@ -101,10 +110,11 @@ public abstract class YarnGateway extends AbstractGateway {
throw
new
GatewayException
(
throw
new
GatewayException
(
"No cluster id was specified. Please specify a cluster to which you would like to connect."
);
"No cluster id was specified. Please specify a cluster to which you would like to connect."
);
}
}
YarnClusterDescriptor
clusterDescriptor
=
clusterClientFactory
/*
YarnClusterDescriptor clusterDescriptor = clusterClientFactory
.createClusterDescriptor(
.createClusterDescriptor(
configuration
);
configuration);*/
YarnClusterDescriptor
clusterDescriptor
=
new
YarnClusterDescriptor
(
configuration
,
yarnConfiguration
,
yarnClient
,
YarnClientYarnClusterInformationRetriever
.
create
(
yarnClient
),
true
);
try
(
ClusterClient
<
ApplicationId
>
clusterClient
=
clusterDescriptor
.
retrieve
(
try
(
ClusterClient
<
ApplicationId
>
clusterClient
=
clusterDescriptor
.
retrieve
(
applicationId
).
getClusterClient
()){
applicationId
).
getClusterClient
()){
List
<
JobInfo
>
jobInfos
=
new
ArrayList
<>();
List
<
JobInfo
>
jobInfos
=
new
ArrayList
<>();
...
@@ -128,12 +138,15 @@ public abstract class YarnGateway extends AbstractGateway {
...
@@ -128,12 +138,15 @@ public abstract class YarnGateway extends AbstractGateway {
if
(
Asserts
.
isNull
(
yarnClient
)){
if
(
Asserts
.
isNull
(
yarnClient
)){
init
();
init
();
}
}
System
.
out
.
println
(
config
.
getClusterConfig
().
toString
());
logger
.
warn
(
config
.
getClusterConfig
().
toString
());
if
(
Asserts
.
isNull
(
config
.
getFlinkConfig
().
getJobId
())){
if
(
Asserts
.
isNull
(
config
.
getFlinkConfig
().
getJobId
())){
throw
new
GatewayException
(
throw
new
GatewayException
(
"No job id was specified. Please specify a job to which you would like to savepont."
);
"No job id was specified. Please specify a job to which you would like to savepont."
);
}
}
/*if(Asserts.isNotNullString(config.getClusterConfig().getYarnConfigPath())) {
configuration = GlobalConfiguration.loadConfiguration(config.getClusterConfig().getYarnConfigPath());
}else {
configuration = new Configuration();
}*/
SavePointResult
result
=
SavePointResult
.
build
(
getType
());
SavePointResult
result
=
SavePointResult
.
build
(
getType
());
YarnClusterClientFactory
clusterClientFactory
=
new
YarnClusterClientFactory
();
YarnClusterClientFactory
clusterClientFactory
=
new
YarnClusterClientFactory
();
configuration
.
set
(
YarnConfigOptions
.
APPLICATION_ID
,
config
.
getClusterConfig
().
getAppId
());
configuration
.
set
(
YarnConfigOptions
.
APPLICATION_ID
,
config
.
getClusterConfig
().
getAppId
());
...
@@ -142,9 +155,11 @@ public abstract class YarnGateway extends AbstractGateway {
...
@@ -142,9 +155,11 @@ public abstract class YarnGateway extends AbstractGateway {
throw
new
GatewayException
(
throw
new
GatewayException
(
"No cluster id was specified. Please specify a cluster to which you would like to connect."
);
"No cluster id was specified. Please specify a cluster to which you would like to connect."
);
}
}
YarnClusterDescriptor
clusterDescriptor
=
clusterClientFactory
/*
YarnClusterDescriptor clusterDescriptor = clusterClientFactory
.createClusterDescriptor(
.createClusterDescriptor(
configuration
);
configuration);*/
YarnClusterDescriptor
clusterDescriptor
=
new
YarnClusterDescriptor
(
configuration
,
yarnConfiguration
,
yarnClient
,
YarnClientYarnClusterInformationRetriever
.
create
(
yarnClient
),
true
);
try
(
ClusterClient
<
ApplicationId
>
clusterClient
=
clusterDescriptor
.
retrieve
(
try
(
ClusterClient
<
ApplicationId
>
clusterClient
=
clusterDescriptor
.
retrieve
(
applicationId
).
getClusterClient
()){
applicationId
).
getClusterClient
()){
List
<
JobInfo
>
jobInfos
=
new
ArrayList
<>();
List
<
JobInfo
>
jobInfos
=
new
ArrayList
<>();
...
...
dlink-web/src/components/Studio/StudioRightTool/StudioSavePoint/index.tsx
View file @
4006fdfa
...
@@ -10,7 +10,7 @@ import {SavePointTableListItem} from "@/components/Studio/StudioRightTool/Studio
...
@@ -10,7 +10,7 @@ import {SavePointTableListItem} from "@/components/Studio/StudioRightTool/Studio
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
connect
}
from
"umi"
;
import
{
connect
}
from
"umi"
;
const
url
=
'/api/
clusterConfiguration
'
;
const
url
=
'/api/
savepoints
'
;
const
StudioSavePoint
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
StudioSavePoint
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
{
current
,
dispatch
}
=
props
;
const
{
current
,
dispatch
}
=
props
;
const
[
row
,
setRow
]
=
useState
<
SavePointTableListItem
>
();
const
[
row
,
setRow
]
=
useState
<
SavePointTableListItem
>
();
...
@@ -22,6 +22,8 @@ const StudioSavePoint: React.FC<{}> = (props: any) => {
...
@@ -22,6 +22,8 @@ const StudioSavePoint: React.FC<{}> = (props: any) => {
dataIndex
:
'name'
,
dataIndex
:
'name'
,
sorter
:
true
,
sorter
:
true
,
hideInTable
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
hideInSearch
:
true
,
/*render: (dom, entity) => {
/*render: (dom, entity) => {
return <a onClick={() => setRow(entity)}>{dom}</a>;
return <a onClick={() => setRow(entity)}>{dom}</a>;
},*/
},*/
...
@@ -68,12 +70,8 @@ const StudioSavePoint: React.FC<{}> = (props: any) => {
...
@@ -68,12 +70,8 @@ const StudioSavePoint: React.FC<{}> = (props: any) => {
return
(
return
(
<
PageContainer
>
<
PageContainer
>
<
ProTable
<
SavePointTableListItem
>
<
ProTable
<
SavePointTableListItem
>
headerTitle="savepoints"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
rowKey="id"
rowKey="id"
search=
{
{
labelWidth
:
120
,
}
}
request=
{
(
params
,
sorter
,
filter
)
=>
queryData
(
url
,
{
taskId
:
current
.
taskId
,...
params
,
sorter
,
filter
})
}
request=
{
(
params
,
sorter
,
filter
)
=>
queryData
(
url
,
{
taskId
:
current
.
taskId
,...
params
,
sorter
,
filter
})
}
columns=
{
columns
}
columns=
{
columns
}
/
>
/
>
...
...
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