Skip to content

Commit a1dc858

Browse files
committed
Convert required to IllegalArgumentException
1 parent 2c55fc2 commit a1dc858

File tree

1 file changed

+6
-2
lines changed
  • yarn/src/main/scala/org/apache/spark/deploy/yarn

1 file changed

+6
-2
lines changed

yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,10 +600,14 @@ private[spark] class Client(
600600
val (_, localizedPath) = distribute(file, resType = resType)
601601
if (addToClasspath) {
602602
if (localizedPath != null) {
603-
cachedSecondaryJarLinks += localizedPath
603+
cachedSecondaryJarLinks += localizedPath
604604
}
605605
} else {
606-
require(localizedPath !=null)
606+
if (localizedPath != null) {
607+
throw new IllegalArgumentException(s"Attempt to add ($file) multiple times. " +
608+
"Please check the values of 'spark.yarn.dist.files' and/or " +
609+
"'spark.yarn.dist.archives'.")
610+
}
607611
}
608612
}
609613
}

0 commit comments

Comments
 (0)