You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by jo...@apache.org on 2015/05/21 23:09:03 UTC
spark git commit: [SPARK-7711] Add a startTime property to match the
corresponding one in Scala
Repository: spark
Updated Branches:
refs/heads/master 3d0cccc85 -> 6b18cdc1b
[SPARK-7711] Add a startTime property to match the corresponding one in Scala
Author: Holden Karau <ho...@pigscanfly.ca>
Closes #6275 from holdenk/SPARK-771-startTime-is-missing-from-pyspark and squashes the following commits:
06662dc [Holden Karau] add mising blank line for style checks
7a87410 [Holden Karau] add back missing newline
7a7876b [Holden Karau] Add a startTime property to match the corresponding one in the Scala SparkContext
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6b18cdc1
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6b18cdc1
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6b18cdc1
Branch: refs/heads/master
Commit: 6b18cdc1b1284b1d48d637d06a1e64829aeb6202
Parents: 3d0cccc
Author: Holden Karau <ho...@pigscanfly.ca>
Authored: Thu May 21 14:08:57 2015 -0700
Committer: Josh Rosen <jo...@databricks.com>
Committed: Thu May 21 14:08:57 2015 -0700
----------------------------------------------------------------------
python/pyspark/context.py | 5 +++++
python/pyspark/tests.py | 4 ++++
2 files changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/6b18cdc1/python/pyspark/context.py
----------------------------------------------------------------------
diff --git a/python/pyspark/context.py b/python/pyspark/context.py
index 1f2b40b..aeb7ad4 100644
--- a/python/pyspark/context.py
+++ b/python/pyspark/context.py
@@ -292,6 +292,11 @@ class SparkContext(object):
return self._jsc.version()
@property
+ def startTime(self):
+ """Return the epoch time when the Spark Context was started."""
+ return self._jsc.startTime()
+
+ @property
def defaultParallelism(self):
"""
Default level of parallelism to use when not given by user (e.g. for
http://git-wip-us.apache.org/repos/asf/spark/blob/6b18cdc1/python/pyspark/tests.py
----------------------------------------------------------------------
diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py
index d8e3199..f9fb37f 100644
--- a/python/pyspark/tests.py
+++ b/python/pyspark/tests.py
@@ -1809,6 +1809,10 @@ class ContextTests(unittest.TestCase):
sc.stop()
+ def test_startTime(self):
+ with SparkContext() as sc:
+ self.assertGreater(sc.startTime, 0)
+
@unittest.skipIf(not _have_scipy, "SciPy not installed")
class SciPyTests(PySparkTestCase):
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org