commit 39385bc8b2ba0adaaa0ea2c7629bce7a9c945e9e Author: Barak Michener Date: Thu Dec 3 20:05:30 2020 +0000 stub out some initial work and go generate diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff4e051 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +go_raylet diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..c554d2e --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module github.com/barakmich/go_raylet + +go 1.15 + +require ( + github.com/gogo/protobuf v1.3.1 + google.golang.org/grpc v1.34.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..4a4ac87 --- /dev/null +++ b/go.sum @@ -0,0 +1,87 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.34.0 h1:raiipEjMOIC/TO2AvyTxP25XFdLxNIBwzDh3FM3XztI= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/main.go b/main.go new file mode 100644 index 0000000..be59112 --- /dev/null +++ b/main.go @@ -0,0 +1,45 @@ +package main + +import ( + "flag" + "fmt" + "io/ioutil" + "net" + "os" + + "github.com/barakmich/go_raylet/ray_rpc" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/grpclog" +) + +var ( + gRPCPort = flag.Int("grpc-port", 50000, "The gRPC server port") + httpPort = flag.Int("http-port", 8080, "The HTTP server port") +) + +var log grpclog.LoggerV2 + +func init() { + log = grpclog.NewLoggerV2(os.Stdout, ioutil.Discard, ioutil.Discard) + grpclog.SetLoggerV2(log) +} + +func main() { + flag.Parse() + addr := fmt.Sprintf("0.0.0.0:%d", *gRPCPort) + lis, err := net.Listen("tcp", addr) + if err != nil { + log.Fatalln("Failed to listen:", err) + } + s := grpc.NewServer( + grpc.Creds(insecure.NewCredentials()), + ) + ray_rpc.RegisterRayletDriverServer(s, NewRayletServicer()) + + // Serve gRPC Server + log.Info("Serving gRPC on https://", addr) + go func() { + log.Fatal(s.Serve(lis)) + }() +} diff --git a/object.go b/object.go new file mode 100644 index 0000000..5ef6a38 --- /dev/null +++ b/object.go @@ -0,0 +1,79 @@ +package main + +import ( + "errors" + "sync" + "time" +) + +type ObjectID int64 + +var ErrObjectNotFound = errors.New("object not found") + +type ObjectStore interface { + AwaitObjects(ids []ObjectID, c chan ObjectResult, timeout *time.Duration) + MakeObject(data []byte) (ObjectID, error) +} + +type ObjectResult struct { + Object *Object + Error error +} + +type Object struct { + ID ObjectID + Data []byte +} + +func GetObject(s ObjectStore, id ObjectID) ([]byte, error) { + c := make(chan ObjectResult) + defer close(c) + ids := []ObjectID{id} + go func() { + s.AwaitObjects(ids, c, nil) + }() + obj := <-c + if !ok { + return nil, errors.New("Couldn't get object") + } + if obj.Error != nil { + return nil, obj.Error + } + return obj.Object.Data, nil +} + +type MemObjectStore struct { + sync.RWMutex + db map[ObjectID][]byte +} + +func (mem *MemObjectStore) AwaitObjects(ids []ObjectID, c chan Object, timeout *time.Duration) { + if timeout != nil { + panic("timeout not yet implemented") + } + mem.RLock() + defer mem.RUnlock() + for _, id := range ids { + v, ok := mem.db[id] + if !ok { + c <- ObjectResult{Error: ErrObjectNotFound} + } else { + c <- ObjectResult{&Object{ID: id, Data: v}} + } + } + close(c) +} + +func (mem *MemObjectStore) MakeObject(data []byte) (ObjectID, error) { + mem.Lock() + defer mem.Unlock() + id := mem.makeID() + mem.db[id] = data + return id, nil +} + +func NewMemObjectStore() *MemObjectStore { + return &MemObjectStore{ + db: make(map[ObjectID][]byte), + } +} diff --git a/ray_rpc/client.go b/ray_rpc/client.go new file mode 100644 index 0000000..2f3fbae --- /dev/null +++ b/ray_rpc/client.go @@ -0,0 +1,3 @@ +package ray_rpc + +//go:generate protoc --proto_path=. --gogoslick_out=plugins=grpc:. ray_client.proto diff --git a/ray_rpc/ray_client.pb.go b/ray_rpc/ray_client.pb.go new file mode 100644 index 0000000..c432ac5 --- /dev/null +++ b/ray_rpc/ray_client.pb.go @@ -0,0 +1,3001 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ray_client.proto + +package ray_rpc + +import ( + bytes "bytes" + context "context" + encoding_binary "encoding/binary" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strconv "strconv" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Type int32 + +const ( + DEFAULT Type = 0 +) + +var Type_name = map[int32]string{ + 0: "DEFAULT", +} + +var Type_value = map[string]int32{ + "DEFAULT": 0, +} + +func (Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{0} +} + +type Arg_Locality int32 + +const ( + INTERNED Arg_Locality = 0 + REFERENCE Arg_Locality = 1 +) + +var Arg_Locality_name = map[int32]string{ + 0: "INTERNED", + 1: "REFERENCE", +} + +var Arg_Locality_value = map[string]int32{ + "INTERNED": 0, + "REFERENCE": 1, +} + +func (Arg_Locality) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{0, 0} +} + +type ClientTask_RemoteExecType int32 + +const ( + FUNCTION ClientTask_RemoteExecType = 0 + ACTOR ClientTask_RemoteExecType = 1 + METHOD ClientTask_RemoteExecType = 2 + STATIC_METHOD ClientTask_RemoteExecType = 3 +) + +var ClientTask_RemoteExecType_name = map[int32]string{ + 0: "FUNCTION", + 1: "ACTOR", + 2: "METHOD", + 3: "STATIC_METHOD", +} + +var ClientTask_RemoteExecType_value = map[string]int32{ + "FUNCTION": 0, + "ACTOR": 1, + "METHOD": 2, + "STATIC_METHOD": 3, +} + +func (ClientTask_RemoteExecType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{1, 0} +} + +type Arg struct { + Local Arg_Locality `protobuf:"varint,1,opt,name=local,proto3,enum=ray.rpc.Arg_Locality" json:"local,omitempty"` + ReferenceId []byte `protobuf:"bytes,2,opt,name=reference_id,json=referenceId,proto3" json:"reference_id,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Type Type `protobuf:"varint,4,opt,name=type,proto3,enum=ray.rpc.Type" json:"type,omitempty"` +} + +func (m *Arg) Reset() { *m = Arg{} } +func (*Arg) ProtoMessage() {} +func (*Arg) Descriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{0} +} +func (m *Arg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Arg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Arg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Arg) XXX_Merge(src proto.Message) { + xxx_messageInfo_Arg.Merge(m, src) +} +func (m *Arg) XXX_Size() int { + return m.Size() +} +func (m *Arg) XXX_DiscardUnknown() { + xxx_messageInfo_Arg.DiscardUnknown(m) +} + +var xxx_messageInfo_Arg proto.InternalMessageInfo + +func (m *Arg) GetLocal() Arg_Locality { + if m != nil { + return m.Local + } + return INTERNED +} + +func (m *Arg) GetReferenceId() []byte { + if m != nil { + return m.ReferenceId + } + return nil +} + +func (m *Arg) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *Arg) GetType() Type { + if m != nil { + return m.Type + } + return DEFAULT +} + +type ClientTask struct { + Type ClientTask_RemoteExecType `protobuf:"varint,1,opt,name=type,proto3,enum=ray.rpc.ClientTask_RemoteExecType" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + PayloadId []byte `protobuf:"bytes,3,opt,name=payload_id,json=payloadId,proto3" json:"payload_id,omitempty"` + Args []*Arg `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"` +} + +func (m *ClientTask) Reset() { *m = ClientTask{} } +func (*ClientTask) ProtoMessage() {} +func (*ClientTask) Descriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{1} +} +func (m *ClientTask) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientTask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientTask.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClientTask) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientTask.Merge(m, src) +} +func (m *ClientTask) XXX_Size() int { + return m.Size() +} +func (m *ClientTask) XXX_DiscardUnknown() { + xxx_messageInfo_ClientTask.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientTask proto.InternalMessageInfo + +func (m *ClientTask) GetType() ClientTask_RemoteExecType { + if m != nil { + return m.Type + } + return FUNCTION +} + +func (m *ClientTask) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ClientTask) GetPayloadId() []byte { + if m != nil { + return m.PayloadId + } + return nil +} + +func (m *ClientTask) GetArgs() []*Arg { + if m != nil { + return m.Args + } + return nil +} + +type ClientTaskTicket struct { + ReturnId []byte `protobuf:"bytes,1,opt,name=return_id,json=returnId,proto3" json:"return_id,omitempty"` +} + +func (m *ClientTaskTicket) Reset() { *m = ClientTaskTicket{} } +func (*ClientTaskTicket) ProtoMessage() {} +func (*ClientTaskTicket) Descriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{2} +} +func (m *ClientTaskTicket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientTaskTicket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientTaskTicket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClientTaskTicket) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientTaskTicket.Merge(m, src) +} +func (m *ClientTaskTicket) XXX_Size() int { + return m.Size() +} +func (m *ClientTaskTicket) XXX_DiscardUnknown() { + xxx_messageInfo_ClientTaskTicket.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientTaskTicket proto.InternalMessageInfo + +func (m *ClientTaskTicket) GetReturnId() []byte { + if m != nil { + return m.ReturnId + } + return nil +} + +type PutRequest struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *PutRequest) Reset() { *m = PutRequest{} } +func (*PutRequest) ProtoMessage() {} +func (*PutRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{3} +} +func (m *PutRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PutRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PutRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PutRequest.Merge(m, src) +} +func (m *PutRequest) XXX_Size() int { + return m.Size() +} +func (m *PutRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PutRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PutRequest proto.InternalMessageInfo + +func (m *PutRequest) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +type PutResponse struct { + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *PutResponse) Reset() { *m = PutResponse{} } +func (*PutResponse) ProtoMessage() {} +func (*PutResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{4} +} +func (m *PutResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PutResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PutResponse.Merge(m, src) +} +func (m *PutResponse) XXX_Size() int { + return m.Size() +} +func (m *PutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PutResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PutResponse proto.InternalMessageInfo + +func (m *PutResponse) GetId() []byte { + if m != nil { + return m.Id + } + return nil +} + +type GetRequest struct { + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *GetRequest) Reset() { *m = GetRequest{} } +func (*GetRequest) ProtoMessage() {} +func (*GetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{5} +} +func (m *GetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetRequest.Merge(m, src) +} +func (m *GetRequest) XXX_Size() int { + return m.Size() +} +func (m *GetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetRequest proto.InternalMessageInfo + +func (m *GetRequest) GetId() []byte { + if m != nil { + return m.Id + } + return nil +} + +type GetResponse struct { + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *GetResponse) Reset() { *m = GetResponse{} } +func (*GetResponse) ProtoMessage() {} +func (*GetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{6} +} +func (m *GetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetResponse.Merge(m, src) +} +func (m *GetResponse) XXX_Size() int { + return m.Size() +} +func (m *GetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetResponse proto.InternalMessageInfo + +func (m *GetResponse) GetValid() bool { + if m != nil { + return m.Valid + } + return false +} + +func (m *GetResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +type WaitRequest struct { + ObjectRefs [][]byte `protobuf:"bytes,1,rep,name=object_refs,json=objectRefs,proto3" json:"object_refs,omitempty"` + NumReturns int64 `protobuf:"varint,2,opt,name=num_returns,json=numReturns,proto3" json:"num_returns,omitempty"` + Timeout float64 `protobuf:"fixed64,3,opt,name=timeout,proto3" json:"timeout,omitempty"` +} + +func (m *WaitRequest) Reset() { *m = WaitRequest{} } +func (*WaitRequest) ProtoMessage() {} +func (*WaitRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{7} +} +func (m *WaitRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WaitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WaitRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WaitRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WaitRequest.Merge(m, src) +} +func (m *WaitRequest) XXX_Size() int { + return m.Size() +} +func (m *WaitRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WaitRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_WaitRequest proto.InternalMessageInfo + +func (m *WaitRequest) GetObjectRefs() [][]byte { + if m != nil { + return m.ObjectRefs + } + return nil +} + +func (m *WaitRequest) GetNumReturns() int64 { + if m != nil { + return m.NumReturns + } + return 0 +} + +func (m *WaitRequest) GetTimeout() float64 { + if m != nil { + return m.Timeout + } + return 0 +} + +type WaitResponse struct { + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` + ReadyObjectIds [][]byte `protobuf:"bytes,2,rep,name=ready_object_ids,json=readyObjectIds,proto3" json:"ready_object_ids,omitempty"` + RemainingObjectIds [][]byte `protobuf:"bytes,3,rep,name=remaining_object_ids,json=remainingObjectIds,proto3" json:"remaining_object_ids,omitempty"` +} + +func (m *WaitResponse) Reset() { *m = WaitResponse{} } +func (*WaitResponse) ProtoMessage() {} +func (*WaitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b171423e2687a533, []int{8} +} +func (m *WaitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WaitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WaitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WaitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_WaitResponse.Merge(m, src) +} +func (m *WaitResponse) XXX_Size() int { + return m.Size() +} +func (m *WaitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_WaitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_WaitResponse proto.InternalMessageInfo + +func (m *WaitResponse) GetValid() bool { + if m != nil { + return m.Valid + } + return false +} + +func (m *WaitResponse) GetReadyObjectIds() [][]byte { + if m != nil { + return m.ReadyObjectIds + } + return nil +} + +func (m *WaitResponse) GetRemainingObjectIds() [][]byte { + if m != nil { + return m.RemainingObjectIds + } + return nil +} + +func init() { + proto.RegisterEnum("ray.rpc.Type", Type_name, Type_value) + proto.RegisterEnum("ray.rpc.Arg_Locality", Arg_Locality_name, Arg_Locality_value) + proto.RegisterEnum("ray.rpc.ClientTask_RemoteExecType", ClientTask_RemoteExecType_name, ClientTask_RemoteExecType_value) + proto.RegisterType((*Arg)(nil), "ray.rpc.Arg") + proto.RegisterType((*ClientTask)(nil), "ray.rpc.ClientTask") + proto.RegisterType((*ClientTaskTicket)(nil), "ray.rpc.ClientTaskTicket") + proto.RegisterType((*PutRequest)(nil), "ray.rpc.PutRequest") + proto.RegisterType((*PutResponse)(nil), "ray.rpc.PutResponse") + proto.RegisterType((*GetRequest)(nil), "ray.rpc.GetRequest") + proto.RegisterType((*GetResponse)(nil), "ray.rpc.GetResponse") + proto.RegisterType((*WaitRequest)(nil), "ray.rpc.WaitRequest") + proto.RegisterType((*WaitResponse)(nil), "ray.rpc.WaitResponse") +} + +func init() { proto.RegisterFile("ray_client.proto", fileDescriptor_b171423e2687a533) } + +var fileDescriptor_b171423e2687a533 = []byte{ + // 694 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xc1, 0x4e, 0xdb, 0x4a, + 0x14, 0xf5, 0x24, 0x01, 0x92, 0x9b, 0x10, 0xf9, 0x0d, 0x20, 0xe5, 0xf1, 0x1e, 0x7e, 0xc1, 0x9b, + 0x17, 0xb5, 0x52, 0x5a, 0xd1, 0xaa, 0xad, 0xd4, 0x6e, 0xd2, 0xc4, 0x40, 0x24, 0x9a, 0xa0, 0xc1, + 0xa8, 0xcb, 0x68, 0xb0, 0x87, 0xd4, 0x25, 0xb1, 0xd3, 0xf1, 0x18, 0xd5, 0x3b, 0x3e, 0xa1, 0x9f, + 0xd1, 0x1f, 0xe8, 0x3f, 0x74, 0xc9, 0x92, 0x65, 0x49, 0x36, 0x5d, 0xf2, 0x03, 0x95, 0x2a, 0x8f, + 0x8d, 0x6d, 0x68, 0xd5, 0x9d, 0xe7, 0xdc, 0x73, 0xee, 0xb9, 0x67, 0xee, 0xc8, 0xa0, 0x72, 0x1a, + 0x8e, 0xac, 0x89, 0xc3, 0x5c, 0xd1, 0x9e, 0x71, 0x4f, 0x78, 0x78, 0x85, 0xd3, 0xb0, 0xcd, 0x67, + 0x96, 0xfe, 0x05, 0x41, 0xb1, 0xc3, 0xc7, 0xf8, 0x21, 0x2c, 0x4d, 0x3c, 0x8b, 0x4e, 0x1a, 0xa8, + 0x89, 0x5a, 0xf5, 0x9d, 0x8d, 0x76, 0x42, 0x68, 0x77, 0xf8, 0xb8, 0x7d, 0x10, 0x55, 0x1c, 0x11, + 0x92, 0x98, 0x83, 0xb7, 0xa1, 0xc6, 0xd9, 0x29, 0xe3, 0xcc, 0xb5, 0xd8, 0xc8, 0xb1, 0x1b, 0x85, + 0x26, 0x6a, 0xd5, 0x48, 0x35, 0xc5, 0xfa, 0x36, 0xc6, 0x50, 0xb2, 0xa9, 0xa0, 0x8d, 0xa2, 0x2c, + 0xc9, 0x6f, 0xbc, 0x0d, 0x25, 0x11, 0xce, 0x58, 0xa3, 0x24, 0x2d, 0x56, 0x53, 0x0b, 0x33, 0x9c, + 0x31, 0x22, 0x4b, 0xfa, 0xff, 0x50, 0xbe, 0x35, 0xc3, 0x35, 0x28, 0xf7, 0x07, 0xa6, 0x41, 0x06, + 0x46, 0x4f, 0x55, 0xf0, 0x2a, 0x54, 0x88, 0xb1, 0x6b, 0x10, 0x63, 0xd0, 0x35, 0x54, 0xa4, 0x2f, + 0x10, 0x40, 0x57, 0x26, 0x32, 0xa9, 0x7f, 0x86, 0x9f, 0x25, 0xad, 0xe3, 0xe9, 0xf5, 0xb4, 0x75, + 0x46, 0x69, 0x13, 0x36, 0xf5, 0x04, 0x33, 0x3e, 0x32, 0x2b, 0xf3, 0x8b, 0xc6, 0x74, 0xe9, 0x94, + 0xc9, 0x04, 0x15, 0x22, 0xbf, 0xf1, 0x16, 0xc0, 0x8c, 0x86, 0x13, 0x8f, 0xda, 0x51, 0xb6, 0x38, + 0x40, 0x25, 0x41, 0xfa, 0x36, 0x6e, 0x42, 0x89, 0xf2, 0xb1, 0xdf, 0x28, 0x35, 0x8b, 0xad, 0xea, + 0x4e, 0x2d, 0x7f, 0x51, 0x44, 0x56, 0xf4, 0x7d, 0xa8, 0xdf, 0x35, 0x8b, 0xa2, 0xec, 0x1e, 0x0f, + 0xba, 0x66, 0x7f, 0x38, 0x50, 0x15, 0x5c, 0x81, 0xa5, 0x4e, 0xd7, 0x1c, 0x12, 0x15, 0x61, 0x80, + 0xe5, 0x37, 0x86, 0xb9, 0x3f, 0xec, 0xa9, 0x05, 0xfc, 0x17, 0xac, 0x1e, 0x99, 0x1d, 0xb3, 0xdf, + 0x1d, 0x25, 0x50, 0x51, 0x7f, 0x04, 0x6a, 0x96, 0xc0, 0x74, 0xac, 0x33, 0x26, 0xf0, 0x3f, 0x50, + 0xe1, 0x4c, 0x04, 0xdc, 0x8d, 0xa6, 0x43, 0x72, 0xba, 0x72, 0x0c, 0xf4, 0x6d, 0xbd, 0x09, 0x70, + 0x18, 0x08, 0xc2, 0x3e, 0x04, 0xcc, 0x17, 0xe9, 0x12, 0x50, 0xb6, 0x04, 0x7d, 0x0b, 0xaa, 0x92, + 0xe1, 0xcf, 0x3c, 0xd7, 0x67, 0xb8, 0x0e, 0x85, 0xb4, 0x4d, 0xc1, 0xb1, 0xf5, 0x7f, 0x01, 0xf6, + 0x58, 0xda, 0xe0, 0x7e, 0xf5, 0x39, 0x54, 0x65, 0x35, 0x11, 0xaf, 0xc3, 0xd2, 0x39, 0x9d, 0x24, + 0x8c, 0x32, 0x89, 0x0f, 0xa9, 0x6b, 0x21, 0xe7, 0xea, 0x40, 0xf5, 0x2d, 0x75, 0xd2, 0xbe, 0xff, + 0x41, 0xd5, 0x3b, 0x79, 0xcf, 0x2c, 0x31, 0xe2, 0xec, 0xd4, 0x6f, 0xa0, 0x66, 0xb1, 0x55, 0x23, + 0x10, 0x43, 0x84, 0x9d, 0xfa, 0x11, 0xc1, 0x0d, 0xa6, 0xa3, 0x38, 0x97, 0x2f, 0x5b, 0x15, 0x09, + 0xb8, 0xc1, 0x94, 0xc4, 0x08, 0x6e, 0xc0, 0x8a, 0x70, 0xa6, 0xcc, 0x0b, 0x84, 0xdc, 0x10, 0x22, + 0xb7, 0x47, 0xfd, 0x02, 0x41, 0x2d, 0xf6, 0xfa, 0xe3, 0x94, 0x2d, 0x50, 0x39, 0xa3, 0x76, 0x38, + 0x4a, 0x06, 0x71, 0xec, 0xc8, 0x26, 0x9a, 0xa3, 0x2e, 0xf1, 0xa1, 0x84, 0xfb, 0xb6, 0x8f, 0x1f, + 0xc3, 0x3a, 0x67, 0x53, 0xea, 0xb8, 0x8e, 0x3b, 0xce, 0xb3, 0x8b, 0x92, 0x8d, 0xd3, 0x5a, 0xaa, + 0x78, 0xb0, 0x06, 0x25, 0xb9, 0xf6, 0x2a, 0xac, 0xf4, 0x8c, 0xdd, 0xce, 0xf1, 0x81, 0xa9, 0x2a, + 0x3b, 0x3f, 0x10, 0xd4, 0x08, 0x0d, 0x27, 0x4c, 0xf4, 0xb8, 0x73, 0xce, 0x38, 0x7e, 0x01, 0x95, + 0x3d, 0x26, 0x62, 0x15, 0x5e, 0x4b, 0xdf, 0x51, 0x76, 0xfd, 0x9b, 0xeb, 0x77, 0xc1, 0x38, 0x8f, + 0xae, 0x44, 0xca, 0xc3, 0xe0, 0x57, 0x65, 0xb6, 0xf9, 0x9c, 0x32, 0xb7, 0x6c, 0x5d, 0xc1, 0x2f, + 0x01, 0xa2, 0xbb, 0x49, 0xa4, 0x19, 0x2b, 0xb7, 0x9c, 0xcd, 0x8d, 0x7b, 0x68, 0x2a, 0x7e, 0x05, + 0xe5, 0x23, 0xeb, 0x1d, 0xb3, 0x83, 0x09, 0xcb, 0xb9, 0x66, 0x0f, 0x74, 0xf3, 0xef, 0xdf, 0x80, + 0xf1, 0xab, 0xd5, 0x95, 0xd7, 0x4f, 0x2f, 0xaf, 0x35, 0xe5, 0xea, 0x5a, 0x53, 0x6e, 0xae, 0x35, + 0x74, 0x31, 0xd7, 0xd0, 0xe7, 0xb9, 0x86, 0xbe, 0xce, 0x35, 0x74, 0x39, 0xd7, 0xd0, 0xb7, 0xb9, + 0x86, 0xbe, 0xcf, 0x35, 0xe5, 0x66, 0xae, 0xa1, 0x4f, 0x0b, 0x4d, 0xb9, 0x5c, 0x68, 0xca, 0xd5, + 0x42, 0x53, 0x4e, 0x96, 0xe5, 0xff, 0xea, 0xc9, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0xa9, + 0x9f, 0x54, 0xc3, 0x04, 0x00, 0x00, +} + +func (x Type) String() string { + s, ok := Type_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) +} +func (x Arg_Locality) String() string { + s, ok := Arg_Locality_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) +} +func (x ClientTask_RemoteExecType) String() string { + s, ok := ClientTask_RemoteExecType_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) +} +func (this *Arg) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Arg) + if !ok { + that2, ok := that.(Arg) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Local != that1.Local { + return false + } + if !bytes.Equal(this.ReferenceId, that1.ReferenceId) { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + if this.Type != that1.Type { + return false + } + return true +} +func (this *ClientTask) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ClientTask) + if !ok { + that2, ok := that.(ClientTask) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Type != that1.Type { + return false + } + if this.Name != that1.Name { + return false + } + if !bytes.Equal(this.PayloadId, that1.PayloadId) { + return false + } + if len(this.Args) != len(that1.Args) { + return false + } + for i := range this.Args { + if !this.Args[i].Equal(that1.Args[i]) { + return false + } + } + return true +} +func (this *ClientTaskTicket) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ClientTaskTicket) + if !ok { + that2, ok := that.(ClientTaskTicket) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.ReturnId, that1.ReturnId) { + return false + } + return true +} +func (this *PutRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PutRequest) + if !ok { + that2, ok := that.(PutRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + return true +} +func (this *PutResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PutResponse) + if !ok { + that2, ok := that.(PutResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Id, that1.Id) { + return false + } + return true +} +func (this *GetRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetRequest) + if !ok { + that2, ok := that.(GetRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Id, that1.Id) { + return false + } + return true +} +func (this *GetResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetResponse) + if !ok { + that2, ok := that.(GetResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Valid != that1.Valid { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + return true +} +func (this *WaitRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*WaitRequest) + if !ok { + that2, ok := that.(WaitRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.ObjectRefs) != len(that1.ObjectRefs) { + return false + } + for i := range this.ObjectRefs { + if !bytes.Equal(this.ObjectRefs[i], that1.ObjectRefs[i]) { + return false + } + } + if this.NumReturns != that1.NumReturns { + return false + } + if this.Timeout != that1.Timeout { + return false + } + return true +} +func (this *WaitResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*WaitResponse) + if !ok { + that2, ok := that.(WaitResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Valid != that1.Valid { + return false + } + if len(this.ReadyObjectIds) != len(that1.ReadyObjectIds) { + return false + } + for i := range this.ReadyObjectIds { + if !bytes.Equal(this.ReadyObjectIds[i], that1.ReadyObjectIds[i]) { + return false + } + } + if len(this.RemainingObjectIds) != len(that1.RemainingObjectIds) { + return false + } + for i := range this.RemainingObjectIds { + if !bytes.Equal(this.RemainingObjectIds[i], that1.RemainingObjectIds[i]) { + return false + } + } + return true +} +func (this *Arg) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&ray_rpc.Arg{") + s = append(s, "Local: "+fmt.Sprintf("%#v", this.Local)+",\n") + s = append(s, "ReferenceId: "+fmt.Sprintf("%#v", this.ReferenceId)+",\n") + s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") + s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ClientTask) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&ray_rpc.ClientTask{") + s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "PayloadId: "+fmt.Sprintf("%#v", this.PayloadId)+",\n") + if this.Args != nil { + s = append(s, "Args: "+fmt.Sprintf("%#v", this.Args)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ClientTaskTicket) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&ray_rpc.ClientTaskTicket{") + s = append(s, "ReturnId: "+fmt.Sprintf("%#v", this.ReturnId)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PutRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&ray_rpc.PutRequest{") + s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PutResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&ray_rpc.PutResponse{") + s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&ray_rpc.GetRequest{") + s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&ray_rpc.GetResponse{") + s = append(s, "Valid: "+fmt.Sprintf("%#v", this.Valid)+",\n") + s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *WaitRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&ray_rpc.WaitRequest{") + s = append(s, "ObjectRefs: "+fmt.Sprintf("%#v", this.ObjectRefs)+",\n") + s = append(s, "NumReturns: "+fmt.Sprintf("%#v", this.NumReturns)+",\n") + s = append(s, "Timeout: "+fmt.Sprintf("%#v", this.Timeout)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *WaitResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&ray_rpc.WaitResponse{") + s = append(s, "Valid: "+fmt.Sprintf("%#v", this.Valid)+",\n") + s = append(s, "ReadyObjectIds: "+fmt.Sprintf("%#v", this.ReadyObjectIds)+",\n") + s = append(s, "RemainingObjectIds: "+fmt.Sprintf("%#v", this.RemainingObjectIds)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringRayClient(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// RayletDriverClient is the client API for RayletDriver service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type RayletDriverClient interface { + GetObject(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) + PutObject(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) + WaitObject(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*WaitResponse, error) + Schedule(ctx context.Context, in *ClientTask, opts ...grpc.CallOption) (*ClientTaskTicket, error) +} + +type rayletDriverClient struct { + cc *grpc.ClientConn +} + +func NewRayletDriverClient(cc *grpc.ClientConn) RayletDriverClient { + return &rayletDriverClient{cc} +} + +func (c *rayletDriverClient) GetObject(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { + out := new(GetResponse) + err := c.cc.Invoke(ctx, "/ray.rpc.RayletDriver/GetObject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rayletDriverClient) PutObject(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { + out := new(PutResponse) + err := c.cc.Invoke(ctx, "/ray.rpc.RayletDriver/PutObject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rayletDriverClient) WaitObject(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*WaitResponse, error) { + out := new(WaitResponse) + err := c.cc.Invoke(ctx, "/ray.rpc.RayletDriver/WaitObject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rayletDriverClient) Schedule(ctx context.Context, in *ClientTask, opts ...grpc.CallOption) (*ClientTaskTicket, error) { + out := new(ClientTaskTicket) + err := c.cc.Invoke(ctx, "/ray.rpc.RayletDriver/Schedule", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RayletDriverServer is the server API for RayletDriver service. +type RayletDriverServer interface { + GetObject(context.Context, *GetRequest) (*GetResponse, error) + PutObject(context.Context, *PutRequest) (*PutResponse, error) + WaitObject(context.Context, *WaitRequest) (*WaitResponse, error) + Schedule(context.Context, *ClientTask) (*ClientTaskTicket, error) +} + +// UnimplementedRayletDriverServer can be embedded to have forward compatible implementations. +type UnimplementedRayletDriverServer struct { +} + +func (*UnimplementedRayletDriverServer) GetObject(ctx context.Context, req *GetRequest) (*GetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetObject not implemented") +} +func (*UnimplementedRayletDriverServer) PutObject(ctx context.Context, req *PutRequest) (*PutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PutObject not implemented") +} +func (*UnimplementedRayletDriverServer) WaitObject(ctx context.Context, req *WaitRequest) (*WaitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WaitObject not implemented") +} +func (*UnimplementedRayletDriverServer) Schedule(ctx context.Context, req *ClientTask) (*ClientTaskTicket, error) { + return nil, status.Errorf(codes.Unimplemented, "method Schedule not implemented") +} + +func RegisterRayletDriverServer(s *grpc.Server, srv RayletDriverServer) { + s.RegisterService(&_RayletDriver_serviceDesc, srv) +} + +func _RayletDriver_GetObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RayletDriverServer).GetObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ray.rpc.RayletDriver/GetObject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RayletDriverServer).GetObject(ctx, req.(*GetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RayletDriver_PutObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RayletDriverServer).PutObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ray.rpc.RayletDriver/PutObject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RayletDriverServer).PutObject(ctx, req.(*PutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RayletDriver_WaitObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WaitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RayletDriverServer).WaitObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ray.rpc.RayletDriver/WaitObject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RayletDriverServer).WaitObject(ctx, req.(*WaitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RayletDriver_Schedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClientTask) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RayletDriverServer).Schedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ray.rpc.RayletDriver/Schedule", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RayletDriverServer).Schedule(ctx, req.(*ClientTask)) + } + return interceptor(ctx, in, info, handler) +} + +var _RayletDriver_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ray.rpc.RayletDriver", + HandlerType: (*RayletDriverServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetObject", + Handler: _RayletDriver_GetObject_Handler, + }, + { + MethodName: "PutObject", + Handler: _RayletDriver_PutObject_Handler, + }, + { + MethodName: "WaitObject", + Handler: _RayletDriver_WaitObject_Handler, + }, + { + MethodName: "Schedule", + Handler: _RayletDriver_Schedule_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ray_client.proto", +} + +func (m *Arg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Arg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Arg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Type != 0 { + i = encodeVarintRayClient(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x20 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x1a + } + if len(m.ReferenceId) > 0 { + i -= len(m.ReferenceId) + copy(dAtA[i:], m.ReferenceId) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.ReferenceId))) + i-- + dAtA[i] = 0x12 + } + if m.Local != 0 { + i = encodeVarintRayClient(dAtA, i, uint64(m.Local)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ClientTask) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClientTask) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientTask) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Args[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRayClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.PayloadId) > 0 { + i -= len(m.PayloadId) + copy(dAtA[i:], m.PayloadId) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.PayloadId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintRayClient(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ClientTaskTicket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClientTaskTicket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientTaskTicket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ReturnId) > 0 { + i -= len(m.ReturnId) + copy(dAtA[i:], m.ReturnId) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.ReturnId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PutRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PutRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PutResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + if m.Valid { + i-- + if m.Valid { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *WaitRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WaitRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WaitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Timeout != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Timeout)))) + i-- + dAtA[i] = 0x19 + } + if m.NumReturns != 0 { + i = encodeVarintRayClient(dAtA, i, uint64(m.NumReturns)) + i-- + dAtA[i] = 0x10 + } + if len(m.ObjectRefs) > 0 { + for iNdEx := len(m.ObjectRefs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ObjectRefs[iNdEx]) + copy(dAtA[i:], m.ObjectRefs[iNdEx]) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.ObjectRefs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *WaitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WaitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WaitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RemainingObjectIds) > 0 { + for iNdEx := len(m.RemainingObjectIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemainingObjectIds[iNdEx]) + copy(dAtA[i:], m.RemainingObjectIds[iNdEx]) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.RemainingObjectIds[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.ReadyObjectIds) > 0 { + for iNdEx := len(m.ReadyObjectIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ReadyObjectIds[iNdEx]) + copy(dAtA[i:], m.ReadyObjectIds[iNdEx]) + i = encodeVarintRayClient(dAtA, i, uint64(len(m.ReadyObjectIds[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Valid { + i-- + if m.Valid { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintRayClient(dAtA []byte, offset int, v uint64) int { + offset -= sovRayClient(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Arg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Local != 0 { + n += 1 + sovRayClient(uint64(m.Local)) + } + l = len(m.ReferenceId) + if l > 0 { + n += 1 + l + sovRayClient(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovRayClient(uint64(l)) + } + if m.Type != 0 { + n += 1 + sovRayClient(uint64(m.Type)) + } + return n +} + +func (m *ClientTask) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovRayClient(uint64(m.Type)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovRayClient(uint64(l)) + } + l = len(m.PayloadId) + if l > 0 { + n += 1 + l + sovRayClient(uint64(l)) + } + if len(m.Args) > 0 { + for _, e := range m.Args { + l = e.Size() + n += 1 + l + sovRayClient(uint64(l)) + } + } + return n +} + +func (m *ClientTaskTicket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ReturnId) + if l > 0 { + n += 1 + l + sovRayClient(uint64(l)) + } + return n +} + +func (m *PutRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovRayClient(uint64(l)) + } + return n +} + +func (m *PutResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovRayClient(uint64(l)) + } + return n +} + +func (m *GetRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovRayClient(uint64(l)) + } + return n +} + +func (m *GetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Valid { + n += 2 + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovRayClient(uint64(l)) + } + return n +} + +func (m *WaitRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ObjectRefs) > 0 { + for _, b := range m.ObjectRefs { + l = len(b) + n += 1 + l + sovRayClient(uint64(l)) + } + } + if m.NumReturns != 0 { + n += 1 + sovRayClient(uint64(m.NumReturns)) + } + if m.Timeout != 0 { + n += 9 + } + return n +} + +func (m *WaitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Valid { + n += 2 + } + if len(m.ReadyObjectIds) > 0 { + for _, b := range m.ReadyObjectIds { + l = len(b) + n += 1 + l + sovRayClient(uint64(l)) + } + } + if len(m.RemainingObjectIds) > 0 { + for _, b := range m.RemainingObjectIds { + l = len(b) + n += 1 + l + sovRayClient(uint64(l)) + } + } + return n +} + +func sovRayClient(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRayClient(x uint64) (n int) { + return sovRayClient(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Arg) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Arg{`, + `Local:` + fmt.Sprintf("%v", this.Local) + `,`, + `ReferenceId:` + fmt.Sprintf("%v", this.ReferenceId) + `,`, + `Data:` + fmt.Sprintf("%v", this.Data) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `}`, + }, "") + return s +} +func (this *ClientTask) String() string { + if this == nil { + return "nil" + } + repeatedStringForArgs := "[]*Arg{" + for _, f := range this.Args { + repeatedStringForArgs += strings.Replace(f.String(), "Arg", "Arg", 1) + "," + } + repeatedStringForArgs += "}" + s := strings.Join([]string{`&ClientTask{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `PayloadId:` + fmt.Sprintf("%v", this.PayloadId) + `,`, + `Args:` + repeatedStringForArgs + `,`, + `}`, + }, "") + return s +} +func (this *ClientTaskTicket) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ClientTaskTicket{`, + `ReturnId:` + fmt.Sprintf("%v", this.ReturnId) + `,`, + `}`, + }, "") + return s +} +func (this *PutRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PutRequest{`, + `Data:` + fmt.Sprintf("%v", this.Data) + `,`, + `}`, + }, "") + return s +} +func (this *PutResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PutResponse{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `}`, + }, "") + return s +} +func (this *GetRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetRequest{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `}`, + }, "") + return s +} +func (this *GetResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetResponse{`, + `Valid:` + fmt.Sprintf("%v", this.Valid) + `,`, + `Data:` + fmt.Sprintf("%v", this.Data) + `,`, + `}`, + }, "") + return s +} +func (this *WaitRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WaitRequest{`, + `ObjectRefs:` + fmt.Sprintf("%v", this.ObjectRefs) + `,`, + `NumReturns:` + fmt.Sprintf("%v", this.NumReturns) + `,`, + `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, + `}`, + }, "") + return s +} +func (this *WaitResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WaitResponse{`, + `Valid:` + fmt.Sprintf("%v", this.Valid) + `,`, + `ReadyObjectIds:` + fmt.Sprintf("%v", this.ReadyObjectIds) + `,`, + `RemainingObjectIds:` + fmt.Sprintf("%v", this.RemainingObjectIds) + `,`, + `}`, + }, "") + return s +} +func valueToStringRayClient(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Arg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Arg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Arg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Local", wireType) + } + m.Local = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Local |= Arg_Locality(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReferenceId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReferenceId = append(m.ReferenceId[:0], dAtA[iNdEx:postIndex]...) + if m.ReferenceId == nil { + m.ReferenceId = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= Type(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRayClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientTask) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClientTask: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientTask: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= ClientTask_RemoteExecType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayloadId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PayloadId = append(m.PayloadId[:0], dAtA[iNdEx:postIndex]...) + if m.PayloadId == nil { + m.PayloadId = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, &Arg{}) + if err := m.Args[len(m.Args)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRayClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientTaskTicket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClientTaskTicket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientTaskTicket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReturnId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReturnId = append(m.ReturnId[:0], dAtA[iNdEx:postIndex]...) + if m.ReturnId == nil { + m.ReturnId = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRayClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PutRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PutRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PutRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRayClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PutResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PutResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) + if m.Id == nil { + m.Id = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRayClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) + if m.Id == nil { + m.Id = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRayClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Valid", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Valid = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRayClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WaitRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WaitRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WaitRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectRefs", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ObjectRefs = append(m.ObjectRefs, make([]byte, postIndex-iNdEx)) + copy(m.ObjectRefs[len(m.ObjectRefs)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumReturns", wireType) + } + m.NumReturns = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumReturns |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Timeout = float64(math.Float64frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipRayClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WaitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WaitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WaitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Valid", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Valid = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadyObjectIds", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReadyObjectIds = append(m.ReadyObjectIds, make([]byte, postIndex-iNdEx)) + copy(m.ReadyObjectIds[len(m.ReadyObjectIds)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemainingObjectIds", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRayClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRayClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRayClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RemainingObjectIds = append(m.RemainingObjectIds, make([]byte, postIndex-iNdEx)) + copy(m.RemainingObjectIds[len(m.RemainingObjectIds)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRayClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRayClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRayClient(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRayClient + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRayClient + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRayClient + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRayClient + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRayClient + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRayClient + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRayClient = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRayClient = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRayClient = fmt.Errorf("proto: unexpected end of group") +) diff --git a/ray_rpc/ray_client.proto b/ray_rpc/ray_client.proto new file mode 100644 index 0000000..fd8fe53 --- /dev/null +++ b/ray_rpc/ray_client.proto @@ -0,0 +1,86 @@ +// Copyright 2020 The Ray Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package ray.rpc; + +enum Type { DEFAULT = 0; } + +message Arg { + enum Locality { + INTERNED = 0; + REFERENCE = 1; + } + Locality local = 1; + bytes reference_id = 2; + bytes data = 3; + Type type = 4; +} + +message ClientTask { + enum RemoteExecType { + FUNCTION = 0; + ACTOR = 1; + METHOD = 2; + STATIC_METHOD = 3; + } + RemoteExecType type = 1; + string name = 2; + bytes payload_id = 3; + repeated Arg args = 4; +} + +message ClientTaskTicket { + bytes return_id = 1; +} + +message PutRequest { + bytes data = 1; +} + +message PutResponse { + bytes id = 1; +} + +message GetRequest { + bytes id = 1; +} + +message GetResponse { + bool valid = 1; + bytes data = 2; +} +message WaitRequest { + repeated bytes object_refs = 1; + int64 num_returns = 2; + double timeout = 3; +} + +message WaitResponse { + bool valid = 1; + repeated bytes ready_object_ids = 2; + repeated bytes remaining_object_ids = 3; +} + +service RayletDriver { + rpc GetObject(GetRequest) returns (GetResponse) { + } + rpc PutObject(PutRequest) returns (PutResponse) { + } + rpc WaitObject(WaitRequest) returns (WaitResponse) { + } + rpc Schedule(ClientTask) returns (ClientTaskTicket) { + } +} diff --git a/servicer.go b/servicer.go new file mode 100644 index 0000000..bab6114 --- /dev/null +++ b/servicer.go @@ -0,0 +1,33 @@ +package main + +import ( + "context" + + "github.com/barakmich/go_raylet/ray_rpc" +) + +type Raylet struct { + Objects ObjectStore +} + +func (r *Raylet) GetObject(_ context.Context, req *ray_rpc.GetRequest) (*ray_rpc.GetResponse, error) { + panic("not implemented") // TODO: Implement +} + +func (r *Raylet) PutObject(_ context.Context, _ *ray_rpc.PutRequest) (*ray_rpc.PutResponse, error) { + panic("not implemented") // TODO: Implement +} + +func (r *Raylet) WaitObject(_ context.Context, _ *ray_rpc.WaitRequest) (*ray_rpc.WaitResponse, error) { + panic("not implemented") // TODO: Implement +} + +func (r *Raylet) Schedule(_ context.Context, _ *ray_rpc.ClientTask) (*ray_rpc.ClientTaskTicket, error) { + panic("not implemented") // TODO: Implement +} + +func NewMemRaylet() *Raylet { + return &Raylet{ + Objects: NewMemObjectStore(), + } +}