add restartInstances with sla requirements

This commit is contained in:
lenhattan86 2021-06-07 15:37:27 -07:00
parent 2d81147aaa
commit 63e466ac0d
8 changed files with 1689 additions and 1132 deletions

View file

@ -1163,6 +1163,9 @@ service AuroraSchedulerManager extends ReadOnlyScheduler {
/** Restarts a batch of shards. */ /** Restarts a batch of shards. */
Response restartShards(5: JobKey job, 3: set<i32> shardIds) Response restartShards(5: JobKey job, 3: set<i32> shardIds)
/** Restarts a batch of shards if sla requirement is satisfied. */
Response slaRestartShards(5: JobKey job, 3: set<i32> shardIds, 2: SlaPolicy slaPolicy)
/** Initiates a kill on tasks. */ /** Initiates a kill on tasks. */
Response killTasks(4: JobKey job, 5: set<i32> instances, 6: string message) Response killTasks(4: JobKey job, 5: set<i32> instances, 6: string message)

View file

@ -1,4 +1,4 @@
// Code generated by Thrift Compiler (0.14.0). DO NOT EDIT. // Code generated by Thrift Compiler (0.14.1). DO NOT EDIT.
package aurora package aurora

View file

@ -1,4 +1,4 @@
// Code generated by Thrift Compiler (0.14.0). DO NOT EDIT. // Code generated by Thrift Compiler (0.14.1). DO NOT EDIT.
package aurora package aurora

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// Code generated by Thrift Compiler (0.14.0). DO NOT EDIT. // Code generated by Thrift Compiler (0.14.1). DO NOT EDIT.
package main package main
@ -13,7 +13,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/apache/thrift/lib/go/thrift" "github.com/apache/thrift/lib/go/thrift"
"apache/aurora" "aurora"
) )
var _ = aurora.GoUnusedProtection__ var _ = aurora.GoUnusedProtection__
@ -27,6 +27,7 @@ func Usage() {
fmt.Fprintln(os.Stderr, " Response descheduleCronJob(JobKey job)") fmt.Fprintln(os.Stderr, " Response descheduleCronJob(JobKey job)")
fmt.Fprintln(os.Stderr, " Response startCronJob(JobKey job)") fmt.Fprintln(os.Stderr, " Response startCronJob(JobKey job)")
fmt.Fprintln(os.Stderr, " Response restartShards(JobKey job, shardIds)") fmt.Fprintln(os.Stderr, " Response restartShards(JobKey job, shardIds)")
fmt.Fprintln(os.Stderr, " Response slaRestartShards(JobKey job, shardIds, SlaPolicy slaPolicy)")
fmt.Fprintln(os.Stderr, " Response killTasks(JobKey job, instances, string message)") fmt.Fprintln(os.Stderr, " Response killTasks(JobKey job, instances, string message)")
fmt.Fprintln(os.Stderr, " Response addInstances(InstanceKey key, i32 count)") fmt.Fprintln(os.Stderr, " Response addInstances(InstanceKey key, i32 count)")
fmt.Fprintln(os.Stderr, " Response replaceCronTemplate(JobConfiguration config)") fmt.Fprintln(os.Stderr, " Response replaceCronTemplate(JobConfiguration config)")
@ -175,19 +176,19 @@ func main() {
fmt.Fprintln(os.Stderr, "CreateJob requires 1 args") fmt.Fprintln(os.Stderr, "CreateJob requires 1 args")
flag.Usage() flag.Usage()
} }
arg213 := flag.Arg(1) arg244 := flag.Arg(1)
mbTrans214 := thrift.NewTMemoryBufferLen(len(arg213)) mbTrans245 := thrift.NewTMemoryBufferLen(len(arg244))
defer mbTrans214.Close() defer mbTrans245.Close()
_, err215 := mbTrans214.WriteString(arg213) _, err246 := mbTrans245.WriteString(arg244)
if err215 != nil { if err246 != nil {
Usage() Usage()
return return
} }
factory216 := thrift.NewTJSONProtocolFactory() factory247 := thrift.NewTJSONProtocolFactory()
jsProt217 := factory216.GetProtocol(mbTrans214) jsProt248 := factory247.GetProtocol(mbTrans245)
argvalue0 := aurora.NewJobConfiguration() argvalue0 := aurora.NewJobConfiguration()
err218 := argvalue0.Read(context.Background(), jsProt217) err249 := argvalue0.Read(context.Background(), jsProt248)
if err218 != nil { if err249 != nil {
Usage() Usage()
return return
} }
@ -200,19 +201,19 @@ func main() {
fmt.Fprintln(os.Stderr, "ScheduleCronJob requires 1 args") fmt.Fprintln(os.Stderr, "ScheduleCronJob requires 1 args")
flag.Usage() flag.Usage()
} }
arg219 := flag.Arg(1) arg250 := flag.Arg(1)
mbTrans220 := thrift.NewTMemoryBufferLen(len(arg219)) mbTrans251 := thrift.NewTMemoryBufferLen(len(arg250))
defer mbTrans220.Close() defer mbTrans251.Close()
_, err221 := mbTrans220.WriteString(arg219) _, err252 := mbTrans251.WriteString(arg250)
if err221 != nil { if err252 != nil {
Usage() Usage()
return return
} }
factory222 := thrift.NewTJSONProtocolFactory() factory253 := thrift.NewTJSONProtocolFactory()
jsProt223 := factory222.GetProtocol(mbTrans220) jsProt254 := factory253.GetProtocol(mbTrans251)
argvalue0 := aurora.NewJobConfiguration() argvalue0 := aurora.NewJobConfiguration()
err224 := argvalue0.Read(context.Background(), jsProt223) err255 := argvalue0.Read(context.Background(), jsProt254)
if err224 != nil { if err255 != nil {
Usage() Usage()
return return
} }
@ -225,19 +226,19 @@ func main() {
fmt.Fprintln(os.Stderr, "DescheduleCronJob requires 1 args") fmt.Fprintln(os.Stderr, "DescheduleCronJob requires 1 args")
flag.Usage() flag.Usage()
} }
arg225 := flag.Arg(1) arg256 := flag.Arg(1)
mbTrans226 := thrift.NewTMemoryBufferLen(len(arg225)) mbTrans257 := thrift.NewTMemoryBufferLen(len(arg256))
defer mbTrans226.Close() defer mbTrans257.Close()
_, err227 := mbTrans226.WriteString(arg225) _, err258 := mbTrans257.WriteString(arg256)
if err227 != nil { if err258 != nil {
Usage() Usage()
return return
} }
factory228 := thrift.NewTJSONProtocolFactory() factory259 := thrift.NewTJSONProtocolFactory()
jsProt229 := factory228.GetProtocol(mbTrans226) jsProt260 := factory259.GetProtocol(mbTrans257)
argvalue0 := aurora.NewJobKey() argvalue0 := aurora.NewJobKey()
err230 := argvalue0.Read(context.Background(), jsProt229) err261 := argvalue0.Read(context.Background(), jsProt260)
if err230 != nil { if err261 != nil {
Usage() Usage()
return return
} }
@ -250,19 +251,19 @@ func main() {
fmt.Fprintln(os.Stderr, "StartCronJob requires 1 args") fmt.Fprintln(os.Stderr, "StartCronJob requires 1 args")
flag.Usage() flag.Usage()
} }
arg231 := flag.Arg(1) arg262 := flag.Arg(1)
mbTrans232 := thrift.NewTMemoryBufferLen(len(arg231)) mbTrans263 := thrift.NewTMemoryBufferLen(len(arg262))
defer mbTrans232.Close() defer mbTrans263.Close()
_, err233 := mbTrans232.WriteString(arg231) _, err264 := mbTrans263.WriteString(arg262)
if err233 != nil { if err264 != nil {
Usage() Usage()
return return
} }
factory234 := thrift.NewTJSONProtocolFactory() factory265 := thrift.NewTJSONProtocolFactory()
jsProt235 := factory234.GetProtocol(mbTrans232) jsProt266 := factory265.GetProtocol(mbTrans263)
argvalue0 := aurora.NewJobKey() argvalue0 := aurora.NewJobKey()
err236 := argvalue0.Read(context.Background(), jsProt235) err267 := argvalue0.Read(context.Background(), jsProt266)
if err236 != nil { if err267 != nil {
Usage() Usage()
return return
} }
@ -275,36 +276,36 @@ func main() {
fmt.Fprintln(os.Stderr, "RestartShards requires 2 args") fmt.Fprintln(os.Stderr, "RestartShards requires 2 args")
flag.Usage() flag.Usage()
} }
arg237 := flag.Arg(1) arg268 := flag.Arg(1)
mbTrans238 := thrift.NewTMemoryBufferLen(len(arg237)) mbTrans269 := thrift.NewTMemoryBufferLen(len(arg268))
defer mbTrans238.Close() defer mbTrans269.Close()
_, err239 := mbTrans238.WriteString(arg237) _, err270 := mbTrans269.WriteString(arg268)
if err239 != nil { if err270 != nil {
Usage() Usage()
return return
} }
factory240 := thrift.NewTJSONProtocolFactory() factory271 := thrift.NewTJSONProtocolFactory()
jsProt241 := factory240.GetProtocol(mbTrans238) jsProt272 := factory271.GetProtocol(mbTrans269)
argvalue0 := aurora.NewJobKey() argvalue0 := aurora.NewJobKey()
err242 := argvalue0.Read(context.Background(), jsProt241) err273 := argvalue0.Read(context.Background(), jsProt272)
if err242 != nil { if err273 != nil {
Usage() Usage()
return return
} }
value0 := argvalue0 value0 := argvalue0
arg243 := flag.Arg(2) arg274 := flag.Arg(2)
mbTrans244 := thrift.NewTMemoryBufferLen(len(arg243)) mbTrans275 := thrift.NewTMemoryBufferLen(len(arg274))
defer mbTrans244.Close() defer mbTrans275.Close()
_, err245 := mbTrans244.WriteString(arg243) _, err276 := mbTrans275.WriteString(arg274)
if err245 != nil { if err276 != nil {
Usage() Usage()
return return
} }
factory246 := thrift.NewTJSONProtocolFactory() factory277 := thrift.NewTJSONProtocolFactory()
jsProt247 := factory246.GetProtocol(mbTrans244) jsProt278 := factory277.GetProtocol(mbTrans275)
containerStruct1 := aurora.NewAuroraSchedulerManagerRestartShardsArgs() containerStruct1 := aurora.NewAuroraSchedulerManagerRestartShardsArgs()
err248 := containerStruct1.ReadField2(context.Background(), jsProt247) err279 := containerStruct1.ReadField2(context.Background(), jsProt278)
if err248 != nil { if err279 != nil {
Usage() Usage()
return return
} }
@ -313,41 +314,101 @@ func main() {
fmt.Print(client.RestartShards(context.Background(), value0, value1)) fmt.Print(client.RestartShards(context.Background(), value0, value1))
fmt.Print("\n") fmt.Print("\n")
break break
case "slaRestartShards":
if flag.NArg() - 1 != 3 {
fmt.Fprintln(os.Stderr, "SlaRestartShards requires 3 args")
flag.Usage()
}
arg280 := flag.Arg(1)
mbTrans281 := thrift.NewTMemoryBufferLen(len(arg280))
defer mbTrans281.Close()
_, err282 := mbTrans281.WriteString(arg280)
if err282 != nil {
Usage()
return
}
factory283 := thrift.NewTJSONProtocolFactory()
jsProt284 := factory283.GetProtocol(mbTrans281)
argvalue0 := aurora.NewJobKey()
err285 := argvalue0.Read(context.Background(), jsProt284)
if err285 != nil {
Usage()
return
}
value0 := argvalue0
arg286 := flag.Arg(2)
mbTrans287 := thrift.NewTMemoryBufferLen(len(arg286))
defer mbTrans287.Close()
_, err288 := mbTrans287.WriteString(arg286)
if err288 != nil {
Usage()
return
}
factory289 := thrift.NewTJSONProtocolFactory()
jsProt290 := factory289.GetProtocol(mbTrans287)
containerStruct1 := aurora.NewAuroraSchedulerManagerSlaRestartShardsArgs()
err291 := containerStruct1.ReadField2(context.Background(), jsProt290)
if err291 != nil {
Usage()
return
}
argvalue1 := containerStruct1.ShardIds
value1 := argvalue1
arg292 := flag.Arg(3)
mbTrans293 := thrift.NewTMemoryBufferLen(len(arg292))
defer mbTrans293.Close()
_, err294 := mbTrans293.WriteString(arg292)
if err294 != nil {
Usage()
return
}
factory295 := thrift.NewTJSONProtocolFactory()
jsProt296 := factory295.GetProtocol(mbTrans293)
argvalue2 := aurora.NewSlaPolicy()
err297 := argvalue2.Read(context.Background(), jsProt296)
if err297 != nil {
Usage()
return
}
value2 := argvalue2
fmt.Print(client.SlaRestartShards(context.Background(), value0, value1, value2))
fmt.Print("\n")
break
case "killTasks": case "killTasks":
if flag.NArg() - 1 != 3 { if flag.NArg() - 1 != 3 {
fmt.Fprintln(os.Stderr, "KillTasks requires 3 args") fmt.Fprintln(os.Stderr, "KillTasks requires 3 args")
flag.Usage() flag.Usage()
} }
arg249 := flag.Arg(1) arg298 := flag.Arg(1)
mbTrans250 := thrift.NewTMemoryBufferLen(len(arg249)) mbTrans299 := thrift.NewTMemoryBufferLen(len(arg298))
defer mbTrans250.Close() defer mbTrans299.Close()
_, err251 := mbTrans250.WriteString(arg249) _, err300 := mbTrans299.WriteString(arg298)
if err251 != nil { if err300 != nil {
Usage() Usage()
return return
} }
factory252 := thrift.NewTJSONProtocolFactory() factory301 := thrift.NewTJSONProtocolFactory()
jsProt253 := factory252.GetProtocol(mbTrans250) jsProt302 := factory301.GetProtocol(mbTrans299)
argvalue0 := aurora.NewJobKey() argvalue0 := aurora.NewJobKey()
err254 := argvalue0.Read(context.Background(), jsProt253) err303 := argvalue0.Read(context.Background(), jsProt302)
if err254 != nil { if err303 != nil {
Usage() Usage()
return return
} }
value0 := argvalue0 value0 := argvalue0
arg255 := flag.Arg(2) arg304 := flag.Arg(2)
mbTrans256 := thrift.NewTMemoryBufferLen(len(arg255)) mbTrans305 := thrift.NewTMemoryBufferLen(len(arg304))
defer mbTrans256.Close() defer mbTrans305.Close()
_, err257 := mbTrans256.WriteString(arg255) _, err306 := mbTrans305.WriteString(arg304)
if err257 != nil { if err306 != nil {
Usage() Usage()
return return
} }
factory258 := thrift.NewTJSONProtocolFactory() factory307 := thrift.NewTJSONProtocolFactory()
jsProt259 := factory258.GetProtocol(mbTrans256) jsProt308 := factory307.GetProtocol(mbTrans305)
containerStruct1 := aurora.NewAuroraSchedulerManagerKillTasksArgs() containerStruct1 := aurora.NewAuroraSchedulerManagerKillTasksArgs()
err260 := containerStruct1.ReadField2(context.Background(), jsProt259) err309 := containerStruct1.ReadField2(context.Background(), jsProt308)
if err260 != nil { if err309 != nil {
Usage() Usage()
return return
} }
@ -363,25 +424,25 @@ func main() {
fmt.Fprintln(os.Stderr, "AddInstances requires 2 args") fmt.Fprintln(os.Stderr, "AddInstances requires 2 args")
flag.Usage() flag.Usage()
} }
arg262 := flag.Arg(1) arg311 := flag.Arg(1)
mbTrans263 := thrift.NewTMemoryBufferLen(len(arg262)) mbTrans312 := thrift.NewTMemoryBufferLen(len(arg311))
defer mbTrans263.Close() defer mbTrans312.Close()
_, err264 := mbTrans263.WriteString(arg262) _, err313 := mbTrans312.WriteString(arg311)
if err264 != nil { if err313 != nil {
Usage() Usage()
return return
} }
factory265 := thrift.NewTJSONProtocolFactory() factory314 := thrift.NewTJSONProtocolFactory()
jsProt266 := factory265.GetProtocol(mbTrans263) jsProt315 := factory314.GetProtocol(mbTrans312)
argvalue0 := aurora.NewInstanceKey() argvalue0 := aurora.NewInstanceKey()
err267 := argvalue0.Read(context.Background(), jsProt266) err316 := argvalue0.Read(context.Background(), jsProt315)
if err267 != nil { if err316 != nil {
Usage() Usage()
return return
} }
value0 := argvalue0 value0 := argvalue0
tmp1, err268 := (strconv.Atoi(flag.Arg(2))) tmp1, err317 := (strconv.Atoi(flag.Arg(2)))
if err268 != nil { if err317 != nil {
Usage() Usage()
return return
} }
@ -395,19 +456,19 @@ func main() {
fmt.Fprintln(os.Stderr, "ReplaceCronTemplate requires 1 args") fmt.Fprintln(os.Stderr, "ReplaceCronTemplate requires 1 args")
flag.Usage() flag.Usage()
} }
arg269 := flag.Arg(1) arg318 := flag.Arg(1)
mbTrans270 := thrift.NewTMemoryBufferLen(len(arg269)) mbTrans319 := thrift.NewTMemoryBufferLen(len(arg318))
defer mbTrans270.Close() defer mbTrans319.Close()
_, err271 := mbTrans270.WriteString(arg269) _, err320 := mbTrans319.WriteString(arg318)
if err271 != nil { if err320 != nil {
Usage() Usage()
return return
} }
factory272 := thrift.NewTJSONProtocolFactory() factory321 := thrift.NewTJSONProtocolFactory()
jsProt273 := factory272.GetProtocol(mbTrans270) jsProt322 := factory321.GetProtocol(mbTrans319)
argvalue0 := aurora.NewJobConfiguration() argvalue0 := aurora.NewJobConfiguration()
err274 := argvalue0.Read(context.Background(), jsProt273) err323 := argvalue0.Read(context.Background(), jsProt322)
if err274 != nil { if err323 != nil {
Usage() Usage()
return return
} }
@ -420,19 +481,19 @@ func main() {
fmt.Fprintln(os.Stderr, "StartJobUpdate requires 2 args") fmt.Fprintln(os.Stderr, "StartJobUpdate requires 2 args")
flag.Usage() flag.Usage()
} }
arg275 := flag.Arg(1) arg324 := flag.Arg(1)
mbTrans276 := thrift.NewTMemoryBufferLen(len(arg275)) mbTrans325 := thrift.NewTMemoryBufferLen(len(arg324))
defer mbTrans276.Close() defer mbTrans325.Close()
_, err277 := mbTrans276.WriteString(arg275) _, err326 := mbTrans325.WriteString(arg324)
if err277 != nil { if err326 != nil {
Usage() Usage()
return return
} }
factory278 := thrift.NewTJSONProtocolFactory() factory327 := thrift.NewTJSONProtocolFactory()
jsProt279 := factory278.GetProtocol(mbTrans276) jsProt328 := factory327.GetProtocol(mbTrans325)
argvalue0 := aurora.NewJobUpdateRequest() argvalue0 := aurora.NewJobUpdateRequest()
err280 := argvalue0.Read(context.Background(), jsProt279) err329 := argvalue0.Read(context.Background(), jsProt328)
if err280 != nil { if err329 != nil {
Usage() Usage()
return return
} }
@ -447,19 +508,19 @@ func main() {
fmt.Fprintln(os.Stderr, "PauseJobUpdate requires 2 args") fmt.Fprintln(os.Stderr, "PauseJobUpdate requires 2 args")
flag.Usage() flag.Usage()
} }
arg282 := flag.Arg(1) arg331 := flag.Arg(1)
mbTrans283 := thrift.NewTMemoryBufferLen(len(arg282)) mbTrans332 := thrift.NewTMemoryBufferLen(len(arg331))
defer mbTrans283.Close() defer mbTrans332.Close()
_, err284 := mbTrans283.WriteString(arg282) _, err333 := mbTrans332.WriteString(arg331)
if err284 != nil { if err333 != nil {
Usage() Usage()
return return
} }
factory285 := thrift.NewTJSONProtocolFactory() factory334 := thrift.NewTJSONProtocolFactory()
jsProt286 := factory285.GetProtocol(mbTrans283) jsProt335 := factory334.GetProtocol(mbTrans332)
argvalue0 := aurora.NewJobUpdateKey() argvalue0 := aurora.NewJobUpdateKey()
err287 := argvalue0.Read(context.Background(), jsProt286) err336 := argvalue0.Read(context.Background(), jsProt335)
if err287 != nil { if err336 != nil {
Usage() Usage()
return return
} }
@ -474,19 +535,19 @@ func main() {
fmt.Fprintln(os.Stderr, "ResumeJobUpdate requires 2 args") fmt.Fprintln(os.Stderr, "ResumeJobUpdate requires 2 args")
flag.Usage() flag.Usage()
} }
arg289 := flag.Arg(1) arg338 := flag.Arg(1)
mbTrans290 := thrift.NewTMemoryBufferLen(len(arg289)) mbTrans339 := thrift.NewTMemoryBufferLen(len(arg338))
defer mbTrans290.Close() defer mbTrans339.Close()
_, err291 := mbTrans290.WriteString(arg289) _, err340 := mbTrans339.WriteString(arg338)
if err291 != nil { if err340 != nil {
Usage() Usage()
return return
} }
factory292 := thrift.NewTJSONProtocolFactory() factory341 := thrift.NewTJSONProtocolFactory()
jsProt293 := factory292.GetProtocol(mbTrans290) jsProt342 := factory341.GetProtocol(mbTrans339)
argvalue0 := aurora.NewJobUpdateKey() argvalue0 := aurora.NewJobUpdateKey()
err294 := argvalue0.Read(context.Background(), jsProt293) err343 := argvalue0.Read(context.Background(), jsProt342)
if err294 != nil { if err343 != nil {
Usage() Usage()
return return
} }
@ -501,19 +562,19 @@ func main() {
fmt.Fprintln(os.Stderr, "AbortJobUpdate requires 2 args") fmt.Fprintln(os.Stderr, "AbortJobUpdate requires 2 args")
flag.Usage() flag.Usage()
} }
arg296 := flag.Arg(1) arg345 := flag.Arg(1)
mbTrans297 := thrift.NewTMemoryBufferLen(len(arg296)) mbTrans346 := thrift.NewTMemoryBufferLen(len(arg345))
defer mbTrans297.Close() defer mbTrans346.Close()
_, err298 := mbTrans297.WriteString(arg296) _, err347 := mbTrans346.WriteString(arg345)
if err298 != nil { if err347 != nil {
Usage() Usage()
return return
} }
factory299 := thrift.NewTJSONProtocolFactory() factory348 := thrift.NewTJSONProtocolFactory()
jsProt300 := factory299.GetProtocol(mbTrans297) jsProt349 := factory348.GetProtocol(mbTrans346)
argvalue0 := aurora.NewJobUpdateKey() argvalue0 := aurora.NewJobUpdateKey()
err301 := argvalue0.Read(context.Background(), jsProt300) err350 := argvalue0.Read(context.Background(), jsProt349)
if err301 != nil { if err350 != nil {
Usage() Usage()
return return
} }
@ -528,19 +589,19 @@ func main() {
fmt.Fprintln(os.Stderr, "RollbackJobUpdate requires 2 args") fmt.Fprintln(os.Stderr, "RollbackJobUpdate requires 2 args")
flag.Usage() flag.Usage()
} }
arg303 := flag.Arg(1) arg352 := flag.Arg(1)
mbTrans304 := thrift.NewTMemoryBufferLen(len(arg303)) mbTrans353 := thrift.NewTMemoryBufferLen(len(arg352))
defer mbTrans304.Close() defer mbTrans353.Close()
_, err305 := mbTrans304.WriteString(arg303) _, err354 := mbTrans353.WriteString(arg352)
if err305 != nil { if err354 != nil {
Usage() Usage()
return return
} }
factory306 := thrift.NewTJSONProtocolFactory() factory355 := thrift.NewTJSONProtocolFactory()
jsProt307 := factory306.GetProtocol(mbTrans304) jsProt356 := factory355.GetProtocol(mbTrans353)
argvalue0 := aurora.NewJobUpdateKey() argvalue0 := aurora.NewJobUpdateKey()
err308 := argvalue0.Read(context.Background(), jsProt307) err357 := argvalue0.Read(context.Background(), jsProt356)
if err308 != nil { if err357 != nil {
Usage() Usage()
return return
} }
@ -555,19 +616,19 @@ func main() {
fmt.Fprintln(os.Stderr, "PulseJobUpdate requires 1 args") fmt.Fprintln(os.Stderr, "PulseJobUpdate requires 1 args")
flag.Usage() flag.Usage()
} }
arg310 := flag.Arg(1) arg359 := flag.Arg(1)
mbTrans311 := thrift.NewTMemoryBufferLen(len(arg310)) mbTrans360 := thrift.NewTMemoryBufferLen(len(arg359))
defer mbTrans311.Close() defer mbTrans360.Close()
_, err312 := mbTrans311.WriteString(arg310) _, err361 := mbTrans360.WriteString(arg359)
if err312 != nil { if err361 != nil {
Usage() Usage()
return return
} }
factory313 := thrift.NewTJSONProtocolFactory() factory362 := thrift.NewTJSONProtocolFactory()
jsProt314 := factory313.GetProtocol(mbTrans311) jsProt363 := factory362.GetProtocol(mbTrans360)
argvalue0 := aurora.NewJobUpdateKey() argvalue0 := aurora.NewJobUpdateKey()
err315 := argvalue0.Read(context.Background(), jsProt314) err364 := argvalue0.Read(context.Background(), jsProt363)
if err315 != nil { if err364 != nil {
Usage() Usage()
return return
} }
@ -598,19 +659,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetTasksStatus requires 1 args") fmt.Fprintln(os.Stderr, "GetTasksStatus requires 1 args")
flag.Usage() flag.Usage()
} }
arg317 := flag.Arg(1) arg366 := flag.Arg(1)
mbTrans318 := thrift.NewTMemoryBufferLen(len(arg317)) mbTrans367 := thrift.NewTMemoryBufferLen(len(arg366))
defer mbTrans318.Close() defer mbTrans367.Close()
_, err319 := mbTrans318.WriteString(arg317) _, err368 := mbTrans367.WriteString(arg366)
if err319 != nil { if err368 != nil {
Usage() Usage()
return return
} }
factory320 := thrift.NewTJSONProtocolFactory() factory369 := thrift.NewTJSONProtocolFactory()
jsProt321 := factory320.GetProtocol(mbTrans318) jsProt370 := factory369.GetProtocol(mbTrans367)
argvalue0 := aurora.NewTaskQuery() argvalue0 := aurora.NewTaskQuery()
err322 := argvalue0.Read(context.Background(), jsProt321) err371 := argvalue0.Read(context.Background(), jsProt370)
if err322 != nil { if err371 != nil {
Usage() Usage()
return return
} }
@ -623,19 +684,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetTasksWithoutConfigs requires 1 args") fmt.Fprintln(os.Stderr, "GetTasksWithoutConfigs requires 1 args")
flag.Usage() flag.Usage()
} }
arg323 := flag.Arg(1) arg372 := flag.Arg(1)
mbTrans324 := thrift.NewTMemoryBufferLen(len(arg323)) mbTrans373 := thrift.NewTMemoryBufferLen(len(arg372))
defer mbTrans324.Close() defer mbTrans373.Close()
_, err325 := mbTrans324.WriteString(arg323) _, err374 := mbTrans373.WriteString(arg372)
if err325 != nil { if err374 != nil {
Usage() Usage()
return return
} }
factory326 := thrift.NewTJSONProtocolFactory() factory375 := thrift.NewTJSONProtocolFactory()
jsProt327 := factory326.GetProtocol(mbTrans324) jsProt376 := factory375.GetProtocol(mbTrans373)
argvalue0 := aurora.NewTaskQuery() argvalue0 := aurora.NewTaskQuery()
err328 := argvalue0.Read(context.Background(), jsProt327) err377 := argvalue0.Read(context.Background(), jsProt376)
if err328 != nil { if err377 != nil {
Usage() Usage()
return return
} }
@ -648,19 +709,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetPendingReason requires 1 args") fmt.Fprintln(os.Stderr, "GetPendingReason requires 1 args")
flag.Usage() flag.Usage()
} }
arg329 := flag.Arg(1) arg378 := flag.Arg(1)
mbTrans330 := thrift.NewTMemoryBufferLen(len(arg329)) mbTrans379 := thrift.NewTMemoryBufferLen(len(arg378))
defer mbTrans330.Close() defer mbTrans379.Close()
_, err331 := mbTrans330.WriteString(arg329) _, err380 := mbTrans379.WriteString(arg378)
if err331 != nil { if err380 != nil {
Usage() Usage()
return return
} }
factory332 := thrift.NewTJSONProtocolFactory() factory381 := thrift.NewTJSONProtocolFactory()
jsProt333 := factory332.GetProtocol(mbTrans330) jsProt382 := factory381.GetProtocol(mbTrans379)
argvalue0 := aurora.NewTaskQuery() argvalue0 := aurora.NewTaskQuery()
err334 := argvalue0.Read(context.Background(), jsProt333) err383 := argvalue0.Read(context.Background(), jsProt382)
if err334 != nil { if err383 != nil {
Usage() Usage()
return return
} }
@ -673,19 +734,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetConfigSummary requires 1 args") fmt.Fprintln(os.Stderr, "GetConfigSummary requires 1 args")
flag.Usage() flag.Usage()
} }
arg335 := flag.Arg(1) arg384 := flag.Arg(1)
mbTrans336 := thrift.NewTMemoryBufferLen(len(arg335)) mbTrans385 := thrift.NewTMemoryBufferLen(len(arg384))
defer mbTrans336.Close() defer mbTrans385.Close()
_, err337 := mbTrans336.WriteString(arg335) _, err386 := mbTrans385.WriteString(arg384)
if err337 != nil { if err386 != nil {
Usage() Usage()
return return
} }
factory338 := thrift.NewTJSONProtocolFactory() factory387 := thrift.NewTJSONProtocolFactory()
jsProt339 := factory338.GetProtocol(mbTrans336) jsProt388 := factory387.GetProtocol(mbTrans385)
argvalue0 := aurora.NewJobKey() argvalue0 := aurora.NewJobKey()
err340 := argvalue0.Read(context.Background(), jsProt339) err389 := argvalue0.Read(context.Background(), jsProt388)
if err340 != nil { if err389 != nil {
Usage() Usage()
return return
} }
@ -718,19 +779,19 @@ func main() {
fmt.Fprintln(os.Stderr, "PopulateJobConfig requires 1 args") fmt.Fprintln(os.Stderr, "PopulateJobConfig requires 1 args")
flag.Usage() flag.Usage()
} }
arg343 := flag.Arg(1) arg392 := flag.Arg(1)
mbTrans344 := thrift.NewTMemoryBufferLen(len(arg343)) mbTrans393 := thrift.NewTMemoryBufferLen(len(arg392))
defer mbTrans344.Close() defer mbTrans393.Close()
_, err345 := mbTrans344.WriteString(arg343) _, err394 := mbTrans393.WriteString(arg392)
if err345 != nil { if err394 != nil {
Usage() Usage()
return return
} }
factory346 := thrift.NewTJSONProtocolFactory() factory395 := thrift.NewTJSONProtocolFactory()
jsProt347 := factory346.GetProtocol(mbTrans344) jsProt396 := factory395.GetProtocol(mbTrans393)
argvalue0 := aurora.NewJobConfiguration() argvalue0 := aurora.NewJobConfiguration()
err348 := argvalue0.Read(context.Background(), jsProt347) err397 := argvalue0.Read(context.Background(), jsProt396)
if err348 != nil { if err397 != nil {
Usage() Usage()
return return
} }
@ -743,19 +804,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetJobUpdateSummaries requires 1 args") fmt.Fprintln(os.Stderr, "GetJobUpdateSummaries requires 1 args")
flag.Usage() flag.Usage()
} }
arg349 := flag.Arg(1) arg398 := flag.Arg(1)
mbTrans350 := thrift.NewTMemoryBufferLen(len(arg349)) mbTrans399 := thrift.NewTMemoryBufferLen(len(arg398))
defer mbTrans350.Close() defer mbTrans399.Close()
_, err351 := mbTrans350.WriteString(arg349) _, err400 := mbTrans399.WriteString(arg398)
if err351 != nil { if err400 != nil {
Usage() Usage()
return return
} }
factory352 := thrift.NewTJSONProtocolFactory() factory401 := thrift.NewTJSONProtocolFactory()
jsProt353 := factory352.GetProtocol(mbTrans350) jsProt402 := factory401.GetProtocol(mbTrans399)
argvalue0 := aurora.NewJobUpdateQuery() argvalue0 := aurora.NewJobUpdateQuery()
err354 := argvalue0.Read(context.Background(), jsProt353) err403 := argvalue0.Read(context.Background(), jsProt402)
if err354 != nil { if err403 != nil {
Usage() Usage()
return return
} }
@ -768,19 +829,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetJobUpdateDetails requires 1 args") fmt.Fprintln(os.Stderr, "GetJobUpdateDetails requires 1 args")
flag.Usage() flag.Usage()
} }
arg355 := flag.Arg(1) arg404 := flag.Arg(1)
mbTrans356 := thrift.NewTMemoryBufferLen(len(arg355)) mbTrans405 := thrift.NewTMemoryBufferLen(len(arg404))
defer mbTrans356.Close() defer mbTrans405.Close()
_, err357 := mbTrans356.WriteString(arg355) _, err406 := mbTrans405.WriteString(arg404)
if err357 != nil { if err406 != nil {
Usage() Usage()
return return
} }
factory358 := thrift.NewTJSONProtocolFactory() factory407 := thrift.NewTJSONProtocolFactory()
jsProt359 := factory358.GetProtocol(mbTrans356) jsProt408 := factory407.GetProtocol(mbTrans405)
argvalue0 := aurora.NewJobUpdateQuery() argvalue0 := aurora.NewJobUpdateQuery()
err360 := argvalue0.Read(context.Background(), jsProt359) err409 := argvalue0.Read(context.Background(), jsProt408)
if err360 != nil { if err409 != nil {
Usage() Usage()
return return
} }
@ -793,19 +854,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetJobUpdateDiff requires 1 args") fmt.Fprintln(os.Stderr, "GetJobUpdateDiff requires 1 args")
flag.Usage() flag.Usage()
} }
arg361 := flag.Arg(1) arg410 := flag.Arg(1)
mbTrans362 := thrift.NewTMemoryBufferLen(len(arg361)) mbTrans411 := thrift.NewTMemoryBufferLen(len(arg410))
defer mbTrans362.Close() defer mbTrans411.Close()
_, err363 := mbTrans362.WriteString(arg361) _, err412 := mbTrans411.WriteString(arg410)
if err363 != nil { if err412 != nil {
Usage() Usage()
return return
} }
factory364 := thrift.NewTJSONProtocolFactory() factory413 := thrift.NewTJSONProtocolFactory()
jsProt365 := factory364.GetProtocol(mbTrans362) jsProt414 := factory413.GetProtocol(mbTrans411)
argvalue0 := aurora.NewJobUpdateRequest() argvalue0 := aurora.NewJobUpdateRequest()
err366 := argvalue0.Read(context.Background(), jsProt365) err415 := argvalue0.Read(context.Background(), jsProt414)
if err366 != nil { if err415 != nil {
Usage() Usage()
return return
} }

View file

@ -1,4 +1,4 @@
// Code generated by Thrift Compiler (0.14.0). DO NOT EDIT. // Code generated by Thrift Compiler (0.14.1). DO NOT EDIT.
package main package main
@ -13,7 +13,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/apache/thrift/lib/go/thrift" "github.com/apache/thrift/lib/go/thrift"
"apache/aurora" "aurora"
) )
var _ = aurora.GoUnusedProtection__ var _ = aurora.GoUnusedProtection__
@ -179,19 +179,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetTasksStatus requires 1 args") fmt.Fprintln(os.Stderr, "GetTasksStatus requires 1 args")
flag.Usage() flag.Usage()
} }
arg132 := flag.Arg(1) arg145 := flag.Arg(1)
mbTrans133 := thrift.NewTMemoryBufferLen(len(arg132)) mbTrans146 := thrift.NewTMemoryBufferLen(len(arg145))
defer mbTrans133.Close() defer mbTrans146.Close()
_, err134 := mbTrans133.WriteString(arg132) _, err147 := mbTrans146.WriteString(arg145)
if err134 != nil { if err147 != nil {
Usage() Usage()
return return
} }
factory135 := thrift.NewTJSONProtocolFactory() factory148 := thrift.NewTJSONProtocolFactory()
jsProt136 := factory135.GetProtocol(mbTrans133) jsProt149 := factory148.GetProtocol(mbTrans146)
argvalue0 := aurora.NewTaskQuery() argvalue0 := aurora.NewTaskQuery()
err137 := argvalue0.Read(context.Background(), jsProt136) err150 := argvalue0.Read(context.Background(), jsProt149)
if err137 != nil { if err150 != nil {
Usage() Usage()
return return
} }
@ -204,19 +204,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetTasksWithoutConfigs requires 1 args") fmt.Fprintln(os.Stderr, "GetTasksWithoutConfigs requires 1 args")
flag.Usage() flag.Usage()
} }
arg138 := flag.Arg(1) arg151 := flag.Arg(1)
mbTrans139 := thrift.NewTMemoryBufferLen(len(arg138)) mbTrans152 := thrift.NewTMemoryBufferLen(len(arg151))
defer mbTrans139.Close() defer mbTrans152.Close()
_, err140 := mbTrans139.WriteString(arg138) _, err153 := mbTrans152.WriteString(arg151)
if err140 != nil { if err153 != nil {
Usage() Usage()
return return
} }
factory141 := thrift.NewTJSONProtocolFactory() factory154 := thrift.NewTJSONProtocolFactory()
jsProt142 := factory141.GetProtocol(mbTrans139) jsProt155 := factory154.GetProtocol(mbTrans152)
argvalue0 := aurora.NewTaskQuery() argvalue0 := aurora.NewTaskQuery()
err143 := argvalue0.Read(context.Background(), jsProt142) err156 := argvalue0.Read(context.Background(), jsProt155)
if err143 != nil { if err156 != nil {
Usage() Usage()
return return
} }
@ -229,19 +229,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetPendingReason requires 1 args") fmt.Fprintln(os.Stderr, "GetPendingReason requires 1 args")
flag.Usage() flag.Usage()
} }
arg144 := flag.Arg(1) arg157 := flag.Arg(1)
mbTrans145 := thrift.NewTMemoryBufferLen(len(arg144)) mbTrans158 := thrift.NewTMemoryBufferLen(len(arg157))
defer mbTrans145.Close() defer mbTrans158.Close()
_, err146 := mbTrans145.WriteString(arg144) _, err159 := mbTrans158.WriteString(arg157)
if err146 != nil { if err159 != nil {
Usage() Usage()
return return
} }
factory147 := thrift.NewTJSONProtocolFactory() factory160 := thrift.NewTJSONProtocolFactory()
jsProt148 := factory147.GetProtocol(mbTrans145) jsProt161 := factory160.GetProtocol(mbTrans158)
argvalue0 := aurora.NewTaskQuery() argvalue0 := aurora.NewTaskQuery()
err149 := argvalue0.Read(context.Background(), jsProt148) err162 := argvalue0.Read(context.Background(), jsProt161)
if err149 != nil { if err162 != nil {
Usage() Usage()
return return
} }
@ -254,19 +254,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetConfigSummary requires 1 args") fmt.Fprintln(os.Stderr, "GetConfigSummary requires 1 args")
flag.Usage() flag.Usage()
} }
arg150 := flag.Arg(1) arg163 := flag.Arg(1)
mbTrans151 := thrift.NewTMemoryBufferLen(len(arg150)) mbTrans164 := thrift.NewTMemoryBufferLen(len(arg163))
defer mbTrans151.Close() defer mbTrans164.Close()
_, err152 := mbTrans151.WriteString(arg150) _, err165 := mbTrans164.WriteString(arg163)
if err152 != nil { if err165 != nil {
Usage() Usage()
return return
} }
factory153 := thrift.NewTJSONProtocolFactory() factory166 := thrift.NewTJSONProtocolFactory()
jsProt154 := factory153.GetProtocol(mbTrans151) jsProt167 := factory166.GetProtocol(mbTrans164)
argvalue0 := aurora.NewJobKey() argvalue0 := aurora.NewJobKey()
err155 := argvalue0.Read(context.Background(), jsProt154) err168 := argvalue0.Read(context.Background(), jsProt167)
if err155 != nil { if err168 != nil {
Usage() Usage()
return return
} }
@ -299,19 +299,19 @@ func main() {
fmt.Fprintln(os.Stderr, "PopulateJobConfig requires 1 args") fmt.Fprintln(os.Stderr, "PopulateJobConfig requires 1 args")
flag.Usage() flag.Usage()
} }
arg158 := flag.Arg(1) arg171 := flag.Arg(1)
mbTrans159 := thrift.NewTMemoryBufferLen(len(arg158)) mbTrans172 := thrift.NewTMemoryBufferLen(len(arg171))
defer mbTrans159.Close() defer mbTrans172.Close()
_, err160 := mbTrans159.WriteString(arg158) _, err173 := mbTrans172.WriteString(arg171)
if err160 != nil { if err173 != nil {
Usage() Usage()
return return
} }
factory161 := thrift.NewTJSONProtocolFactory() factory174 := thrift.NewTJSONProtocolFactory()
jsProt162 := factory161.GetProtocol(mbTrans159) jsProt175 := factory174.GetProtocol(mbTrans172)
argvalue0 := aurora.NewJobConfiguration() argvalue0 := aurora.NewJobConfiguration()
err163 := argvalue0.Read(context.Background(), jsProt162) err176 := argvalue0.Read(context.Background(), jsProt175)
if err163 != nil { if err176 != nil {
Usage() Usage()
return return
} }
@ -324,19 +324,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetJobUpdateSummaries requires 1 args") fmt.Fprintln(os.Stderr, "GetJobUpdateSummaries requires 1 args")
flag.Usage() flag.Usage()
} }
arg164 := flag.Arg(1) arg177 := flag.Arg(1)
mbTrans165 := thrift.NewTMemoryBufferLen(len(arg164)) mbTrans178 := thrift.NewTMemoryBufferLen(len(arg177))
defer mbTrans165.Close() defer mbTrans178.Close()
_, err166 := mbTrans165.WriteString(arg164) _, err179 := mbTrans178.WriteString(arg177)
if err166 != nil { if err179 != nil {
Usage() Usage()
return return
} }
factory167 := thrift.NewTJSONProtocolFactory() factory180 := thrift.NewTJSONProtocolFactory()
jsProt168 := factory167.GetProtocol(mbTrans165) jsProt181 := factory180.GetProtocol(mbTrans178)
argvalue0 := aurora.NewJobUpdateQuery() argvalue0 := aurora.NewJobUpdateQuery()
err169 := argvalue0.Read(context.Background(), jsProt168) err182 := argvalue0.Read(context.Background(), jsProt181)
if err169 != nil { if err182 != nil {
Usage() Usage()
return return
} }
@ -349,19 +349,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetJobUpdateDetails requires 1 args") fmt.Fprintln(os.Stderr, "GetJobUpdateDetails requires 1 args")
flag.Usage() flag.Usage()
} }
arg170 := flag.Arg(1) arg183 := flag.Arg(1)
mbTrans171 := thrift.NewTMemoryBufferLen(len(arg170)) mbTrans184 := thrift.NewTMemoryBufferLen(len(arg183))
defer mbTrans171.Close() defer mbTrans184.Close()
_, err172 := mbTrans171.WriteString(arg170) _, err185 := mbTrans184.WriteString(arg183)
if err172 != nil { if err185 != nil {
Usage() Usage()
return return
} }
factory173 := thrift.NewTJSONProtocolFactory() factory186 := thrift.NewTJSONProtocolFactory()
jsProt174 := factory173.GetProtocol(mbTrans171) jsProt187 := factory186.GetProtocol(mbTrans184)
argvalue0 := aurora.NewJobUpdateQuery() argvalue0 := aurora.NewJobUpdateQuery()
err175 := argvalue0.Read(context.Background(), jsProt174) err188 := argvalue0.Read(context.Background(), jsProt187)
if err175 != nil { if err188 != nil {
Usage() Usage()
return return
} }
@ -374,19 +374,19 @@ func main() {
fmt.Fprintln(os.Stderr, "GetJobUpdateDiff requires 1 args") fmt.Fprintln(os.Stderr, "GetJobUpdateDiff requires 1 args")
flag.Usage() flag.Usage()
} }
arg176 := flag.Arg(1) arg189 := flag.Arg(1)
mbTrans177 := thrift.NewTMemoryBufferLen(len(arg176)) mbTrans190 := thrift.NewTMemoryBufferLen(len(arg189))
defer mbTrans177.Close() defer mbTrans190.Close()
_, err178 := mbTrans177.WriteString(arg176) _, err191 := mbTrans190.WriteString(arg189)
if err178 != nil { if err191 != nil {
Usage() Usage()
return return
} }
factory179 := thrift.NewTJSONProtocolFactory() factory192 := thrift.NewTJSONProtocolFactory()
jsProt180 := factory179.GetProtocol(mbTrans177) jsProt193 := factory192.GetProtocol(mbTrans190)
argvalue0 := aurora.NewJobUpdateRequest() argvalue0 := aurora.NewJobUpdateRequest()
err181 := argvalue0.Read(context.Background(), jsProt180) err194 := argvalue0.Read(context.Background(), jsProt193)
if err181 != nil { if err194 != nil {
Usage() Usage()
return return
} }

View file

@ -522,6 +522,20 @@ func (c *Client) RestartInstances(key aurora.JobKey, instances ...int32) error {
return nil return nil
} }
// Restarts specific instances with SLA specified
func (c *Client) SlaRestartInstances(key aurora.JobKey, policy *aurora.SlaPolicy, instances ...int32) error {
c.logger.DebugPrintf("SlaRestartInstances Thrift Payload: %+v %v\n", key, instances)
_, retryErr := c.thriftCallWithRetries(false, func() (*aurora.Response, error) {
return c.client.SlaRestartShards(context.TODO(), &key, instances, policy)
})
if retryErr != nil {
return errors.Wrap(retryErr, "error sending SlaRestartInstances command to Aurora Scheduler")
}
return nil
}
// Restarts all active tasks under a job configuration. // Restarts all active tasks under a job configuration.
func (c *Client) RestartJob(key aurora.JobKey) error { func (c *Client) RestartJob(key aurora.JobKey) error {