From 2eaa60f6813e4282bd6d505add22e72f2e4a0373 Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Fri, 16 Nov 2018 11:41:09 -0800 Subject: [PATCH] Support Drain SLA API (#88) * Bringing thrift API up to date with Aurora 0.21.0. * Adding support for SLA Drain Host API. --- auroraAPI.thrift | 109 +- examples/client.go | 31 + .../aurora_admin-remote.go | 679 ++++--- .../aurora_scheduler_manager-remote.go | 436 ++-- gen-go/apache/aurora/auroraadmin.go | 595 +++++- .../apache/aurora/auroraschedulermanager.go | 156 +- gen-go/apache/aurora/constants.go | 3 + .../read_only_scheduler-remote.go | 144 +- gen-go/apache/aurora/readonlyscheduler.go | 140 +- gen-go/apache/aurora/ttypes.go | 1804 ++++++++++++----- job.go | 3 - realis.go | 34 + realis_e2e_test.go | 31 + 13 files changed, 2842 insertions(+), 1323 deletions(-) diff --git a/auroraAPI.thrift b/auroraAPI.thrift index 8acd4f3..063774d 100644 --- a/auroraAPI.thrift +++ b/auroraAPI.thrift @@ -115,11 +115,13 @@ struct JobKey { 3: string name } +// TODO(jly): Deprecated, remove in 0.21. See AURORA-1959. /** A unique lock key. */ union LockKey { 1: JobKey job } +// TODO(jly): Deprecated, remove in 0.21. See AURORA-1959. /** A generic lock struct to facilitate context specific resource/operation serialization. */ struct Lock { /** ID of the lock - unique per storage */ @@ -238,6 +240,42 @@ union Resource { 5: i64 numGpus } +struct PartitionPolicy { + 1: bool reschedule + 2: optional i64 delaySecs +} + +/** SLA requirements expressed as the percentage of instances to be RUNNING every durationSecs */ +struct PercentageSlaPolicy { + /* The percentage of active instances required every `durationSecs`. */ + 1: double percentage + /** Minimum time duration a task needs to be `RUNNING` to be treated as active */ + 2: i64 durationSecs +} + +/** SLA requirements expressed as the number of instances to be RUNNING every durationSecs */ +struct CountSlaPolicy { + /** The number of active instances required every `durationSecs` */ + 1: i64 count + /** Minimum time duration a task needs to be `RUNNING` to be treated as active */ + 2: i64 durationSecs +} + +/** SLA requirements to be delegated to an external coordinator */ +struct CoordinatorSlaPolicy { + /** URL for the coordinator service that needs to be contacted for SLA checks */ + 1: string coordinatorUrl + /** Field in the Coordinator response json indicating if the action is allowed or not */ + 2: string statusKey +} + +/** SLA requirements expressed in one of the many types */ +union SlaPolicy { + 1: PercentageSlaPolicy percentageSlaPolicy + 2: CountSlaPolicy countSlaPolicy + 3: CoordinatorSlaPolicy coordinatorSlaPolicy +} + /** Description of the tasks contained within a job. */ struct TaskConfig { /** Job task belongs to. */ @@ -246,12 +284,6 @@ struct TaskConfig { /** contains the role component of JobKey */ 17: Identity owner 7: bool isService - // TODO(maxim): Deprecated. See AURORA-1707. - 8: double numCpus - // TODO(maxim): Deprecated. See AURORA-1707. - 9: i64 ramMb - // TODO(maxim): Deprecated. See AURORA-1707. - 10: i64 diskMb 11: i32 priority 13: i32 maxTaskFailures // TODO(mnurolahzade): Deprecated. See AURORA-1708. @@ -263,8 +295,6 @@ struct TaskConfig { 32: set resources 20: set constraints - /** a list of named ports this task requests */ - 21: set requestedPorts /** Resources to retrieve with Mesos Fetcher */ 33: optional set mesosFetcherUris /** @@ -278,6 +308,10 @@ struct TaskConfig { 25: optional ExecutorConfig executorConfig /** Used to display additional details in the UI. */ 27: optional set metadata + /** Policy for how to deal with task partitions */ + 34: optional PartitionPolicy partitionPolicy + /** SLA requirements to be met during maintenance */ + 35: optional SlaPolicy slaPolicy // This field is deliberately placed at the end to work around a bug in the immutable wrapper // code generator. See AURORA-1185 for details. @@ -286,15 +320,6 @@ struct TaskConfig { } struct ResourceAggregate { - // TODO(maxim): Deprecated. See AURORA-1707. - /** Number of CPU cores allotted. */ - 1: double numCpus - // TODO(maxim): Deprecated. See AURORA-1707. - /** Megabytes of RAM allotted. */ - 2: i64 ramMb - // TODO(maxim): Deprecated. See AURORA-1707. - /** Megabytes of disk space allotted. */ - 3: i64 diskMb /** Aggregated resource values. */ 4: set resources } @@ -422,7 +447,11 @@ enum ScheduleStatus { /** A fault in the task environment has caused the system to believe the task no longer exists. * This can happen, for example, when a slave process disappears. */ - LOST = 7 + LOST = 7, + /** + * The task is currently partitioned and in an unknown state. + **/ + PARTITIONED = 18 } // States that a task may be in while still considered active. @@ -434,6 +463,7 @@ const set ACTIVE_STATES = [ScheduleStatus.ASSIGNED, ScheduleStatus.RESTARTING ScheduleStatus.RUNNING, ScheduleStatus.STARTING, + ScheduleStatus.PARTITIONED, ScheduleStatus.THROTTLED] // States that a task may be in while associated with a slave machine and non-terminal. @@ -443,6 +473,7 @@ const set SLAVE_ASSIGNED_STATES = [ScheduleStatus.ASSIGNED, ScheduleStatus.PREEMPTING, ScheduleStatus.RESTARTING, ScheduleStatus.RUNNING, + ScheduleStatus.PARTITIONED, ScheduleStatus.STARTING] // States that a task may be in while in an active sandbox. @@ -450,6 +481,7 @@ const set LIVE_STATES = [ScheduleStatus.KILLING, ScheduleStatus.PREEMPTING, ScheduleStatus.RESTARTING, ScheduleStatus.DRAINING, + ScheduleStatus.PARTITIONED, ScheduleStatus.RUNNING] // States a completed task may be in. @@ -518,6 +550,11 @@ struct ScheduledTask { * this task. */ 3: i32 failureCount + /** + * The number of partitions this task has accumulated over its lifetime. + */ + 6: i32 timesPartitioned + /** State change history for this task. */ 4: list taskEvents /** @@ -619,7 +656,6 @@ const set ACTIVE_JOB_UPDATE_STATES = [JobUpdateStatus.ROLLING_F JobUpdateStatus.ROLL_BACK_PAUSED, JobUpdateStatus.ROLL_FORWARD_AWAITING_PULSE, JobUpdateStatus.ROLL_BACK_AWAITING_PULSE] - /** States the job update can be in while waiting for a pulse. */ const set AWAITNG_PULSE_JOB_UPDATE_STATES = [JobUpdateStatus.ROLL_FORWARD_AWAITING_PULSE, JobUpdateStatus.ROLL_BACK_AWAITING_PULSE] @@ -706,13 +742,19 @@ struct JobUpdateSettings { */ 8: bool waitForBatchCompletion - /** - * If set, requires external calls to pulseJobUpdate RPC within the specified rate for the - * update to make progress. If no pulses received within specified interval the update will - * block. A blocked update is unable to continue but retains its current status. It may only get - * unblocked by a fresh pulseJobUpdate call. - */ + /** + * If set, requires external calls to pulseJobUpdate RPC within the specified rate for the + * update to make progress. If no pulses received within specified interval the update will + * block. A blocked update is unable to continue but retains its current status. It may only get + * unblocked by a fresh pulseJobUpdate call. + */ 9: optional i32 blockIfNoPulsesAfterMs + + /** + * If true, updates will obey the SLA requirements of the tasks being updated. If the SLA policy + * differs between the old and new task configurations, updates will use the newest configuration. + */ + 10: optional bool slaAware } /** Event marking a state transition in job update lifecycle. */ @@ -743,6 +785,9 @@ struct JobInstanceUpdateEvent { /** Job update action taken on the instance. */ 3: JobUpdateAction action + + /** Optional message explaining the instance update event. */ + 4: optional string message } /** Maps instance IDs to TaskConfigs it. */ @@ -855,6 +900,13 @@ struct JobUpdateQuery { 7: i32 limit } +struct HostMaintenanceRequest { + 1: string host + 2: SlaPolicy defaultSlaPolicy + 3: i64 timeoutSecs + 4: i64 createdTimestampMs +} + struct ListBackupsResult { 1: set backups } @@ -1039,7 +1091,6 @@ service ReadOnlyScheduler { Response getJobUpdateSummaries(1: JobUpdateQuery jobUpdateQuery) /** Gets job update details. */ - // TODO(zmanji): `key` is deprecated, remove this with AURORA-1765 Response getJobUpdateDetails(2: JobUpdateQuery query) /** Gets the diff between client (desired) and server (current) job states. */ @@ -1192,6 +1243,12 @@ service AuroraAdmin extends AuroraSchedulerManager { /** Set the given hosts back into serving mode. */ Response endMaintenance(1: Hosts hosts) + /** + * Ask scheduler to put hosts into DRAINING mode and move scheduled tasks off of the hosts + * such that its SLA requirements are satisfied. Use defaultSlaPolicy if it is not set for a task. + **/ + Response slaDrainHosts(1: Hosts hosts, 2: SlaPolicy defaultSlaPolicy, 3: i64 timeoutSecs) + /** Start a storage snapshot and block until it completes. */ Response snapshot() diff --git a/examples/client.go b/examples/client.go index 23ffdc8..4d62630 100644 --- a/examples/client.go +++ b/examples/client.go @@ -554,6 +554,37 @@ func main() { fmt.Print(result.String()) + case "SLADrainHosts": + fmt.Println("Setting hosts to DRAINING using SLA aware draining") + if hostList == "" { + log.Fatal("No hosts specified to drain") + } + hosts := strings.Split(hostList, ",") + + policy := aurora.SlaPolicy{PercentageSlaPolicy: &aurora.PercentageSlaPolicy{Percentage: 50.0}} + + result, err := r.SLADrainHosts(&policy, 30, hosts...) + if err != nil { + log.Fatalf("error: %+v\n", err.Error()) + } + + // Monitor change to DRAINING and DRAINED mode + hostResult, err := monitor.HostMaintenance( + hosts, + []aurora.MaintenanceMode{aurora.MaintenanceMode_DRAINED, aurora.MaintenanceMode_DRAINING}, + 5, + 10) + if err != nil { + for host, ok := range hostResult { + if !ok { + fmt.Printf("Host %s did not transtion into desired mode(s)\n", host) + } + } + log.Fatalf("error: %+v\n", err.Error()) + } + + fmt.Print(result.String()) + case "endMaintenance": fmt.Println("Setting hosts to ACTIVE") if hostList == "" { diff --git a/gen-go/apache/aurora/aurora_admin-remote/aurora_admin-remote.go b/gen-go/apache/aurora/aurora_admin-remote/aurora_admin-remote.go index 3afe684..d6f7bfd 100755 --- a/gen-go/apache/aurora/aurora_admin-remote/aurora_admin-remote.go +++ b/gen-go/apache/aurora/aurora_admin-remote/aurora_admin-remote.go @@ -33,6 +33,7 @@ func Usage() { fmt.Fprintln(os.Stderr, " Response drainHosts(Hosts hosts)") fmt.Fprintln(os.Stderr, " Response maintenanceStatus(Hosts hosts)") fmt.Fprintln(os.Stderr, " Response endMaintenance(Hosts hosts)") + fmt.Fprintln(os.Stderr, " Response slaDrainHosts(Hosts hosts, SlaPolicy defaultSlaPolicy, i64 timeoutSecs)") fmt.Fprintln(os.Stderr, " Response snapshot()") fmt.Fprintln(os.Stderr, " Response triggerExplicitTaskReconciliation(ExplicitReconciliationSettings settings)") fmt.Fprintln(os.Stderr, " Response triggerImplicitTaskReconciliation()") @@ -165,19 +166,19 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - arg353 := flag.Arg(2) - mbTrans354 := thrift.NewTMemoryBufferLen(len(arg353)) - defer mbTrans354.Close() - _, err355 := mbTrans354.WriteString(arg353) - if err355 != nil { + arg354 := flag.Arg(2) + mbTrans355 := thrift.NewTMemoryBufferLen(len(arg354)) + defer mbTrans355.Close() + _, err356 := mbTrans355.WriteString(arg354) + if err356 != nil { Usage() return } - factory356 := thrift.NewTSimpleJSONProtocolFactory() - jsProt357 := factory356.GetProtocol(mbTrans354) + factory357 := thrift.NewTSimpleJSONProtocolFactory() + jsProt358 := factory357.GetProtocol(mbTrans355) argvalue1 := aurora.NewResourceAggregate() - err358 := argvalue1.Read(jsProt357) - if err358 != nil { + err359 := argvalue1.Read(jsProt358) + if err359 != nil { Usage() return } @@ -233,19 +234,19 @@ func main() { fmt.Fprintln(os.Stderr, "QueryRecovery requires 1 args") flag.Usage() } - arg361 := flag.Arg(1) - mbTrans362 := thrift.NewTMemoryBufferLen(len(arg361)) - defer mbTrans362.Close() - _, err363 := mbTrans362.WriteString(arg361) - if err363 != nil { + arg362 := flag.Arg(1) + mbTrans363 := thrift.NewTMemoryBufferLen(len(arg362)) + defer mbTrans363.Close() + _, err364 := mbTrans363.WriteString(arg362) + if err364 != nil { Usage() return } - factory364 := thrift.NewTSimpleJSONProtocolFactory() - jsProt365 := factory364.GetProtocol(mbTrans362) + factory365 := thrift.NewTSimpleJSONProtocolFactory() + jsProt366 := factory365.GetProtocol(mbTrans363) argvalue0 := aurora.NewTaskQuery() - err366 := argvalue0.Read(jsProt365) - if err366 != nil { + err367 := argvalue0.Read(jsProt366) + if err367 != nil { Usage() return } @@ -258,19 +259,19 @@ func main() { fmt.Fprintln(os.Stderr, "DeleteRecoveryTasks requires 1 args") flag.Usage() } - arg367 := flag.Arg(1) - mbTrans368 := thrift.NewTMemoryBufferLen(len(arg367)) - defer mbTrans368.Close() - _, err369 := mbTrans368.WriteString(arg367) - if err369 != nil { + arg368 := flag.Arg(1) + mbTrans369 := thrift.NewTMemoryBufferLen(len(arg368)) + defer mbTrans369.Close() + _, err370 := mbTrans369.WriteString(arg368) + if err370 != nil { Usage() return } - factory370 := thrift.NewTSimpleJSONProtocolFactory() - jsProt371 := factory370.GetProtocol(mbTrans368) + factory371 := thrift.NewTSimpleJSONProtocolFactory() + jsProt372 := factory371.GetProtocol(mbTrans369) argvalue0 := aurora.NewTaskQuery() - err372 := argvalue0.Read(jsProt371) - if err372 != nil { + err373 := argvalue0.Read(jsProt372) + if err373 != nil { Usage() return } @@ -299,19 +300,19 @@ func main() { fmt.Fprintln(os.Stderr, "StartMaintenance requires 1 args") flag.Usage() } - arg373 := flag.Arg(1) - mbTrans374 := thrift.NewTMemoryBufferLen(len(arg373)) - defer mbTrans374.Close() - _, err375 := mbTrans374.WriteString(arg373) - if err375 != nil { + arg374 := flag.Arg(1) + mbTrans375 := thrift.NewTMemoryBufferLen(len(arg374)) + defer mbTrans375.Close() + _, err376 := mbTrans375.WriteString(arg374) + if err376 != nil { Usage() return } - factory376 := thrift.NewTSimpleJSONProtocolFactory() - jsProt377 := factory376.GetProtocol(mbTrans374) + factory377 := thrift.NewTSimpleJSONProtocolFactory() + jsProt378 := factory377.GetProtocol(mbTrans375) argvalue0 := aurora.NewHosts() - err378 := argvalue0.Read(jsProt377) - if err378 != nil { + err379 := argvalue0.Read(jsProt378) + if err379 != nil { Usage() return } @@ -324,19 +325,19 @@ func main() { fmt.Fprintln(os.Stderr, "DrainHosts requires 1 args") flag.Usage() } - arg379 := flag.Arg(1) - mbTrans380 := thrift.NewTMemoryBufferLen(len(arg379)) - defer mbTrans380.Close() - _, err381 := mbTrans380.WriteString(arg379) - if err381 != nil { + arg380 := flag.Arg(1) + mbTrans381 := thrift.NewTMemoryBufferLen(len(arg380)) + defer mbTrans381.Close() + _, err382 := mbTrans381.WriteString(arg380) + if err382 != nil { Usage() return } - factory382 := thrift.NewTSimpleJSONProtocolFactory() - jsProt383 := factory382.GetProtocol(mbTrans380) + factory383 := thrift.NewTSimpleJSONProtocolFactory() + jsProt384 := factory383.GetProtocol(mbTrans381) argvalue0 := aurora.NewHosts() - err384 := argvalue0.Read(jsProt383) - if err384 != nil { + err385 := argvalue0.Read(jsProt384) + if err385 != nil { Usage() return } @@ -349,19 +350,19 @@ func main() { fmt.Fprintln(os.Stderr, "MaintenanceStatus requires 1 args") flag.Usage() } - arg385 := flag.Arg(1) - mbTrans386 := thrift.NewTMemoryBufferLen(len(arg385)) - defer mbTrans386.Close() - _, err387 := mbTrans386.WriteString(arg385) - if err387 != nil { + arg386 := flag.Arg(1) + mbTrans387 := thrift.NewTMemoryBufferLen(len(arg386)) + defer mbTrans387.Close() + _, err388 := mbTrans387.WriteString(arg386) + if err388 != nil { Usage() return } - factory388 := thrift.NewTSimpleJSONProtocolFactory() - jsProt389 := factory388.GetProtocol(mbTrans386) + factory389 := thrift.NewTSimpleJSONProtocolFactory() + jsProt390 := factory389.GetProtocol(mbTrans387) argvalue0 := aurora.NewHosts() - err390 := argvalue0.Read(jsProt389) - if err390 != nil { + err391 := argvalue0.Read(jsProt390) + if err391 != nil { Usage() return } @@ -374,19 +375,19 @@ func main() { fmt.Fprintln(os.Stderr, "EndMaintenance requires 1 args") flag.Usage() } - arg391 := flag.Arg(1) - mbTrans392 := thrift.NewTMemoryBufferLen(len(arg391)) - defer mbTrans392.Close() - _, err393 := mbTrans392.WriteString(arg391) - if err393 != nil { + arg392 := flag.Arg(1) + mbTrans393 := thrift.NewTMemoryBufferLen(len(arg392)) + defer mbTrans393.Close() + _, err394 := mbTrans393.WriteString(arg392) + if err394 != nil { Usage() return } - factory394 := thrift.NewTSimpleJSONProtocolFactory() - jsProt395 := factory394.GetProtocol(mbTrans392) + factory395 := thrift.NewTSimpleJSONProtocolFactory() + jsProt396 := factory395.GetProtocol(mbTrans393) argvalue0 := aurora.NewHosts() - err396 := argvalue0.Read(jsProt395) - if err396 != nil { + err397 := argvalue0.Read(jsProt396) + if err397 != nil { Usage() return } @@ -394,6 +395,54 @@ func main() { fmt.Print(client.EndMaintenance(value0)) fmt.Print("\n") break + case "slaDrainHosts": + if flag.NArg()-1 != 3 { + fmt.Fprintln(os.Stderr, "SlaDrainHosts requires 3 args") + flag.Usage() + } + arg398 := flag.Arg(1) + mbTrans399 := thrift.NewTMemoryBufferLen(len(arg398)) + defer mbTrans399.Close() + _, err400 := mbTrans399.WriteString(arg398) + if err400 != nil { + Usage() + return + } + factory401 := thrift.NewTSimpleJSONProtocolFactory() + jsProt402 := factory401.GetProtocol(mbTrans399) + argvalue0 := aurora.NewHosts() + err403 := argvalue0.Read(jsProt402) + if err403 != nil { + Usage() + return + } + value0 := argvalue0 + arg404 := flag.Arg(2) + mbTrans405 := thrift.NewTMemoryBufferLen(len(arg404)) + defer mbTrans405.Close() + _, err406 := mbTrans405.WriteString(arg404) + if err406 != nil { + Usage() + return + } + factory407 := thrift.NewTSimpleJSONProtocolFactory() + jsProt408 := factory407.GetProtocol(mbTrans405) + argvalue1 := aurora.NewSlaPolicy() + err409 := argvalue1.Read(jsProt408) + if err409 != nil { + Usage() + return + } + value1 := argvalue1 + argvalue2, err410 := (strconv.ParseInt(flag.Arg(3), 10, 64)) + if err410 != nil { + Usage() + return + } + value2 := argvalue2 + fmt.Print(client.SlaDrainHosts(value0, value1, value2)) + fmt.Print("\n") + break case "snapshot": if flag.NArg()-1 != 0 { fmt.Fprintln(os.Stderr, "Snapshot requires 0 args") @@ -407,19 +456,19 @@ func main() { fmt.Fprintln(os.Stderr, "TriggerExplicitTaskReconciliation requires 1 args") flag.Usage() } - arg397 := flag.Arg(1) - mbTrans398 := thrift.NewTMemoryBufferLen(len(arg397)) - defer mbTrans398.Close() - _, err399 := mbTrans398.WriteString(arg397) - if err399 != nil { + arg411 := flag.Arg(1) + mbTrans412 := thrift.NewTMemoryBufferLen(len(arg411)) + defer mbTrans412.Close() + _, err413 := mbTrans412.WriteString(arg411) + if err413 != nil { Usage() return } - factory400 := thrift.NewTSimpleJSONProtocolFactory() - jsProt401 := factory400.GetProtocol(mbTrans398) + factory414 := thrift.NewTSimpleJSONProtocolFactory() + jsProt415 := factory414.GetProtocol(mbTrans412) argvalue0 := aurora.NewExplicitReconciliationSettings() - err402 := argvalue0.Read(jsProt401) - if err402 != nil { + err416 := argvalue0.Read(jsProt415) + if err416 != nil { Usage() return } @@ -440,19 +489,19 @@ func main() { fmt.Fprintln(os.Stderr, "PruneTasks requires 1 args") flag.Usage() } - arg403 := flag.Arg(1) - mbTrans404 := thrift.NewTMemoryBufferLen(len(arg403)) - defer mbTrans404.Close() - _, err405 := mbTrans404.WriteString(arg403) - if err405 != nil { + arg417 := flag.Arg(1) + mbTrans418 := thrift.NewTMemoryBufferLen(len(arg417)) + defer mbTrans418.Close() + _, err419 := mbTrans418.WriteString(arg417) + if err419 != nil { Usage() return } - factory406 := thrift.NewTSimpleJSONProtocolFactory() - jsProt407 := factory406.GetProtocol(mbTrans404) + factory420 := thrift.NewTSimpleJSONProtocolFactory() + jsProt421 := factory420.GetProtocol(mbTrans418) argvalue0 := aurora.NewTaskQuery() - err408 := argvalue0.Read(jsProt407) - if err408 != nil { + err422 := argvalue0.Read(jsProt421) + if err422 != nil { Usage() return } @@ -465,19 +514,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateJob requires 1 args") flag.Usage() } - arg409 := flag.Arg(1) - mbTrans410 := thrift.NewTMemoryBufferLen(len(arg409)) - defer mbTrans410.Close() - _, err411 := mbTrans410.WriteString(arg409) - if err411 != nil { + arg423 := flag.Arg(1) + mbTrans424 := thrift.NewTMemoryBufferLen(len(arg423)) + defer mbTrans424.Close() + _, err425 := mbTrans424.WriteString(arg423) + if err425 != nil { Usage() return } - factory412 := thrift.NewTSimpleJSONProtocolFactory() - jsProt413 := factory412.GetProtocol(mbTrans410) + factory426 := thrift.NewTSimpleJSONProtocolFactory() + jsProt427 := factory426.GetProtocol(mbTrans424) argvalue0 := aurora.NewJobConfiguration() - err414 := argvalue0.Read(jsProt413) - if err414 != nil { + err428 := argvalue0.Read(jsProt427) + if err428 != nil { Usage() return } @@ -490,19 +539,19 @@ func main() { fmt.Fprintln(os.Stderr, "ScheduleCronJob requires 1 args") flag.Usage() } - arg415 := flag.Arg(1) - mbTrans416 := thrift.NewTMemoryBufferLen(len(arg415)) - defer mbTrans416.Close() - _, err417 := mbTrans416.WriteString(arg415) - if err417 != nil { + arg429 := flag.Arg(1) + mbTrans430 := thrift.NewTMemoryBufferLen(len(arg429)) + defer mbTrans430.Close() + _, err431 := mbTrans430.WriteString(arg429) + if err431 != nil { Usage() return } - factory418 := thrift.NewTSimpleJSONProtocolFactory() - jsProt419 := factory418.GetProtocol(mbTrans416) + factory432 := thrift.NewTSimpleJSONProtocolFactory() + jsProt433 := factory432.GetProtocol(mbTrans430) argvalue0 := aurora.NewJobConfiguration() - err420 := argvalue0.Read(jsProt419) - if err420 != nil { + err434 := argvalue0.Read(jsProt433) + if err434 != nil { Usage() return } @@ -515,19 +564,19 @@ func main() { fmt.Fprintln(os.Stderr, "DescheduleCronJob requires 1 args") flag.Usage() } - arg421 := flag.Arg(1) - mbTrans422 := thrift.NewTMemoryBufferLen(len(arg421)) - defer mbTrans422.Close() - _, err423 := mbTrans422.WriteString(arg421) - if err423 != nil { + arg435 := flag.Arg(1) + mbTrans436 := thrift.NewTMemoryBufferLen(len(arg435)) + defer mbTrans436.Close() + _, err437 := mbTrans436.WriteString(arg435) + if err437 != nil { Usage() return } - factory424 := thrift.NewTSimpleJSONProtocolFactory() - jsProt425 := factory424.GetProtocol(mbTrans422) + factory438 := thrift.NewTSimpleJSONProtocolFactory() + jsProt439 := factory438.GetProtocol(mbTrans436) argvalue0 := aurora.NewJobKey() - err426 := argvalue0.Read(jsProt425) - if err426 != nil { + err440 := argvalue0.Read(jsProt439) + if err440 != nil { Usage() return } @@ -540,19 +589,19 @@ func main() { fmt.Fprintln(os.Stderr, "StartCronJob requires 1 args") flag.Usage() } - arg427 := flag.Arg(1) - mbTrans428 := thrift.NewTMemoryBufferLen(len(arg427)) - defer mbTrans428.Close() - _, err429 := mbTrans428.WriteString(arg427) - if err429 != nil { + arg441 := flag.Arg(1) + mbTrans442 := thrift.NewTMemoryBufferLen(len(arg441)) + defer mbTrans442.Close() + _, err443 := mbTrans442.WriteString(arg441) + if err443 != nil { Usage() return } - factory430 := thrift.NewTSimpleJSONProtocolFactory() - jsProt431 := factory430.GetProtocol(mbTrans428) + factory444 := thrift.NewTSimpleJSONProtocolFactory() + jsProt445 := factory444.GetProtocol(mbTrans442) argvalue0 := aurora.NewJobKey() - err432 := argvalue0.Read(jsProt431) - if err432 != nil { + err446 := argvalue0.Read(jsProt445) + if err446 != nil { Usage() return } @@ -565,36 +614,36 @@ func main() { fmt.Fprintln(os.Stderr, "RestartShards requires 2 args") flag.Usage() } - arg433 := flag.Arg(1) - mbTrans434 := thrift.NewTMemoryBufferLen(len(arg433)) - defer mbTrans434.Close() - _, err435 := mbTrans434.WriteString(arg433) - if err435 != nil { + arg447 := flag.Arg(1) + mbTrans448 := thrift.NewTMemoryBufferLen(len(arg447)) + defer mbTrans448.Close() + _, err449 := mbTrans448.WriteString(arg447) + if err449 != nil { Usage() return } - factory436 := thrift.NewTSimpleJSONProtocolFactory() - jsProt437 := factory436.GetProtocol(mbTrans434) + factory450 := thrift.NewTSimpleJSONProtocolFactory() + jsProt451 := factory450.GetProtocol(mbTrans448) argvalue0 := aurora.NewJobKey() - err438 := argvalue0.Read(jsProt437) - if err438 != nil { + err452 := argvalue0.Read(jsProt451) + if err452 != nil { Usage() return } value0 := argvalue0 - arg439 := flag.Arg(2) - mbTrans440 := thrift.NewTMemoryBufferLen(len(arg439)) - defer mbTrans440.Close() - _, err441 := mbTrans440.WriteString(arg439) - if err441 != nil { + arg453 := flag.Arg(2) + mbTrans454 := thrift.NewTMemoryBufferLen(len(arg453)) + defer mbTrans454.Close() + _, err455 := mbTrans454.WriteString(arg453) + if err455 != nil { Usage() return } - factory442 := thrift.NewTSimpleJSONProtocolFactory() - jsProt443 := factory442.GetProtocol(mbTrans440) + factory456 := thrift.NewTSimpleJSONProtocolFactory() + jsProt457 := factory456.GetProtocol(mbTrans454) containerStruct1 := aurora.NewAuroraAdminRestartShardsArgs() - err444 := containerStruct1.ReadField2(jsProt443) - if err444 != nil { + err458 := containerStruct1.ReadField2(jsProt457) + if err458 != nil { Usage() return } @@ -608,36 +657,36 @@ func main() { fmt.Fprintln(os.Stderr, "KillTasks requires 3 args") flag.Usage() } - arg445 := flag.Arg(1) - mbTrans446 := thrift.NewTMemoryBufferLen(len(arg445)) - defer mbTrans446.Close() - _, err447 := mbTrans446.WriteString(arg445) - if err447 != nil { + arg459 := flag.Arg(1) + mbTrans460 := thrift.NewTMemoryBufferLen(len(arg459)) + defer mbTrans460.Close() + _, err461 := mbTrans460.WriteString(arg459) + if err461 != nil { Usage() return } - factory448 := thrift.NewTSimpleJSONProtocolFactory() - jsProt449 := factory448.GetProtocol(mbTrans446) + factory462 := thrift.NewTSimpleJSONProtocolFactory() + jsProt463 := factory462.GetProtocol(mbTrans460) argvalue0 := aurora.NewJobKey() - err450 := argvalue0.Read(jsProt449) - if err450 != nil { + err464 := argvalue0.Read(jsProt463) + if err464 != nil { Usage() return } value0 := argvalue0 - arg451 := flag.Arg(2) - mbTrans452 := thrift.NewTMemoryBufferLen(len(arg451)) - defer mbTrans452.Close() - _, err453 := mbTrans452.WriteString(arg451) - if err453 != nil { + arg465 := flag.Arg(2) + mbTrans466 := thrift.NewTMemoryBufferLen(len(arg465)) + defer mbTrans466.Close() + _, err467 := mbTrans466.WriteString(arg465) + if err467 != nil { Usage() return } - factory454 := thrift.NewTSimpleJSONProtocolFactory() - jsProt455 := factory454.GetProtocol(mbTrans452) + factory468 := thrift.NewTSimpleJSONProtocolFactory() + jsProt469 := factory468.GetProtocol(mbTrans466) containerStruct1 := aurora.NewAuroraAdminKillTasksArgs() - err456 := containerStruct1.ReadField2(jsProt455) - if err456 != nil { + err470 := containerStruct1.ReadField2(jsProt469) + if err470 != nil { Usage() return } @@ -653,25 +702,25 @@ func main() { fmt.Fprintln(os.Stderr, "AddInstances requires 2 args") flag.Usage() } - arg458 := flag.Arg(1) - mbTrans459 := thrift.NewTMemoryBufferLen(len(arg458)) - defer mbTrans459.Close() - _, err460 := mbTrans459.WriteString(arg458) - if err460 != nil { + arg472 := flag.Arg(1) + mbTrans473 := thrift.NewTMemoryBufferLen(len(arg472)) + defer mbTrans473.Close() + _, err474 := mbTrans473.WriteString(arg472) + if err474 != nil { Usage() return } - factory461 := thrift.NewTSimpleJSONProtocolFactory() - jsProt462 := factory461.GetProtocol(mbTrans459) + factory475 := thrift.NewTSimpleJSONProtocolFactory() + jsProt476 := factory475.GetProtocol(mbTrans473) argvalue0 := aurora.NewInstanceKey() - err463 := argvalue0.Read(jsProt462) - if err463 != nil { + err477 := argvalue0.Read(jsProt476) + if err477 != nil { Usage() return } value0 := argvalue0 - tmp1, err464 := (strconv.Atoi(flag.Arg(2))) - if err464 != nil { + tmp1, err478 := (strconv.Atoi(flag.Arg(2))) + if err478 != nil { Usage() return } @@ -685,19 +734,19 @@ func main() { fmt.Fprintln(os.Stderr, "ReplaceCronTemplate requires 1 args") flag.Usage() } - arg465 := flag.Arg(1) - mbTrans466 := thrift.NewTMemoryBufferLen(len(arg465)) - defer mbTrans466.Close() - _, err467 := mbTrans466.WriteString(arg465) - if err467 != nil { + arg479 := flag.Arg(1) + mbTrans480 := thrift.NewTMemoryBufferLen(len(arg479)) + defer mbTrans480.Close() + _, err481 := mbTrans480.WriteString(arg479) + if err481 != nil { Usage() return } - factory468 := thrift.NewTSimpleJSONProtocolFactory() - jsProt469 := factory468.GetProtocol(mbTrans466) + factory482 := thrift.NewTSimpleJSONProtocolFactory() + jsProt483 := factory482.GetProtocol(mbTrans480) argvalue0 := aurora.NewJobConfiguration() - err470 := argvalue0.Read(jsProt469) - if err470 != nil { + err484 := argvalue0.Read(jsProt483) + if err484 != nil { Usage() return } @@ -710,19 +759,19 @@ func main() { fmt.Fprintln(os.Stderr, "StartJobUpdate requires 2 args") flag.Usage() } - arg471 := flag.Arg(1) - mbTrans472 := thrift.NewTMemoryBufferLen(len(arg471)) - defer mbTrans472.Close() - _, err473 := mbTrans472.WriteString(arg471) - if err473 != nil { + arg485 := flag.Arg(1) + mbTrans486 := thrift.NewTMemoryBufferLen(len(arg485)) + defer mbTrans486.Close() + _, err487 := mbTrans486.WriteString(arg485) + if err487 != nil { Usage() return } - factory474 := thrift.NewTSimpleJSONProtocolFactory() - jsProt475 := factory474.GetProtocol(mbTrans472) + factory488 := thrift.NewTSimpleJSONProtocolFactory() + jsProt489 := factory488.GetProtocol(mbTrans486) argvalue0 := aurora.NewJobUpdateRequest() - err476 := argvalue0.Read(jsProt475) - if err476 != nil { + err490 := argvalue0.Read(jsProt489) + if err490 != nil { Usage() return } @@ -737,60 +786,6 @@ func main() { fmt.Fprintln(os.Stderr, "PauseJobUpdate requires 2 args") flag.Usage() } - arg478 := flag.Arg(1) - mbTrans479 := thrift.NewTMemoryBufferLen(len(arg478)) - defer mbTrans479.Close() - _, err480 := mbTrans479.WriteString(arg478) - if err480 != nil { - Usage() - return - } - factory481 := thrift.NewTSimpleJSONProtocolFactory() - jsProt482 := factory481.GetProtocol(mbTrans479) - argvalue0 := aurora.NewJobUpdateKey() - err483 := argvalue0.Read(jsProt482) - if err483 != nil { - Usage() - return - } - value0 := argvalue0 - argvalue1 := flag.Arg(2) - value1 := argvalue1 - fmt.Print(client.PauseJobUpdate(value0, value1)) - fmt.Print("\n") - break - case "resumeJobUpdate": - if flag.NArg()-1 != 2 { - fmt.Fprintln(os.Stderr, "ResumeJobUpdate requires 2 args") - flag.Usage() - } - arg485 := flag.Arg(1) - mbTrans486 := thrift.NewTMemoryBufferLen(len(arg485)) - defer mbTrans486.Close() - _, err487 := mbTrans486.WriteString(arg485) - if err487 != nil { - Usage() - return - } - factory488 := thrift.NewTSimpleJSONProtocolFactory() - jsProt489 := factory488.GetProtocol(mbTrans486) - argvalue0 := aurora.NewJobUpdateKey() - err490 := argvalue0.Read(jsProt489) - if err490 != nil { - Usage() - return - } - value0 := argvalue0 - argvalue1 := flag.Arg(2) - value1 := argvalue1 - fmt.Print(client.ResumeJobUpdate(value0, value1)) - fmt.Print("\n") - break - case "abortJobUpdate": - if flag.NArg()-1 != 2 { - fmt.Fprintln(os.Stderr, "AbortJobUpdate requires 2 args") - flag.Usage() - } arg492 := flag.Arg(1) mbTrans493 := thrift.NewTMemoryBufferLen(len(arg492)) defer mbTrans493.Close() @@ -810,12 +805,12 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.AbortJobUpdate(value0, value1)) + fmt.Print(client.PauseJobUpdate(value0, value1)) fmt.Print("\n") break - case "rollbackJobUpdate": + case "resumeJobUpdate": if flag.NArg()-1 != 2 { - fmt.Fprintln(os.Stderr, "RollbackJobUpdate requires 2 args") + fmt.Fprintln(os.Stderr, "ResumeJobUpdate requires 2 args") flag.Usage() } arg499 := flag.Arg(1) @@ -837,12 +832,12 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.RollbackJobUpdate(value0, value1)) + fmt.Print(client.ResumeJobUpdate(value0, value1)) fmt.Print("\n") break - case "pulseJobUpdate": - if flag.NArg()-1 != 1 { - fmt.Fprintln(os.Stderr, "PulseJobUpdate requires 1 args") + case "abortJobUpdate": + if flag.NArg()-1 != 2 { + fmt.Fprintln(os.Stderr, "AbortJobUpdate requires 2 args") flag.Usage() } arg506 := flag.Arg(1) @@ -862,6 +857,60 @@ func main() { return } value0 := argvalue0 + argvalue1 := flag.Arg(2) + value1 := argvalue1 + fmt.Print(client.AbortJobUpdate(value0, value1)) + fmt.Print("\n") + break + case "rollbackJobUpdate": + if flag.NArg()-1 != 2 { + fmt.Fprintln(os.Stderr, "RollbackJobUpdate requires 2 args") + flag.Usage() + } + arg513 := flag.Arg(1) + mbTrans514 := thrift.NewTMemoryBufferLen(len(arg513)) + defer mbTrans514.Close() + _, err515 := mbTrans514.WriteString(arg513) + if err515 != nil { + Usage() + return + } + factory516 := thrift.NewTSimpleJSONProtocolFactory() + jsProt517 := factory516.GetProtocol(mbTrans514) + argvalue0 := aurora.NewJobUpdateKey() + err518 := argvalue0.Read(jsProt517) + if err518 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := flag.Arg(2) + value1 := argvalue1 + fmt.Print(client.RollbackJobUpdate(value0, value1)) + fmt.Print("\n") + break + case "pulseJobUpdate": + if flag.NArg()-1 != 1 { + fmt.Fprintln(os.Stderr, "PulseJobUpdate requires 1 args") + flag.Usage() + } + arg520 := flag.Arg(1) + mbTrans521 := thrift.NewTMemoryBufferLen(len(arg520)) + defer mbTrans521.Close() + _, err522 := mbTrans521.WriteString(arg520) + if err522 != nil { + Usage() + return + } + factory523 := thrift.NewTSimpleJSONProtocolFactory() + jsProt524 := factory523.GetProtocol(mbTrans521) + argvalue0 := aurora.NewJobUpdateKey() + err525 := argvalue0.Read(jsProt524) + if err525 != nil { + Usage() + return + } + value0 := argvalue0 fmt.Print(client.PulseJobUpdate(value0)) fmt.Print("\n") break @@ -888,19 +937,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTasksStatus requires 1 args") flag.Usage() } - arg513 := flag.Arg(1) - mbTrans514 := thrift.NewTMemoryBufferLen(len(arg513)) - defer mbTrans514.Close() - _, err515 := mbTrans514.WriteString(arg513) - if err515 != nil { + arg527 := flag.Arg(1) + mbTrans528 := thrift.NewTMemoryBufferLen(len(arg527)) + defer mbTrans528.Close() + _, err529 := mbTrans528.WriteString(arg527) + if err529 != nil { Usage() return } - factory516 := thrift.NewTSimpleJSONProtocolFactory() - jsProt517 := factory516.GetProtocol(mbTrans514) + factory530 := thrift.NewTSimpleJSONProtocolFactory() + jsProt531 := factory530.GetProtocol(mbTrans528) argvalue0 := aurora.NewTaskQuery() - err518 := argvalue0.Read(jsProt517) - if err518 != nil { + err532 := argvalue0.Read(jsProt531) + if err532 != nil { Usage() return } @@ -913,19 +962,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTasksWithoutConfigs requires 1 args") flag.Usage() } - arg519 := flag.Arg(1) - mbTrans520 := thrift.NewTMemoryBufferLen(len(arg519)) - defer mbTrans520.Close() - _, err521 := mbTrans520.WriteString(arg519) - if err521 != nil { + arg533 := flag.Arg(1) + mbTrans534 := thrift.NewTMemoryBufferLen(len(arg533)) + defer mbTrans534.Close() + _, err535 := mbTrans534.WriteString(arg533) + if err535 != nil { Usage() return } - factory522 := thrift.NewTSimpleJSONProtocolFactory() - jsProt523 := factory522.GetProtocol(mbTrans520) + factory536 := thrift.NewTSimpleJSONProtocolFactory() + jsProt537 := factory536.GetProtocol(mbTrans534) argvalue0 := aurora.NewTaskQuery() - err524 := argvalue0.Read(jsProt523) - if err524 != nil { + err538 := argvalue0.Read(jsProt537) + if err538 != nil { Usage() return } @@ -938,19 +987,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetPendingReason requires 1 args") flag.Usage() } - arg525 := flag.Arg(1) - mbTrans526 := thrift.NewTMemoryBufferLen(len(arg525)) - defer mbTrans526.Close() - _, err527 := mbTrans526.WriteString(arg525) - if err527 != nil { + arg539 := flag.Arg(1) + mbTrans540 := thrift.NewTMemoryBufferLen(len(arg539)) + defer mbTrans540.Close() + _, err541 := mbTrans540.WriteString(arg539) + if err541 != nil { Usage() return } - factory528 := thrift.NewTSimpleJSONProtocolFactory() - jsProt529 := factory528.GetProtocol(mbTrans526) + factory542 := thrift.NewTSimpleJSONProtocolFactory() + jsProt543 := factory542.GetProtocol(mbTrans540) argvalue0 := aurora.NewTaskQuery() - err530 := argvalue0.Read(jsProt529) - if err530 != nil { + err544 := argvalue0.Read(jsProt543) + if err544 != nil { Usage() return } @@ -963,19 +1012,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetConfigSummary requires 1 args") flag.Usage() } - arg531 := flag.Arg(1) - mbTrans532 := thrift.NewTMemoryBufferLen(len(arg531)) - defer mbTrans532.Close() - _, err533 := mbTrans532.WriteString(arg531) - if err533 != nil { + arg545 := flag.Arg(1) + mbTrans546 := thrift.NewTMemoryBufferLen(len(arg545)) + defer mbTrans546.Close() + _, err547 := mbTrans546.WriteString(arg545) + if err547 != nil { Usage() return } - factory534 := thrift.NewTSimpleJSONProtocolFactory() - jsProt535 := factory534.GetProtocol(mbTrans532) + factory548 := thrift.NewTSimpleJSONProtocolFactory() + jsProt549 := factory548.GetProtocol(mbTrans546) argvalue0 := aurora.NewJobKey() - err536 := argvalue0.Read(jsProt535) - if err536 != nil { + err550 := argvalue0.Read(jsProt549) + if err550 != nil { Usage() return } @@ -1008,19 +1057,19 @@ func main() { fmt.Fprintln(os.Stderr, "PopulateJobConfig requires 1 args") flag.Usage() } - arg539 := flag.Arg(1) - mbTrans540 := thrift.NewTMemoryBufferLen(len(arg539)) - defer mbTrans540.Close() - _, err541 := mbTrans540.WriteString(arg539) - if err541 != nil { + arg553 := flag.Arg(1) + mbTrans554 := thrift.NewTMemoryBufferLen(len(arg553)) + defer mbTrans554.Close() + _, err555 := mbTrans554.WriteString(arg553) + if err555 != nil { Usage() return } - factory542 := thrift.NewTSimpleJSONProtocolFactory() - jsProt543 := factory542.GetProtocol(mbTrans540) + factory556 := thrift.NewTSimpleJSONProtocolFactory() + jsProt557 := factory556.GetProtocol(mbTrans554) argvalue0 := aurora.NewJobConfiguration() - err544 := argvalue0.Read(jsProt543) - if err544 != nil { + err558 := argvalue0.Read(jsProt557) + if err558 != nil { Usage() return } @@ -1033,19 +1082,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetJobUpdateSummaries requires 1 args") flag.Usage() } - arg545 := flag.Arg(1) - mbTrans546 := thrift.NewTMemoryBufferLen(len(arg545)) - defer mbTrans546.Close() - _, err547 := mbTrans546.WriteString(arg545) - if err547 != nil { + arg559 := flag.Arg(1) + mbTrans560 := thrift.NewTMemoryBufferLen(len(arg559)) + defer mbTrans560.Close() + _, err561 := mbTrans560.WriteString(arg559) + if err561 != nil { Usage() return } - factory548 := thrift.NewTSimpleJSONProtocolFactory() - jsProt549 := factory548.GetProtocol(mbTrans546) + factory562 := thrift.NewTSimpleJSONProtocolFactory() + jsProt563 := factory562.GetProtocol(mbTrans560) argvalue0 := aurora.NewJobUpdateQuery() - err550 := argvalue0.Read(jsProt549) - if err550 != nil { + err564 := argvalue0.Read(jsProt563) + if err564 != nil { Usage() return } @@ -1058,19 +1107,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetJobUpdateDetails requires 1 args") flag.Usage() } - arg551 := flag.Arg(1) - mbTrans552 := thrift.NewTMemoryBufferLen(len(arg551)) - defer mbTrans552.Close() - _, err553 := mbTrans552.WriteString(arg551) - if err553 != nil { + arg565 := flag.Arg(1) + mbTrans566 := thrift.NewTMemoryBufferLen(len(arg565)) + defer mbTrans566.Close() + _, err567 := mbTrans566.WriteString(arg565) + if err567 != nil { Usage() return } - factory554 := thrift.NewTSimpleJSONProtocolFactory() - jsProt555 := factory554.GetProtocol(mbTrans552) + factory568 := thrift.NewTSimpleJSONProtocolFactory() + jsProt569 := factory568.GetProtocol(mbTrans566) argvalue0 := aurora.NewJobUpdateQuery() - err556 := argvalue0.Read(jsProt555) - if err556 != nil { + err570 := argvalue0.Read(jsProt569) + if err570 != nil { Usage() return } @@ -1083,19 +1132,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetJobUpdateDiff requires 1 args") flag.Usage() } - arg557 := flag.Arg(1) - mbTrans558 := thrift.NewTMemoryBufferLen(len(arg557)) - defer mbTrans558.Close() - _, err559 := mbTrans558.WriteString(arg557) - if err559 != nil { + arg571 := flag.Arg(1) + mbTrans572 := thrift.NewTMemoryBufferLen(len(arg571)) + defer mbTrans572.Close() + _, err573 := mbTrans572.WriteString(arg571) + if err573 != nil { Usage() return } - factory560 := thrift.NewTSimpleJSONProtocolFactory() - jsProt561 := factory560.GetProtocol(mbTrans558) + factory574 := thrift.NewTSimpleJSONProtocolFactory() + jsProt575 := factory574.GetProtocol(mbTrans572) argvalue0 := aurora.NewJobUpdateRequest() - err562 := argvalue0.Read(jsProt561) - if err562 != nil { + err576 := argvalue0.Read(jsProt575) + if err576 != nil { Usage() return } diff --git a/gen-go/apache/aurora/aurora_scheduler_manager-remote/aurora_scheduler_manager-remote.go b/gen-go/apache/aurora/aurora_scheduler_manager-remote/aurora_scheduler_manager-remote.go index 463e867..3ca67ea 100755 --- a/gen-go/apache/aurora/aurora_scheduler_manager-remote/aurora_scheduler_manager-remote.go +++ b/gen-go/apache/aurora/aurora_scheduler_manager-remote/aurora_scheduler_manager-remote.go @@ -146,19 +146,19 @@ func main() { fmt.Fprintln(os.Stderr, "CreateJob requires 1 args") flag.Usage() } - arg163 := flag.Arg(1) - mbTrans164 := thrift.NewTMemoryBufferLen(len(arg163)) - defer mbTrans164.Close() - _, err165 := mbTrans164.WriteString(arg163) - if err165 != nil { + arg162 := flag.Arg(1) + mbTrans163 := thrift.NewTMemoryBufferLen(len(arg162)) + defer mbTrans163.Close() + _, err164 := mbTrans163.WriteString(arg162) + if err164 != nil { Usage() return } - factory166 := thrift.NewTSimpleJSONProtocolFactory() - jsProt167 := factory166.GetProtocol(mbTrans164) + factory165 := thrift.NewTSimpleJSONProtocolFactory() + jsProt166 := factory165.GetProtocol(mbTrans163) argvalue0 := aurora.NewJobConfiguration() - err168 := argvalue0.Read(jsProt167) - if err168 != nil { + err167 := argvalue0.Read(jsProt166) + if err167 != nil { Usage() return } @@ -171,19 +171,19 @@ func main() { fmt.Fprintln(os.Stderr, "ScheduleCronJob requires 1 args") flag.Usage() } - arg169 := flag.Arg(1) - mbTrans170 := thrift.NewTMemoryBufferLen(len(arg169)) - defer mbTrans170.Close() - _, err171 := mbTrans170.WriteString(arg169) - if err171 != nil { + arg168 := flag.Arg(1) + mbTrans169 := thrift.NewTMemoryBufferLen(len(arg168)) + defer mbTrans169.Close() + _, err170 := mbTrans169.WriteString(arg168) + if err170 != nil { Usage() return } - factory172 := thrift.NewTSimpleJSONProtocolFactory() - jsProt173 := factory172.GetProtocol(mbTrans170) + factory171 := thrift.NewTSimpleJSONProtocolFactory() + jsProt172 := factory171.GetProtocol(mbTrans169) argvalue0 := aurora.NewJobConfiguration() - err174 := argvalue0.Read(jsProt173) - if err174 != nil { + err173 := argvalue0.Read(jsProt172) + if err173 != nil { Usage() return } @@ -196,19 +196,19 @@ func main() { fmt.Fprintln(os.Stderr, "DescheduleCronJob requires 1 args") flag.Usage() } - arg175 := flag.Arg(1) - mbTrans176 := thrift.NewTMemoryBufferLen(len(arg175)) - defer mbTrans176.Close() - _, err177 := mbTrans176.WriteString(arg175) - if err177 != nil { + arg174 := flag.Arg(1) + mbTrans175 := thrift.NewTMemoryBufferLen(len(arg174)) + defer mbTrans175.Close() + _, err176 := mbTrans175.WriteString(arg174) + if err176 != nil { Usage() return } - factory178 := thrift.NewTSimpleJSONProtocolFactory() - jsProt179 := factory178.GetProtocol(mbTrans176) + factory177 := thrift.NewTSimpleJSONProtocolFactory() + jsProt178 := factory177.GetProtocol(mbTrans175) argvalue0 := aurora.NewJobKey() - err180 := argvalue0.Read(jsProt179) - if err180 != nil { + err179 := argvalue0.Read(jsProt178) + if err179 != nil { Usage() return } @@ -221,19 +221,19 @@ func main() { fmt.Fprintln(os.Stderr, "StartCronJob requires 1 args") flag.Usage() } - arg181 := flag.Arg(1) - mbTrans182 := thrift.NewTMemoryBufferLen(len(arg181)) - defer mbTrans182.Close() - _, err183 := mbTrans182.WriteString(arg181) - if err183 != nil { + arg180 := flag.Arg(1) + mbTrans181 := thrift.NewTMemoryBufferLen(len(arg180)) + defer mbTrans181.Close() + _, err182 := mbTrans181.WriteString(arg180) + if err182 != nil { Usage() return } - factory184 := thrift.NewTSimpleJSONProtocolFactory() - jsProt185 := factory184.GetProtocol(mbTrans182) + factory183 := thrift.NewTSimpleJSONProtocolFactory() + jsProt184 := factory183.GetProtocol(mbTrans181) argvalue0 := aurora.NewJobKey() - err186 := argvalue0.Read(jsProt185) - if err186 != nil { + err185 := argvalue0.Read(jsProt184) + if err185 != nil { Usage() return } @@ -246,36 +246,36 @@ func main() { fmt.Fprintln(os.Stderr, "RestartShards requires 2 args") flag.Usage() } - arg187 := flag.Arg(1) - mbTrans188 := thrift.NewTMemoryBufferLen(len(arg187)) - defer mbTrans188.Close() - _, err189 := mbTrans188.WriteString(arg187) - if err189 != nil { + arg186 := flag.Arg(1) + mbTrans187 := thrift.NewTMemoryBufferLen(len(arg186)) + defer mbTrans187.Close() + _, err188 := mbTrans187.WriteString(arg186) + if err188 != nil { Usage() return } - factory190 := thrift.NewTSimpleJSONProtocolFactory() - jsProt191 := factory190.GetProtocol(mbTrans188) + factory189 := thrift.NewTSimpleJSONProtocolFactory() + jsProt190 := factory189.GetProtocol(mbTrans187) argvalue0 := aurora.NewJobKey() - err192 := argvalue0.Read(jsProt191) - if err192 != nil { + err191 := argvalue0.Read(jsProt190) + if err191 != nil { Usage() return } value0 := argvalue0 - arg193 := flag.Arg(2) - mbTrans194 := thrift.NewTMemoryBufferLen(len(arg193)) - defer mbTrans194.Close() - _, err195 := mbTrans194.WriteString(arg193) - if err195 != nil { + arg192 := flag.Arg(2) + mbTrans193 := thrift.NewTMemoryBufferLen(len(arg192)) + defer mbTrans193.Close() + _, err194 := mbTrans193.WriteString(arg192) + if err194 != nil { Usage() return } - factory196 := thrift.NewTSimpleJSONProtocolFactory() - jsProt197 := factory196.GetProtocol(mbTrans194) + factory195 := thrift.NewTSimpleJSONProtocolFactory() + jsProt196 := factory195.GetProtocol(mbTrans193) containerStruct1 := aurora.NewAuroraSchedulerManagerRestartShardsArgs() - err198 := containerStruct1.ReadField2(jsProt197) - if err198 != nil { + err197 := containerStruct1.ReadField2(jsProt196) + if err197 != nil { Usage() return } @@ -289,36 +289,36 @@ func main() { fmt.Fprintln(os.Stderr, "KillTasks requires 3 args") flag.Usage() } - arg199 := flag.Arg(1) - mbTrans200 := thrift.NewTMemoryBufferLen(len(arg199)) - defer mbTrans200.Close() - _, err201 := mbTrans200.WriteString(arg199) - if err201 != nil { + arg198 := flag.Arg(1) + mbTrans199 := thrift.NewTMemoryBufferLen(len(arg198)) + defer mbTrans199.Close() + _, err200 := mbTrans199.WriteString(arg198) + if err200 != nil { Usage() return } - factory202 := thrift.NewTSimpleJSONProtocolFactory() - jsProt203 := factory202.GetProtocol(mbTrans200) + factory201 := thrift.NewTSimpleJSONProtocolFactory() + jsProt202 := factory201.GetProtocol(mbTrans199) argvalue0 := aurora.NewJobKey() - err204 := argvalue0.Read(jsProt203) - if err204 != nil { + err203 := argvalue0.Read(jsProt202) + if err203 != nil { Usage() return } value0 := argvalue0 - arg205 := flag.Arg(2) - mbTrans206 := thrift.NewTMemoryBufferLen(len(arg205)) - defer mbTrans206.Close() - _, err207 := mbTrans206.WriteString(arg205) - if err207 != nil { + arg204 := flag.Arg(2) + mbTrans205 := thrift.NewTMemoryBufferLen(len(arg204)) + defer mbTrans205.Close() + _, err206 := mbTrans205.WriteString(arg204) + if err206 != nil { Usage() return } - factory208 := thrift.NewTSimpleJSONProtocolFactory() - jsProt209 := factory208.GetProtocol(mbTrans206) + factory207 := thrift.NewTSimpleJSONProtocolFactory() + jsProt208 := factory207.GetProtocol(mbTrans205) containerStruct1 := aurora.NewAuroraSchedulerManagerKillTasksArgs() - err210 := containerStruct1.ReadField2(jsProt209) - if err210 != nil { + err209 := containerStruct1.ReadField2(jsProt208) + if err209 != nil { Usage() return } @@ -334,25 +334,25 @@ func main() { fmt.Fprintln(os.Stderr, "AddInstances requires 2 args") flag.Usage() } - arg212 := flag.Arg(1) - mbTrans213 := thrift.NewTMemoryBufferLen(len(arg212)) - defer mbTrans213.Close() - _, err214 := mbTrans213.WriteString(arg212) - if err214 != nil { + arg211 := flag.Arg(1) + mbTrans212 := thrift.NewTMemoryBufferLen(len(arg211)) + defer mbTrans212.Close() + _, err213 := mbTrans212.WriteString(arg211) + if err213 != nil { Usage() return } - factory215 := thrift.NewTSimpleJSONProtocolFactory() - jsProt216 := factory215.GetProtocol(mbTrans213) + factory214 := thrift.NewTSimpleJSONProtocolFactory() + jsProt215 := factory214.GetProtocol(mbTrans212) argvalue0 := aurora.NewInstanceKey() - err217 := argvalue0.Read(jsProt216) - if err217 != nil { + err216 := argvalue0.Read(jsProt215) + if err216 != nil { Usage() return } value0 := argvalue0 - tmp1, err218 := (strconv.Atoi(flag.Arg(2))) - if err218 != nil { + tmp1, err217 := (strconv.Atoi(flag.Arg(2))) + if err217 != nil { Usage() return } @@ -366,19 +366,19 @@ func main() { fmt.Fprintln(os.Stderr, "ReplaceCronTemplate requires 1 args") flag.Usage() } - arg219 := flag.Arg(1) - mbTrans220 := thrift.NewTMemoryBufferLen(len(arg219)) - defer mbTrans220.Close() - _, err221 := mbTrans220.WriteString(arg219) - if err221 != nil { + arg218 := flag.Arg(1) + mbTrans219 := thrift.NewTMemoryBufferLen(len(arg218)) + defer mbTrans219.Close() + _, err220 := mbTrans219.WriteString(arg218) + if err220 != nil { Usage() return } - factory222 := thrift.NewTSimpleJSONProtocolFactory() - jsProt223 := factory222.GetProtocol(mbTrans220) + factory221 := thrift.NewTSimpleJSONProtocolFactory() + jsProt222 := factory221.GetProtocol(mbTrans219) argvalue0 := aurora.NewJobConfiguration() - err224 := argvalue0.Read(jsProt223) - if err224 != nil { + err223 := argvalue0.Read(jsProt222) + if err223 != nil { Usage() return } @@ -391,19 +391,19 @@ func main() { fmt.Fprintln(os.Stderr, "StartJobUpdate requires 2 args") flag.Usage() } - arg225 := flag.Arg(1) - mbTrans226 := thrift.NewTMemoryBufferLen(len(arg225)) - defer mbTrans226.Close() - _, err227 := mbTrans226.WriteString(arg225) - if err227 != nil { + arg224 := flag.Arg(1) + mbTrans225 := thrift.NewTMemoryBufferLen(len(arg224)) + defer mbTrans225.Close() + _, err226 := mbTrans225.WriteString(arg224) + if err226 != nil { Usage() return } - factory228 := thrift.NewTSimpleJSONProtocolFactory() - jsProt229 := factory228.GetProtocol(mbTrans226) + factory227 := thrift.NewTSimpleJSONProtocolFactory() + jsProt228 := factory227.GetProtocol(mbTrans225) argvalue0 := aurora.NewJobUpdateRequest() - err230 := argvalue0.Read(jsProt229) - if err230 != nil { + err229 := argvalue0.Read(jsProt228) + if err229 != nil { Usage() return } @@ -418,19 +418,19 @@ func main() { fmt.Fprintln(os.Stderr, "PauseJobUpdate requires 2 args") flag.Usage() } - arg232 := flag.Arg(1) - mbTrans233 := thrift.NewTMemoryBufferLen(len(arg232)) - defer mbTrans233.Close() - _, err234 := mbTrans233.WriteString(arg232) - if err234 != nil { + arg231 := flag.Arg(1) + mbTrans232 := thrift.NewTMemoryBufferLen(len(arg231)) + defer mbTrans232.Close() + _, err233 := mbTrans232.WriteString(arg231) + if err233 != nil { Usage() return } - factory235 := thrift.NewTSimpleJSONProtocolFactory() - jsProt236 := factory235.GetProtocol(mbTrans233) + factory234 := thrift.NewTSimpleJSONProtocolFactory() + jsProt235 := factory234.GetProtocol(mbTrans232) argvalue0 := aurora.NewJobUpdateKey() - err237 := argvalue0.Read(jsProt236) - if err237 != nil { + err236 := argvalue0.Read(jsProt235) + if err236 != nil { Usage() return } @@ -445,19 +445,19 @@ func main() { fmt.Fprintln(os.Stderr, "ResumeJobUpdate requires 2 args") flag.Usage() } - arg239 := flag.Arg(1) - mbTrans240 := thrift.NewTMemoryBufferLen(len(arg239)) - defer mbTrans240.Close() - _, err241 := mbTrans240.WriteString(arg239) - if err241 != nil { + arg238 := flag.Arg(1) + mbTrans239 := thrift.NewTMemoryBufferLen(len(arg238)) + defer mbTrans239.Close() + _, err240 := mbTrans239.WriteString(arg238) + if err240 != nil { Usage() return } - factory242 := thrift.NewTSimpleJSONProtocolFactory() - jsProt243 := factory242.GetProtocol(mbTrans240) + factory241 := thrift.NewTSimpleJSONProtocolFactory() + jsProt242 := factory241.GetProtocol(mbTrans239) argvalue0 := aurora.NewJobUpdateKey() - err244 := argvalue0.Read(jsProt243) - if err244 != nil { + err243 := argvalue0.Read(jsProt242) + if err243 != nil { Usage() return } @@ -472,19 +472,19 @@ func main() { fmt.Fprintln(os.Stderr, "AbortJobUpdate requires 2 args") flag.Usage() } - arg246 := flag.Arg(1) - mbTrans247 := thrift.NewTMemoryBufferLen(len(arg246)) - defer mbTrans247.Close() - _, err248 := mbTrans247.WriteString(arg246) - if err248 != nil { + arg245 := flag.Arg(1) + mbTrans246 := thrift.NewTMemoryBufferLen(len(arg245)) + defer mbTrans246.Close() + _, err247 := mbTrans246.WriteString(arg245) + if err247 != nil { Usage() return } - factory249 := thrift.NewTSimpleJSONProtocolFactory() - jsProt250 := factory249.GetProtocol(mbTrans247) + factory248 := thrift.NewTSimpleJSONProtocolFactory() + jsProt249 := factory248.GetProtocol(mbTrans246) argvalue0 := aurora.NewJobUpdateKey() - err251 := argvalue0.Read(jsProt250) - if err251 != nil { + err250 := argvalue0.Read(jsProt249) + if err250 != nil { Usage() return } @@ -499,19 +499,19 @@ func main() { fmt.Fprintln(os.Stderr, "RollbackJobUpdate requires 2 args") flag.Usage() } - arg253 := flag.Arg(1) - mbTrans254 := thrift.NewTMemoryBufferLen(len(arg253)) - defer mbTrans254.Close() - _, err255 := mbTrans254.WriteString(arg253) - if err255 != nil { + arg252 := flag.Arg(1) + mbTrans253 := thrift.NewTMemoryBufferLen(len(arg252)) + defer mbTrans253.Close() + _, err254 := mbTrans253.WriteString(arg252) + if err254 != nil { Usage() return } - factory256 := thrift.NewTSimpleJSONProtocolFactory() - jsProt257 := factory256.GetProtocol(mbTrans254) + factory255 := thrift.NewTSimpleJSONProtocolFactory() + jsProt256 := factory255.GetProtocol(mbTrans253) argvalue0 := aurora.NewJobUpdateKey() - err258 := argvalue0.Read(jsProt257) - if err258 != nil { + err257 := argvalue0.Read(jsProt256) + if err257 != nil { Usage() return } @@ -526,19 +526,19 @@ func main() { fmt.Fprintln(os.Stderr, "PulseJobUpdate requires 1 args") flag.Usage() } - arg260 := flag.Arg(1) - mbTrans261 := thrift.NewTMemoryBufferLen(len(arg260)) - defer mbTrans261.Close() - _, err262 := mbTrans261.WriteString(arg260) - if err262 != nil { + arg259 := flag.Arg(1) + mbTrans260 := thrift.NewTMemoryBufferLen(len(arg259)) + defer mbTrans260.Close() + _, err261 := mbTrans260.WriteString(arg259) + if err261 != nil { Usage() return } - factory263 := thrift.NewTSimpleJSONProtocolFactory() - jsProt264 := factory263.GetProtocol(mbTrans261) + factory262 := thrift.NewTSimpleJSONProtocolFactory() + jsProt263 := factory262.GetProtocol(mbTrans260) argvalue0 := aurora.NewJobUpdateKey() - err265 := argvalue0.Read(jsProt264) - if err265 != nil { + err264 := argvalue0.Read(jsProt263) + if err264 != nil { Usage() return } @@ -569,19 +569,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTasksStatus requires 1 args") flag.Usage() } - arg267 := flag.Arg(1) - mbTrans268 := thrift.NewTMemoryBufferLen(len(arg267)) - defer mbTrans268.Close() - _, err269 := mbTrans268.WriteString(arg267) - if err269 != nil { + arg266 := flag.Arg(1) + mbTrans267 := thrift.NewTMemoryBufferLen(len(arg266)) + defer mbTrans267.Close() + _, err268 := mbTrans267.WriteString(arg266) + if err268 != nil { Usage() return } - factory270 := thrift.NewTSimpleJSONProtocolFactory() - jsProt271 := factory270.GetProtocol(mbTrans268) + factory269 := thrift.NewTSimpleJSONProtocolFactory() + jsProt270 := factory269.GetProtocol(mbTrans267) argvalue0 := aurora.NewTaskQuery() - err272 := argvalue0.Read(jsProt271) - if err272 != nil { + err271 := argvalue0.Read(jsProt270) + if err271 != nil { Usage() return } @@ -594,19 +594,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTasksWithoutConfigs requires 1 args") flag.Usage() } - arg273 := flag.Arg(1) - mbTrans274 := thrift.NewTMemoryBufferLen(len(arg273)) - defer mbTrans274.Close() - _, err275 := mbTrans274.WriteString(arg273) - if err275 != nil { + arg272 := flag.Arg(1) + mbTrans273 := thrift.NewTMemoryBufferLen(len(arg272)) + defer mbTrans273.Close() + _, err274 := mbTrans273.WriteString(arg272) + if err274 != nil { Usage() return } - factory276 := thrift.NewTSimpleJSONProtocolFactory() - jsProt277 := factory276.GetProtocol(mbTrans274) + factory275 := thrift.NewTSimpleJSONProtocolFactory() + jsProt276 := factory275.GetProtocol(mbTrans273) argvalue0 := aurora.NewTaskQuery() - err278 := argvalue0.Read(jsProt277) - if err278 != nil { + err277 := argvalue0.Read(jsProt276) + if err277 != nil { Usage() return } @@ -619,19 +619,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetPendingReason requires 1 args") flag.Usage() } - arg279 := flag.Arg(1) - mbTrans280 := thrift.NewTMemoryBufferLen(len(arg279)) - defer mbTrans280.Close() - _, err281 := mbTrans280.WriteString(arg279) - if err281 != nil { + arg278 := flag.Arg(1) + mbTrans279 := thrift.NewTMemoryBufferLen(len(arg278)) + defer mbTrans279.Close() + _, err280 := mbTrans279.WriteString(arg278) + if err280 != nil { Usage() return } - factory282 := thrift.NewTSimpleJSONProtocolFactory() - jsProt283 := factory282.GetProtocol(mbTrans280) + factory281 := thrift.NewTSimpleJSONProtocolFactory() + jsProt282 := factory281.GetProtocol(mbTrans279) argvalue0 := aurora.NewTaskQuery() - err284 := argvalue0.Read(jsProt283) - if err284 != nil { + err283 := argvalue0.Read(jsProt282) + if err283 != nil { Usage() return } @@ -644,19 +644,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetConfigSummary requires 1 args") flag.Usage() } - arg285 := flag.Arg(1) - mbTrans286 := thrift.NewTMemoryBufferLen(len(arg285)) - defer mbTrans286.Close() - _, err287 := mbTrans286.WriteString(arg285) - if err287 != nil { + arg284 := flag.Arg(1) + mbTrans285 := thrift.NewTMemoryBufferLen(len(arg284)) + defer mbTrans285.Close() + _, err286 := mbTrans285.WriteString(arg284) + if err286 != nil { Usage() return } - factory288 := thrift.NewTSimpleJSONProtocolFactory() - jsProt289 := factory288.GetProtocol(mbTrans286) + factory287 := thrift.NewTSimpleJSONProtocolFactory() + jsProt288 := factory287.GetProtocol(mbTrans285) argvalue0 := aurora.NewJobKey() - err290 := argvalue0.Read(jsProt289) - if err290 != nil { + err289 := argvalue0.Read(jsProt288) + if err289 != nil { Usage() return } @@ -689,19 +689,19 @@ func main() { fmt.Fprintln(os.Stderr, "PopulateJobConfig requires 1 args") flag.Usage() } - arg293 := flag.Arg(1) - mbTrans294 := thrift.NewTMemoryBufferLen(len(arg293)) - defer mbTrans294.Close() - _, err295 := mbTrans294.WriteString(arg293) - if err295 != nil { + arg292 := flag.Arg(1) + mbTrans293 := thrift.NewTMemoryBufferLen(len(arg292)) + defer mbTrans293.Close() + _, err294 := mbTrans293.WriteString(arg292) + if err294 != nil { Usage() return } - factory296 := thrift.NewTSimpleJSONProtocolFactory() - jsProt297 := factory296.GetProtocol(mbTrans294) + factory295 := thrift.NewTSimpleJSONProtocolFactory() + jsProt296 := factory295.GetProtocol(mbTrans293) argvalue0 := aurora.NewJobConfiguration() - err298 := argvalue0.Read(jsProt297) - if err298 != nil { + err297 := argvalue0.Read(jsProt296) + if err297 != nil { Usage() return } @@ -714,19 +714,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetJobUpdateSummaries requires 1 args") flag.Usage() } - arg299 := flag.Arg(1) - mbTrans300 := thrift.NewTMemoryBufferLen(len(arg299)) - defer mbTrans300.Close() - _, err301 := mbTrans300.WriteString(arg299) - if err301 != nil { + arg298 := flag.Arg(1) + mbTrans299 := thrift.NewTMemoryBufferLen(len(arg298)) + defer mbTrans299.Close() + _, err300 := mbTrans299.WriteString(arg298) + if err300 != nil { Usage() return } - factory302 := thrift.NewTSimpleJSONProtocolFactory() - jsProt303 := factory302.GetProtocol(mbTrans300) + factory301 := thrift.NewTSimpleJSONProtocolFactory() + jsProt302 := factory301.GetProtocol(mbTrans299) argvalue0 := aurora.NewJobUpdateQuery() - err304 := argvalue0.Read(jsProt303) - if err304 != nil { + err303 := argvalue0.Read(jsProt302) + if err303 != nil { Usage() return } @@ -739,19 +739,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetJobUpdateDetails requires 1 args") flag.Usage() } - arg305 := flag.Arg(1) - mbTrans306 := thrift.NewTMemoryBufferLen(len(arg305)) - defer mbTrans306.Close() - _, err307 := mbTrans306.WriteString(arg305) - if err307 != nil { + arg304 := flag.Arg(1) + mbTrans305 := thrift.NewTMemoryBufferLen(len(arg304)) + defer mbTrans305.Close() + _, err306 := mbTrans305.WriteString(arg304) + if err306 != nil { Usage() return } - factory308 := thrift.NewTSimpleJSONProtocolFactory() - jsProt309 := factory308.GetProtocol(mbTrans306) + factory307 := thrift.NewTSimpleJSONProtocolFactory() + jsProt308 := factory307.GetProtocol(mbTrans305) argvalue0 := aurora.NewJobUpdateQuery() - err310 := argvalue0.Read(jsProt309) - if err310 != nil { + err309 := argvalue0.Read(jsProt308) + if err309 != nil { Usage() return } @@ -764,19 +764,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetJobUpdateDiff requires 1 args") flag.Usage() } - arg311 := flag.Arg(1) - mbTrans312 := thrift.NewTMemoryBufferLen(len(arg311)) - defer mbTrans312.Close() - _, err313 := mbTrans312.WriteString(arg311) - if err313 != nil { + arg310 := flag.Arg(1) + mbTrans311 := thrift.NewTMemoryBufferLen(len(arg310)) + defer mbTrans311.Close() + _, err312 := mbTrans311.WriteString(arg310) + if err312 != nil { Usage() return } - factory314 := thrift.NewTSimpleJSONProtocolFactory() - jsProt315 := factory314.GetProtocol(mbTrans312) + factory313 := thrift.NewTSimpleJSONProtocolFactory() + jsProt314 := factory313.GetProtocol(mbTrans311) argvalue0 := aurora.NewJobUpdateRequest() - err316 := argvalue0.Read(jsProt315) - if err316 != nil { + err315 := argvalue0.Read(jsProt314) + if err315 != nil { Usage() return } diff --git a/gen-go/apache/aurora/auroraadmin.go b/gen-go/apache/aurora/auroraadmin.go index 3956e5f..b00e9cf 100644 --- a/gen-go/apache/aurora/auroraadmin.go +++ b/gen-go/apache/aurora/auroraadmin.go @@ -74,6 +74,15 @@ type AuroraAdmin interface { // Parameters: // - Hosts EndMaintenance(hosts *Hosts) (r *Response, err error) + // Ask scheduler to put hosts into DRAINING mode and move scheduled tasks off of the hosts + // such that its SLA requirements are satisfied. Use defaultSlaPolicy if it is not set for a task. + // + // + // Parameters: + // - Hosts + // - DefaultSlaPolicy + // - TimeoutSecs + SlaDrainHosts(hosts *Hosts, defaultSlaPolicy *SlaPolicy, timeoutSecs int64) (r *Response, err error) // Start a storage snapshot and block until it completes. Snapshot() (r *Response, err error) // Tell scheduler to trigger an explicit task reconciliation with the given settings. @@ -158,16 +167,16 @@ func (p *AuroraAdminClient) recvSetQuota() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error317 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error318 error - error318, err = error317.Read(iprot) + error316 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error317 error + error317, err = error316.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error318 + err = error317 return } if mTypeId != thrift.REPLY { @@ -241,16 +250,16 @@ func (p *AuroraAdminClient) recvForceTaskState() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error319 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error320 error - error320, err = error319.Read(iprot) + error318 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error319 error + error319, err = error318.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error320 + err = error319 return } if mTypeId != thrift.REPLY { @@ -315,16 +324,16 @@ func (p *AuroraAdminClient) recvPerformBackup() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error321 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error322 error - error322, err = error321.Read(iprot) + error320 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error321 error + error321, err = error320.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error322 + err = error321 return } if mTypeId != thrift.REPLY { @@ -389,16 +398,16 @@ func (p *AuroraAdminClient) recvListBackups() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error323 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error324 error - error324, err = error323.Read(iprot) + error322 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error323 error + error323, err = error322.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error324 + err = error323 return } if mTypeId != thrift.REPLY { @@ -468,16 +477,16 @@ func (p *AuroraAdminClient) recvStageRecovery() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error325 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error326 error - error326, err = error325.Read(iprot) + error324 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error325 error + error325, err = error324.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error326 + err = error325 return } if mTypeId != thrift.REPLY { @@ -547,16 +556,16 @@ func (p *AuroraAdminClient) recvQueryRecovery() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error327 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error328 error - error328, err = error327.Read(iprot) + error326 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error327 error + error327, err = error326.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error328 + err = error327 return } if mTypeId != thrift.REPLY { @@ -626,16 +635,16 @@ func (p *AuroraAdminClient) recvDeleteRecoveryTasks() (value *Response, err erro return } if mTypeId == thrift.EXCEPTION { - error329 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error330 error - error330, err = error329.Read(iprot) + error328 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error329 error + error329, err = error328.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error330 + err = error329 return } if mTypeId != thrift.REPLY { @@ -700,16 +709,16 @@ func (p *AuroraAdminClient) recvCommitRecovery() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error331 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error332 error - error332, err = error331.Read(iprot) + error330 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error331 error + error331, err = error330.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error332 + err = error331 return } if mTypeId != thrift.REPLY { @@ -774,16 +783,16 @@ func (p *AuroraAdminClient) recvUnloadRecovery() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error333 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error334 error - error334, err = error333.Read(iprot) + error332 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error333 error + error333, err = error332.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error334 + err = error333 return } if mTypeId != thrift.REPLY { @@ -853,16 +862,16 @@ func (p *AuroraAdminClient) recvStartMaintenance() (value *Response, err error) return } if mTypeId == thrift.EXCEPTION { - error335 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error336 error - error336, err = error335.Read(iprot) + error334 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error335 error + error335, err = error334.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error336 + err = error335 return } if mTypeId != thrift.REPLY { @@ -932,16 +941,16 @@ func (p *AuroraAdminClient) recvDrainHosts() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error337 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error338 error - error338, err = error337.Read(iprot) + error336 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error337 error + error337, err = error336.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error338 + err = error337 return } if mTypeId != thrift.REPLY { @@ -1011,16 +1020,16 @@ func (p *AuroraAdminClient) recvMaintenanceStatus() (value *Response, err error) return } if mTypeId == thrift.EXCEPTION { - error339 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error340 error - error340, err = error339.Read(iprot) + error338 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error339 error + error339, err = error338.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error340 + err = error339 return } if mTypeId != thrift.REPLY { @@ -1090,16 +1099,16 @@ func (p *AuroraAdminClient) recvEndMaintenance() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error341 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error342 error - error342, err = error341.Read(iprot) + error340 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error341 error + error341, err = error340.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error342 + err = error341 return } if mTypeId != thrift.REPLY { @@ -1117,6 +1126,91 @@ func (p *AuroraAdminClient) recvEndMaintenance() (value *Response, err error) { return } +// Ask scheduler to put hosts into DRAINING mode and move scheduled tasks off of the hosts +// such that its SLA requirements are satisfied. Use defaultSlaPolicy if it is not set for a task. +// +// +// Parameters: +// - Hosts +// - DefaultSlaPolicy +// - TimeoutSecs +func (p *AuroraAdminClient) SlaDrainHosts(hosts *Hosts, defaultSlaPolicy *SlaPolicy, timeoutSecs int64) (r *Response, err error) { + if err = p.sendSlaDrainHosts(hosts, defaultSlaPolicy, timeoutSecs); err != nil { + return + } + return p.recvSlaDrainHosts() +} + +func (p *AuroraAdminClient) sendSlaDrainHosts(hosts *Hosts, defaultSlaPolicy *SlaPolicy, timeoutSecs int64) (err error) { + oprot := p.OutputProtocol + if oprot == nil { + oprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.OutputProtocol = oprot + } + p.SeqId++ + if err = oprot.WriteMessageBegin("slaDrainHosts", thrift.CALL, p.SeqId); err != nil { + return + } + args := AuroraAdminSlaDrainHostsArgs{ + Hosts: hosts, + DefaultSlaPolicy: defaultSlaPolicy, + TimeoutSecs: timeoutSecs, + } + if err = args.Write(oprot); err != nil { + return + } + if err = oprot.WriteMessageEnd(); err != nil { + return + } + return oprot.Flush() +} + +func (p *AuroraAdminClient) recvSlaDrainHosts() (value *Response, err error) { + iprot := p.InputProtocol + if iprot == nil { + iprot = p.ProtocolFactory.GetProtocol(p.Transport) + p.InputProtocol = iprot + } + method, mTypeId, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return + } + if method != "slaDrainHosts" { + err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "slaDrainHosts failed: wrong method name") + return + } + if p.SeqId != seqId { + err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "slaDrainHosts failed: out of sequence response") + return + } + if mTypeId == thrift.EXCEPTION { + error342 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error343 error + error343, err = error342.Read(iprot) + if err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + err = error343 + return + } + if mTypeId != thrift.REPLY { + err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "slaDrainHosts failed: invalid message type") + return + } + result := AuroraAdminSlaDrainHostsResult{} + if err = result.Read(iprot); err != nil { + return + } + if err = iprot.ReadMessageEnd(); err != nil { + return + } + value = result.GetSuccess() + return +} + // Start a storage snapshot and block until it completes. func (p *AuroraAdminClient) Snapshot() (r *Response, err error) { if err = p.sendSnapshot(); err != nil { @@ -1164,16 +1258,16 @@ func (p *AuroraAdminClient) recvSnapshot() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error343 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error344 error - error344, err = error343.Read(iprot) + error344 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error345 error + error345, err = error344.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error344 + err = error345 return } if mTypeId != thrift.REPLY { @@ -1243,16 +1337,16 @@ func (p *AuroraAdminClient) recvTriggerExplicitTaskReconciliation() (value *Resp return } if mTypeId == thrift.EXCEPTION { - error345 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error346 error - error346, err = error345.Read(iprot) + error346 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error347 error + error347, err = error346.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error346 + err = error347 return } if mTypeId != thrift.REPLY { @@ -1317,16 +1411,16 @@ func (p *AuroraAdminClient) recvTriggerImplicitTaskReconciliation() (value *Resp return } if mTypeId == thrift.EXCEPTION { - error347 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error348 error - error348, err = error347.Read(iprot) + error348 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error349 error + error349, err = error348.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error348 + err = error349 return } if mTypeId != thrift.REPLY { @@ -1398,16 +1492,16 @@ func (p *AuroraAdminClient) recvPruneTasks() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error349 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error350 error - error350, err = error349.Read(iprot) + error350 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error351 error + error351, err = error350.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error350 + err = error351 return } if mTypeId != thrift.REPLY { @@ -1430,25 +1524,26 @@ type AuroraAdminProcessor struct { } func NewAuroraAdminProcessor(handler AuroraAdmin) *AuroraAdminProcessor { - self351 := &AuroraAdminProcessor{NewAuroraSchedulerManagerProcessor(handler)} - self351.AddToProcessorMap("setQuota", &auroraAdminProcessorSetQuota{handler: handler}) - self351.AddToProcessorMap("forceTaskState", &auroraAdminProcessorForceTaskState{handler: handler}) - self351.AddToProcessorMap("performBackup", &auroraAdminProcessorPerformBackup{handler: handler}) - self351.AddToProcessorMap("listBackups", &auroraAdminProcessorListBackups{handler: handler}) - self351.AddToProcessorMap("stageRecovery", &auroraAdminProcessorStageRecovery{handler: handler}) - self351.AddToProcessorMap("queryRecovery", &auroraAdminProcessorQueryRecovery{handler: handler}) - self351.AddToProcessorMap("deleteRecoveryTasks", &auroraAdminProcessorDeleteRecoveryTasks{handler: handler}) - self351.AddToProcessorMap("commitRecovery", &auroraAdminProcessorCommitRecovery{handler: handler}) - self351.AddToProcessorMap("unloadRecovery", &auroraAdminProcessorUnloadRecovery{handler: handler}) - self351.AddToProcessorMap("startMaintenance", &auroraAdminProcessorStartMaintenance{handler: handler}) - self351.AddToProcessorMap("drainHosts", &auroraAdminProcessorDrainHosts{handler: handler}) - self351.AddToProcessorMap("maintenanceStatus", &auroraAdminProcessorMaintenanceStatus{handler: handler}) - self351.AddToProcessorMap("endMaintenance", &auroraAdminProcessorEndMaintenance{handler: handler}) - self351.AddToProcessorMap("snapshot", &auroraAdminProcessorSnapshot{handler: handler}) - self351.AddToProcessorMap("triggerExplicitTaskReconciliation", &auroraAdminProcessorTriggerExplicitTaskReconciliation{handler: handler}) - self351.AddToProcessorMap("triggerImplicitTaskReconciliation", &auroraAdminProcessorTriggerImplicitTaskReconciliation{handler: handler}) - self351.AddToProcessorMap("pruneTasks", &auroraAdminProcessorPruneTasks{handler: handler}) - return self351 + self352 := &AuroraAdminProcessor{NewAuroraSchedulerManagerProcessor(handler)} + self352.AddToProcessorMap("setQuota", &auroraAdminProcessorSetQuota{handler: handler}) + self352.AddToProcessorMap("forceTaskState", &auroraAdminProcessorForceTaskState{handler: handler}) + self352.AddToProcessorMap("performBackup", &auroraAdminProcessorPerformBackup{handler: handler}) + self352.AddToProcessorMap("listBackups", &auroraAdminProcessorListBackups{handler: handler}) + self352.AddToProcessorMap("stageRecovery", &auroraAdminProcessorStageRecovery{handler: handler}) + self352.AddToProcessorMap("queryRecovery", &auroraAdminProcessorQueryRecovery{handler: handler}) + self352.AddToProcessorMap("deleteRecoveryTasks", &auroraAdminProcessorDeleteRecoveryTasks{handler: handler}) + self352.AddToProcessorMap("commitRecovery", &auroraAdminProcessorCommitRecovery{handler: handler}) + self352.AddToProcessorMap("unloadRecovery", &auroraAdminProcessorUnloadRecovery{handler: handler}) + self352.AddToProcessorMap("startMaintenance", &auroraAdminProcessorStartMaintenance{handler: handler}) + self352.AddToProcessorMap("drainHosts", &auroraAdminProcessorDrainHosts{handler: handler}) + self352.AddToProcessorMap("maintenanceStatus", &auroraAdminProcessorMaintenanceStatus{handler: handler}) + self352.AddToProcessorMap("endMaintenance", &auroraAdminProcessorEndMaintenance{handler: handler}) + self352.AddToProcessorMap("slaDrainHosts", &auroraAdminProcessorSlaDrainHosts{handler: handler}) + self352.AddToProcessorMap("snapshot", &auroraAdminProcessorSnapshot{handler: handler}) + self352.AddToProcessorMap("triggerExplicitTaskReconciliation", &auroraAdminProcessorTriggerExplicitTaskReconciliation{handler: handler}) + self352.AddToProcessorMap("triggerImplicitTaskReconciliation", &auroraAdminProcessorTriggerImplicitTaskReconciliation{handler: handler}) + self352.AddToProcessorMap("pruneTasks", &auroraAdminProcessorPruneTasks{handler: handler}) + return self352 } type auroraAdminProcessorSetQuota struct { @@ -2075,6 +2170,54 @@ func (p *auroraAdminProcessorEndMaintenance) Process(seqId int32, iprot, oprot t return true, err } +type auroraAdminProcessorSlaDrainHosts struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorSlaDrainHosts) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminSlaDrainHostsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("slaDrainHosts", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminSlaDrainHostsResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.SlaDrainHosts(args.Hosts, args.DefaultSlaPolicy, args.TimeoutSecs); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing slaDrainHosts: "+err2.Error()) + oprot.WriteMessageBegin("slaDrainHosts", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush() + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("slaDrainHosts", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + type auroraAdminProcessorSnapshot struct { handler AuroraAdmin } @@ -4740,6 +4883,284 @@ func (p *AuroraAdminEndMaintenanceResult) String() string { return fmt.Sprintf("AuroraAdminEndMaintenanceResult(%+v)", *p) } +// Attributes: +// - Hosts +// - DefaultSlaPolicy +// - TimeoutSecs +type AuroraAdminSlaDrainHostsArgs struct { + Hosts *Hosts `thrift:"hosts,1" json:"hosts"` + DefaultSlaPolicy *SlaPolicy `thrift:"defaultSlaPolicy,2" json:"defaultSlaPolicy"` + TimeoutSecs int64 `thrift:"timeoutSecs,3" json:"timeoutSecs"` +} + +func NewAuroraAdminSlaDrainHostsArgs() *AuroraAdminSlaDrainHostsArgs { + return &AuroraAdminSlaDrainHostsArgs{} +} + +var AuroraAdminSlaDrainHostsArgs_Hosts_DEFAULT *Hosts + +func (p *AuroraAdminSlaDrainHostsArgs) GetHosts() *Hosts { + if !p.IsSetHosts() { + return AuroraAdminSlaDrainHostsArgs_Hosts_DEFAULT + } + return p.Hosts +} + +var AuroraAdminSlaDrainHostsArgs_DefaultSlaPolicy_DEFAULT *SlaPolicy + +func (p *AuroraAdminSlaDrainHostsArgs) GetDefaultSlaPolicy() *SlaPolicy { + if !p.IsSetDefaultSlaPolicy() { + return AuroraAdminSlaDrainHostsArgs_DefaultSlaPolicy_DEFAULT + } + return p.DefaultSlaPolicy +} + +func (p *AuroraAdminSlaDrainHostsArgs) GetTimeoutSecs() int64 { + return p.TimeoutSecs +} +func (p *AuroraAdminSlaDrainHostsArgs) IsSetHosts() bool { + return p.Hosts != nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) IsSetDefaultSlaPolicy() bool { + return p.DefaultSlaPolicy != nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.readField1(iprot); err != nil { + return err + } + case 2: + if err := p.readField2(iprot); err != nil { + return err + } + case 3: + if err := p.readField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) readField1(iprot thrift.TProtocol) error { + p.Hosts = &Hosts{} + if err := p.Hosts.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) readField2(iprot thrift.TProtocol) error { + p.DefaultSlaPolicy = &SlaPolicy{} + if err := p.DefaultSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DefaultSlaPolicy), err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) readField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TimeoutSecs = v + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("slaDrainHosts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) + } + if err := p.Hosts.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) + } + return err +} + +func (p *AuroraAdminSlaDrainHostsArgs) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("defaultSlaPolicy", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultSlaPolicy: ", p), err) + } + if err := p.DefaultSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DefaultSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultSlaPolicy: ", p), err) + } + return err +} + +func (p *AuroraAdminSlaDrainHostsArgs) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("timeoutSecs", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:timeoutSecs: ", p), err) + } + if err := oprot.WriteI64(int64(p.TimeoutSecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timeoutSecs (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:timeoutSecs: ", p), err) + } + return err +} + +func (p *AuroraAdminSlaDrainHostsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminSlaDrainHostsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminSlaDrainHostsResult struct { + Success *Response `thrift:"success,0" json:"success,omitempty"` +} + +func NewAuroraAdminSlaDrainHostsResult() *AuroraAdminSlaDrainHostsResult { + return &AuroraAdminSlaDrainHostsResult{} +} + +var AuroraAdminSlaDrainHostsResult_Success_DEFAULT *Response + +func (p *AuroraAdminSlaDrainHostsResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminSlaDrainHostsResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminSlaDrainHostsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminSlaDrainHostsResult) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if err := p.readField0(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsResult) readField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("slaDrainHosts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField0(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminSlaDrainHostsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminSlaDrainHostsResult(%+v)", *p) +} + type AuroraAdminSnapshotArgs struct { } diff --git a/gen-go/apache/aurora/auroraschedulermanager.go b/gen-go/apache/aurora/auroraschedulermanager.go index 33757e8..a448b72 100644 --- a/gen-go/apache/aurora/auroraschedulermanager.go +++ b/gen-go/apache/aurora/auroraschedulermanager.go @@ -171,16 +171,16 @@ func (p *AuroraSchedulerManagerClient) recvCreateJob() (value *Response, err err return } if mTypeId == thrift.EXCEPTION { - error132 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error133 error - error133, err = error132.Read(iprot) + error131 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error132 error + error132, err = error131.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error133 + err = error132 return } if mTypeId != thrift.REPLY { @@ -252,16 +252,16 @@ func (p *AuroraSchedulerManagerClient) recvScheduleCronJob() (value *Response, e return } if mTypeId == thrift.EXCEPTION { - error134 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error135 error - error135, err = error134.Read(iprot) + error133 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error134 error + error134, err = error133.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error135 + err = error134 return } if mTypeId != thrift.REPLY { @@ -332,16 +332,16 @@ func (p *AuroraSchedulerManagerClient) recvDescheduleCronJob() (value *Response, return } if mTypeId == thrift.EXCEPTION { - error136 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error137 error - error137, err = error136.Read(iprot) + error135 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error136 error + error136, err = error135.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error137 + err = error136 return } if mTypeId != thrift.REPLY { @@ -412,16 +412,16 @@ func (p *AuroraSchedulerManagerClient) recvStartCronJob() (value *Response, err return } if mTypeId == thrift.EXCEPTION { - error138 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error139 error - error139, err = error138.Read(iprot) + error137 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error138 error + error138, err = error137.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error139 + err = error138 return } if mTypeId != thrift.REPLY { @@ -493,16 +493,16 @@ func (p *AuroraSchedulerManagerClient) recvRestartShards() (value *Response, err return } if mTypeId == thrift.EXCEPTION { - error140 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error141 error - error141, err = error140.Read(iprot) + error139 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error140 error + error140, err = error139.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error141 + err = error140 return } if mTypeId != thrift.REPLY { @@ -576,16 +576,16 @@ func (p *AuroraSchedulerManagerClient) recvKillTasks() (value *Response, err err return } if mTypeId == thrift.EXCEPTION { - error142 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error143 error - error143, err = error142.Read(iprot) + error141 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error142 error + error142, err = error141.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error143 + err = error142 return } if mTypeId != thrift.REPLY { @@ -657,16 +657,16 @@ func (p *AuroraSchedulerManagerClient) recvAddInstances() (value *Response, err return } if mTypeId == thrift.EXCEPTION { - error144 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error145 error - error145, err = error144.Read(iprot) + error143 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error144 error + error144, err = error143.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error145 + err = error144 return } if mTypeId != thrift.REPLY { @@ -737,16 +737,16 @@ func (p *AuroraSchedulerManagerClient) recvReplaceCronTemplate() (value *Respons return } if mTypeId == thrift.EXCEPTION { - error146 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error147 error - error147, err = error146.Read(iprot) + error145 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error146 error + error146, err = error145.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error147 + err = error146 return } if mTypeId != thrift.REPLY { @@ -818,16 +818,16 @@ func (p *AuroraSchedulerManagerClient) recvStartJobUpdate() (value *Response, er return } if mTypeId == thrift.EXCEPTION { - error148 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error149 error - error149, err = error148.Read(iprot) + error147 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error148 error + error148, err = error147.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error149 + err = error148 return } if mTypeId != thrift.REPLY { @@ -899,16 +899,16 @@ func (p *AuroraSchedulerManagerClient) recvPauseJobUpdate() (value *Response, er return } if mTypeId == thrift.EXCEPTION { - error150 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error151 error - error151, err = error150.Read(iprot) + error149 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error150 error + error150, err = error149.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error151 + err = error150 return } if mTypeId != thrift.REPLY { @@ -980,16 +980,16 @@ func (p *AuroraSchedulerManagerClient) recvResumeJobUpdate() (value *Response, e return } if mTypeId == thrift.EXCEPTION { - error152 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error153 error - error153, err = error152.Read(iprot) + error151 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error152 error + error152, err = error151.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error153 + err = error152 return } if mTypeId != thrift.REPLY { @@ -1061,16 +1061,16 @@ func (p *AuroraSchedulerManagerClient) recvAbortJobUpdate() (value *Response, er return } if mTypeId == thrift.EXCEPTION { - error154 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error155 error - error155, err = error154.Read(iprot) + error153 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error154 error + error154, err = error153.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error155 + err = error154 return } if mTypeId != thrift.REPLY { @@ -1142,16 +1142,16 @@ func (p *AuroraSchedulerManagerClient) recvRollbackJobUpdate() (value *Response, return } if mTypeId == thrift.EXCEPTION { - error156 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error157 error - error157, err = error156.Read(iprot) + error155 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error156 error + error156, err = error155.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error157 + err = error156 return } if mTypeId != thrift.REPLY { @@ -1223,16 +1223,16 @@ func (p *AuroraSchedulerManagerClient) recvPulseJobUpdate() (value *Response, er return } if mTypeId == thrift.EXCEPTION { - error158 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error159 error - error159, err = error158.Read(iprot) + error157 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error158 error + error158, err = error157.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error159 + err = error158 return } if mTypeId != thrift.REPLY { @@ -1255,22 +1255,22 @@ type AuroraSchedulerManagerProcessor struct { } func NewAuroraSchedulerManagerProcessor(handler AuroraSchedulerManager) *AuroraSchedulerManagerProcessor { - self160 := &AuroraSchedulerManagerProcessor{NewReadOnlySchedulerProcessor(handler)} - self160.AddToProcessorMap("createJob", &auroraSchedulerManagerProcessorCreateJob{handler: handler}) - self160.AddToProcessorMap("scheduleCronJob", &auroraSchedulerManagerProcessorScheduleCronJob{handler: handler}) - self160.AddToProcessorMap("descheduleCronJob", &auroraSchedulerManagerProcessorDescheduleCronJob{handler: handler}) - self160.AddToProcessorMap("startCronJob", &auroraSchedulerManagerProcessorStartCronJob{handler: handler}) - self160.AddToProcessorMap("restartShards", &auroraSchedulerManagerProcessorRestartShards{handler: handler}) - self160.AddToProcessorMap("killTasks", &auroraSchedulerManagerProcessorKillTasks{handler: handler}) - self160.AddToProcessorMap("addInstances", &auroraSchedulerManagerProcessorAddInstances{handler: handler}) - self160.AddToProcessorMap("replaceCronTemplate", &auroraSchedulerManagerProcessorReplaceCronTemplate{handler: handler}) - self160.AddToProcessorMap("startJobUpdate", &auroraSchedulerManagerProcessorStartJobUpdate{handler: handler}) - self160.AddToProcessorMap("pauseJobUpdate", &auroraSchedulerManagerProcessorPauseJobUpdate{handler: handler}) - self160.AddToProcessorMap("resumeJobUpdate", &auroraSchedulerManagerProcessorResumeJobUpdate{handler: handler}) - self160.AddToProcessorMap("abortJobUpdate", &auroraSchedulerManagerProcessorAbortJobUpdate{handler: handler}) - self160.AddToProcessorMap("rollbackJobUpdate", &auroraSchedulerManagerProcessorRollbackJobUpdate{handler: handler}) - self160.AddToProcessorMap("pulseJobUpdate", &auroraSchedulerManagerProcessorPulseJobUpdate{handler: handler}) - return self160 + self159 := &AuroraSchedulerManagerProcessor{NewReadOnlySchedulerProcessor(handler)} + self159.AddToProcessorMap("createJob", &auroraSchedulerManagerProcessorCreateJob{handler: handler}) + self159.AddToProcessorMap("scheduleCronJob", &auroraSchedulerManagerProcessorScheduleCronJob{handler: handler}) + self159.AddToProcessorMap("descheduleCronJob", &auroraSchedulerManagerProcessorDescheduleCronJob{handler: handler}) + self159.AddToProcessorMap("startCronJob", &auroraSchedulerManagerProcessorStartCronJob{handler: handler}) + self159.AddToProcessorMap("restartShards", &auroraSchedulerManagerProcessorRestartShards{handler: handler}) + self159.AddToProcessorMap("killTasks", &auroraSchedulerManagerProcessorKillTasks{handler: handler}) + self159.AddToProcessorMap("addInstances", &auroraSchedulerManagerProcessorAddInstances{handler: handler}) + self159.AddToProcessorMap("replaceCronTemplate", &auroraSchedulerManagerProcessorReplaceCronTemplate{handler: handler}) + self159.AddToProcessorMap("startJobUpdate", &auroraSchedulerManagerProcessorStartJobUpdate{handler: handler}) + self159.AddToProcessorMap("pauseJobUpdate", &auroraSchedulerManagerProcessorPauseJobUpdate{handler: handler}) + self159.AddToProcessorMap("resumeJobUpdate", &auroraSchedulerManagerProcessorResumeJobUpdate{handler: handler}) + self159.AddToProcessorMap("abortJobUpdate", &auroraSchedulerManagerProcessorAbortJobUpdate{handler: handler}) + self159.AddToProcessorMap("rollbackJobUpdate", &auroraSchedulerManagerProcessorRollbackJobUpdate{handler: handler}) + self159.AddToProcessorMap("pulseJobUpdate", &auroraSchedulerManagerProcessorPulseJobUpdate{handler: handler}) + return self159 } type auroraSchedulerManagerProcessorCreateJob struct { @@ -2832,13 +2832,13 @@ func (p *AuroraSchedulerManagerRestartShardsArgs) readField3(iprot thrift.TProto tSet := make(map[int32]bool, size) p.ShardIds = tSet for i := 0; i < size; i++ { - var _elem161 int32 + var _elem160 int32 if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem161 = v + _elem160 = v } - p.ShardIds[_elem161] = true + p.ShardIds[_elem160] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -3099,13 +3099,13 @@ func (p *AuroraSchedulerManagerKillTasksArgs) readField5(iprot thrift.TProtocol) tSet := make(map[int32]bool, size) p.Instances = tSet for i := 0; i < size; i++ { - var _elem162 int32 + var _elem161 int32 if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem162 = v + _elem161 = v } - p.Instances[_elem162] = true + p.Instances[_elem161] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) diff --git a/gen-go/apache/aurora/constants.go b/gen-go/apache/aurora/constants.go index 84211aa..9284ff5 100644 --- a/gen-go/apache/aurora/constants.go +++ b/gen-go/apache/aurora/constants.go @@ -41,6 +41,7 @@ func init() { 12: true, 2: true, 1: true, + 18: true, 16: true, } @@ -51,6 +52,7 @@ func init() { 13: true, 12: true, 2: true, + 18: true, 1: true, } @@ -59,6 +61,7 @@ func init() { 13: true, 12: true, 17: true, + 18: true, 2: true, } diff --git a/gen-go/apache/aurora/read_only_scheduler-remote/read_only_scheduler-remote.go b/gen-go/apache/aurora/read_only_scheduler-remote/read_only_scheduler-remote.go index b9c3d90..2c2687f 100755 --- a/gen-go/apache/aurora/read_only_scheduler-remote/read_only_scheduler-remote.go +++ b/gen-go/apache/aurora/read_only_scheduler-remote/read_only_scheduler-remote.go @@ -150,19 +150,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTasksStatus requires 1 args") flag.Usage() } - arg82 := flag.Arg(1) - mbTrans83 := thrift.NewTMemoryBufferLen(len(arg82)) - defer mbTrans83.Close() - _, err84 := mbTrans83.WriteString(arg82) - if err84 != nil { + arg81 := flag.Arg(1) + mbTrans82 := thrift.NewTMemoryBufferLen(len(arg81)) + defer mbTrans82.Close() + _, err83 := mbTrans82.WriteString(arg81) + if err83 != nil { Usage() return } - factory85 := thrift.NewTSimpleJSONProtocolFactory() - jsProt86 := factory85.GetProtocol(mbTrans83) + factory84 := thrift.NewTSimpleJSONProtocolFactory() + jsProt85 := factory84.GetProtocol(mbTrans82) argvalue0 := aurora.NewTaskQuery() - err87 := argvalue0.Read(jsProt86) - if err87 != nil { + err86 := argvalue0.Read(jsProt85) + if err86 != nil { Usage() return } @@ -175,19 +175,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetTasksWithoutConfigs requires 1 args") flag.Usage() } - arg88 := flag.Arg(1) - mbTrans89 := thrift.NewTMemoryBufferLen(len(arg88)) - defer mbTrans89.Close() - _, err90 := mbTrans89.WriteString(arg88) - if err90 != nil { + arg87 := flag.Arg(1) + mbTrans88 := thrift.NewTMemoryBufferLen(len(arg87)) + defer mbTrans88.Close() + _, err89 := mbTrans88.WriteString(arg87) + if err89 != nil { Usage() return } - factory91 := thrift.NewTSimpleJSONProtocolFactory() - jsProt92 := factory91.GetProtocol(mbTrans89) + factory90 := thrift.NewTSimpleJSONProtocolFactory() + jsProt91 := factory90.GetProtocol(mbTrans88) argvalue0 := aurora.NewTaskQuery() - err93 := argvalue0.Read(jsProt92) - if err93 != nil { + err92 := argvalue0.Read(jsProt91) + if err92 != nil { Usage() return } @@ -200,19 +200,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetPendingReason requires 1 args") flag.Usage() } - arg94 := flag.Arg(1) - mbTrans95 := thrift.NewTMemoryBufferLen(len(arg94)) - defer mbTrans95.Close() - _, err96 := mbTrans95.WriteString(arg94) - if err96 != nil { + arg93 := flag.Arg(1) + mbTrans94 := thrift.NewTMemoryBufferLen(len(arg93)) + defer mbTrans94.Close() + _, err95 := mbTrans94.WriteString(arg93) + if err95 != nil { Usage() return } - factory97 := thrift.NewTSimpleJSONProtocolFactory() - jsProt98 := factory97.GetProtocol(mbTrans95) + factory96 := thrift.NewTSimpleJSONProtocolFactory() + jsProt97 := factory96.GetProtocol(mbTrans94) argvalue0 := aurora.NewTaskQuery() - err99 := argvalue0.Read(jsProt98) - if err99 != nil { + err98 := argvalue0.Read(jsProt97) + if err98 != nil { Usage() return } @@ -225,19 +225,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetConfigSummary requires 1 args") flag.Usage() } - arg100 := flag.Arg(1) - mbTrans101 := thrift.NewTMemoryBufferLen(len(arg100)) - defer mbTrans101.Close() - _, err102 := mbTrans101.WriteString(arg100) - if err102 != nil { + arg99 := flag.Arg(1) + mbTrans100 := thrift.NewTMemoryBufferLen(len(arg99)) + defer mbTrans100.Close() + _, err101 := mbTrans100.WriteString(arg99) + if err101 != nil { Usage() return } - factory103 := thrift.NewTSimpleJSONProtocolFactory() - jsProt104 := factory103.GetProtocol(mbTrans101) + factory102 := thrift.NewTSimpleJSONProtocolFactory() + jsProt103 := factory102.GetProtocol(mbTrans100) argvalue0 := aurora.NewJobKey() - err105 := argvalue0.Read(jsProt104) - if err105 != nil { + err104 := argvalue0.Read(jsProt103) + if err104 != nil { Usage() return } @@ -270,19 +270,19 @@ func main() { fmt.Fprintln(os.Stderr, "PopulateJobConfig requires 1 args") flag.Usage() } - arg108 := flag.Arg(1) - mbTrans109 := thrift.NewTMemoryBufferLen(len(arg108)) - defer mbTrans109.Close() - _, err110 := mbTrans109.WriteString(arg108) - if err110 != nil { + arg107 := flag.Arg(1) + mbTrans108 := thrift.NewTMemoryBufferLen(len(arg107)) + defer mbTrans108.Close() + _, err109 := mbTrans108.WriteString(arg107) + if err109 != nil { Usage() return } - factory111 := thrift.NewTSimpleJSONProtocolFactory() - jsProt112 := factory111.GetProtocol(mbTrans109) + factory110 := thrift.NewTSimpleJSONProtocolFactory() + jsProt111 := factory110.GetProtocol(mbTrans108) argvalue0 := aurora.NewJobConfiguration() - err113 := argvalue0.Read(jsProt112) - if err113 != nil { + err112 := argvalue0.Read(jsProt111) + if err112 != nil { Usage() return } @@ -295,19 +295,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetJobUpdateSummaries requires 1 args") flag.Usage() } - arg114 := flag.Arg(1) - mbTrans115 := thrift.NewTMemoryBufferLen(len(arg114)) - defer mbTrans115.Close() - _, err116 := mbTrans115.WriteString(arg114) - if err116 != nil { + arg113 := flag.Arg(1) + mbTrans114 := thrift.NewTMemoryBufferLen(len(arg113)) + defer mbTrans114.Close() + _, err115 := mbTrans114.WriteString(arg113) + if err115 != nil { Usage() return } - factory117 := thrift.NewTSimpleJSONProtocolFactory() - jsProt118 := factory117.GetProtocol(mbTrans115) + factory116 := thrift.NewTSimpleJSONProtocolFactory() + jsProt117 := factory116.GetProtocol(mbTrans114) argvalue0 := aurora.NewJobUpdateQuery() - err119 := argvalue0.Read(jsProt118) - if err119 != nil { + err118 := argvalue0.Read(jsProt117) + if err118 != nil { Usage() return } @@ -320,19 +320,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetJobUpdateDetails requires 1 args") flag.Usage() } - arg120 := flag.Arg(1) - mbTrans121 := thrift.NewTMemoryBufferLen(len(arg120)) - defer mbTrans121.Close() - _, err122 := mbTrans121.WriteString(arg120) - if err122 != nil { + arg119 := flag.Arg(1) + mbTrans120 := thrift.NewTMemoryBufferLen(len(arg119)) + defer mbTrans120.Close() + _, err121 := mbTrans120.WriteString(arg119) + if err121 != nil { Usage() return } - factory123 := thrift.NewTSimpleJSONProtocolFactory() - jsProt124 := factory123.GetProtocol(mbTrans121) + factory122 := thrift.NewTSimpleJSONProtocolFactory() + jsProt123 := factory122.GetProtocol(mbTrans120) argvalue0 := aurora.NewJobUpdateQuery() - err125 := argvalue0.Read(jsProt124) - if err125 != nil { + err124 := argvalue0.Read(jsProt123) + if err124 != nil { Usage() return } @@ -345,19 +345,19 @@ func main() { fmt.Fprintln(os.Stderr, "GetJobUpdateDiff requires 1 args") flag.Usage() } - arg126 := flag.Arg(1) - mbTrans127 := thrift.NewTMemoryBufferLen(len(arg126)) - defer mbTrans127.Close() - _, err128 := mbTrans127.WriteString(arg126) - if err128 != nil { + arg125 := flag.Arg(1) + mbTrans126 := thrift.NewTMemoryBufferLen(len(arg125)) + defer mbTrans126.Close() + _, err127 := mbTrans126.WriteString(arg125) + if err127 != nil { Usage() return } - factory129 := thrift.NewTSimpleJSONProtocolFactory() - jsProt130 := factory129.GetProtocol(mbTrans127) + factory128 := thrift.NewTSimpleJSONProtocolFactory() + jsProt129 := factory128.GetProtocol(mbTrans126) argvalue0 := aurora.NewJobUpdateRequest() - err131 := argvalue0.Read(jsProt130) - if err131 != nil { + err130 := argvalue0.Read(jsProt129) + if err130 != nil { Usage() return } diff --git a/gen-go/apache/aurora/readonlyscheduler.go b/gen-go/apache/aurora/readonlyscheduler.go index e87a66d..dba7255 100644 --- a/gen-go/apache/aurora/readonlyscheduler.go +++ b/gen-go/apache/aurora/readonlyscheduler.go @@ -152,16 +152,16 @@ func (p *ReadOnlySchedulerClient) recvGetRoleSummary() (value *Response, err err return } if mTypeId == thrift.EXCEPTION { - error53 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error54 error - error54, err = error53.Read(iprot) + error52 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error53 error + error53, err = error52.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error54 + err = error53 return } if mTypeId != thrift.REPLY { @@ -231,16 +231,16 @@ func (p *ReadOnlySchedulerClient) recvGetJobSummary() (value *Response, err erro return } if mTypeId == thrift.EXCEPTION { - error55 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error56 error - error56, err = error55.Read(iprot) + error54 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error55 error + error55, err = error54.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error56 + err = error55 return } if mTypeId != thrift.REPLY { @@ -310,16 +310,16 @@ func (p *ReadOnlySchedulerClient) recvGetTasksStatus() (value *Response, err err return } if mTypeId == thrift.EXCEPTION { - error57 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error58 error - error58, err = error57.Read(iprot) + error56 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error57 error + error57, err = error56.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error58 + err = error57 return } if mTypeId != thrift.REPLY { @@ -390,16 +390,16 @@ func (p *ReadOnlySchedulerClient) recvGetTasksWithoutConfigs() (value *Response, return } if mTypeId == thrift.EXCEPTION { - error59 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error60 error - error60, err = error59.Read(iprot) + error58 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error59 error + error59, err = error58.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error60 + err = error59 return } if mTypeId != thrift.REPLY { @@ -469,16 +469,16 @@ func (p *ReadOnlySchedulerClient) recvGetPendingReason() (value *Response, err e return } if mTypeId == thrift.EXCEPTION { - error61 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error62 error - error62, err = error61.Read(iprot) + error60 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error61 error + error61, err = error60.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error62 + err = error61 return } if mTypeId != thrift.REPLY { @@ -548,16 +548,16 @@ func (p *ReadOnlySchedulerClient) recvGetConfigSummary() (value *Response, err e return } if mTypeId == thrift.EXCEPTION { - error63 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error64 error - error64, err = error63.Read(iprot) + error62 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error63 error + error63, err = error62.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error64 + err = error63 return } if mTypeId != thrift.REPLY { @@ -628,16 +628,16 @@ func (p *ReadOnlySchedulerClient) recvGetJobs() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error65 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error66 error - error66, err = error65.Read(iprot) + error64 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error65 error + error65, err = error64.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error66 + err = error65 return } if mTypeId != thrift.REPLY { @@ -707,16 +707,16 @@ func (p *ReadOnlySchedulerClient) recvGetQuota() (value *Response, err error) { return } if mTypeId == thrift.EXCEPTION { - error67 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error68 error - error68, err = error67.Read(iprot) + error66 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error67 error + error67, err = error66.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error68 + err = error67 return } if mTypeId != thrift.REPLY { @@ -787,16 +787,16 @@ func (p *ReadOnlySchedulerClient) recvPopulateJobConfig() (value *Response, err return } if mTypeId == thrift.EXCEPTION { - error69 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error70 error - error70, err = error69.Read(iprot) + error68 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error69 error + error69, err = error68.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error70 + err = error69 return } if mTypeId != thrift.REPLY { @@ -866,16 +866,16 @@ func (p *ReadOnlySchedulerClient) recvGetJobUpdateSummaries() (value *Response, return } if mTypeId == thrift.EXCEPTION { - error71 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error72 error - error72, err = error71.Read(iprot) + error70 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error71 error + error71, err = error70.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error72 + err = error71 return } if mTypeId != thrift.REPLY { @@ -945,16 +945,16 @@ func (p *ReadOnlySchedulerClient) recvGetJobUpdateDetails() (value *Response, er return } if mTypeId == thrift.EXCEPTION { - error73 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error74 error - error74, err = error73.Read(iprot) + error72 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error73 error + error73, err = error72.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error74 + err = error73 return } if mTypeId != thrift.REPLY { @@ -1024,16 +1024,16 @@ func (p *ReadOnlySchedulerClient) recvGetJobUpdateDiff() (value *Response, err e return } if mTypeId == thrift.EXCEPTION { - error75 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error76 error - error76, err = error75.Read(iprot) + error74 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error75 error + error75, err = error74.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error76 + err = error75 return } if mTypeId != thrift.REPLY { @@ -1098,16 +1098,16 @@ func (p *ReadOnlySchedulerClient) recvGetTierConfigs() (value *Response, err err return } if mTypeId == thrift.EXCEPTION { - error77 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error78 error - error78, err = error77.Read(iprot) + error76 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error77 error + error77, err = error76.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error78 + err = error77 return } if mTypeId != thrift.REPLY { @@ -1145,21 +1145,21 @@ func (p *ReadOnlySchedulerProcessor) ProcessorMap() map[string]thrift.TProcessor func NewReadOnlySchedulerProcessor(handler ReadOnlyScheduler) *ReadOnlySchedulerProcessor { - self79 := &ReadOnlySchedulerProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self79.processorMap["getRoleSummary"] = &readOnlySchedulerProcessorGetRoleSummary{handler: handler} - self79.processorMap["getJobSummary"] = &readOnlySchedulerProcessorGetJobSummary{handler: handler} - self79.processorMap["getTasksStatus"] = &readOnlySchedulerProcessorGetTasksStatus{handler: handler} - self79.processorMap["getTasksWithoutConfigs"] = &readOnlySchedulerProcessorGetTasksWithoutConfigs{handler: handler} - self79.processorMap["getPendingReason"] = &readOnlySchedulerProcessorGetPendingReason{handler: handler} - self79.processorMap["getConfigSummary"] = &readOnlySchedulerProcessorGetConfigSummary{handler: handler} - self79.processorMap["getJobs"] = &readOnlySchedulerProcessorGetJobs{handler: handler} - self79.processorMap["getQuota"] = &readOnlySchedulerProcessorGetQuota{handler: handler} - self79.processorMap["populateJobConfig"] = &readOnlySchedulerProcessorPopulateJobConfig{handler: handler} - self79.processorMap["getJobUpdateSummaries"] = &readOnlySchedulerProcessorGetJobUpdateSummaries{handler: handler} - self79.processorMap["getJobUpdateDetails"] = &readOnlySchedulerProcessorGetJobUpdateDetails{handler: handler} - self79.processorMap["getJobUpdateDiff"] = &readOnlySchedulerProcessorGetJobUpdateDiff{handler: handler} - self79.processorMap["getTierConfigs"] = &readOnlySchedulerProcessorGetTierConfigs{handler: handler} - return self79 + self78 := &ReadOnlySchedulerProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self78.processorMap["getRoleSummary"] = &readOnlySchedulerProcessorGetRoleSummary{handler: handler} + self78.processorMap["getJobSummary"] = &readOnlySchedulerProcessorGetJobSummary{handler: handler} + self78.processorMap["getTasksStatus"] = &readOnlySchedulerProcessorGetTasksStatus{handler: handler} + self78.processorMap["getTasksWithoutConfigs"] = &readOnlySchedulerProcessorGetTasksWithoutConfigs{handler: handler} + self78.processorMap["getPendingReason"] = &readOnlySchedulerProcessorGetPendingReason{handler: handler} + self78.processorMap["getConfigSummary"] = &readOnlySchedulerProcessorGetConfigSummary{handler: handler} + self78.processorMap["getJobs"] = &readOnlySchedulerProcessorGetJobs{handler: handler} + self78.processorMap["getQuota"] = &readOnlySchedulerProcessorGetQuota{handler: handler} + self78.processorMap["populateJobConfig"] = &readOnlySchedulerProcessorPopulateJobConfig{handler: handler} + self78.processorMap["getJobUpdateSummaries"] = &readOnlySchedulerProcessorGetJobUpdateSummaries{handler: handler} + self78.processorMap["getJobUpdateDetails"] = &readOnlySchedulerProcessorGetJobUpdateDetails{handler: handler} + self78.processorMap["getJobUpdateDiff"] = &readOnlySchedulerProcessorGetJobUpdateDiff{handler: handler} + self78.processorMap["getTierConfigs"] = &readOnlySchedulerProcessorGetTierConfigs{handler: handler} + return self78 } func (p *ReadOnlySchedulerProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -1172,12 +1172,12 @@ func (p *ReadOnlySchedulerProcessor) Process(iprot, oprot thrift.TProtocol) (suc } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x80 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + x79 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x80.Write(oprot) + x79.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x80 + return false, x79 } diff --git a/gen-go/apache/aurora/ttypes.go b/gen-go/apache/aurora/ttypes.go index 1bb406a..1f1d45c 100644 --- a/gen-go/apache/aurora/ttypes.go +++ b/gen-go/apache/aurora/ttypes.go @@ -230,20 +230,21 @@ func (p *CronCollisionPolicy) UnmarshalText(text []byte) error { type ScheduleStatus int64 const ( - ScheduleStatus_INIT ScheduleStatus = 11 - ScheduleStatus_THROTTLED ScheduleStatus = 16 - ScheduleStatus_PENDING ScheduleStatus = 0 - ScheduleStatus_ASSIGNED ScheduleStatus = 9 - ScheduleStatus_STARTING ScheduleStatus = 1 - ScheduleStatus_RUNNING ScheduleStatus = 2 - ScheduleStatus_FINISHED ScheduleStatus = 3 - ScheduleStatus_PREEMPTING ScheduleStatus = 13 - ScheduleStatus_RESTARTING ScheduleStatus = 12 - ScheduleStatus_DRAINING ScheduleStatus = 17 - ScheduleStatus_FAILED ScheduleStatus = 4 - ScheduleStatus_KILLED ScheduleStatus = 5 - ScheduleStatus_KILLING ScheduleStatus = 6 - ScheduleStatus_LOST ScheduleStatus = 7 + ScheduleStatus_INIT ScheduleStatus = 11 + ScheduleStatus_THROTTLED ScheduleStatus = 16 + ScheduleStatus_PENDING ScheduleStatus = 0 + ScheduleStatus_ASSIGNED ScheduleStatus = 9 + ScheduleStatus_STARTING ScheduleStatus = 1 + ScheduleStatus_RUNNING ScheduleStatus = 2 + ScheduleStatus_FINISHED ScheduleStatus = 3 + ScheduleStatus_PREEMPTING ScheduleStatus = 13 + ScheduleStatus_RESTARTING ScheduleStatus = 12 + ScheduleStatus_DRAINING ScheduleStatus = 17 + ScheduleStatus_FAILED ScheduleStatus = 4 + ScheduleStatus_KILLED ScheduleStatus = 5 + ScheduleStatus_KILLING ScheduleStatus = 6 + ScheduleStatus_LOST ScheduleStatus = 7 + ScheduleStatus_PARTITIONED ScheduleStatus = 18 ) func (p ScheduleStatus) String() string { @@ -276,6 +277,8 @@ func (p ScheduleStatus) String() string { return "KILLING" case ScheduleStatus_LOST: return "LOST" + case ScheduleStatus_PARTITIONED: + return "PARTITIONED" } return "" } @@ -310,6 +313,8 @@ func ScheduleStatusFromString(s string) (ScheduleStatus, error) { return ScheduleStatus_KILLING, nil case "LOST": return ScheduleStatus_LOST, nil + case "PARTITIONED": + return ScheduleStatus_PARTITIONED, nil } return ScheduleStatus(0), fmt.Errorf("not a valid ScheduleStatus string") } @@ -4319,22 +4324,750 @@ func (p *Resource) String() string { return fmt.Sprintf("Resource(%+v)", *p) } +// Attributes: +// - Reschedule +// - DelaySecs +type PartitionPolicy struct { + Reschedule bool `thrift:"reschedule,1" json:"reschedule"` + DelaySecs *int64 `thrift:"delaySecs,2" json:"delaySecs,omitempty"` +} + +func NewPartitionPolicy() *PartitionPolicy { + return &PartitionPolicy{} +} + +func (p *PartitionPolicy) GetReschedule() bool { + return p.Reschedule +} + +var PartitionPolicy_DelaySecs_DEFAULT int64 + +func (p *PartitionPolicy) GetDelaySecs() int64 { + if !p.IsSetDelaySecs() { + return PartitionPolicy_DelaySecs_DEFAULT + } + return *p.DelaySecs +} +func (p *PartitionPolicy) IsSetDelaySecs() bool { + return p.DelaySecs != nil +} + +func (p *PartitionPolicy) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.readField1(iprot); err != nil { + return err + } + case 2: + if err := p.readField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *PartitionPolicy) readField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Reschedule = v + } + return nil +} + +func (p *PartitionPolicy) readField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DelaySecs = &v + } + return nil +} + +func (p *PartitionPolicy) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("PartitionPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *PartitionPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("reschedule", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:reschedule: ", p), err) + } + if err := oprot.WriteBool(bool(p.Reschedule)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reschedule (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:reschedule: ", p), err) + } + return err +} + +func (p *PartitionPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDelaySecs() { + if err := oprot.WriteFieldBegin("delaySecs", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delaySecs: ", p), err) + } + if err := oprot.WriteI64(int64(*p.DelaySecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delaySecs (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delaySecs: ", p), err) + } + } + return err +} + +func (p *PartitionPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionPolicy(%+v)", *p) +} + +// SLA requirements expressed as the percentage of instances to be RUNNING every durationSecs +// +// Attributes: +// - Percentage +// - DurationSecs: Minimum time duration a task needs to be `RUNNING` to be treated as active +type PercentageSlaPolicy struct { + Percentage float64 `thrift:"percentage,1" json:"percentage"` + DurationSecs int64 `thrift:"durationSecs,2" json:"durationSecs"` +} + +func NewPercentageSlaPolicy() *PercentageSlaPolicy { + return &PercentageSlaPolicy{} +} + +func (p *PercentageSlaPolicy) GetPercentage() float64 { + return p.Percentage +} + +func (p *PercentageSlaPolicy) GetDurationSecs() int64 { + return p.DurationSecs +} +func (p *PercentageSlaPolicy) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.readField1(iprot); err != nil { + return err + } + case 2: + if err := p.readField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *PercentageSlaPolicy) readField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Percentage = v + } + return nil +} + +func (p *PercentageSlaPolicy) readField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DurationSecs = v + } + return nil +} + +func (p *PercentageSlaPolicy) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("PercentageSlaPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *PercentageSlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("percentage", thrift.DOUBLE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:percentage: ", p), err) + } + if err := oprot.WriteDouble(float64(p.Percentage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.percentage (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:percentage: ", p), err) + } + return err +} + +func (p *PercentageSlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("durationSecs", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:durationSecs: ", p), err) + } + if err := oprot.WriteI64(int64(p.DurationSecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.durationSecs (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:durationSecs: ", p), err) + } + return err +} + +func (p *PercentageSlaPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PercentageSlaPolicy(%+v)", *p) +} + +// SLA requirements expressed as the number of instances to be RUNNING every durationSecs +// +// Attributes: +// - Count: The number of active instances required every `durationSecs` +// - DurationSecs: Minimum time duration a task needs to be `RUNNING` to be treated as active +type CountSlaPolicy struct { + Count int64 `thrift:"count,1" json:"count"` + DurationSecs int64 `thrift:"durationSecs,2" json:"durationSecs"` +} + +func NewCountSlaPolicy() *CountSlaPolicy { + return &CountSlaPolicy{} +} + +func (p *CountSlaPolicy) GetCount() int64 { + return p.Count +} + +func (p *CountSlaPolicy) GetDurationSecs() int64 { + return p.DurationSecs +} +func (p *CountSlaPolicy) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.readField1(iprot); err != nil { + return err + } + case 2: + if err := p.readField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CountSlaPolicy) readField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Count = v + } + return nil +} + +func (p *CountSlaPolicy) readField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DurationSecs = v + } + return nil +} + +func (p *CountSlaPolicy) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CountSlaPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CountSlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("count", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:count: ", p), err) + } + if err := oprot.WriteI64(int64(p.Count)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.count (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:count: ", p), err) + } + return err +} + +func (p *CountSlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("durationSecs", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:durationSecs: ", p), err) + } + if err := oprot.WriteI64(int64(p.DurationSecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.durationSecs (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:durationSecs: ", p), err) + } + return err +} + +func (p *CountSlaPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CountSlaPolicy(%+v)", *p) +} + +// SLA requirements to be delegated to an external coordinator +// +// Attributes: +// - CoordinatorUrl: URL for the coordinator service that needs to be contacted for SLA checks +// - StatusKey: Field in the Coordinator response json indicating if the action is allowed or not +type CoordinatorSlaPolicy struct { + CoordinatorUrl string `thrift:"coordinatorUrl,1" json:"coordinatorUrl"` + StatusKey string `thrift:"statusKey,2" json:"statusKey"` +} + +func NewCoordinatorSlaPolicy() *CoordinatorSlaPolicy { + return &CoordinatorSlaPolicy{} +} + +func (p *CoordinatorSlaPolicy) GetCoordinatorUrl() string { + return p.CoordinatorUrl +} + +func (p *CoordinatorSlaPolicy) GetStatusKey() string { + return p.StatusKey +} +func (p *CoordinatorSlaPolicy) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.readField1(iprot); err != nil { + return err + } + case 2: + if err := p.readField2(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CoordinatorSlaPolicy) readField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.CoordinatorUrl = v + } + return nil +} + +func (p *CoordinatorSlaPolicy) readField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.StatusKey = v + } + return nil +} + +func (p *CoordinatorSlaPolicy) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CoordinatorSlaPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *CoordinatorSlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("coordinatorUrl", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:coordinatorUrl: ", p), err) + } + if err := oprot.WriteString(string(p.CoordinatorUrl)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.coordinatorUrl (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:coordinatorUrl: ", p), err) + } + return err +} + +func (p *CoordinatorSlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("statusKey", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statusKey: ", p), err) + } + if err := oprot.WriteString(string(p.StatusKey)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.statusKey (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statusKey: ", p), err) + } + return err +} + +func (p *CoordinatorSlaPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CoordinatorSlaPolicy(%+v)", *p) +} + +// SLA requirements expressed in one of the many types +// +// Attributes: +// - PercentageSlaPolicy +// - CountSlaPolicy +// - CoordinatorSlaPolicy +type SlaPolicy struct { + PercentageSlaPolicy *PercentageSlaPolicy `thrift:"percentageSlaPolicy,1" json:"percentageSlaPolicy,omitempty"` + CountSlaPolicy *CountSlaPolicy `thrift:"countSlaPolicy,2" json:"countSlaPolicy,omitempty"` + CoordinatorSlaPolicy *CoordinatorSlaPolicy `thrift:"coordinatorSlaPolicy,3" json:"coordinatorSlaPolicy,omitempty"` +} + +func NewSlaPolicy() *SlaPolicy { + return &SlaPolicy{} +} + +var SlaPolicy_PercentageSlaPolicy_DEFAULT *PercentageSlaPolicy + +func (p *SlaPolicy) GetPercentageSlaPolicy() *PercentageSlaPolicy { + if !p.IsSetPercentageSlaPolicy() { + return SlaPolicy_PercentageSlaPolicy_DEFAULT + } + return p.PercentageSlaPolicy +} + +var SlaPolicy_CountSlaPolicy_DEFAULT *CountSlaPolicy + +func (p *SlaPolicy) GetCountSlaPolicy() *CountSlaPolicy { + if !p.IsSetCountSlaPolicy() { + return SlaPolicy_CountSlaPolicy_DEFAULT + } + return p.CountSlaPolicy +} + +var SlaPolicy_CoordinatorSlaPolicy_DEFAULT *CoordinatorSlaPolicy + +func (p *SlaPolicy) GetCoordinatorSlaPolicy() *CoordinatorSlaPolicy { + if !p.IsSetCoordinatorSlaPolicy() { + return SlaPolicy_CoordinatorSlaPolicy_DEFAULT + } + return p.CoordinatorSlaPolicy +} +func (p *SlaPolicy) CountSetFieldsSlaPolicy() int { + count := 0 + if p.IsSetPercentageSlaPolicy() { + count++ + } + if p.IsSetCountSlaPolicy() { + count++ + } + if p.IsSetCoordinatorSlaPolicy() { + count++ + } + return count + +} + +func (p *SlaPolicy) IsSetPercentageSlaPolicy() bool { + return p.PercentageSlaPolicy != nil +} + +func (p *SlaPolicy) IsSetCountSlaPolicy() bool { + return p.CountSlaPolicy != nil +} + +func (p *SlaPolicy) IsSetCoordinatorSlaPolicy() bool { + return p.CoordinatorSlaPolicy != nil +} + +func (p *SlaPolicy) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.readField1(iprot); err != nil { + return err + } + case 2: + if err := p.readField2(iprot); err != nil { + return err + } + case 3: + if err := p.readField3(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SlaPolicy) readField1(iprot thrift.TProtocol) error { + p.PercentageSlaPolicy = &PercentageSlaPolicy{} + if err := p.PercentageSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PercentageSlaPolicy), err) + } + return nil +} + +func (p *SlaPolicy) readField2(iprot thrift.TProtocol) error { + p.CountSlaPolicy = &CountSlaPolicy{} + if err := p.CountSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CountSlaPolicy), err) + } + return nil +} + +func (p *SlaPolicy) readField3(iprot thrift.TProtocol) error { + p.CoordinatorSlaPolicy = &CoordinatorSlaPolicy{} + if err := p.CoordinatorSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CoordinatorSlaPolicy), err) + } + return nil +} + +func (p *SlaPolicy) Write(oprot thrift.TProtocol) error { + if c := p.CountSetFieldsSlaPolicy(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("SlaPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *SlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetPercentageSlaPolicy() { + if err := oprot.WriteFieldBegin("percentageSlaPolicy", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:percentageSlaPolicy: ", p), err) + } + if err := p.PercentageSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PercentageSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:percentageSlaPolicy: ", p), err) + } + } + return err +} + +func (p *SlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCountSlaPolicy() { + if err := oprot.WriteFieldBegin("countSlaPolicy", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:countSlaPolicy: ", p), err) + } + if err := p.CountSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CountSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:countSlaPolicy: ", p), err) + } + } + return err +} + +func (p *SlaPolicy) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetCoordinatorSlaPolicy() { + if err := oprot.WriteFieldBegin("coordinatorSlaPolicy", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:coordinatorSlaPolicy: ", p), err) + } + if err := p.CoordinatorSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CoordinatorSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:coordinatorSlaPolicy: ", p), err) + } + } + return err +} + +func (p *SlaPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SlaPolicy(%+v)", *p) +} + // Description of the tasks contained within a job. // // Attributes: // - Job: Job task belongs to. // - Owner: contains the role component of JobKey // - IsService -// - NumCpus -// - RamMb -// - DiskMb // - Priority // - MaxTaskFailures // - Production: Whether this is a production task, which can preempt. // - Tier: Task tier type. // - Resources: All resources required to run a task. // - Constraints -// - RequestedPorts: a list of named ports this task requests // - MesosFetcherUris: Resources to retrieve with Mesos Fetcher // - TaskLinks: Custom links to include when displaying this task on the scheduler dashboard. Keys are anchor // text, values are URLs. Wildcards are supported for dynamic link crafting based on host, ports, @@ -4342,24 +5075,24 @@ func (p *Resource) String() string { // - ContactEmail // - ExecutorConfig: Executor configuration // - Metadata: Used to display additional details in the UI. +// - PartitionPolicy: Policy for how to deal with task partitions +// - SlaPolicy: SLA requirements to be met during maintenance // - Container: the container the task should use to execute type TaskConfig struct { // unused fields # 1 to 6 - IsService bool `thrift:"isService,7" json:"isService"` - NumCpus float64 `thrift:"numCpus,8" json:"numCpus"` - RamMb int64 `thrift:"ramMb,9" json:"ramMb"` - DiskMb int64 `thrift:"diskMb,10" json:"diskMb"` - Priority int32 `thrift:"priority,11" json:"priority"` + IsService bool `thrift:"isService,7" json:"isService"` + // unused fields # 8 to 10 + Priority int32 `thrift:"priority,11" json:"priority"` // unused field # 12 MaxTaskFailures int32 `thrift:"maxTaskFailures,13" json:"maxTaskFailures"` // unused fields # 14 to 16 Owner *Identity `thrift:"owner,17" json:"owner"` Production *bool `thrift:"production,18" json:"production,omitempty"` // unused field # 19 - Constraints map[*Constraint]bool `thrift:"constraints,20" json:"constraints"` - RequestedPorts map[string]bool `thrift:"requestedPorts,21" json:"requestedPorts"` - TaskLinks map[string]string `thrift:"taskLinks,22" json:"taskLinks,omitempty"` - ContactEmail *string `thrift:"contactEmail,23" json:"contactEmail,omitempty"` + Constraints map[*Constraint]bool `thrift:"constraints,20" json:"constraints"` + // unused field # 21 + TaskLinks map[string]string `thrift:"taskLinks,22" json:"taskLinks,omitempty"` + ContactEmail *string `thrift:"contactEmail,23" json:"contactEmail,omitempty"` // unused field # 24 ExecutorConfig *ExecutorConfig `thrift:"executorConfig,25" json:"executorConfig,omitempty"` // unused field # 26 @@ -4370,6 +5103,8 @@ type TaskConfig struct { // unused field # 31 Resources map[*Resource]bool `thrift:"resources,32" json:"resources"` MesosFetcherUris map[*MesosFetcherURI]bool `thrift:"mesosFetcherUris,33" json:"mesosFetcherUris,omitempty"` + PartitionPolicy *PartitionPolicy `thrift:"partitionPolicy,34" json:"partitionPolicy,omitempty"` + SlaPolicy *SlaPolicy `thrift:"slaPolicy,35" json:"slaPolicy,omitempty"` } func NewTaskConfig() *TaskConfig { @@ -4398,18 +5133,6 @@ func (p *TaskConfig) GetIsService() bool { return p.IsService } -func (p *TaskConfig) GetNumCpus() float64 { - return p.NumCpus -} - -func (p *TaskConfig) GetRamMb() int64 { - return p.RamMb -} - -func (p *TaskConfig) GetDiskMb() int64 { - return p.DiskMb -} - func (p *TaskConfig) GetPriority() int32 { return p.Priority } @@ -4444,10 +5167,6 @@ func (p *TaskConfig) GetConstraints() map[*Constraint]bool { return p.Constraints } -func (p *TaskConfig) GetRequestedPorts() map[string]bool { - return p.RequestedPorts -} - var TaskConfig_MesosFetcherUris_DEFAULT map[*MesosFetcherURI]bool func (p *TaskConfig) GetMesosFetcherUris() map[*MesosFetcherURI]bool { @@ -4484,6 +5203,24 @@ func (p *TaskConfig) GetMetadata() map[*Metadata]bool { return p.Metadata } +var TaskConfig_PartitionPolicy_DEFAULT *PartitionPolicy + +func (p *TaskConfig) GetPartitionPolicy() *PartitionPolicy { + if !p.IsSetPartitionPolicy() { + return TaskConfig_PartitionPolicy_DEFAULT + } + return p.PartitionPolicy +} + +var TaskConfig_SlaPolicy_DEFAULT *SlaPolicy + +func (p *TaskConfig) GetSlaPolicy() *SlaPolicy { + if !p.IsSetSlaPolicy() { + return TaskConfig_SlaPolicy_DEFAULT + } + return p.SlaPolicy +} + var TaskConfig_Container_DEFAULT *Container = &Container{ Mesos: &MesosContainer{}, } @@ -4530,6 +5267,14 @@ func (p *TaskConfig) IsSetMetadata() bool { return p.Metadata != nil } +func (p *TaskConfig) IsSetPartitionPolicy() bool { + return p.PartitionPolicy != nil +} + +func (p *TaskConfig) IsSetSlaPolicy() bool { + return p.SlaPolicy != nil +} + func (p *TaskConfig) IsSetContainer() bool { return p.Container != nil } @@ -4560,18 +5305,6 @@ func (p *TaskConfig) Read(iprot thrift.TProtocol) error { if err := p.readField7(iprot); err != nil { return err } - case 8: - if err := p.readField8(iprot); err != nil { - return err - } - case 9: - if err := p.readField9(iprot); err != nil { - return err - } - case 10: - if err := p.readField10(iprot); err != nil { - return err - } case 11: if err := p.readField11(iprot); err != nil { return err @@ -4596,10 +5329,6 @@ func (p *TaskConfig) Read(iprot thrift.TProtocol) error { if err := p.readField20(iprot); err != nil { return err } - case 21: - if err := p.readField21(iprot); err != nil { - return err - } case 33: if err := p.readField33(iprot); err != nil { return err @@ -4620,6 +5349,14 @@ func (p *TaskConfig) Read(iprot thrift.TProtocol) error { if err := p.readField27(iprot); err != nil { return err } + case 34: + if err := p.readField34(iprot); err != nil { + return err + } + case 35: + if err := p.readField35(iprot); err != nil { + return err + } case 29: if err := p.readField29(iprot); err != nil { return err @@ -4664,33 +5401,6 @@ func (p *TaskConfig) readField7(iprot thrift.TProtocol) error { return nil } -func (p *TaskConfig) readField8(iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(); err != nil { - return thrift.PrependError("error reading field 8: ", err) - } else { - p.NumCpus = v - } - return nil -} - -func (p *TaskConfig) readField9(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 9: ", err) - } else { - p.RamMb = v - } - return nil -} - -func (p *TaskConfig) readField10(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 10: ", err) - } else { - p.DiskMb = v - } - return nil -} - func (p *TaskConfig) readField11(iprot thrift.TProtocol) error { if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 11: ", err) @@ -4767,28 +5477,6 @@ func (p *TaskConfig) readField20(iprot thrift.TProtocol) error { return nil } -func (p *TaskConfig) readField21(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadSetBegin() - if err != nil { - return thrift.PrependError("error reading set begin: ", err) - } - tSet := make(map[string]bool, size) - p.RequestedPorts = tSet - for i := 0; i < size; i++ { - var _elem7 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem7 = v - } - p.RequestedPorts[_elem7] = true - } - if err := iprot.ReadSetEnd(); err != nil { - return thrift.PrependError("error reading set end: ", err) - } - return nil -} - func (p *TaskConfig) readField33(iprot thrift.TProtocol) error { _, size, err := iprot.ReadSetBegin() if err != nil { @@ -4797,11 +5485,11 @@ func (p *TaskConfig) readField33(iprot thrift.TProtocol) error { tSet := make(map[*MesosFetcherURI]bool, size) p.MesosFetcherUris = tSet for i := 0; i < size; i++ { - _elem8 := &MesosFetcherURI{} - if err := _elem8.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + _elem7 := &MesosFetcherURI{} + if err := _elem7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) } - p.MesosFetcherUris[_elem8] = true + p.MesosFetcherUris[_elem7] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -4817,19 +5505,19 @@ func (p *TaskConfig) readField22(iprot thrift.TProtocol) error { tMap := make(map[string]string, size) p.TaskLinks = tMap for i := 0; i < size; i++ { - var _key9 string + var _key8 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key9 = v + _key8 = v } - var _val10 string + var _val9 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val10 = v + _val9 = v } - p.TaskLinks[_key9] = _val10 + p.TaskLinks[_key8] = _val9 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -4862,11 +5550,11 @@ func (p *TaskConfig) readField27(iprot thrift.TProtocol) error { tSet := make(map[*Metadata]bool, size) p.Metadata = tSet for i := 0; i < size; i++ { - _elem11 := &Metadata{} - if err := _elem11.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + _elem10 := &Metadata{} + if err := _elem10.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) } - p.Metadata[_elem11] = true + p.Metadata[_elem10] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -4874,6 +5562,22 @@ func (p *TaskConfig) readField27(iprot thrift.TProtocol) error { return nil } +func (p *TaskConfig) readField34(iprot thrift.TProtocol) error { + p.PartitionPolicy = &PartitionPolicy{} + if err := p.PartitionPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PartitionPolicy), err) + } + return nil +} + +func (p *TaskConfig) readField35(iprot thrift.TProtocol) error { + p.SlaPolicy = &SlaPolicy{} + if err := p.SlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SlaPolicy), err) + } + return nil +} + func (p *TaskConfig) readField29(iprot thrift.TProtocol) error { p.Container = &Container{} if err := p.Container.Read(iprot); err != nil { @@ -4889,15 +5593,6 @@ func (p *TaskConfig) Write(oprot thrift.TProtocol) error { if err := p.writeField7(oprot); err != nil { return err } - if err := p.writeField8(oprot); err != nil { - return err - } - if err := p.writeField9(oprot); err != nil { - return err - } - if err := p.writeField10(oprot); err != nil { - return err - } if err := p.writeField11(oprot); err != nil { return err } @@ -4913,9 +5608,6 @@ func (p *TaskConfig) Write(oprot thrift.TProtocol) error { if err := p.writeField20(oprot); err != nil { return err } - if err := p.writeField21(oprot); err != nil { - return err - } if err := p.writeField22(oprot); err != nil { return err } @@ -4943,6 +5635,12 @@ func (p *TaskConfig) Write(oprot thrift.TProtocol) error { if err := p.writeField33(oprot); err != nil { return err } + if err := p.writeField34(oprot); err != nil { + return err + } + if err := p.writeField35(oprot); err != nil { + return err + } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -4965,45 +5663,6 @@ func (p *TaskConfig) writeField7(oprot thrift.TProtocol) (err error) { return err } -func (p *TaskConfig) writeField8(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("numCpus", thrift.DOUBLE, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:numCpus: ", p), err) - } - if err := oprot.WriteDouble(float64(p.NumCpus)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.numCpus (8) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:numCpus: ", p), err) - } - return err -} - -func (p *TaskConfig) writeField9(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("ramMb", thrift.I64, 9); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:ramMb: ", p), err) - } - if err := oprot.WriteI64(int64(p.RamMb)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ramMb (9) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 9:ramMb: ", p), err) - } - return err -} - -func (p *TaskConfig) writeField10(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("diskMb", thrift.I64, 10); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:diskMb: ", p), err) - } - if err := oprot.WriteI64(int64(p.DiskMb)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.diskMb (10) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 10:diskMb: ", p), err) - } - return err -} - func (p *TaskConfig) writeField11(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("priority", thrift.I32, 11); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:priority: ", p), err) @@ -5079,27 +5738,6 @@ func (p *TaskConfig) writeField20(oprot thrift.TProtocol) (err error) { return err } -func (p *TaskConfig) writeField21(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("requestedPorts", thrift.SET, 21); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 21:requestedPorts: ", p), err) - } - if err := oprot.WriteSetBegin(thrift.STRING, len(p.RequestedPorts)); err != nil { - return thrift.PrependError("error writing set begin: ", err) - } - for v, _ := range p.RequestedPorts { - if err := oprot.WriteString(string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteSetEnd(); err != nil { - return thrift.PrependError("error writing set end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 21:requestedPorts: ", p), err) - } - return err -} - func (p *TaskConfig) writeField22(oprot thrift.TProtocol) (err error) { if p.IsSetTaskLinks() { if err := oprot.WriteFieldBegin("taskLinks", thrift.MAP, 22); err != nil { @@ -5264,6 +5902,36 @@ func (p *TaskConfig) writeField33(oprot thrift.TProtocol) (err error) { return err } +func (p *TaskConfig) writeField34(oprot thrift.TProtocol) (err error) { + if p.IsSetPartitionPolicy() { + if err := oprot.WriteFieldBegin("partitionPolicy", thrift.STRUCT, 34); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 34:partitionPolicy: ", p), err) + } + if err := p.PartitionPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PartitionPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 34:partitionPolicy: ", p), err) + } + } + return err +} + +func (p *TaskConfig) writeField35(oprot thrift.TProtocol) (err error) { + if p.IsSetSlaPolicy() { + if err := oprot.WriteFieldBegin("slaPolicy", thrift.STRUCT, 35); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 35:slaPolicy: ", p), err) + } + if err := p.SlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 35:slaPolicy: ", p), err) + } + } + return err +} + func (p *TaskConfig) String() string { if p == nil { return "" @@ -5272,14 +5940,9 @@ func (p *TaskConfig) String() string { } // Attributes: -// - NumCpus: Number of CPU cores allotted. -// - RamMb: Megabytes of RAM allotted. -// - DiskMb: Megabytes of disk space allotted. // - Resources: Aggregated resource values. type ResourceAggregate struct { - NumCpus float64 `thrift:"numCpus,1" json:"numCpus"` - RamMb int64 `thrift:"ramMb,2" json:"ramMb"` - DiskMb int64 `thrift:"diskMb,3" json:"diskMb"` + // unused fields # 1 to 3 Resources map[*Resource]bool `thrift:"resources,4" json:"resources"` } @@ -5287,18 +5950,6 @@ func NewResourceAggregate() *ResourceAggregate { return &ResourceAggregate{} } -func (p *ResourceAggregate) GetNumCpus() float64 { - return p.NumCpus -} - -func (p *ResourceAggregate) GetRamMb() int64 { - return p.RamMb -} - -func (p *ResourceAggregate) GetDiskMb() int64 { - return p.DiskMb -} - func (p *ResourceAggregate) GetResources() map[*Resource]bool { return p.Resources } @@ -5316,18 +5967,6 @@ func (p *ResourceAggregate) Read(iprot thrift.TProtocol) error { break } switch fieldId { - case 1: - if err := p.readField1(iprot); err != nil { - return err - } - case 2: - if err := p.readField2(iprot); err != nil { - return err - } - case 3: - if err := p.readField3(iprot); err != nil { - return err - } case 4: if err := p.readField4(iprot); err != nil { return err @@ -5347,33 +5986,6 @@ func (p *ResourceAggregate) Read(iprot thrift.TProtocol) error { return nil } -func (p *ResourceAggregate) readField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.NumCpus = v - } - return nil -} - -func (p *ResourceAggregate) readField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.RamMb = v - } - return nil -} - -func (p *ResourceAggregate) readField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.DiskMb = v - } - return nil -} - func (p *ResourceAggregate) readField4(iprot thrift.TProtocol) error { _, size, err := iprot.ReadSetBegin() if err != nil { @@ -5382,11 +5994,11 @@ func (p *ResourceAggregate) readField4(iprot thrift.TProtocol) error { tSet := make(map[*Resource]bool, size) p.Resources = tSet for i := 0; i < size; i++ { - _elem12 := &Resource{} - if err := _elem12.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + _elem11 := &Resource{} + if err := _elem11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) } - p.Resources[_elem12] = true + p.Resources[_elem11] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -5398,15 +6010,6 @@ func (p *ResourceAggregate) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("ResourceAggregate"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { - return err - } - if err := p.writeField2(oprot); err != nil { - return err - } - if err := p.writeField3(oprot); err != nil { - return err - } if err := p.writeField4(oprot); err != nil { return err } @@ -5419,45 +6022,6 @@ func (p *ResourceAggregate) Write(oprot thrift.TProtocol) error { return nil } -func (p *ResourceAggregate) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("numCpus", thrift.DOUBLE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:numCpus: ", p), err) - } - if err := oprot.WriteDouble(float64(p.NumCpus)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.numCpus (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:numCpus: ", p), err) - } - return err -} - -func (p *ResourceAggregate) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("ramMb", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ramMb: ", p), err) - } - if err := oprot.WriteI64(int64(p.RamMb)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ramMb (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ramMb: ", p), err) - } - return err -} - -func (p *ResourceAggregate) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("diskMb", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:diskMb: ", p), err) - } - if err := oprot.WriteI64(int64(p.DiskMb)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.diskMb (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:diskMb: ", p), err) - } - return err -} - func (p *ResourceAggregate) writeField4(oprot thrift.TProtocol) (err error) { if err := oprot.WriteFieldBegin("resources", thrift.SET, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:resources: ", p), err) @@ -6387,11 +6951,11 @@ func (p *ConfigGroup) readField3(iprot thrift.TProtocol) error { tSet := make(map[*Range]bool, size) p.Instances = tSet for i := 0; i < size; i++ { - _elem13 := &Range{} - if err := _elem13.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) + _elem12 := &Range{} + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) } - p.Instances[_elem13] = true + p.Instances[_elem12] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -6540,11 +7104,11 @@ func (p *ConfigSummary) readField2(iprot thrift.TProtocol) error { tSet := make(map[*ConfigGroup]bool, size) p.Groups = tSet for i := 0; i < size; i++ { - _elem14 := &ConfigGroup{} - if err := _elem14.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + _elem13 := &ConfigGroup{} + if err := _elem13.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) } - p.Groups[_elem14] = true + p.Groups[_elem13] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -7365,19 +7929,19 @@ func (p *AssignedTask) readField5(iprot thrift.TProtocol) error { tMap := make(map[string]int32, size) p.AssignedPorts = tMap for i := 0; i < size; i++ { - var _key15 string + var _key14 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key15 = v + _key14 = v } - var _val16 int32 + var _val15 int32 if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val16 = v + _val15 = v } - p.AssignedPorts[_key15] = _val16 + p.AssignedPorts[_key14] = _val15 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -7528,15 +8092,17 @@ func (p *AssignedTask) String() string { // - Status: The current status of this task. // - FailureCount: The number of failures that this task has accumulated over the multi-generational history of // this task. +// - TimesPartitioned: The number of partitions this task has accumulated over its lifetime. // - TaskEvents: State change history for this task. // - AncestorId: The task ID of the previous generation of this task. When a task is automatically rescheduled, // a copy of the task is created and ancestor ID of the previous task's task ID. type ScheduledTask struct { - AssignedTask *AssignedTask `thrift:"assignedTask,1" json:"assignedTask"` - Status ScheduleStatus `thrift:"status,2" json:"status"` - FailureCount int32 `thrift:"failureCount,3" json:"failureCount"` - TaskEvents []*TaskEvent `thrift:"taskEvents,4" json:"taskEvents"` - AncestorId string `thrift:"ancestorId,5" json:"ancestorId"` + AssignedTask *AssignedTask `thrift:"assignedTask,1" json:"assignedTask"` + Status ScheduleStatus `thrift:"status,2" json:"status"` + FailureCount int32 `thrift:"failureCount,3" json:"failureCount"` + TaskEvents []*TaskEvent `thrift:"taskEvents,4" json:"taskEvents"` + AncestorId string `thrift:"ancestorId,5" json:"ancestorId"` + TimesPartitioned int32 `thrift:"timesPartitioned,6" json:"timesPartitioned"` } func NewScheduledTask() *ScheduledTask { @@ -7560,6 +8126,10 @@ func (p *ScheduledTask) GetFailureCount() int32 { return p.FailureCount } +func (p *ScheduledTask) GetTimesPartitioned() int32 { + return p.TimesPartitioned +} + func (p *ScheduledTask) GetTaskEvents() []*TaskEvent { return p.TaskEvents } @@ -7597,6 +8167,10 @@ func (p *ScheduledTask) Read(iprot thrift.TProtocol) error { if err := p.readField3(iprot); err != nil { return err } + case 6: + if err := p.readField6(iprot); err != nil { + return err + } case 4: if err := p.readField4(iprot); err != nil { return err @@ -7647,6 +8221,15 @@ func (p *ScheduledTask) readField3(iprot thrift.TProtocol) error { return nil } +func (p *ScheduledTask) readField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.TimesPartitioned = v + } + return nil +} + func (p *ScheduledTask) readField4(iprot thrift.TProtocol) error { _, size, err := iprot.ReadListBegin() if err != nil { @@ -7655,11 +8238,11 @@ func (p *ScheduledTask) readField4(iprot thrift.TProtocol) error { tSlice := make([]*TaskEvent, 0, size) p.TaskEvents = tSlice for i := 0; i < size; i++ { - _elem17 := &TaskEvent{} - if err := _elem17.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + _elem16 := &TaskEvent{} + if err := _elem16.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) } - p.TaskEvents = append(p.TaskEvents, _elem17) + p.TaskEvents = append(p.TaskEvents, _elem16) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7695,6 +8278,9 @@ func (p *ScheduledTask) Write(oprot thrift.TProtocol) error { if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { + return err + } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -7777,6 +8363,19 @@ func (p *ScheduledTask) writeField5(oprot thrift.TProtocol) (err error) { return err } +func (p *ScheduledTask) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("timesPartitioned", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:timesPartitioned: ", p), err) + } + if err := oprot.WriteI32(int32(p.TimesPartitioned)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timesPartitioned (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:timesPartitioned: ", p), err) + } + return err +} + func (p *ScheduledTask) String() string { if p == nil { return "" @@ -7838,11 +8437,11 @@ func (p *ScheduleStatusResult_) readField1(iprot thrift.TProtocol) error { tSlice := make([]*ScheduledTask, 0, size) p.Tasks = tSlice for i := 0; i < size; i++ { - _elem18 := &ScheduledTask{} - if err := _elem18.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) + _elem17 := &ScheduledTask{} + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) } - p.Tasks = append(p.Tasks, _elem18) + p.Tasks = append(p.Tasks, _elem17) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7948,11 +8547,11 @@ func (p *GetJobsResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*JobConfiguration]bool, size) p.Configs = tSet for i := 0; i < size; i++ { - _elem19 := &JobConfiguration{} - if err := _elem19.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + _elem18 := &JobConfiguration{} + if err := _elem18.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) } - p.Configs[_elem19] = true + p.Configs[_elem18] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -8257,13 +8856,13 @@ func (p *TaskQuery) readField4(iprot thrift.TProtocol) error { tSet := make(map[string]bool, size) p.TaskIds = tSet for i := 0; i < size; i++ { - var _elem20 string + var _elem19 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem20 = v + _elem19 = v } - p.TaskIds[_elem20] = true + p.TaskIds[_elem19] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -8279,14 +8878,14 @@ func (p *TaskQuery) readField5(iprot thrift.TProtocol) error { tSet := make(map[ScheduleStatus]bool, size) p.Statuses = tSet for i := 0; i < size; i++ { - var _elem21 ScheduleStatus + var _elem20 ScheduleStatus if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := ScheduleStatus(v) - _elem21 = temp + _elem20 = temp } - p.Statuses[_elem21] = true + p.Statuses[_elem20] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -8302,13 +8901,13 @@ func (p *TaskQuery) readField7(iprot thrift.TProtocol) error { tSet := make(map[int32]bool, size) p.InstanceIds = tSet for i := 0; i < size; i++ { - var _elem22 int32 + var _elem21 int32 if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem22 = v + _elem21 = v } - p.InstanceIds[_elem22] = true + p.InstanceIds[_elem21] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -8324,13 +8923,13 @@ func (p *TaskQuery) readField10(iprot thrift.TProtocol) error { tSet := make(map[string]bool, size) p.SlaveHosts = tSet for i := 0; i < size; i++ { - var _elem23 string + var _elem22 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem23 = v + _elem22 = v } - p.SlaveHosts[_elem23] = true + p.SlaveHosts[_elem22] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -8346,11 +8945,11 @@ func (p *TaskQuery) readField11(iprot thrift.TProtocol) error { tSet := make(map[*JobKey]bool, size) p.JobKeys = tSet for i := 0; i < size; i++ { - _elem24 := &JobKey{} - if err := _elem24.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) + _elem23 := &JobKey{} + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) } - p.JobKeys[_elem24] = true + p.JobKeys[_elem23] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -8958,13 +9557,13 @@ func (p *Hosts) readField1(iprot thrift.TProtocol) error { tSet := make(map[string]bool, size) p.HostNames = tSet for i := 0; i < size; i++ { - var _elem25 string + var _elem24 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem25 = v + _elem24 = v } - p.HostNames[_elem25] = true + p.HostNames[_elem24] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -9293,6 +9892,8 @@ func (p *JobUpdateKey) String() string { // update to make progress. If no pulses received within specified interval the update will // block. A blocked update is unable to continue but retains its current status. It may only get // unblocked by a fresh pulseJobUpdate call. +// - SlaAware: If true, updates will obey the SLA requirements of the tasks being updated. If the SLA policy +// differs between the old and new task configurations, updates will use the newest configuration. type JobUpdateSettings struct { UpdateGroupSize int32 `thrift:"updateGroupSize,1" json:"updateGroupSize"` MaxPerInstanceFailures int32 `thrift:"maxPerInstanceFailures,2" json:"maxPerInstanceFailures"` @@ -9303,6 +9904,7 @@ type JobUpdateSettings struct { UpdateOnlyTheseInstances map[*Range]bool `thrift:"updateOnlyTheseInstances,7" json:"updateOnlyTheseInstances"` WaitForBatchCompletion bool `thrift:"waitForBatchCompletion,8" json:"waitForBatchCompletion"` BlockIfNoPulsesAfterMs *int32 `thrift:"blockIfNoPulsesAfterMs,9" json:"blockIfNoPulsesAfterMs,omitempty"` + SlaAware *bool `thrift:"slaAware,10" json:"slaAware,omitempty"` } func NewJobUpdateSettings() *JobUpdateSettings { @@ -9345,10 +9947,23 @@ func (p *JobUpdateSettings) GetBlockIfNoPulsesAfterMs() int32 { } return *p.BlockIfNoPulsesAfterMs } + +var JobUpdateSettings_SlaAware_DEFAULT bool + +func (p *JobUpdateSettings) GetSlaAware() bool { + if !p.IsSetSlaAware() { + return JobUpdateSettings_SlaAware_DEFAULT + } + return *p.SlaAware +} func (p *JobUpdateSettings) IsSetBlockIfNoPulsesAfterMs() bool { return p.BlockIfNoPulsesAfterMs != nil } +func (p *JobUpdateSettings) IsSetSlaAware() bool { + return p.SlaAware != nil +} + func (p *JobUpdateSettings) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -9395,6 +10010,10 @@ func (p *JobUpdateSettings) Read(iprot thrift.TProtocol) error { if err := p.readField9(iprot); err != nil { return err } + case 10: + if err := p.readField10(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -9463,11 +10082,11 @@ func (p *JobUpdateSettings) readField7(iprot thrift.TProtocol) error { tSet := make(map[*Range]bool, size) p.UpdateOnlyTheseInstances = tSet for i := 0; i < size; i++ { - _elem26 := &Range{} - if err := _elem26.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) + _elem25 := &Range{} + if err := _elem25.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) } - p.UpdateOnlyTheseInstances[_elem26] = true + p.UpdateOnlyTheseInstances[_elem25] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -9493,6 +10112,15 @@ func (p *JobUpdateSettings) readField9(iprot thrift.TProtocol) error { return nil } +func (p *JobUpdateSettings) readField10(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) + } else { + p.SlaAware = &v + } + return nil +} + func (p *JobUpdateSettings) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("JobUpdateSettings"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) @@ -9521,6 +10149,9 @@ func (p *JobUpdateSettings) Write(oprot thrift.TProtocol) error { if err := p.writeField9(oprot); err != nil { return err } + if err := p.writeField10(oprot); err != nil { + return err + } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -9644,6 +10275,21 @@ func (p *JobUpdateSettings) writeField9(oprot thrift.TProtocol) (err error) { return err } +func (p *JobUpdateSettings) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetSlaAware() { + if err := oprot.WriteFieldBegin("slaAware", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:slaAware: ", p), err) + } + if err := oprot.WriteBool(bool(*p.SlaAware)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.slaAware (10) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:slaAware: ", p), err) + } + } + return err +} + func (p *JobUpdateSettings) String() string { if p == nil { return "" @@ -9879,10 +10525,12 @@ func (p *JobUpdateEvent) String() string { // - InstanceId: Job instance ID. // - TimestampMs: Epoch timestamp in milliseconds. // - Action: Job update action taken on the instance. +// - Message: Optional message explaining the instance update event. type JobInstanceUpdateEvent struct { InstanceId int32 `thrift:"instanceId,1" json:"instanceId"` TimestampMs int64 `thrift:"timestampMs,2" json:"timestampMs"` Action JobUpdateAction `thrift:"action,3" json:"action"` + Message *string `thrift:"message,4" json:"message,omitempty"` } func NewJobInstanceUpdateEvent() *JobInstanceUpdateEvent { @@ -9900,6 +10548,19 @@ func (p *JobInstanceUpdateEvent) GetTimestampMs() int64 { func (p *JobInstanceUpdateEvent) GetAction() JobUpdateAction { return p.Action } + +var JobInstanceUpdateEvent_Message_DEFAULT string + +func (p *JobInstanceUpdateEvent) GetMessage() string { + if !p.IsSetMessage() { + return JobInstanceUpdateEvent_Message_DEFAULT + } + return *p.Message +} +func (p *JobInstanceUpdateEvent) IsSetMessage() bool { + return p.Message != nil +} + func (p *JobInstanceUpdateEvent) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -9926,6 +10587,10 @@ func (p *JobInstanceUpdateEvent) Read(iprot thrift.TProtocol) error { if err := p.readField3(iprot); err != nil { return err } + case 4: + if err := p.readField4(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -9969,6 +10634,15 @@ func (p *JobInstanceUpdateEvent) readField3(iprot thrift.TProtocol) error { return nil } +func (p *JobInstanceUpdateEvent) readField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Message = &v + } + return nil +} + func (p *JobInstanceUpdateEvent) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("JobInstanceUpdateEvent"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) @@ -9982,6 +10656,9 @@ func (p *JobInstanceUpdateEvent) Write(oprot thrift.TProtocol) error { if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { + return err + } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -10030,6 +10707,21 @@ func (p *JobInstanceUpdateEvent) writeField3(oprot thrift.TProtocol) (err error) return err } +func (p *JobInstanceUpdateEvent) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetMessage() { + if err := oprot.WriteFieldBegin("message", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:message: ", p), err) + } + if err := oprot.WriteString(string(*p.Message)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.message (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:message: ", p), err) + } + } + return err +} + func (p *JobInstanceUpdateEvent) String() string { if p == nil { return "" @@ -10120,11 +10812,11 @@ func (p *InstanceTaskConfig) readField2(iprot thrift.TProtocol) error { tSet := make(map[*Range]bool, size) p.Instances = tSet for i := 0; i < size; i++ { - _elem27 := &Range{} - if err := _elem27.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + _elem26 := &Range{} + if err := _elem26.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) } - p.Instances[_elem27] = true + p.Instances[_elem26] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -10492,11 +11184,11 @@ func (p *JobUpdateSummary) readField6(iprot thrift.TProtocol) error { tSet := make(map[*Metadata]bool, size) p.Metadata = tSet for i := 0; i < size; i++ { - _elem28 := &Metadata{} - if err := _elem28.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) + _elem27 := &Metadata{} + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) } - p.Metadata[_elem28] = true + p.Metadata[_elem27] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -10692,11 +11384,11 @@ func (p *JobUpdateInstructions) readField1(iprot thrift.TProtocol) error { tSet := make(map[*InstanceTaskConfig]bool, size) p.InitialState = tSet for i := 0; i < size; i++ { - _elem29 := &InstanceTaskConfig{} - if err := _elem29.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + _elem28 := &InstanceTaskConfig{} + if err := _elem28.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) } - p.InitialState[_elem29] = true + p.InitialState[_elem28] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -11031,11 +11723,11 @@ func (p *JobUpdateDetails) readField2(iprot thrift.TProtocol) error { tSlice := make([]*JobUpdateEvent, 0, size) p.UpdateEvents = tSlice for i := 0; i < size; i++ { - _elem30 := &JobUpdateEvent{} - if err := _elem30.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + _elem29 := &JobUpdateEvent{} + if err := _elem29.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) } - p.UpdateEvents = append(p.UpdateEvents, _elem30) + p.UpdateEvents = append(p.UpdateEvents, _elem29) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11051,11 +11743,11 @@ func (p *JobUpdateDetails) readField3(iprot thrift.TProtocol) error { tSlice := make([]*JobInstanceUpdateEvent, 0, size) p.InstanceEvents = tSlice for i := 0; i < size; i++ { - _elem31 := &JobInstanceUpdateEvent{} - if err := _elem31.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) + _elem30 := &JobInstanceUpdateEvent{} + if err := _elem30.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) } - p.InstanceEvents = append(p.InstanceEvents, _elem31) + p.InstanceEvents = append(p.InstanceEvents, _elem30) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11282,11 +11974,11 @@ func (p *JobUpdateRequest) readField4(iprot thrift.TProtocol) error { tSet := make(map[*Metadata]bool, size) p.Metadata = tSet for i := 0; i < size; i++ { - _elem32 := &Metadata{} - if err := _elem32.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) + _elem31 := &Metadata{} + if err := _elem31.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) } - p.Metadata[_elem32] = true + p.Metadata[_elem31] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -11582,14 +12274,14 @@ func (p *JobUpdateQuery) readField5(iprot thrift.TProtocol) error { tSet := make(map[JobUpdateStatus]bool, size) p.UpdateStatuses = tSet for i := 0; i < size; i++ { - var _elem33 JobUpdateStatus + var _elem32 JobUpdateStatus if v, err := iprot.ReadI32(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := JobUpdateStatus(v) - _elem33 = temp + _elem32 = temp } - p.UpdateStatuses[_elem33] = true + p.UpdateStatuses[_elem32] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -11765,6 +12457,210 @@ func (p *JobUpdateQuery) String() string { return fmt.Sprintf("JobUpdateQuery(%+v)", *p) } +// Attributes: +// - Host +// - DefaultSlaPolicy +// - TimeoutSecs +// - CreatedTimestampMs +type HostMaintenanceRequest struct { + Host string `thrift:"host,1" json:"host"` + DefaultSlaPolicy *SlaPolicy `thrift:"defaultSlaPolicy,2" json:"defaultSlaPolicy"` + TimeoutSecs int64 `thrift:"timeoutSecs,3" json:"timeoutSecs"` + CreatedTimestampMs int64 `thrift:"createdTimestampMs,4" json:"createdTimestampMs"` +} + +func NewHostMaintenanceRequest() *HostMaintenanceRequest { + return &HostMaintenanceRequest{} +} + +func (p *HostMaintenanceRequest) GetHost() string { + return p.Host +} + +var HostMaintenanceRequest_DefaultSlaPolicy_DEFAULT *SlaPolicy + +func (p *HostMaintenanceRequest) GetDefaultSlaPolicy() *SlaPolicy { + if !p.IsSetDefaultSlaPolicy() { + return HostMaintenanceRequest_DefaultSlaPolicy_DEFAULT + } + return p.DefaultSlaPolicy +} + +func (p *HostMaintenanceRequest) GetTimeoutSecs() int64 { + return p.TimeoutSecs +} + +func (p *HostMaintenanceRequest) GetCreatedTimestampMs() int64 { + return p.CreatedTimestampMs +} +func (p *HostMaintenanceRequest) IsSetDefaultSlaPolicy() bool { + return p.DefaultSlaPolicy != nil +} + +func (p *HostMaintenanceRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if err := p.readField1(iprot); err != nil { + return err + } + case 2: + if err := p.readField2(iprot); err != nil { + return err + } + case 3: + if err := p.readField3(iprot); err != nil { + return err + } + case 4: + if err := p.readField4(iprot); err != nil { + return err + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HostMaintenanceRequest) readField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Host = v + } + return nil +} + +func (p *HostMaintenanceRequest) readField2(iprot thrift.TProtocol) error { + p.DefaultSlaPolicy = &SlaPolicy{} + if err := p.DefaultSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DefaultSlaPolicy), err) + } + return nil +} + +func (p *HostMaintenanceRequest) readField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TimeoutSecs = v + } + return nil +} + +func (p *HostMaintenanceRequest) readField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.CreatedTimestampMs = v + } + return nil +} + +func (p *HostMaintenanceRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("HostMaintenanceRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if err := p.writeField1(oprot); err != nil { + return err + } + if err := p.writeField2(oprot); err != nil { + return err + } + if err := p.writeField3(oprot); err != nil { + return err + } + if err := p.writeField4(oprot); err != nil { + return err + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil +} + +func (p *HostMaintenanceRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("host", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) + } + if err := oprot.WriteString(string(p.Host)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) + } + return err +} + +func (p *HostMaintenanceRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("defaultSlaPolicy", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultSlaPolicy: ", p), err) + } + if err := p.DefaultSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DefaultSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultSlaPolicy: ", p), err) + } + return err +} + +func (p *HostMaintenanceRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("timeoutSecs", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:timeoutSecs: ", p), err) + } + if err := oprot.WriteI64(int64(p.TimeoutSecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timeoutSecs (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:timeoutSecs: ", p), err) + } + return err +} + +func (p *HostMaintenanceRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("createdTimestampMs", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:createdTimestampMs: ", p), err) + } + if err := oprot.WriteI64(int64(p.CreatedTimestampMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.createdTimestampMs (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:createdTimestampMs: ", p), err) + } + return err +} + +func (p *HostMaintenanceRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HostMaintenanceRequest(%+v)", *p) +} + // Attributes: // - Backups type ListBackupsResult_ struct { @@ -11819,13 +12715,13 @@ func (p *ListBackupsResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[string]bool, size) p.Backups = tSet for i := 0; i < size; i++ { - var _elem34 string + var _elem33 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem34 = v + _elem33 = v } - p.Backups[_elem34] = true + p.Backups[_elem33] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -11931,11 +12827,11 @@ func (p *StartMaintenanceResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*HostStatus]bool, size) p.Statuses = tSet for i := 0; i < size; i++ { - _elem35 := &HostStatus{} - if err := _elem35.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) + _elem34 := &HostStatus{} + if err := _elem34.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem34), err) } - p.Statuses[_elem35] = true + p.Statuses[_elem34] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -12041,11 +12937,11 @@ func (p *DrainHostsResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*HostStatus]bool, size) p.Statuses = tSet for i := 0; i < size; i++ { - _elem36 := &HostStatus{} - if err := _elem36.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) + _elem35 := &HostStatus{} + if err := _elem35.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) } - p.Statuses[_elem36] = true + p.Statuses[_elem35] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -12151,11 +13047,11 @@ func (p *QueryRecoveryResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*ScheduledTask]bool, size) p.Tasks = tSet for i := 0; i < size; i++ { - _elem37 := &ScheduledTask{} - if err := _elem37.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) + _elem36 := &ScheduledTask{} + if err := _elem36.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) } - p.Tasks[_elem37] = true + p.Tasks[_elem36] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -12261,11 +13157,11 @@ func (p *MaintenanceStatusResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*HostStatus]bool, size) p.Statuses = tSet for i := 0; i < size; i++ { - _elem38 := &HostStatus{} - if err := _elem38.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem38), err) + _elem37 := &HostStatus{} + if err := _elem37.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) } - p.Statuses[_elem38] = true + p.Statuses[_elem37] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -12371,11 +13267,11 @@ func (p *EndMaintenanceResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*HostStatus]bool, size) p.Statuses = tSet for i := 0; i < size; i++ { - _elem39 := &HostStatus{} - if err := _elem39.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem39), err) + _elem38 := &HostStatus{} + if err := _elem38.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem38), err) } - p.Statuses[_elem39] = true + p.Statuses[_elem38] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -12481,11 +13377,11 @@ func (p *RoleSummaryResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*RoleSummary]bool, size) p.Summaries = tSet for i := 0; i < size; i++ { - _elem40 := &RoleSummary{} - if err := _elem40.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem40), err) + _elem39 := &RoleSummary{} + if err := _elem39.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem39), err) } - p.Summaries[_elem40] = true + p.Summaries[_elem39] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -12591,11 +13487,11 @@ func (p *JobSummaryResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*JobSummary]bool, size) p.Summaries = tSet for i := 0; i < size; i++ { - _elem41 := &JobSummary{} - if err := _elem41.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) + _elem40 := &JobSummary{} + if err := _elem40.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem40), err) } - p.Summaries[_elem41] = true + p.Summaries[_elem40] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -12800,11 +13696,11 @@ func (p *GetPendingReasonResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*PendingReason]bool, size) p.Reasons = tSet for i := 0; i < size; i++ { - _elem42 := &PendingReason{} - if err := _elem42.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem42), err) + _elem41 := &PendingReason{} + if err := _elem41.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) } - p.Reasons[_elem42] = true + p.Reasons[_elem41] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -13058,11 +13954,11 @@ func (p *GetJobUpdateSummariesResult_) readField1(iprot thrift.TProtocol) error tSlice := make([]*JobUpdateSummary, 0, size) p.UpdateSummaries = tSlice for i := 0; i < size; i++ { - _elem43 := &JobUpdateSummary{} - if err := _elem43.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) + _elem42 := &JobUpdateSummary{} + if err := _elem42.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem42), err) } - p.UpdateSummaries = append(p.UpdateSummaries, _elem43) + p.UpdateSummaries = append(p.UpdateSummaries, _elem42) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -13197,11 +14093,11 @@ func (p *GetJobUpdateDetailsResult_) readField2(iprot thrift.TProtocol) error { tSlice := make([]*JobUpdateDetails, 0, size) p.DetailsList = tSlice for i := 0; i < size; i++ { - _elem44 := &JobUpdateDetails{} - if err := _elem44.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem44), err) + _elem43 := &JobUpdateDetails{} + if err := _elem43.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) } - p.DetailsList = append(p.DetailsList, _elem44) + p.DetailsList = append(p.DetailsList, _elem43) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -13447,11 +14343,11 @@ func (p *GetJobUpdateDiffResult_) readField1(iprot thrift.TProtocol) error { tSet := make(map[*ConfigGroup]bool, size) p.Add = tSet for i := 0; i < size; i++ { - _elem45 := &ConfigGroup{} - if err := _elem45.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) + _elem44 := &ConfigGroup{} + if err := _elem44.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem44), err) } - p.Add[_elem45] = true + p.Add[_elem44] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -13467,11 +14363,11 @@ func (p *GetJobUpdateDiffResult_) readField2(iprot thrift.TProtocol) error { tSet := make(map[*ConfigGroup]bool, size) p.Remove = tSet for i := 0; i < size; i++ { - _elem46 := &ConfigGroup{} - if err := _elem46.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + _elem45 := &ConfigGroup{} + if err := _elem45.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) } - p.Remove[_elem46] = true + p.Remove[_elem45] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -13487,11 +14383,11 @@ func (p *GetJobUpdateDiffResult_) readField3(iprot thrift.TProtocol) error { tSet := make(map[*ConfigGroup]bool, size) p.Update = tSet for i := 0; i < size; i++ { - _elem47 := &ConfigGroup{} - if err := _elem47.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem47), err) + _elem46 := &ConfigGroup{} + if err := _elem46.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) } - p.Update[_elem47] = true + p.Update[_elem46] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -13507,11 +14403,11 @@ func (p *GetJobUpdateDiffResult_) readField4(iprot thrift.TProtocol) error { tSet := make(map[*ConfigGroup]bool, size) p.Unchanged = tSet for i := 0; i < size; i++ { - _elem48 := &ConfigGroup{} - if err := _elem48.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem48), err) + _elem47 := &ConfigGroup{} + if err := _elem47.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem47), err) } - p.Unchanged[_elem48] = true + p.Unchanged[_elem47] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -13710,19 +14606,19 @@ func (p *TierConfig) readField2(iprot thrift.TProtocol) error { tMap := make(map[string]string, size) p.Settings = tMap for i := 0; i < size; i++ { - var _key49 string + var _key48 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key49 = v + _key48 = v } - var _val50 string + var _val49 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val50 = v + _val49 = v } - p.Settings[_key49] = _val50 + p.Settings[_key48] = _val49 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -13868,11 +14764,11 @@ func (p *GetTierConfigResult_) readField2(iprot thrift.TProtocol) error { tSet := make(map[*TierConfig]bool, size) p.Tiers = tSet for i := 0; i < size; i++ { - _elem51 := &TierConfig{} - if err := _elem51.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) + _elem50 := &TierConfig{} + if err := _elem50.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) } - p.Tiers[_elem51] = true + p.Tiers[_elem50] = true } if err := iprot.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) @@ -15319,11 +16215,11 @@ func (p *Response) readField6(iprot thrift.TProtocol) error { tSlice := make([]*ResponseDetail, 0, size) p.Details = tSlice for i := 0; i < size; i++ { - _elem52 := &ResponseDetail{} - if err := _elem52.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + _elem51 := &ResponseDetail{} + if err := _elem51.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) } - p.Details = append(p.Details, _elem52) + p.Details = append(p.Details, _elem51) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) diff --git a/job.go b/job.go index eb2da87..0ff2aac 100644 --- a/job.go +++ b/job.go @@ -155,21 +155,18 @@ func (j *AuroraJob) ExecutorData(data string) Job { func (j *AuroraJob) CPU(cpus float64) Job { *j.resources["cpu"].NumCpus = cpus - j.jobConfig.TaskConfig.NumCpus = cpus //Will be deprecated soon return j } func (j *AuroraJob) RAM(ram int64) Job { *j.resources["ram"].RamMb = ram - j.jobConfig.TaskConfig.RamMb = ram //Will be deprecated soon return j } func (j *AuroraJob) Disk(disk int64) Job { *j.resources["disk"].DiskMb = disk - j.jobConfig.TaskConfig.DiskMb = disk //Will be deprecated return j } diff --git a/realis.go b/realis.go index 97e588f..8878b45 100644 --- a/realis.go +++ b/realis.go @@ -73,6 +73,7 @@ type Realis interface { // Admin functions DrainHosts(hosts ...string) (*aurora.Response, *aurora.DrainHostsResult_, error) + SLADrainHosts(policy *aurora.SlaPolicy, timeout int64, hosts ...string) (*aurora.DrainHostsResult_, error) StartMaintenance(hosts ...string) (*aurora.Response, *aurora.StartMaintenanceResult_, error) EndMaintenance(hosts ...string) (*aurora.Response, *aurora.EndMaintenanceResult_, error) MaintenanceStatus(hosts ...string) (*aurora.Response, *aurora.MaintenanceStatusResult_, error) @@ -1021,6 +1022,39 @@ func (r *realisClient) DrainHosts(hosts ...string) (*aurora.Response, *aurora.Dr return resp, result, nil } +// Start SLA Aware Drain. +// defaultSlaPolicy is the fallback SlaPolicy to use if a task does not have an SlaPolicy. +// After timeoutSecs, tasks will be forcefully drained without checking SLA. +func (r *realisClient) SLADrainHosts(policy *aurora.SlaPolicy, timeout int64, hosts ...string) (*aurora.DrainHostsResult_, error) { + var result *aurora.DrainHostsResult_ + + if len(hosts) == 0 { + return nil, errors.New("no hosts provided to drain") + } + + drainList := aurora.NewHosts() + drainList.HostNames = make(map[string]bool) + for _, host := range hosts { + drainList.HostNames[host] = true + } + + r.logger.DebugPrintf("SLADrainHosts Thrift Payload: %v\n", drainList) + + resp, retryErr := r.thriftCallWithRetries(func() (*aurora.Response, error) { + return r.adminClient.SlaDrainHosts(drainList, policy, timeout) + }) + + if retryErr != nil { + return result, errors.Wrap(retryErr, "Unable to recover connection") + } + + if resp.GetResult_() != nil { + result = resp.GetResult_().GetDrainHostsResult_() + } + + return result, nil +} + func (r *realisClient) StartMaintenance(hosts ...string) (*aurora.Response, *aurora.StartMaintenanceResult_, error) { var result *aurora.StartMaintenanceResult_ diff --git a/realis_e2e_test.go b/realis_e2e_test.go index 7c7d25d..9108903 100644 --- a/realis_e2e_test.go +++ b/realis_e2e_test.go @@ -567,6 +567,37 @@ func TestRealisClient_DrainHosts(t *testing.T) { } +func TestRealisClient_SLADrainHosts(t *testing.T) { + hosts := []string{"localhost"} + policy := aurora.SlaPolicy{PercentageSlaPolicy: &aurora.PercentageSlaPolicy{Percentage: 50.0}} + + _, err := r.SLADrainHosts(&policy, 30, hosts...) + if err != nil { + fmt.Printf("error: %+v\n", err.Error()) + os.Exit(1) + } + + // Monitor change to DRAINING and DRAINED mode + hostResults, err := monitor.HostMaintenance( + hosts, + []aurora.MaintenanceMode{aurora.MaintenanceMode_DRAINED, aurora.MaintenanceMode_DRAINING}, + 1, + 50) + assert.Equal(t, map[string]bool{"localhost": true}, hostResults) + assert.NoError(t, err) + + _, _, err = r.EndMaintenance(hosts...) + assert.NoError(t, err) + + // Monitor change to DRAINING and DRAINED mode + _, err = monitor.HostMaintenance( + hosts, + []aurora.MaintenanceMode{aurora.MaintenanceMode_NONE}, + 5, + 10) + assert.NoError(t, err) +} + // Test multiple go routines using a single connection func TestRealisClient_SessionThreadSafety(t *testing.T) {