tgravescs commented on a change in pull request #24615: [SPARK-27488][CORE] 
Driver interface to support GPU resources
URL: https://github.com/apache/spark/pull/24615#discussion_r286981952
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/ResourceDiscoverer.scala
 ##########
 @@ -42,28 +42,40 @@ private[spark] object ResourceDiscoverer extends Logging {
 
   private implicit val formats = DefaultFormats
 
-  def findResources(sparkConf: SparkConf, isDriver: Boolean): Map[String, 
ResourceInformation] = {
-    val prefix = if (isDriver) {
-      SPARK_DRIVER_RESOURCE_PREFIX
-    } else {
-      SPARK_EXECUTOR_RESOURCE_PREFIX
-    }
-    // get unique resource types by grabbing first part config with multiple 
periods,
-    // ie resourceType.count, grab resourceType part
-    val resourceNames = sparkConf.getAllWithPrefix(prefix).map { case (k, _) =>
-      k.split('.').head
-    }.toSet
+  /**
+   * This function will discover information about a set of resources by using 
the
+   * user specified script 
(spark.{driver/executor}.resource.{resourceName}.discoveryScript).
+   * It either takes a set of resource names or if that isn't specified
+   * it uses the config prefix to look at the executor or driver configs
+   * to get the resource names. Then for each resource it will run the 
discovery script
+   * and get the ResourceInformation about it.
+   *
+   * @param sparkConf SparkConf
+   * @param confPrefix Driver or Executor resource prefix
+   * @param resources Optional set of resource names
+   * @return Map of resource name to ResourceInformation
+   */
+  def discoverResourcesInformation(
+      sparkConf: SparkConf,
+      confPrefix: String,
+      resources: Option[Set[String]] = None
 
 Review comment:
   pushed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to