GitHub user preeze opened a pull request:
https://github.com/apache/spark/pull/5835
[SPARK-7233][CORE] Detect REPL mode once
<h3>Description</h3>
Detect REPL mode once per JVM lifespan.
Previous behavior was to check presence of interpreter mode every time a
job was submitted. In the case of execution of multiple short-living jobs this
was causing massive mutual blocks between submission threads.
For more details please refer to
https://issues.apache.org/jira/browse/SPARK-7233.
<h3>Notes</h3>
* I inverted the return value in case of catching an exception from `true`
to `false`. It seems more logical to assume that if the REPL class is not
found, we aren't in the interpreter mode.
* I'd personally would call `classForName` with just a Spark classloader
(`org.apache.spark.util.Utils#getSparkClassLoader`) but
`org.apache.spark.util.Utils#getContextOrSparkClassLoader` is said to be
preferable.
* I struggled to come up with a concise, readable and clear unit test.
Suggestions are welcome if you feel necessary.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/preeze/spark SPARK-7233
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5835.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 #5835
----
commit c319039e0b6c1c179cb20dfb37ec93c86b463048
Author: Oleksii Kostyliev <[email protected]>
Date: 2015-04-30T14:11:28Z
SPARK-7233: move inInterpreter to Utils and make it lazy
commit d6c07fc7702f49d3d9005fde6d9d8dc334422a82
Author: Oleksii Kostyliev <[email protected]>
Date: 2015-05-01T09:30:44Z
SPARK-7233: properly handle the inverted meaning of isInInterpreter
----
---
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]