@@ -21,6 +21,8 @@ import java.io.File
2121import  java .util .{ArrayList  =>  JArrayList , List  =>  JList }
2222import  java .util .Collections 
2323
24+ import  org .apache .spark .executor .MesosExecutorBackend 
25+ 
2426import  scala .collection .JavaConversions ._ 
2527import  scala .collection .mutable .{HashMap , HashSet }
2628
@@ -123,14 +125,16 @@ private[spark] class MesosSchedulerBackend(
123125    val  command  =  CommandInfo .newBuilder()
124126      .setEnvironment(environment)
125127    val  uri  =  sc.conf.get(" spark.executor.uri"  , null )
128+     val  executorBackendName  =  classOf [MesosExecutorBackend ].getName
126129    if  (uri ==  null ) {
127-       val  executorPath  =  new  File (executorSparkHome, " /sbin/spark-executor"  ).getCanonicalPath
130+       val  executorPath  =  new  File (executorSparkHome, s " /bin/spark-class  $executorBackendName" )
131+         .getCanonicalPath
128132      command.setValue(" %s %s"  .format(prefixEnv, executorPath))
129133    } else  {
130134      //  Grab everything to the first '.'. We'll use that and '*' to
131135      //  glob the directory "correctly".
132136      val  basename  =  uri.split('/' ).last.split('.' ).head
133-       command.setValue(" cd %s *; %s  ./sbin /spark-executor " .format(basename, prefixEnv) )
137+       command.setValue(s " cd  ${basename} *;  $prefixEnv  ./bin /spark-class   $executorBackendName " )
134138      command.addUris(CommandInfo .URI .newBuilder().setValue(uri))
135139    }
136140    val  cpus  =  Resource .newBuilder()
0 commit comments