From 5b236869e45f61b000ae28659fc9bcfd7d17c1ca Mon Sep 17 00:00:00 2001 From: Jyotiska NK Date: Thu, 20 Mar 2014 22:18:41 +0530 Subject: [PATCH] Updated context.py with method descriptions Added descriptions for methods _initialize_context and _ensure_initialized --- python/pyspark/context.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/pyspark/context.py b/python/pyspark/context.py index bf2454fd7e38e..90c3decbe4b01 100644 --- a/python/pyspark/context.py +++ b/python/pyspark/context.py @@ -162,12 +162,18 @@ def __init__(self, master=None, appName=None, sparkHome=None, pyFiles=None, self._temp_dir = \ self._jvm.org.apache.spark.util.Utils.createTempDir(local_dir).getAbsolutePath() - # Initialize SparkContext in function to allow subclass specific initialization def _initialize_context(self, jconf): + """ + Initialize SparkContext in function to allow subclass specific initialization + """ return self._jvm.JavaSparkContext(jconf) @classmethod def _ensure_initialized(cls, instance=None, gateway=None): + """ + Checks whether a SparkContext is initialized or not. + Throws error if a SparkContext is already running. + """ with SparkContext._lock: if not SparkContext._gateway: SparkContext._gateway = gateway or launch_gateway()