From a42d848d5890d55f4a8ff680f9a1ef05d96ea721 Mon Sep 17 00:00:00 2001 From: lenhattan86 Date: Thu, 16 Sep 2021 14:05:26 -0700 Subject: [PATCH] add priority into task config --- job.go | 5 +++++ task.go | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/job.go b/job.go index b553520..698ecfa 100644 --- a/job.go +++ b/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() } diff --git a/task.go b/task.go index e4037c3..a6e9f5a 100644 --- a/task.go +++ b/task.go @@ -287,6 +287,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 {