vanzin commented on a change in pull request #23706: [SPARK-26790][CORE] Change 
approach for retrieving executor logs and attributes: self-retrieve
URL: https://github.com/apache/spark/pull/23706#discussion_r256644857
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
 ##########
 @@ -181,14 +181,36 @@ private[spark] class CoarseGrainedExecutorBackend(
 
 private[spark] object CoarseGrainedExecutorBackend extends Logging {
 
-  private def run(
+  case class CoarseGrainedExecutorBackendArguments(
       driverUrl: String,
       executorId: String,
       hostname: String,
       cores: Int,
       appId: String,
       workerUrl: Option[String],
-      userClassPath: Seq[URL]) {
+      userClassPath: mutable.ListBuffer[URL])
+
+  def main(args: Array[String]): Unit = {
+    val arguments = parseArguments(args, this.getClass.getCanonicalName)
+
+    val createFn: (RpcEnv, SparkEnv) => CoarseGrainedExecutorBackend = { case 
(rpcEnv, env) =>
+      new CoarseGrainedExecutorBackend(rpcEnv, arguments.driverUrl, 
arguments.executorId,
+        arguments.hostname, arguments.cores, arguments.userClassPath, env)
+    }
+    run(arguments.driverUrl, arguments.executorId, arguments.hostname, 
arguments.cores,
+      arguments.appId, arguments.workerUrl, arguments.userClassPath, createFn)
+    System.exit(0)
+  }
+
+  def run(
+      driverUrl: String,
+      executorId: String,
+      hostname: String,
+      cores: Int,
+      appId: String,
+      workerUrl: Option[String],
+      userClassPath: Seq[URL],
 
 Review comment:
   This is actually not used now. I'm almost suggesting you should just have 
`CoarseGrainedExecutorBackendArguments` as an argument here...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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