Support Drain SLA API (#88)

* Bringing thrift API up to date with Aurora 0.21.0.

* Adding support for SLA Drain Host API.
This commit is contained in:
Renan DelValle 2018-11-16 11:41:09 -08:00 committed by GitHub
parent a09a18ea3b
commit 2eaa60f681
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 2842 additions and 1323 deletions

View file

@ -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<Resource> resources
20: set<Constraint> constraints
/** a list of named ports this task requests */
21: set<string> requestedPorts
/** Resources to retrieve with Mesos Fetcher */
33: optional set<MesosFetcherURI> mesosFetcherUris
/**
@ -278,6 +308,10 @@ struct TaskConfig {
25: optional ExecutorConfig executorConfig
/** Used to display additional details in the UI. */
27: optional set<Metadata> 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<Resource> 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<ScheduleStatus> 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<ScheduleStatus> 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<ScheduleStatus> 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<TaskEvent> taskEvents
/**
@ -619,7 +656,6 @@ const set<JobUpdateStatus> 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<JobUpdateStatus> 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<string> 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()

View file

@ -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 == "" {

View file

@ -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
}

View file

@ -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 "<nil>"
}
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 "<nil>"
}
return fmt.Sprintf("AuroraAdminSlaDrainHostsResult(%+v)", *p)
}
type AuroraAdminSnapshotArgs struct {
}

View file

@ -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)

View file

@ -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,
}

View file

@ -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
}

View file

@ -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
}

File diff suppressed because it is too large Load diff

3
job.go
View file

@ -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
}

View file

@ -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_

View file

@ -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) {