Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
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
wangpeng
dinky
Commits
fa2d5a4d
Unverified
Commit
fa2d5a4d
authored
Mar 13, 2024
by
Zzm0809
Committed by
GitHub
Mar 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix] fix array out of bounds (#3279)
Co-authored-by:
Zzm0809
<
Zzm0809@users.noreply.github.com
>
parent
c6f4a851
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
YarnGateway.java
...way/src/main/java/org/dinky/gateway/yarn/YarnGateway.java
+17
-8
No files found.
dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnGateway.java
View file @
fa2d5a4d
...
...
@@ -35,6 +35,7 @@ import org.dinky.gateway.result.SavePointResult;
import
org.dinky.gateway.result.TestResult
;
import
org.dinky.gateway.result.YarnResult
;
import
org.dinky.utils.FlinkJsonUtil
;
import
org.dinky.utils.ThreadUtil
;
import
org.apache.flink.client.deployment.ClusterRetrieveException
;
import
org.apache.flink.client.program.ClusterClient
;
...
...
@@ -58,6 +59,7 @@ import org.apache.hadoop.security.UserGroupInformation;
import
org.apache.hadoop.service.Service
;
import
org.apache.hadoop.yarn.api.records.ApplicationId
;
import
org.apache.hadoop.yarn.api.records.ApplicationReport
;
import
org.apache.hadoop.yarn.api.records.ContainerReport
;
import
org.apache.hadoop.yarn.api.records.FinalApplicationStatus
;
import
org.apache.hadoop.yarn.api.records.YarnApplicationState
;
import
org.apache.hadoop.yarn.client.api.YarnClient
;
...
...
@@ -384,13 +386,20 @@ public abstract class YarnGateway extends AbstractGateway {
}
protected
String
getYarnContainerLog
(
ApplicationReport
applicationReport
)
throws
YarnException
,
IOException
{
String
logUrl
=
yarnClient
.
getContainers
(
applicationReport
.
getCurrentApplicationAttemptId
())
.
get
(
0
)
.
getLogUrl
();
String
content
=
HttpUtil
.
get
(
logUrl
+
"/jobmanager.log?start=-10000"
);
String
log
=
ReUtil
.
getGroup1
(
HTML_TAG_REGEX
,
content
);
logger
.
info
(
"\n\nHistory log url is: {}\n\n "
,
logUrl
);
return
log
;
// Wait for up to 2.5 s. If the history log is not found yet, a prompt message will be returned.
int
counts
=
5
;
while
(
yarnClient
.
getContainers
(
applicationReport
.
getCurrentApplicationAttemptId
())
.
isEmpty
()
&&
counts
--
>
0
)
{
ThreadUtil
.
sleep
(
500
);
}
List
<
ContainerReport
>
containers
=
yarnClient
.
getContainers
(
applicationReport
.
getCurrentApplicationAttemptId
());
if
(
CollUtil
.
isNotEmpty
(
containers
))
{
String
logUrl
=
containers
.
get
(
0
).
getLogUrl
();
String
content
=
HttpUtil
.
get
(
logUrl
+
"/jobmanager.log?start=-10000"
);
return
ReUtil
.
getGroup1
(
HTML_TAG_REGEX
,
content
);
}
return
"No history log found yet. so can't get log url, please check yarn cluster status or check if the flink job is running in yarn cluster or please go to yarn interface to view the log."
;
}
}
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