You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/04/15 14:14:48 UTC

[GitHub] [spark] tgravescs commented on a change in pull request #24374: [SPARK-27366][CORE] Support GPU Resources in Spark job scheduling

tgravescs commented on a change in pull request #24374: [SPARK-27366][CORE] Support GPU Resources in Spark job scheduling
URL: https://github.com/apache/spark/pull/24374#discussion_r275375117
 
 

 ##########
 File path: core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala
 ##########
 @@ -184,3 +278,49 @@ class CoarseGrainedSchedulerBackendSuite extends SparkFunSuite with LocalSparkCo
     )
   }
 }
+
+/** Simple cluster manager that wires up our mock backend for the gpu resource tests. */
+private class CSMockExternalClusterManager extends ExternalClusterManager {
+
+  var ts: TaskSchedulerImpl = _
+
+  val MOCK_REGEX = """coarseclustermanager\[(.*)\]""".r
+  def canCreate(masterURL: String): Boolean = MOCK_REGEX.findFirstIn(masterURL).isDefined
+
+  def createTaskScheduler(
+      sc: SparkContext,
+      masterURL: String): TaskScheduler = {
+    ts = mock[TaskSchedulerImpl]
+    when(ts.sc).thenReturn(sc)
+    when(ts.applicationId()).thenReturn("appid1")
+    when(ts.applicationAttemptId()).thenReturn(Some("attempt1"))
+    when(ts.schedulingMode).thenReturn(SchedulingMode.FIFO)
+    when(ts.nodeBlacklist()).thenReturn(Set.empty[String])
+    val frameSize = RpcUtils.maxMessageSizeBytes(sc.conf)
 
 Review comment:
   not needed 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org