@@ -9,12 +9,7 @@ import org.apache.mesos.Protos.ContainerInfo.DockerInfo
9
9
import org .apache .mesos .Protos .Environment .Variable
10
10
import org .apache .mesos .Protos ._
11
11
import org .apache .mesos .chronos .scheduler .config .SchedulerConfiguration
12
- import org .apache .mesos .chronos .scheduler .jobs .{
13
- BaseJob ,
14
- ContainerType ,
15
- Fetch ,
16
- TaskUtils
17
- }
12
+ import org .apache .mesos .chronos .scheduler .jobs .{Volume => _ , _ }
18
13
19
14
import scala .collection .JavaConverters ._
20
15
import scala .collection .Map
@@ -86,22 +81,30 @@ class MesosTaskBuilder @Inject()(val conf: SchedulerConfiguration) {
86
81
if (job.executor.nonEmpty) {
87
82
appendExecutorData(taskInfo, job, environment, uriCommand)
88
83
} else {
84
+ val jobArguments = TaskUtils .getJobArgumentsForTaskId(taskId.getValue)
85
+ val jobWithCommand = if (jobArguments != null && ! jobArguments.isEmpty) {
86
+ JobUtils .getJobWithArguments(job, jobArguments)
87
+ } else {
88
+ job
89
+ }
90
+
89
91
val command = CommandInfo .newBuilder()
90
- if (job.command.startsWith(" http" ) || job.command.startsWith(" ftp" )) {
92
+ if (jobWithCommand.command.startsWith(" http" ) || jobWithCommand.command
93
+ .startsWith(" ftp" )) {
91
94
val uri1 = CommandInfo .URI
92
95
.newBuilder()
93
- .setValue(job .command)
96
+ .setValue(jobWithCommand .command)
94
97
.setExecutable(true )
95
98
.build()
96
99
97
100
command
98
101
.addUris(uri1)
99
- .setValue(
100
- " \" . " + job.command.substring(job .command.lastIndexOf(" /" )) + " \" " )
102
+ .setValue(" \" . " + jobWithCommand.command.substring(
103
+ jobWithCommand .command.lastIndexOf(" /" )) + " \" " )
101
104
.setEnvironment(environment)
102
105
} else {
103
- val jobHasCmd = ! job .command.isEmpty
104
- if (jobHasCmd) command.setValue(job .command)
106
+ val jobHasCmd = ! jobWithCommand .command.isEmpty
107
+ if (jobHasCmd) command.setValue(jobWithCommand .command)
105
108
106
109
command
107
110
.setShell(job.shell)
0 commit comments