From 6a32f1ccb55ad9cc684c0cf67130204dd985ed30 Mon Sep 17 00:00:00 2001 From: John Cai Date: Thu, 24 Oct 2019 16:42:15 -0700 Subject: Add GetObjectPool RPC Adds an RPC to get a repository's object pool. Also added a method under internal/git/objectpool to get an object pool of a repository. --- proto/go/gitalypb/objectpool.pb.go | 191 ++++++++++++++++++++++++++++++------- proto/objectpool.proto | 19 +++- 2 files changed, 172 insertions(+), 38 deletions(-) (limited to 'proto') diff --git a/proto/go/gitalypb/objectpool.pb.go b/proto/go/gitalypb/objectpool.pb.go index 2fa353791..5fd046192 100644 --- a/proto/go/gitalypb/objectpool.pb.go +++ b/proto/go/gitalypb/objectpool.pb.go @@ -562,6 +562,84 @@ func (m *FetchIntoObjectPoolResponse) XXX_DiscardUnknown() { var xxx_messageInfo_FetchIntoObjectPoolResponse proto.InternalMessageInfo +type GetObjectPoolRequest struct { + Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetObjectPoolRequest) Reset() { *m = GetObjectPoolRequest{} } +func (m *GetObjectPoolRequest) String() string { return proto.CompactTextString(m) } +func (*GetObjectPoolRequest) ProtoMessage() {} +func (*GetObjectPoolRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_949871727a345eae, []int{14} +} + +func (m *GetObjectPoolRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetObjectPoolRequest.Unmarshal(m, b) +} +func (m *GetObjectPoolRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetObjectPoolRequest.Marshal(b, m, deterministic) +} +func (m *GetObjectPoolRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetObjectPoolRequest.Merge(m, src) +} +func (m *GetObjectPoolRequest) XXX_Size() int { + return xxx_messageInfo_GetObjectPoolRequest.Size(m) +} +func (m *GetObjectPoolRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetObjectPoolRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetObjectPoolRequest proto.InternalMessageInfo + +func (m *GetObjectPoolRequest) GetRepository() *Repository { + if m != nil { + return m.Repository + } + return nil +} + +type GetObjectPoolResponse struct { + ObjectPool *ObjectPool `protobuf:"bytes,1,opt,name=object_pool,json=objectPool,proto3" json:"object_pool,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetObjectPoolResponse) Reset() { *m = GetObjectPoolResponse{} } +func (m *GetObjectPoolResponse) String() string { return proto.CompactTextString(m) } +func (*GetObjectPoolResponse) ProtoMessage() {} +func (*GetObjectPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_949871727a345eae, []int{15} +} + +func (m *GetObjectPoolResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetObjectPoolResponse.Unmarshal(m, b) +} +func (m *GetObjectPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetObjectPoolResponse.Marshal(b, m, deterministic) +} +func (m *GetObjectPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetObjectPoolResponse.Merge(m, src) +} +func (m *GetObjectPoolResponse) XXX_Size() int { + return xxx_messageInfo_GetObjectPoolResponse.Size(m) +} +func (m *GetObjectPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetObjectPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetObjectPoolResponse proto.InternalMessageInfo + +func (m *GetObjectPoolResponse) GetObjectPool() *ObjectPool { + if m != nil { + return m.ObjectPool + } + return nil +} + func init() { proto.RegisterType((*CreateObjectPoolRequest)(nil), "gitaly.CreateObjectPoolRequest") proto.RegisterType((*CreateObjectPoolResponse)(nil), "gitaly.CreateObjectPoolResponse") @@ -577,47 +655,52 @@ func init() { proto.RegisterType((*DisconnectGitAlternatesResponse)(nil), "gitaly.DisconnectGitAlternatesResponse") proto.RegisterType((*FetchIntoObjectPoolRequest)(nil), "gitaly.FetchIntoObjectPoolRequest") proto.RegisterType((*FetchIntoObjectPoolResponse)(nil), "gitaly.FetchIntoObjectPoolResponse") + proto.RegisterType((*GetObjectPoolRequest)(nil), "gitaly.GetObjectPoolRequest") + proto.RegisterType((*GetObjectPoolResponse)(nil), "gitaly.GetObjectPoolResponse") } func init() { proto.RegisterFile("objectpool.proto", fileDescriptor_949871727a345eae) } var fileDescriptor_949871727a345eae = []byte{ - // 557 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0x35, 0xad, 0x08, 0xe1, 0xa6, 0x42, 0x61, 0x10, 0x24, 0x1a, 0x68, 0x93, 0x0e, 0x6d, - 0x31, 0x95, 0xea, 0x10, 0xf7, 0x09, 0x80, 0xaa, 0x08, 0x09, 0x01, 0x32, 0x65, 0xc3, 0x06, 0x39, - 0xee, 0x55, 0x6a, 0xea, 0x7a, 0xcc, 0x78, 0x82, 0x54, 0xb6, 0x6c, 0x41, 0x62, 0x83, 0xf2, 0x52, - 0x3c, 0x51, 0x56, 0x28, 0xf6, 0x24, 0xce, 0xdf, 0x24, 0x56, 0xdb, 0x9d, 0x6d, 0x9d, 0x9c, 0xf3, - 0xf9, 0xfa, 0x9e, 0x09, 0x54, 0x45, 0xe7, 0x2b, 0xfa, 0x2a, 0x16, 0x22, 0xb4, 0x63, 0x29, 0x94, - 0xa0, 0xa5, 0x6e, 0xa0, 0xbc, 0xf0, 0x92, 0x6d, 0x24, 0x67, 0x9e, 0xc4, 0xd3, 0xec, 0x29, 0xff, - 0x01, 0xb5, 0x57, 0x12, 0x3d, 0x85, 0xef, 0x53, 0xfd, 0x07, 0x21, 0x42, 0x17, 0xbf, 0xf5, 0x30, - 0x51, 0xf4, 0x10, 0x2a, 0x99, 0xc9, 0x97, 0xa1, 0x4b, 0x9d, 0x34, 0x89, 0x55, 0x71, 0xa8, 0x9d, - 0xd9, 0xd8, 0x13, 0x7a, 0x10, 0xe3, 0x6b, 0xba, 0x0f, 0x25, 0x21, 0x83, 0x6e, 0x10, 0xd5, 0xd7, - 0xa6, 0xf5, 0x2e, 0xc6, 0x22, 0x09, 0x94, 0x90, 0x97, 0xae, 0x56, 0x70, 0x06, 0xf5, 0xf9, 0xec, - 0x24, 0x16, 0x51, 0x82, 0xfc, 0x1d, 0xd4, 0x8e, 0x30, 0xc4, 0x9b, 0xe2, 0x1a, 0x66, 0xcd, 0xfb, - 0xe9, 0xac, 0x5f, 0x04, 0xb6, 0xdf, 0x06, 0xd1, 0x79, 0x8e, 0x78, 0x22, 0x6e, 0x68, 0x1c, 0x0e, - 0x80, 0x1c, 0xbb, 0x2e, 0x19, 0xc9, 0x84, 0x8a, 0xef, 0x00, 0x5f, 0x46, 0xa3, 0xa1, 0xff, 0x10, - 0xd8, 0xfd, 0x14, 0x85, 0x53, 0xc2, 0x63, 0x29, 0x2e, 0xe6, 0xc1, 0xa7, 0x19, 0x48, 0x11, 0x86, - 0xd9, 0x97, 0x5d, 0x2b, 0x34, 0x63, 0x0b, 0xf6, 0x56, 0x11, 0x69, 0x78, 0x17, 0x1e, 0xbb, 0x78, - 0xda, 0x8b, 0xc3, 0xc0, 0xf7, 0x14, 0x4e, 0x30, 0x5c, 0x1d, 0x99, 0x37, 0x60, 0xd3, 0xe0, 0xa9, - 0x43, 0x4f, 0x60, 0xeb, 0x28, 0x48, 0x7c, 0x11, 0x45, 0xe8, 0xab, 0xd7, 0x81, 0x7a, 0x11, 0x2a, - 0x94, 0x91, 0xa7, 0x30, 0xb9, 0x4e, 0xec, 0x36, 0x34, 0x8c, 0xae, 0x3a, 0xf8, 0x2f, 0x01, 0x76, - 0x8c, 0xca, 0x3f, 0x7b, 0x13, 0xa9, 0x05, 0x8b, 0x95, 0x57,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0xa7, 0x7c, - 0x64, 0x65, 0x6e, 0x2c, 0x7b, 0xb2, 0x54, 0x33, 0xbb, 0xd1, 0xce, 0x70, 0xa3, 0xdb, 0x2f, 0x9f, - 0x7f, 0x1e, 0xfe, 0x2a, 0xf4, 0x3a, 0xb6, 0x2f, 0x2e, 0x5a, 0xd9, 0xe5, 0x81, 0x90, 0xdd, 0x56, - 0xe6, 0xd5, 0x4a, 0xff, 0x8f, 0x5b, 0x5d, 0xa1, 0xef, 0xe3, 0x4e, 0xa7, 0x94, 0x3e, 0x3a, 0xfc, - 0x1f, 0x00, 0x00, 0xff, 0xff, 0xb8, 0xbc, 0xac, 0x59, 0xcc, 0x07, 0x00, 0x00, + // 598 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x6e, 0xd3, 0x40, + 0x18, 0xd4, 0xa6, 0x22, 0x0d, 0x5f, 0x0a, 0x0a, 0x0b, 0x25, 0xd1, 0xd2, 0x34, 0xe9, 0xd2, 0x16, + 0x53, 0xa9, 0x0e, 0x71, 0x9f, 0x00, 0xa8, 0x5a, 0x81, 0x2a, 0x40, 0xa6, 0x08, 0x89, 0x0b, 0x72, + 0xdc, 0x55, 0x6a, 0xea, 0x7a, 0xcd, 0x7a, 0x83, 0x54, 0xae, 0x5c, 0x41, 0xe2, 0x82, 0xf2, 0x04, + 0xbc, 0x64, 0x4e, 0x28, 0xf6, 0x26, 0x4e, 0x9c, 0x6c, 0x12, 0x85, 0xdc, 0xfc, 0x33, 0x9a, 0x99, + 0xfd, 0xfc, 0xcd, 0xc8, 0x50, 0xe2, 0xad, 0x2f, 0xcc, 0x95, 0x21, 0xe7, 0xbe, 0x19, 0x0a, 0x2e, + 0x39, 0xce, 0xb7, 0x3d, 0xe9, 0xf8, 0x37, 0x64, 0x23, 0xba, 0x74, 0x04, 0xbb, 0x48, 0x9e, 0xd2, + 0xef, 0x50, 0x7e, 0x29, 0x98, 0x23, 0xd9, 0xdb, 0x18, 0xff, 0x8e, 0x73, 0xdf, 0x66, 0x5f, 0x3b, + 0x2c, 0x92, 0xf8, 0x08, 0x8a, 0x09, 0xc9, 0xe7, 0x3e, 0x4b, 0x05, 0xd5, 0x91, 0x51, 0xb4, 0xb0, + 0x99, 0xd0, 0x98, 0x23, 0x78, 0xe0, 0xc3, 0x6b, 0x7c, 0x00, 0x79, 0x2e, 0xbc, 0xb6, 0x17, 0x54, + 0x72, 0xe3, 0x78, 0x9b, 0x85, 0x3c, 0xf2, 0x24, 0x17, 0x37, 0xb6, 0x42, 0x50, 0x02, 0x95, 0x49, + 0xed, 0x28, 0xe4, 0x41, 0xc4, 0xe8, 0x1b, 0x28, 0x1f, 0x33, 0x9f, 0xad, 0xca, 0x57, 0x5f, 0x6b, + 0x92, 0x4f, 0x69, 0xfd, 0x44, 0xb0, 0x73, 0xe6, 0x05, 0x57, 0xa9, 0xc5, 0x73, 0xbe, 0xa2, 0x71, + 0x58, 0x00, 0x62, 0xc8, 0x3a, 0x63, 0x24, 0x23, 0x28, 0xba, 0x0b, 0x74, 0x96, 0x1b, 0x65, 0xfa, + 0x37, 0x82, 0xbd, 0x0f, 0x81, 0x3f, 0x06, 0x3c, 0x11, 0xfc, 0x7a, 0xd2, 0xf8, 0xb8, 0x07, 0xb4, + 0x88, 0x87, 0xec, 0x61, 0x73, 0x0b, 0xcd, 0xd8, 0x80, 0xfd, 0x79, 0x8e, 0x94, 0x79, 0x1b, 0xb6, + 0x6c, 0x76, 0xd1, 0x09, 0x7d, 0xcf, 0x75, 0x24, 0x1b, 0xf1, 0xb0, 0xbc, 0x65, 0x5a, 0x83, 0xaa, + 0x86, 0x53, 0x89, 0x9e, 0xc3, 0xf6, 0xb1, 0x17, 0xb9, 0x3c, 0x08, 0x98, 0x2b, 0x4f, 0x3d, 0xf9, + 0xdc, 0x97, 0x4c, 0x04, 0x8e, 0x64, 0xd1, 0xff, 0xc8, 0xee, 0x40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5, + 0x42, 0xf6, 0xe6, 0xa0, 0x94, 0xe6, 0xed, 0x5e, 0xd7, 0xb8, 0x15, 0x6b, 0xe2, 0x0e, 0x94, 0x35, + 0xd9, 0xc6, 0xfb, 0xc3, 0x0f, 0x3a, 0xb3, 0x52, 0xc8, 0x93, 0xb9, 0xb8, 0x49, 0xd9, 0x00, 0xee, + 0x4f, 0xc9, 0x25, 0xa6, 0x03, 0x2a, 0x7d, 0x97, 0x90, 0xc7, 0x33, 0x31, 0xd9, 0x8d, 0xb6, 0xfa, + 0x1b, 0xdd, 0xc4, 0x1f, 0xe1, 0xce, 0x58, 0x38, 0xf1, 0xd6, 0x80, 0x65, 0x5a, 0xfe, 0x49, 0x55, + 0xf3, 0x76, 0xec, 0x20, 0x39, 0x82, 0x9a, 0x2f, 0x9e, 0x7d, 0xea, 0x43, 0x7d, 0xa7, 0x65, 0xba, + 0xfc, 0xba, 0x91, 0x5c, 0x1e, 0x72, 0xd1, 0x6e, 0x24, 0x04, 0x8d, 0xf8, 0x17, 0xa4, 0xd1, 0xe6, + 0xea, 0x3e, 0x6c, 0xb5, 0xf2, 0xf1, 0xa3, 0xa3, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe5, 0xac, + 0x18, 0x11, 0xbf, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -640,6 +723,7 @@ type ObjectPoolServiceClient interface { ReduplicateRepository(ctx context.Context, in *ReduplicateRepositoryRequest, opts ...grpc.CallOption) (*ReduplicateRepositoryResponse, error) DisconnectGitAlternates(ctx context.Context, in *DisconnectGitAlternatesRequest, opts ...grpc.CallOption) (*DisconnectGitAlternatesResponse, error) FetchIntoObjectPool(ctx context.Context, in *FetchIntoObjectPoolRequest, opts ...grpc.CallOption) (*FetchIntoObjectPoolResponse, error) + GetObjectPool(ctx context.Context, in *GetObjectPoolRequest, opts ...grpc.CallOption) (*GetObjectPoolResponse, error) } type objectPoolServiceClient struct { @@ -713,6 +797,15 @@ func (c *objectPoolServiceClient) FetchIntoObjectPool(ctx context.Context, in *F return out, nil } +func (c *objectPoolServiceClient) GetObjectPool(ctx context.Context, in *GetObjectPoolRequest, opts ...grpc.CallOption) (*GetObjectPoolResponse, error) { + out := new(GetObjectPoolResponse) + err := c.cc.Invoke(ctx, "/gitaly.ObjectPoolService/GetObjectPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ObjectPoolServiceServer is the server API for ObjectPoolService service. type ObjectPoolServiceServer interface { CreateObjectPool(context.Context, *CreateObjectPoolRequest) (*CreateObjectPoolResponse, error) @@ -723,6 +816,7 @@ type ObjectPoolServiceServer interface { ReduplicateRepository(context.Context, *ReduplicateRepositoryRequest) (*ReduplicateRepositoryResponse, error) DisconnectGitAlternates(context.Context, *DisconnectGitAlternatesRequest) (*DisconnectGitAlternatesResponse, error) FetchIntoObjectPool(context.Context, *FetchIntoObjectPoolRequest) (*FetchIntoObjectPoolResponse, error) + GetObjectPool(context.Context, *GetObjectPoolRequest) (*GetObjectPoolResponse, error) } // UnimplementedObjectPoolServiceServer can be embedded to have forward compatible implementations. @@ -750,6 +844,9 @@ func (*UnimplementedObjectPoolServiceServer) DisconnectGitAlternates(ctx context func (*UnimplementedObjectPoolServiceServer) FetchIntoObjectPool(ctx context.Context, req *FetchIntoObjectPoolRequest) (*FetchIntoObjectPoolResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FetchIntoObjectPool not implemented") } +func (*UnimplementedObjectPoolServiceServer) GetObjectPool(ctx context.Context, req *GetObjectPoolRequest) (*GetObjectPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetObjectPool not implemented") +} func RegisterObjectPoolServiceServer(s *grpc.Server, srv ObjectPoolServiceServer) { s.RegisterService(&_ObjectPoolService_serviceDesc, srv) @@ -881,6 +978,24 @@ func _ObjectPoolService_FetchIntoObjectPool_Handler(srv interface{}, ctx context return interceptor(ctx, in, info, handler) } +func _ObjectPoolService_GetObjectPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetObjectPoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectPoolServiceServer).GetObjectPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitaly.ObjectPoolService/GetObjectPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectPoolServiceServer).GetObjectPool(ctx, req.(*GetObjectPoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _ObjectPoolService_serviceDesc = grpc.ServiceDesc{ ServiceName: "gitaly.ObjectPoolService", HandlerType: (*ObjectPoolServiceServer)(nil), @@ -913,6 +1028,10 @@ var _ObjectPoolService_serviceDesc = grpc.ServiceDesc{ MethodName: "FetchIntoObjectPool", Handler: _ObjectPoolService_FetchIntoObjectPool_Handler, }, + { + MethodName: "GetObjectPool", + Handler: _ObjectPoolService_GetObjectPool_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "objectpool.proto", diff --git a/proto/objectpool.proto b/proto/objectpool.proto index 94b962c8e..128e7dfcc 100644 --- a/proto/objectpool.proto +++ b/proto/objectpool.proto @@ -11,8 +11,7 @@ service ObjectPoolService { option (op_type) = { op: MUTATOR target_repository_field: "1.1" - additional_repository_field: "2" - }; + additional_repository_field: "2" }; } rpc DeleteObjectPool(DeleteObjectPoolRequest) returns (DeleteObjectPoolResponse) { option (op_type) = { @@ -56,6 +55,12 @@ service ObjectPoolService { additional_repository_field: "1" }; } + rpc GetObjectPool(GetObjectPoolRequest) returns (GetObjectPoolResponse) { + option (op_type) = { + op: ACCESSOR + target_repository_field: "1" + }; + } } // Creates an object pool from the repository. The client is responsible for @@ -104,3 +109,13 @@ message FetchIntoObjectPoolRequest { bool repack = 3; } message FetchIntoObjectPoolResponse {} + +message GetObjectPoolRequest { + Repository repository = 1; +} + +message GetObjectPoolResponse { + ObjectPool object_pool = 1; +} + + -- cgit v1.2.3