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
a8367874
Commit
a8367874
authored
Jun 14, 2022
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix-603] [admin] Task information will be cleared when refreshing tasks that have lost connection
parent
858fbd45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
JobHistoryServiceImpl.java
...in/java/com/dlink/service/impl/JobHistoryServiceImpl.java
+5
-0
TaskServiceImpl.java
...src/main/java/com/dlink/service/impl/TaskServiceImpl.java
+5
-1
No files found.
dlink-admin/src/main/java/com/dlink/service/impl/JobHistoryServiceImpl.java
View file @
a8367874
package
com
.
dlink
.
service
.
impl
;
import
com.dlink.constant.FlinkRestResultConstant
;
import
org.springframework.stereotype.Service
;
import
com.dlink.api.FlinkAPI
;
...
...
@@ -70,6 +71,9 @@ public class JobHistoryServiceImpl extends SuperServiceImpl<JobHistoryMapper, Jo
jobHistory
.
setId
(
id
);
try
{
JsonNode
jobInfo
=
FlinkAPI
.
build
(
jobManagerHost
).
getJobInfo
(
jobId
);
if
(
jobInfo
.
has
(
FlinkRestResultConstant
.
ERRORS
)){
return
jobHistory
;
}
JsonNode
exception
=
FlinkAPI
.
build
(
jobManagerHost
).
getException
(
jobId
);
JsonNode
checkPoints
=
FlinkAPI
.
build
(
jobManagerHost
).
getCheckPoints
(
jobId
);
JsonNode
checkPointsConfig
=
FlinkAPI
.
build
(
jobManagerHost
).
getCheckPointsConfig
(
jobId
);
...
...
@@ -87,6 +91,7 @@ public class JobHistoryServiceImpl extends SuperServiceImpl<JobHistoryMapper, Jo
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
return
jobHistory
;
}
...
...
dlink-admin/src/main/java/com/dlink/service/impl/TaskServiceImpl.java
View file @
a8367874
...
...
@@ -604,6 +604,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
jobInfoDetail
.
setClusterConfiguration
(
clusterConfigurationService
.
getClusterConfigById
(
history
.
getClusterConfigurationId
()));
}
jobInfoDetail
.
setHistory
(
history
);
jobInfoDetail
.
setJobHistory
(
jobHistoryService
.
getJobHistory
(
id
));
pool
.
push
(
key
,
jobInfoDetail
);
}
if
(!
isCoercive
&&
!
inRefreshPlan
(
jobInfoDetail
.
getInstance
()))
{
...
...
@@ -611,10 +612,13 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
}
JobHistory
jobHistoryJson
=
jobHistoryService
.
refreshJobHistory
(
id
,
jobInfoDetail
.
getCluster
().
getJobManagerHost
(),
jobInfoDetail
.
getInstance
().
getJid
(),
jobInfoDetail
.
isNeedSave
());
JobHistory
jobHistory
=
jobHistoryService
.
getJobHistoryInfo
(
jobHistoryJson
);
if
(
JobStatus
.
isDone
(
jobInfoDetail
.
getInstance
().
getStatus
())
&&
Asserts
.
isNull
(
jobHistory
.
getJob
()))
{
return
jobInfoDetail
.
getInstance
();
}
jobInfoDetail
.
setJobHistory
(
jobHistory
);
String
status
=
jobInfoDetail
.
getInstance
().
getStatus
();
boolean
jobStatusChanged
=
false
;
if
(
Asserts
.
isNull
(
jobInfoDetail
.
getJobHistory
().
getJob
())
||
jobInfoDetail
.
getJobHistory
().
getJob
().
has
(
FlinkRestResultConstant
.
ERRORS
))
{
if
(
Asserts
.
isNull
(
jobInfoDetail
.
getJobHistory
().
getJob
())
||
Asserts
.
isNull
(
jobInfoDetail
.
getJobHistory
().
getJob
()
))
{
jobInfoDetail
.
getInstance
().
setStatus
(
JobStatus
.
UNKNOWN
.
getValue
());
}
else
{
jobInfoDetail
.
getInstance
().
setDuration
(
jobInfoDetail
.
getJobHistory
().
getJob
().
get
(
FlinkRestResultConstant
.
JOB_DURATION
).
asLong
()
/
1000
);
...
...
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