[SPARK-2435] Add shutdown hook to pyspark
Author: Matthew Farrellee <matt@redhat.com> Closes #2183 from mattf/SPARK-2435 and squashes the following commits: ee0ee99 [Matthew Farrellee] [SPARK-2435] Add shutdown hook to pyspark
This commit is contained in:
parent
c5cbc49233
commit
7c6e71f05f
|
@ -28,6 +28,7 @@ if sys.version_info[0] != 2:
|
|||
sys.exit(1)
|
||||
|
||||
|
||||
import atexit
|
||||
import os
|
||||
import platform
|
||||
import pyspark
|
||||
|
@ -42,6 +43,7 @@ if os.environ.get("SPARK_EXECUTOR_URI"):
|
|||
SparkContext.setSystemProperty("spark.executor.uri", os.environ["SPARK_EXECUTOR_URI"])
|
||||
|
||||
sc = SparkContext(appName="PySparkShell", pyFiles=add_files)
|
||||
atexit.register(lambda: sc.stop())
|
||||
|
||||
print("""Welcome to
|
||||
____ __
|
||||
|
|
Loading…
Reference in a new issue