You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@toree.apache.org by ma...@apache.org on 2016/11/07 14:29:28 UTC
[05/15] incubator-toree git commit: Ensuring the contexts are cleaned
up correctly
Ensuring the contexts are cleaned up correctly
Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/6a77283c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/6a77283c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/6a77283c
Branch: refs/heads/master
Commit: 6a77283c6064ac3e6f4e3d0c86bf86925e4cc686
Parents: a5303b4
Author: Liam Fisk <li...@xtra.co.nz>
Authored: Thu Jun 30 11:57:23 2016 +1200
Committer: Marius van Niekerk <ma...@maxpoint.com>
Committed: Thu Oct 20 17:50:58 2016 -0400
----------------------------------------------------------------------
.../src/main/resources/PySpark/pyspark_runner.py | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/6a77283c/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py
----------------------------------------------------------------------
diff --git a/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py b/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py
index d84c5c4..5073a4d 100644
--- a/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py
+++ b/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py
@@ -107,10 +107,16 @@ class Kernel(object):
return parent + [x for x in self._jvm_kernel.__dir__() if x not in parent]
def createSparkContext(self, config):
+ global conf, sc, sqlContext
+
jconf = gateway.jvm.org.apache.spark.SparkConf(False)
for key,value in config.getAll():
jconf.set(key, value)
self._jvm_kernel.createSparkContext(jconf)
+ conf = None
+ sc = None
+ sqlContext = None
+
self.refreshContext()
def refreshContext(self):