[KYUUBI #6366] Improve log message for YARN getApplicationInfoByTag
# 🔍 Description
Unify the words and provide the tag for the waiting submission case.
## Types of changes 🔖
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
## Test Plan 🧪
Manually review.
---
# Checklist 📝
- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
Closes #6366 from pan3793/improve-log.
Closes #6366
30e3fdee0 [Cheng Pan] fix style
a3b36ea33 [Cheng Pan] Improve log message for YARN getApplicationInfoByTag
Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit d19119bae1)
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
parent
b749df2418
commit
f149af7f2b
@ -27,7 +27,7 @@ import org.apache.hadoop.yarn.client.api.YarnClient
|
||||
|
||||
import org.apache.kyuubi.{Logging, Utils}
|
||||
import org.apache.kyuubi.config.KyuubiConf
|
||||
import org.apache.kyuubi.config.KyuubiConf.YarnUserStrategy
|
||||
import org.apache.kyuubi.config.KyuubiConf.{ENGINE_YARN_SUBMIT_TIMEOUT, YarnUserStrategy}
|
||||
import org.apache.kyuubi.config.KyuubiConf.YarnUserStrategy._
|
||||
import org.apache.kyuubi.engine.ApplicationOperation._
|
||||
import org.apache.kyuubi.engine.ApplicationState.ApplicationState
|
||||
@ -129,21 +129,22 @@ class YarnApplicationOperation extends ApplicationOperation with Logging {
|
||||
tag: String,
|
||||
proxyUser: Option[String] = None,
|
||||
submitTime: Option[Long] = None): ApplicationInfo = withYarnClient(proxyUser) { yarnClient =>
|
||||
debug(s"Getting application info from Yarn cluster by $tag tag")
|
||||
debug(s"Getting application info from YARN cluster by tag: $tag")
|
||||
val reports = yarnClient.getApplications(null, null, Set(tag).asJava)
|
||||
if (reports.isEmpty) {
|
||||
debug(s"Application with tag $tag not found")
|
||||
debug(s"Can't find target application from YARN cluster by tag: $tag")
|
||||
submitTime match {
|
||||
case Some(_submitTime) =>
|
||||
val elapsedTime = System.currentTimeMillis - _submitTime
|
||||
if (elapsedTime > submitTimeout) {
|
||||
error(s"Can't find target yarn application by tag: $tag, " +
|
||||
s"elapsed time: ${elapsedTime}ms exceeds ${submitTimeout}ms.")
|
||||
ApplicationInfo.NOT_FOUND
|
||||
} else {
|
||||
warn("Wait for yarn application to be submitted, " +
|
||||
s"elapsed time: ${elapsedTime}ms, return UNKNOWN status")
|
||||
if (elapsedTime < submitTimeout) {
|
||||
info(s"Wait for YARN application[tag: $tag] to be submitted, " +
|
||||
s"elapsed time: ${elapsedTime}ms, return ${ApplicationInfo.UNKNOWN} status")
|
||||
ApplicationInfo.UNKNOWN
|
||||
} else {
|
||||
error(s"Can't find target application from YARN cluster by tag: $tag, " +
|
||||
s"elapsed time: ${elapsedTime}ms exceeds ${ENGINE_YARN_SUBMIT_TIMEOUT.key}: " +
|
||||
s"${submitTimeout}ms, return ${ApplicationInfo.NOT_FOUND} status")
|
||||
ApplicationInfo.NOT_FOUND
|
||||
}
|
||||
case _ => ApplicationInfo.NOT_FOUND
|
||||
}
|
||||
@ -158,7 +159,7 @@ class YarnApplicationOperation extends ApplicationOperation with Logging {
|
||||
report.getFinalApplicationStatus),
|
||||
url = Option(report.getTrackingUrl),
|
||||
error = Option(report.getDiagnostics))
|
||||
debug(s"Successfully got application info by $tag: $info")
|
||||
debug(s"Successfully got application info by tag: $tag. $info")
|
||||
info
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user