parent
983bf44b9f
commit
425faf28b8
4 changed files with 19 additions and 1 deletions
5
job.go
5
job.go
|
@ -156,6 +156,11 @@ func (j *AuroraJob) IsService(isService bool) *AuroraJob {
|
|||
return j
|
||||
}
|
||||
|
||||
func (j *AuroraJob) Priority(priority int32) *AuroraJob {
|
||||
j.task.Priority(priority)
|
||||
return j
|
||||
}
|
||||
|
||||
func (j *AuroraJob) TaskConfig() *aurora.TaskConfig {
|
||||
return j.task.TaskConfig()
|
||||
}
|
||||
|
|
|
@ -221,6 +221,11 @@ func (j *JobUpdate) IsService(isService bool) *JobUpdate {
|
|||
return j
|
||||
}
|
||||
|
||||
func (j *JobUpdate) Priority(priority int32) *JobUpdate {
|
||||
j.task.Priority(priority)
|
||||
return j
|
||||
}
|
||||
|
||||
func (j *JobUpdate) TaskConfig() *aurora.TaskConfig {
|
||||
return j.task.TaskConfig()
|
||||
}
|
||||
|
|
9
task.go
9
task.go
|
@ -78,7 +78,8 @@ func TaskFromThrift(config *aurora.TaskConfig) *AuroraTask {
|
|||
Role(config.Job.Role).
|
||||
Name(config.Job.Name).
|
||||
MaxFailure(config.MaxTaskFailures).
|
||||
IsService(config.IsService)
|
||||
IsService(config.IsService).
|
||||
Priority(config.Priority)
|
||||
|
||||
if config.Tier != nil {
|
||||
newTask.Tier(*config.Tier)
|
||||
|
@ -287,6 +288,12 @@ func (t *AuroraTask) IsService(isService bool) *AuroraTask {
|
|||
return t
|
||||
}
|
||||
|
||||
//set priority for preemption or priority-queueing
|
||||
func (t *AuroraTask) Priority(priority int32) *AuroraTask {
|
||||
t.task.Priority = priority
|
||||
return t
|
||||
}
|
||||
|
||||
// Add a list of URIs with the same extract and cache configuration. Scheduler must have
|
||||
// --enable_mesos_fetcher flag enabled. Currently there is no duplicate detection.
|
||||
func (t *AuroraTask) AddURIs(extract bool, cache bool, values ...string) *AuroraTask {
|
||||
|
|
|
@ -34,6 +34,7 @@ func TestAuroraTask_Clone(t *testing.T) {
|
|||
RAM(643).
|
||||
Disk(1000).
|
||||
IsService(true).
|
||||
Priority(1).
|
||||
AddPorts(10).
|
||||
Tier("preferred").
|
||||
MaxFailure(23).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue