Changing location from where to get thrift bidnings to that it points to github location. Ran go fmt on the entire project.
This commit is contained in:
parent
4408aefaad
commit
3a78e32e27
6 changed files with 16 additions and 18 deletions
|
@ -17,14 +17,13 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"gen-go/apache/aurora"
|
||||
"github.com/rdelval/gorealis"
|
||||
"github.com/rdelval/gorealis/gen-go/apache/aurora"
|
||||
"github.com/rdelval/gorealis/response"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"github.com/rdelval/gorealis/response"
|
||||
)
|
||||
|
||||
|
||||
func main() {
|
||||
cmd := flag.String("cmd", "", "Job request type to send to Aurora Scheduler")
|
||||
executor := flag.String("executor", "thermos", "Executor to use")
|
||||
|
@ -124,8 +123,8 @@ func main() {
|
|||
}
|
||||
fmt.Println(resp.String())
|
||||
|
||||
if(resp.ResponseCode == aurora.ResponseCode_OK) {
|
||||
if(!monitor.Instances(job.JobKey(), job.GetInstanceCount(), 5, 50)) {
|
||||
if resp.ResponseCode == aurora.ResponseCode_OK {
|
||||
if !monitor.Instances(job.JobKey(), job.GetInstanceCount(), 5, 50) {
|
||||
_, err := r.KillJob(job.JobKey())
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
@ -143,8 +142,8 @@ func main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
if(resp.ResponseCode == aurora.ResponseCode_OK) {
|
||||
if(!monitor.Instances(job.JobKey(), 0, 5, 50)) {
|
||||
if resp.ResponseCode == aurora.ResponseCode_OK {
|
||||
if !monitor.Instances(job.JobKey(), 0, 5, 50) {
|
||||
fmt.Println("Unable to kill all instances of job")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
@ -193,8 +192,8 @@ func main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
if(resp.ResponseCode == aurora.ResponseCode_OK) {
|
||||
if(!monitor.Instances(job.JobKey(), job.GetInstanceCount()+numOfInstances, 5, 50)) {
|
||||
if resp.ResponseCode == aurora.ResponseCode_OK {
|
||||
if !monitor.Instances(job.JobKey(), job.GetInstanceCount()+numOfInstances, 5, 50) {
|
||||
fmt.Println("Flexing up failed")
|
||||
}
|
||||
}
|
||||
|
|
2
job.go
2
job.go
|
@ -15,7 +15,7 @@
|
|||
package realis
|
||||
|
||||
import (
|
||||
"gen-go/apache/aurora"
|
||||
"github.com/rdelval/gorealis/gen-go/apache/aurora"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ package realis
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"gen-go/apache/aurora"
|
||||
"github.com/rdelval/gorealis/gen-go/apache/aurora"
|
||||
"github.com/rdelval/gorealis/response"
|
||||
"os"
|
||||
"time"
|
||||
|
@ -62,7 +62,6 @@ func (m *Monitor) JobUpdate(updateKey aurora.JobUpdateKey, interval int, timeout
|
|||
return false
|
||||
}
|
||||
|
||||
|
||||
func (m *Monitor) Instances(key *aurora.JobKey, instances int32, interval int, timeout int) bool {
|
||||
|
||||
for i := 0; i*interval < timeout; i++ {
|
||||
|
@ -74,7 +73,7 @@ func (m *Monitor) Instances(key *aurora.JobKey, instances int32, interval int, t
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
if(len(live) == int(instances)){
|
||||
if len(live) == int(instances) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ package realis
|
|||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"gen-go/apache/aurora"
|
||||
"git.apache.org/thrift.git/lib/go/thrift"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rdelval/gorealis/gen-go/apache/aurora"
|
||||
"net/http"
|
||||
"net/http/cookiejar"
|
||||
"os"
|
||||
|
@ -32,7 +32,7 @@ type Realis interface {
|
|||
AddInstances(instKey aurora.InstanceKey, count int32) (*aurora.Response, error)
|
||||
CreateJob(auroraJob Job) (*aurora.Response, error)
|
||||
FetchTaskConfig(instKey aurora.InstanceKey) (*aurora.TaskConfig, error)
|
||||
GetInstanceIds(key *aurora.JobKey, states map[aurora.ScheduleStatus]bool) (map[int32]bool, error)
|
||||
GetInstanceIds(key *aurora.JobKey, states map[aurora.ScheduleStatus]bool) (map[int32]bool, error)
|
||||
JobUpdateDetails(updateKey aurora.JobUpdateKey) (*aurora.Response, error)
|
||||
KillJob(key *aurora.JobKey) (*aurora.Response, error)
|
||||
KillInstances(key *aurora.JobKey, instances ...int32) (*aurora.Response, error)
|
||||
|
@ -287,5 +287,5 @@ func (r realisClient) JobUpdateDetails(updateKey aurora.JobUpdateKey) (*aurora.R
|
|||
return nil, errors.Wrap(err, "Unable to get job update details")
|
||||
}
|
||||
|
||||
return resp,nil
|
||||
return resp, nil
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
package response
|
||||
|
||||
import (
|
||||
"gen-go/apache/aurora"
|
||||
"github.com/rdelval/gorealis/gen-go/apache/aurora"
|
||||
)
|
||||
|
||||
// Get key from a response created by a StartJobUpdate call
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package realis
|
||||
|
||||
import (
|
||||
"gen-go/apache/aurora"
|
||||
"github.com/rdelval/gorealis/gen-go/apache/aurora"
|
||||
)
|
||||
|
||||
// Structure to collect all information required to create job update
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue