Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,16 @@ private[spark] class Client(
).foreach { case (flist, resType, addToClasspath) =>
flist.foreach { file =>
val (_, localizedPath) = distribute(file, resType = resType)
if (addToClasspath && localizedPath != null) {
cachedSecondaryJarLinks += localizedPath
if (addToClasspath) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment here explaining what exactly thi sis doing to help explain and keep from breaking in future.

Also can you add another unit test to cover this case.

if (localizedPath != null) {
cachedSecondaryJarLinks += localizedPath
}
} else {
if (localizedPath != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess here is localizedPath == null ?

throw new IllegalArgumentException(s"Attempt to add ($file) multiple times. " +
"Please check the values of 'spark.yarn.dist.files' and/or " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove the part about check values of those specific configs because there are multiple ways for these to specified (configs or --files, --jars, etc). Perhaps just say please check the values you specified for uploading files,jars, and archives to make sure one isn't specified multiple times..

"'spark.yarn.dist.archives'.")
}
}
}
}
Expand Down