File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
alpha/src/main/scala/org/apache/spark/deploy/yarn
stable/src/main/scala/org/apache/spark/deploy/yarn Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,12 @@ private[spark] class Client(
122
122
amContainer.setContainerTokens(ByteBuffer .wrap(dob.getData()))
123
123
}
124
124
125
- /** */
126
- override def getClientToken (report : ApplicationReport ): String = report.getClientToken
125
+ /**
126
+ * Return the security token used by this client to communicate with the ApplicationMaster.
127
+ * If no security is enabled, the token returned by the report is null.
128
+ */
129
+ override def getClientToken (report : ApplicationReport ): String =
130
+ Option (report.getClientToken).getOrElse(" " )
127
131
}
128
132
129
133
private [spark] object Client {
Original file line number Diff line number Diff line change @@ -108,10 +108,12 @@ private[spark] class Client(
108
108
override def getApplicationReport (appId : ApplicationId ): ApplicationReport =
109
109
yarnClient.getApplicationReport(appId)
110
110
111
- /** */
112
- // FIXME: This could throw NPE
111
+ /**
112
+ * Return the security token used by this client to communicate with the ApplicationMaster.
113
+ * If no security is enabled, the token returned by the report is null.
114
+ */
113
115
override def getClientToken (report : ApplicationReport ): String =
114
- report.getClientToAMToken. toString
116
+ Option ( report.getClientToAMToken).map(_. toString).getOrElse( " " )
115
117
}
116
118
117
119
private [spark] object Client {
You can’t perform that action at this time.
0 commit comments