Github user MaxGekk commented on a diff in the pull request:
https://github.com/apache/spark/pull/21589#discussion_r198800988
--- Diff: R/pkg/R/context.R ---
@@ -451,3 +435,31 @@ setCheckpointDir <- function(directory) {
sc <- getSparkContext()
invisible(callJMethod(sc, "setCheckpointDir",
suppressWarnings(normalizePath(directory))))
}
+
+#' Total number of CPU cores of all executors registered in the cluster at
the moment.
+#'
+#' @rdname spark.numCores
+#' @return current number of cores in the cluster.
+#' @examples
+#'\dontrun{
+#' spark.numCores()
+#'}
+#' @note numCores since 2.4.0
+spark.numCores <- function() {
--- End diff --
If you don't mind, I leave the functions in the `spark` namespace.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]