Skip to content

Commit 547487c

Browse files
committed
Provide default values for null application report entries
1 parent a0ad1e9 commit 547487c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,12 @@ private[spark] trait ClientBase extends Logging {
429429

430430
if (logApplicationReport) {
431431
logInfo(s"Application report from ResourceManager for app ${appId.getId} (state: $state)")
432+
val clientToken = Option(getClientToken(report)).getOrElse("N/A")
433+
val appDiagnostics = Option(report.getDiagnostics).getOrElse("N/A")
432434
val details = "\n" +
433435
s"\t full application identifier: $appId\n" +
434-
s"\t clientToken: ${getClientToken(report)}\n" +
435-
s"\t appDiagnostics: ${report.getDiagnostics}\n" +
436+
s"\t clientToken: $clientToken\n" +
437+
s"\t appDiagnostics: $appDiagnostics\n" +
436438
s"\t appMasterHost: ${report.getHost}\n" +
437439
s"\t appQueue: ${report.getQueue}\n" +
438440
s"\t appMasterRpcPort: ${report.getRpcPort}\n" +

0 commit comments

Comments
 (0)