From ff545e8aa6449b5a199bee42b8fe123880266503 Mon Sep 17 00:00:00 2001 From: PRADYUMNA KAUSHIK <9302481+pradykaushik@users.noreply.github.com> Date: Fri, 22 Dec 2017 08:53:05 -0800 Subject: [PATCH] Fixing semantic errors in docs/getting-started.md (#44) * fixed semantics. Earlier mentioned that 'Pystachio does yet support...'. Changed now to mention 'Pystachio does not yet support...' * fixed grammatical mistake. * Ran gofmt on project. --- clusters_test.go | 3 ++- docs/getting-started.md | 4 ++-- examples/client.go | 2 +- job.go | 1 - logger.go | 2 +- response/response.go | 2 +- updatejob.go | 3 --- .../thrift.git/lib/go/thrift/framed_transport.go | 3 +-- .../thrift.git/lib/go/thrift/iostream_transport.go | 3 +-- vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go | 6 +++--- .../thrift.git/lib/go/thrift/protocol_exception.go | 3 +-- .../thrift.git/lib/go/thrift/rich_transport.go | 1 - .../thrift.git/lib/go/thrift/simple_server.go | 2 +- vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go | 3 +-- .../thrift.git/lib/go/thrift/ssl_server_socket.go | 2 +- .../git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go | 3 +-- vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go | 3 --- zk.go | 1 - 18 files changed, 17 insertions(+), 30 deletions(-) diff --git a/clusters_test.go b/clusters_test.go index 6f854dd..4d34038 100644 --- a/clusters_test.go +++ b/clusters_test.go @@ -16,9 +16,10 @@ package realis_test import ( "fmt" - "github.com/stretchr/testify/assert" "testing" + "github.com/paypal/gorealis" + "github.com/stretchr/testify/assert" ) func TestLoadClusters(t *testing.T) { diff --git a/docs/getting-started.md b/docs/getting-started.md index 16191c6..dd472d2 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -15,7 +15,7 @@ until the end of step 4 (Start the local cluster) and skip to configuring Docker Follow the guide at http://aurora.apache.org/documentation/latest/operations/installation/ ### Configuring Scheduler to use Docker-Compose executor -In order use the docker compose executor with Aurora, we must first give the scheduler +In order to use the docker compose executor with Aurora, we must first give the scheduler a configuration file that contains information on how to run the executor. #### Configuration file @@ -91,7 +91,7 @@ $ sudo service aurora-scheduler restart ``` ### Using a custom client -Pystachio does yet support launching tasks using custom executors. Therefore, a custom +Pystachio does not yet support launching tasks using custom executors. Therefore, a custom client must be used in order to launch tasks using a custom executor. In this case, we will be using [gorealis](https://github.com/paypal/gorealis) to launch a task with the compose executor on Aurora. diff --git a/examples/client.go b/examples/client.go index 4d15634..e94a34a 100644 --- a/examples/client.go +++ b/examples/client.go @@ -196,7 +196,7 @@ func main() { } fmt.Println(resp.String()) - if ok, err := monitor.JobUpdate(*resp.GetKey(), 5, 50); !ok || err != nil { + if ok, err := monitor.JobUpdate(*resp.GetKey(), 5, 50); !ok || err != nil { _, err := r.KillJob(job.JobKey()) if err != nil { fmt.Println(err) diff --git a/job.go b/job.go index 8753500..1173e3f 100644 --- a/job.go +++ b/job.go @@ -87,7 +87,6 @@ func NewJob() Job { taskConfig.Resources[ramMb] = true taskConfig.Resources[diskMb] = true - numCpus.NumCpus = new(float64) ramMb.RamMb = new(int64) diskMb.DiskMb = new(int64) diff --git a/logger.go b/logger.go index 6ddd077..aa1e377 100644 --- a/logger.go +++ b/logger.go @@ -26,4 +26,4 @@ func (NoopLogger) Printf(format string, a ...interface{}) {} func (NoopLogger) Print(a ...interface{}) {} -func (NoopLogger) Println(a ...interface{}) {} \ No newline at end of file +func (NoopLogger) Println(a ...interface{}) {} diff --git a/response/response.go b/response/response.go index 3066ba3..1cc0167 100644 --- a/response/response.go +++ b/response/response.go @@ -18,8 +18,8 @@ package response import ( "bytes" - "github.com/pkg/errors" "github.com/paypal/gorealis/gen-go/apache/aurora" + "github.com/pkg/errors" ) // Get key from a response created by a StartJobUpdate call diff --git a/updatejob.go b/updatejob.go index d772141..502f54f 100644 --- a/updatejob.go +++ b/updatejob.go @@ -24,8 +24,6 @@ type UpdateJob struct { req *aurora.JobUpdateRequest } - - // Create a default UpdateJob object. func NewDefaultUpdateJob(config *aurora.TaskConfig) *UpdateJob { @@ -141,7 +139,6 @@ func (u *UpdateJob) RollbackOnFail(rollback bool) *UpdateJob { return u } - // TODO(rdelvalle): Integrate this struct with the JobUpdate struct so that we don't repeat code type UpdateSettings struct { settings aurora.JobUpdateSettings diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go index d0bae21..c8bb887 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go @@ -48,7 +48,7 @@ func NewTFramedTransportFactory(factory TTransportFactory) TTransportFactory { } func NewTFramedTransportFactoryMaxLength(factory TTransportFactory, maxLength uint32) TTransportFactory { - return &tFramedTransportFactory{factory: factory, maxLength: maxLength} + return &tFramedTransportFactory{factory: factory, maxLength: maxLength} } func (p *tFramedTransportFactory) GetTransport(base TTransport) TTransport { @@ -164,4 +164,3 @@ func (p *TFramedTransport) readFrameHeader() (uint32, error) { func (p *TFramedTransport) RemainingBytes() (num_bytes uint64) { return uint64(p.frameSize) } - diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/iostream_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/iostream_transport.go index 794872f..70bede9 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/iostream_transport.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/iostream_transport.go @@ -209,6 +209,5 @@ func (p *StreamTransport) WriteString(s string) (n int, err error) { func (p *StreamTransport) RemainingBytes() (num_bytes uint64) { const maxSize = ^uint64(0) - return maxSize // the thruth is, we just don't know unless framed is used + return maxSize // the thruth is, we just don't know unless framed is used } - diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go index 32bb7b3..25e6d24 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go @@ -89,9 +89,9 @@ func SkipDefaultDepth(prot TProtocol, typeId TType) (err error) { // Skips over the next data element from the provided input TProtocol object. func Skip(self TProtocol, fieldType TType, maxDepth int) (err error) { - - if maxDepth <= 0 { - return NewTProtocolExceptionWithType( DEPTH_LIMIT, errors.New("Depth limit exceeded")) + + if maxDepth <= 0 { + return NewTProtocolExceptionWithType(DEPTH_LIMIT, errors.New("Depth limit exceeded")) } switch fieldType { diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_exception.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_exception.go index 6e357ee..29ab75d 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_exception.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_exception.go @@ -60,7 +60,7 @@ func NewTProtocolException(err error) TProtocolException { if err == nil { return nil } - if e,ok := err.(TProtocolException); ok { + if e, ok := err.(TProtocolException); ok { return e } if _, ok := err.(base64.CorruptInputError); ok { @@ -75,4 +75,3 @@ func NewTProtocolExceptionWithType(errType int, err error) TProtocolException { } return &tProtocolException{errType, err.Error()} } - diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/rich_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/rich_transport.go index 8e296a9..4025beb 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/rich_transport.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/rich_transport.go @@ -66,4 +66,3 @@ func writeByte(w io.Writer, c byte) error { _, err := w.Write(v[0:1]) return err } - diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_server.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_server.go index 4097c4a..90ebd19 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_server.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_server.go @@ -188,7 +188,7 @@ func (p *TSimpleServer) processRequests(client TTransport) error { if err, ok := err.(TApplicationException); ok && err.TypeId() == UNKNOWN_METHOD { continue } - if !ok { + if !ok { break } } diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go index 82e28b4..383b1fe 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go @@ -161,6 +161,5 @@ func (p *TSocket) Interrupt() error { func (p *TSocket) RemainingBytes() (num_bytes uint64) { const maxSize = ^uint64(0) - return maxSize // the thruth is, we just don't know unless framed is used + return maxSize // the thruth is, we just don't know unless framed is used } - diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_server_socket.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_server_socket.go index 58f859b..0615528 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_server_socket.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_server_socket.go @@ -20,9 +20,9 @@ package thrift import ( + "crypto/tls" "net" "time" - "crypto/tls" ) type TSSLServerSocket struct { diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go index 04d3850..86a68a3 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go @@ -166,6 +166,5 @@ func (p *TSSLSocket) Interrupt() error { func (p *TSSLSocket) RemainingBytes() (num_bytes uint64) { const maxSize = ^uint64(0) - return maxSize // the thruth is, we just don't know unless framed is used + return maxSize // the thruth is, we just don't know unless framed is used } - diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go index 4538996..70a85a8 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go @@ -34,7 +34,6 @@ type ReadSizeProvider interface { RemainingBytes() (num_bytes uint64) } - // Encapsulates the I/O layer type TTransport interface { io.ReadWriteCloser @@ -52,7 +51,6 @@ type stringWriter interface { WriteString(s string) (n int, err error) } - // This is "enchanced" transport with extra capabilities. You need to use one of these // to construct protocol. // Notably, TSocket does not implement this interface, and it is always a mistake to use @@ -65,4 +63,3 @@ type TRichTransport interface { Flusher ReadSizeProvider } - diff --git a/zk.go b/zk.go index 3344d8d..a8a2fe6 100644 --- a/zk.go +++ b/zk.go @@ -36,7 +36,6 @@ type ServiceInstance struct { Status string `json:"status"` } - // Retrieves current Aurora leader from ZK. func LeaderFromZK(cluster Cluster) (string, error) {