diff --git a/examples/client.go b/examples/client.go index 6dd9a0f..96eef20 100644 --- a/examples/client.go +++ b/examples/client.go @@ -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") } } diff --git a/job.go b/job.go index af69cc9..2e77a3d 100644 --- a/job.go +++ b/job.go @@ -15,7 +15,7 @@ package realis import ( - "gen-go/apache/aurora" + "github.com/rdelval/gorealis/gen-go/apache/aurora" "strconv" ) diff --git a/monitors.go b/monitors.go index d44a4cf..bb61165 100644 --- a/monitors.go +++ b/monitors.go @@ -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 } diff --git a/realis.go b/realis.go index 624d150..f466ba2 100644 --- a/realis.go +++ b/realis.go @@ -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 } diff --git a/response/response.go b/response/response.go index 47d3a63..6a22aa8 100644 --- a/response/response.go +++ b/response/response.go @@ -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 diff --git a/updatejob.go b/updatejob.go index ea3c68b..cb2d8c6 100644 --- a/updatejob.go +++ b/updatejob.go @@ -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