Github user MaxGekk commented on a diff in the pull request:
https://github.com/apache/spark/pull/21589#discussion_r202460774
--- Diff: python/pyspark/context.py ---
@@ -406,6 +406,22 @@ def defaultMinPartitions(self):
"""
return self._jsc.sc().defaultMinPartitions()
+ @property
+ def numCores(self):
+ """
+ Total number of CPU cores of all executors registered in the
cluster at the moment.
+ The number reflects current status of the cluster and can change
in the future.
+ """
+ return self._jsc.sc().numCores()
+
+ @property
+ def numExecutors(self):
+ """
+ Total number of executors registered in the cluster at the moment.
+ The number reflects current status of the cluster and can change
in the future.
--- End diff --
I added it
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]