Merge pull request #42 from nspcc-dev/update-object-search

Update object search
This commit is contained in:
Evgeniy Kulikov 2020-02-04 13:30:21 +03:00 committed by GitHub
commit 06789f451f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 109 additions and 82 deletions

View file

@ -63,7 +63,7 @@ rpc Get(GetRequest) returns (stream GetResponse);
rpc Put(stream PutRequest) returns (PutResponse);
rpc Delete(DeleteRequest) returns (DeleteResponse);
rpc Head(HeadRequest) returns (HeadResponse);
rpc Search(SearchRequest) returns (SearchResponse);
rpc Search(SearchRequest) returns (stream SearchResponse);
rpc GetRange(GetRangeRequest) returns (GetRangeResponse);
rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse);

View file

@ -883,60 +883,60 @@ func init() {
func init() { proto.RegisterFile("object/service.proto", fileDescriptor_dfcdf610ade6a9ce) }
var fileDescriptor_dfcdf610ade6a9ce = []byte{
// 843 bytes of a gzipped FileDescriptorProto
// 846 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4d, 0x4f, 0x33, 0x55,
0x14, 0xee, 0xed, 0x94, 0x01, 0x4e, 0xa7, 0xd0, 0x5c, 0x2a, 0x36, 0x23, 0x29, 0x64, 0x82, 0xa6,
0xc6, 0x74, 0x8a, 0x98, 0x00, 0x89, 0xb8, 0xb0, 0x6d, 0xa0, 0x2c, 0x0c, 0x78, 0x21, 0x24, 0xba,
0x9b, 0x4e, 0x6f, 0xdb, 0x91, 0x32, 0x53, 0xe7, 0x03, 0xc2, 0x0f, 0x70, 0xed, 0xd6, 0x85, 0x3f,
0xc5, 0x1f, 0xc0, 0xc6, 0x84, 0xa5, 0x71, 0x41, 0x4c, 0x5d, 0xbb, 0x37, 0x71, 0x63, 0xee, 0xc7,
0x74, 0xa6, 0x45, 0x50, 0x59, 0xbc, 0x7d, 0x57, 0x3d, 0xf7, 0x39, 0x5f, 0x3d, 0x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 0x32, 0x57, 0x52, 0xd2, 0x2b, 0xbb, 0xaf, 0x2d, 0x84, 0x3f, 0x81, 0x95,
0x98, 0x54, 0xfc, 0x66, 0x7a, 0xf6, 0xd4, 0x3e, 0xea, 0xd5, 0xc7, 0x0e, 0xd9, 0xf9, 0x08, 0xb4,
0xf4, 0x33, 0xc1, 0x6f, 0x3d, 0x8c, 0x4c, 0x09, 0x56, 0xdf, 0xf8, 0x6b, 0xa7, 0x28, 0xd5, 0xfe,
0xf8, 0x76, 0x56, 0x43, 0x77, 0xb3, 0x1a, 0xfa, 0x69, 0x56, 0x43, 0xbf, 0xcc, 0x6a, 0xe8, 0xbb,
0x5f, 0x6b, 0xb9, 0x2f, 0xdf, 0x4e, 0x7d, 0x8a, 0xba, 0xc1, 0xd4, 0xb6, 0x1b, 0x03, 0x7a, 0xd5,
0x74, 0xa9, 0x37, 0x0c, 0x1a, 0xd6, 0xd4, 0x69, 0x8a, 0x8a, 0x7d, 0x95, 0x7f, 0x89, 0x7e, 0xf0,
0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xee, 0x6d, 0x9e, 0x41, 0x3d, 0x0b, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -973,7 +973,7 @@ type ServiceClient interface {
// Search objects in container. Version of query language format SHOULD BE
// set to 1. Search query represented in serialized format (see query
// package).
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (Service_SearchClient, error)
// GetRange of data payload. Ranges are set of pairs (offset, length).
// Fragments order in response corresponds to ranges order in request.
GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (*GetRangeResponse, error)
@ -1076,13 +1076,36 @@ func (c *serviceClient) Head(ctx context.Context, in *HeadRequest, opts ...grpc.
return out, nil
}
func (c *serviceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) {
out := new(SearchResponse)
err := c.cc.Invoke(ctx, "/object.Service/Search", in, out, opts...)
func (c *serviceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (Service_SearchClient, error) {
stream, err := c.cc.NewStream(ctx, &_Service_serviceDesc.Streams[2], "/object.Service/Search", opts...)
if err != nil {
return nil, err
}
return out, nil
x := &serviceSearchClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Service_SearchClient interface {
Recv() (*SearchResponse, error)
grpc.ClientStream
}
type serviceSearchClient struct {
grpc.ClientStream
}
func (x *serviceSearchClient) Recv() (*SearchResponse, error) {
m := new(SearchResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *serviceClient) GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (*GetRangeResponse, error) {
@ -1127,7 +1150,7 @@ type ServiceServer interface {
// Search objects in container. Version of query language format SHOULD BE
// set to 1. Search query represented in serialized format (see query
// package).
Search(context.Context, *SearchRequest) (*SearchResponse, error)
Search(*SearchRequest, Service_SearchServer) error
// GetRange of data payload. Ranges are set of pairs (offset, length).
// Fragments order in response corresponds to ranges order in request.
GetRange(context.Context, *GetRangeRequest) (*GetRangeResponse, error)
@ -1154,8 +1177,8 @@ func (*UnimplementedServiceServer) Delete(ctx context.Context, req *DeleteReques
func (*UnimplementedServiceServer) Head(ctx context.Context, req *HeadRequest) (*HeadResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Head not implemented")
}
func (*UnimplementedServiceServer) Search(ctx context.Context, req *SearchRequest) (*SearchResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Search not implemented")
func (*UnimplementedServiceServer) Search(req *SearchRequest, srv Service_SearchServer) error {
return status.Errorf(codes.Unimplemented, "method Search not implemented")
}
func (*UnimplementedServiceServer) GetRange(ctx context.Context, req *GetRangeRequest) (*GetRangeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRange not implemented")
@ -1251,22 +1274,25 @@ func _Service_Head_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler)
}
func _Service_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchRequest)
if err := dec(in); err != nil {
return nil, err
func _Service_Search_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SearchRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
if interceptor == nil {
return srv.(ServiceServer).Search(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/object.Service/Search",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceServer).Search(ctx, req.(*SearchRequest))
}
return interceptor(ctx, in, info, handler)
return srv.(ServiceServer).Search(m, &serviceSearchServer{stream})
}
type Service_SearchServer interface {
Send(*SearchResponse) error
grpc.ServerStream
}
type serviceSearchServer struct {
grpc.ServerStream
}
func (x *serviceSearchServer) Send(m *SearchResponse) error {
return x.ServerStream.SendMsg(m)
}
func _Service_GetRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
@ -1317,10 +1343,6 @@ var _Service_serviceDesc = grpc.ServiceDesc{
MethodName: "Head",
Handler: _Service_Head_Handler,
},
{
MethodName: "Search",
Handler: _Service_Search_Handler,
},
{
MethodName: "GetRange",
Handler: _Service_GetRange_Handler,
@ -1341,6 +1363,11 @@ var _Service_serviceDesc = grpc.ServiceDesc{
Handler: _Service_Put_Handler,
ClientStreams: true,
},
{
StreamName: "Search",
Handler: _Service_Search_Handler,
ServerStreams: true,
},
},
Metadata: "object/service.proto",
}

View file

@ -40,7 +40,7 @@ service Service {
// Search objects in container. Version of query language format SHOULD BE
// set to 1. Search query represented in serialized format (see query
// package).
rpc Search(SearchRequest) returns (SearchResponse);
rpc Search(SearchRequest) returns (stream SearchResponse);
// GetRange of data payload. Ranges are set of pairs (offset, length).
// Fragments order in response corresponds to ranges order in request.