tgravescs commented on a change in pull request #25047:
[WIP][SPARK-27371][CORE] Support GPU-aware resources scheduling in Standalone
URL: https://github.com/apache/spark/pull/25047#discussion_r310165369
##########
File path: core/src/main/scala/org/apache/spark/deploy/master/WorkerInfo.scala
##########
@@ -19,17 +19,34 @@ package org.apache.spark.deploy.master
import scala.collection.mutable
+import org.apache.spark.resource.{ResourceAllocator, ResourceInformation,
ResourceRequirement}
import org.apache.spark.rpc.RpcEndpointRef
import org.apache.spark.util.Utils
+private[spark] case class WorkerResourceInfo(name: String, addresses:
Seq[String])
+ extends ResourceAllocator(name, addresses) {
+
+ def toResourceInformation(): ResourceInformation = {
+ new ResourceInformation(name, addresses.toArray)
+ }
+
+ def acquire(amount: Int): ResourceInformation = {
+ val allocated = availableAddrs.take(amount)
+ acquire(allocated)
+ new ResourceInformation(name, allocated.toArray)
+ }
+}
+
private[spark] class WorkerInfo(
val id: String,
val host: String,
val port: Int,
val cores: Int,
val memory: Int,
val endpoint: RpcEndpointRef,
- val webUiAddress: String)
+ val webUiAddress: String,
+ val resources: Map[String, WorkerResourceInfo],
+ val pid: Int = 0)
Review comment:
I don't think pid is used here
----------------------------------------------------------------
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]