The reason this PR was submitted was to fix issues observed by users trying
to run spark examples on yarn.
It was initially meant to be only a documentation change : until we
observed that SparkPi was making assumptions about environment variables -
which are not relevant to yarn mode, but is in other modes.

Actually this api, addJar, is not useful in yarn mode imo.


While it could be argued that all usage of the api (explicitly or
implicitly) should defend against this sort of bug, practically
(particularly when there are different modes of usage) it is not always
possible. Ignore if error is deemed beneign or fail with exception if it is
severe - in this case, ignore since it is expected failure.

Ofcourse, this is just my opinion to ensure that exposed api is robust !

Please feel free to cherry pick the changes ...



On Fri, May 17, 2013 at 2:30 AM, Reynold Xin <notifications@github.com>wrote:

> In core/src/main/scala/spark/SparkContext.scala:
>
> > @@ -537,6 +537,10 @@ class SparkContext(
> >     * filesystems), or an HTTP, HTTPS or FTP URI.
> >     */
> >    def addJar(path: String) {
> > +    if (null == path) {
> > +      logInfo("null specified as parameter to addJar")
>
> Actually - do you mind doing this in a separate PR? I am not entirely sure
> if it is the right behavior to ignore null paths, because it suggests a
> programming error.
>
> The documentation changes should definitely go in.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mesos/spark/pull/614/files#r4265291>
> .
>