GitHub user rcsenkbeil opened a pull request:

    https://github.com/apache/spark/pull/1929

    Added support for :cp <jar> that was broken in Scala 2.10.x for REPL

    As seen with [SI-6502](https://issues.scala-lang.org/browse/SI-6502) of 
Scala, the _:cp_ command was broken in Scala 2.10.x. As the Spark shell is a 
friendly wrapper on top of the Scala REPL, it is also affected by this problem.
    
    My solution was to alter the internal classpath and invalidate any new 
entries. I also had to add the ability to add new entries to the parent 
classloader of the interpreter (SparkIMain's global).
    
    The advantage of this versus wiping the interpreter and replaying all of 
the commands is that you don't have to worry about rerunning heavy 
Spark-related commands (going to the cluster) or potentially reloading data 
that might have changed. Instead, you get to work from where you left off.
    
    Until this is fixed upstream for 2.10.x, I had to use reflection to alter 
the internal compiler classpath.
    
    The solution now looks like this:
    ![screen shot 2014-08-13 at 3 46 02 
pm](https://cloud.githubusercontent.com/assets/2481802/3912625/f02b1440-232c-11e4-9bf6-bafb3e352d14.png)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rcsenkbeil/spark FixReplClasspathSupport

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/1929.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1929
    
----
commit a220639475694418f010420b24960b53e81509e7
Author: Chip Senkbeil <[email protected]>
Date:   2014-08-13T20:47:33Z

    Added support for :cp <jar> that was broken in Scala 2.10.x for REPL

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to