From c2e50b3381387431b8673902f647dffb975aee86 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Fri, 20 Feb 2026 13:11:36 +0500 Subject: [PATCH 01/14] feat: one phase search --- api/seqproxyapi/v1/seq_proxy_api.proto | 7 + api/storeapi/store_api.proto | 38 +- pkg/seqproxyapi/v1/seq_proxy_api.pb.go | 51 +- pkg/seqproxyapi/v1/seq_proxy_api.pb.gw.go | 63 + .../v1/seq_proxy_api_vtproto.pb.go | 36 + pkg/storeapi/store_api.pb.go | 876 +- pkg/storeapi/store_api.pb.gw.go | 46 + pkg/storeapi/store_api_vtproto.pb.go | 10081 ++++++++++------ proxy/search/ingestor.go | 2 +- proxy/search/mock/store_api_client_mock.go | 20 + proxy/search/one_phase_search.go | 113 + proxyapi/grpc_one_phase_search.go | 165 + proxyapi/grpc_v1.go | 1 + proxyapi/mock/grpc_v1.go | 16 + storeapi/client.go | 55 + storeapi/grpc_fetch.go | 35 +- storeapi/grpc_one_phase_search.go | 111 + 17 files changed, 7589 insertions(+), 4127 deletions(-) create mode 100644 proxy/search/one_phase_search.go create mode 100644 proxyapi/grpc_one_phase_search.go create mode 100644 storeapi/grpc_one_phase_search.go diff --git a/api/seqproxyapi/v1/seq_proxy_api.proto b/api/seqproxyapi/v1/seq_proxy_api.proto index 22ca2f1d..659c05e5 100644 --- a/api/seqproxyapi/v1/seq_proxy_api.proto +++ b/api/seqproxyapi/v1/seq_proxy_api.proto @@ -111,6 +111,13 @@ service SeqProxyApi { body: "*" }; } + + rpc OnePhaseSearch(SearchRequest) returns (SearchResponse) { + option (google.api.http) = { + post: "/one-phase-search" + body: "*" + }; + } } // Custom error code, returned by seq-db proxy. diff --git a/api/storeapi/store_api.proto b/api/storeapi/store_api.proto index 43a343b8..c5ae31d7 100644 --- a/api/storeapi/store_api.proto +++ b/api/storeapi/store_api.proto @@ -26,6 +26,8 @@ service StoreApi { rpc Fetch(FetchRequest) returns (stream BinaryData) {} rpc Status(StatusRequest) returns (StatusResponse) {} + + rpc OnePhaseSearch(OnePhaseSearchRequest) returns (stream OnePhaseSearchResponse) {} } message BulkRequest { @@ -244,12 +246,13 @@ message IdWithHint { string hint = 2; } -message FetchRequest { - message FieldsFilter { +message FieldsFilter { repeated string fields = 1; // see seqproxyapi.FetchRequest.FieldsFilter.allow_list for details. bool allow_list = 2; } + +message FetchRequest { repeated string ids = 1; bool explain = 3; repeated IdWithHint ids_with_hints = 4; @@ -264,3 +267,34 @@ message StatusRequest {} message StatusResponse { google.protobuf.Timestamp oldest_time = 1; } + +message OnePhaseSearchRequest { + string query = 1; + int64 from = 2; + int64 to = 3; + int64 size = 4; + int64 offset = 5; + bool explain = 6; + bool with_total = 7; + Order order = 8; + string offset_id = 9; + FieldsFilter fields_filter = 10; +} + +message OnePhaseSearchResponse { + oneof ResponseType { + Header header = 1; + Document document = 2; + } +} + +message Document { + BinaryData data = 1; +} + +message Header { + uint64 total = 1; + repeated string errors = 2; + SearchErrorCode code = 3; + optional ExplainEntry explain = 4; +} diff --git a/pkg/seqproxyapi/v1/seq_proxy_api.pb.go b/pkg/seqproxyapi/v1/seq_proxy_api.pb.go index eac9fd1c..9665df6b 100644 --- a/pkg/seqproxyapi/v1/seq_proxy_api.pb.go +++ b/pkg/seqproxyapi/v1/seq_proxy_api.pb.go @@ -3042,7 +3042,7 @@ var file_seqproxyapi_v1_seq_proxy_api_proto_rawDesc = string([]byte{ 0x19, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x03, 0x32, 0x98, 0x0c, 0x0a, 0x0b, 0x53, 0x65, 0x71, + 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x03, 0x32, 0x87, 0x0d, 0x0a, 0x0b, 0x53, 0x65, 0x71, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x41, 0x70, 0x69, 0x12, 0x5b, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, @@ -3140,11 +3140,18 @@ var file_seqproxyapi_v1_seq_proxy_api_proto_rawDesc = string([]byte{ 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x2d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x2f, 0x6c, - 0x69, 0x73, 0x74, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6f, 0x7a, 0x6f, 0x6e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x73, 0x65, 0x71, 0x2d, 0x64, - 0x62, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x73, 0x74, 0x12, 0x6d, 0x0a, 0x0e, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, + 0x11, 0x2f, 0x6f, 0x6e, 0x65, 0x2d, 0x70, 0x68, 0x61, 0x73, 0x65, 0x2d, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x6f, 0x7a, 0x6f, 0x6e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x73, 0x65, 0x71, 0x2d, 0x64, 0x62, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var ( @@ -3281,21 +3288,23 @@ var file_seqproxyapi_v1_seq_proxy_api_proto_depIdxs = []int32{ 20, // 69: seqproxyapi.v1.SeqProxyApi.CancelAsyncSearch:input_type -> seqproxyapi.v1.CancelAsyncSearchRequest 22, // 70: seqproxyapi.v1.SeqProxyApi.DeleteAsyncSearch:input_type -> seqproxyapi.v1.DeleteAsyncSearchRequest 24, // 71: seqproxyapi.v1.SeqProxyApi.GetAsyncSearchesList:input_type -> seqproxyapi.v1.GetAsyncSearchesListRequest - 14, // 72: seqproxyapi.v1.SeqProxyApi.Search:output_type -> seqproxyapi.v1.SearchResponse - 15, // 73: seqproxyapi.v1.SeqProxyApi.ComplexSearch:output_type -> seqproxyapi.v1.ComplexSearchResponse - 28, // 74: seqproxyapi.v1.SeqProxyApi.GetAggregation:output_type -> seqproxyapi.v1.GetAggregationResponse - 30, // 75: seqproxyapi.v1.SeqProxyApi.GetHistogram:output_type -> seqproxyapi.v1.GetHistogramResponse - 5, // 76: seqproxyapi.v1.SeqProxyApi.Fetch:output_type -> seqproxyapi.v1.Document - 33, // 77: seqproxyapi.v1.SeqProxyApi.Mapping:output_type -> seqproxyapi.v1.MappingResponse - 35, // 78: seqproxyapi.v1.SeqProxyApi.Status:output_type -> seqproxyapi.v1.StatusResponse - 39, // 79: seqproxyapi.v1.SeqProxyApi.Export:output_type -> seqproxyapi.v1.ExportResponse - 17, // 80: seqproxyapi.v1.SeqProxyApi.StartAsyncSearch:output_type -> seqproxyapi.v1.StartAsyncSearchResponse - 19, // 81: seqproxyapi.v1.SeqProxyApi.FetchAsyncSearchResult:output_type -> seqproxyapi.v1.FetchAsyncSearchResultResponse - 21, // 82: seqproxyapi.v1.SeqProxyApi.CancelAsyncSearch:output_type -> seqproxyapi.v1.CancelAsyncSearchResponse - 23, // 83: seqproxyapi.v1.SeqProxyApi.DeleteAsyncSearch:output_type -> seqproxyapi.v1.DeleteAsyncSearchResponse - 25, // 84: seqproxyapi.v1.SeqProxyApi.GetAsyncSearchesList:output_type -> seqproxyapi.v1.GetAsyncSearchesListResponse - 72, // [72:85] is the sub-list for method output_type - 59, // [59:72] is the sub-list for method input_type + 12, // 72: seqproxyapi.v1.SeqProxyApi.OnePhaseSearch:input_type -> seqproxyapi.v1.SearchRequest + 14, // 73: seqproxyapi.v1.SeqProxyApi.Search:output_type -> seqproxyapi.v1.SearchResponse + 15, // 74: seqproxyapi.v1.SeqProxyApi.ComplexSearch:output_type -> seqproxyapi.v1.ComplexSearchResponse + 28, // 75: seqproxyapi.v1.SeqProxyApi.GetAggregation:output_type -> seqproxyapi.v1.GetAggregationResponse + 30, // 76: seqproxyapi.v1.SeqProxyApi.GetHistogram:output_type -> seqproxyapi.v1.GetHistogramResponse + 5, // 77: seqproxyapi.v1.SeqProxyApi.Fetch:output_type -> seqproxyapi.v1.Document + 33, // 78: seqproxyapi.v1.SeqProxyApi.Mapping:output_type -> seqproxyapi.v1.MappingResponse + 35, // 79: seqproxyapi.v1.SeqProxyApi.Status:output_type -> seqproxyapi.v1.StatusResponse + 39, // 80: seqproxyapi.v1.SeqProxyApi.Export:output_type -> seqproxyapi.v1.ExportResponse + 17, // 81: seqproxyapi.v1.SeqProxyApi.StartAsyncSearch:output_type -> seqproxyapi.v1.StartAsyncSearchResponse + 19, // 82: seqproxyapi.v1.SeqProxyApi.FetchAsyncSearchResult:output_type -> seqproxyapi.v1.FetchAsyncSearchResultResponse + 21, // 83: seqproxyapi.v1.SeqProxyApi.CancelAsyncSearch:output_type -> seqproxyapi.v1.CancelAsyncSearchResponse + 23, // 84: seqproxyapi.v1.SeqProxyApi.DeleteAsyncSearch:output_type -> seqproxyapi.v1.DeleteAsyncSearchResponse + 25, // 85: seqproxyapi.v1.SeqProxyApi.GetAsyncSearchesList:output_type -> seqproxyapi.v1.GetAsyncSearchesListResponse + 14, // 86: seqproxyapi.v1.SeqProxyApi.OnePhaseSearch:output_type -> seqproxyapi.v1.SearchResponse + 73, // [73:87] is the sub-list for method output_type + 59, // [59:73] is the sub-list for method input_type 59, // [59:59] is the sub-list for extension type_name 59, // [59:59] is the sub-list for extension extendee 0, // [0:59] is the sub-list for field type_name diff --git a/pkg/seqproxyapi/v1/seq_proxy_api.pb.gw.go b/pkg/seqproxyapi/v1/seq_proxy_api.pb.gw.go index 28010d15..26257727 100644 --- a/pkg/seqproxyapi/v1/seq_proxy_api.pb.gw.go +++ b/pkg/seqproxyapi/v1/seq_proxy_api.pb.gw.go @@ -351,6 +351,30 @@ func local_request_SeqProxyApi_GetAsyncSearchesList_0(ctx context.Context, marsh return msg, metadata, err } +func request_SeqProxyApi_OnePhaseSearch_0(ctx context.Context, marshaler runtime.Marshaler, client SeqProxyApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq SearchRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.OnePhaseSearch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_SeqProxyApi_OnePhaseSearch_0(ctx context.Context, marshaler runtime.Marshaler, server SeqProxyApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq SearchRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.OnePhaseSearch(ctx, &protoReq) + return msg, metadata, err +} + // RegisterSeqProxyApiHandlerServer registers the http handlers for service SeqProxyApi to "mux". // UnaryRPC :call SeqProxyApiServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -591,6 +615,26 @@ func RegisterSeqProxyApiHandlerServer(ctx context.Context, mux *runtime.ServeMux } forward_SeqProxyApi_GetAsyncSearchesList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_SeqProxyApi_OnePhaseSearch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/seqproxyapi.v1.SeqProxyApi/OnePhaseSearch", runtime.WithHTTPPathPattern("/one-phase-search")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SeqProxyApi_OnePhaseSearch_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_SeqProxyApi_OnePhaseSearch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } @@ -852,6 +896,23 @@ func RegisterSeqProxyApiHandlerClient(ctx context.Context, mux *runtime.ServeMux } forward_SeqProxyApi_GetAsyncSearchesList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_SeqProxyApi_OnePhaseSearch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/seqproxyapi.v1.SeqProxyApi/OnePhaseSearch", runtime.WithHTTPPathPattern("/one-phase-search")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SeqProxyApi_OnePhaseSearch_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_SeqProxyApi_OnePhaseSearch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } @@ -869,6 +930,7 @@ var ( pattern_SeqProxyApi_CancelAsyncSearch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"async-searches", "search_id", "cancel"}, "")) pattern_SeqProxyApi_DeleteAsyncSearch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"async-searches", "search_id"}, "")) pattern_SeqProxyApi_GetAsyncSearchesList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"async-searches", "list"}, "")) + pattern_SeqProxyApi_OnePhaseSearch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"one-phase-search"}, "")) ) var ( @@ -885,4 +947,5 @@ var ( forward_SeqProxyApi_CancelAsyncSearch_0 = runtime.ForwardResponseMessage forward_SeqProxyApi_DeleteAsyncSearch_0 = runtime.ForwardResponseMessage forward_SeqProxyApi_GetAsyncSearchesList_0 = runtime.ForwardResponseMessage + forward_SeqProxyApi_OnePhaseSearch_0 = runtime.ForwardResponseMessage ) diff --git a/pkg/seqproxyapi/v1/seq_proxy_api_vtproto.pb.go b/pkg/seqproxyapi/v1/seq_proxy_api_vtproto.pb.go index 97f47d65..56011acf 100644 --- a/pkg/seqproxyapi/v1/seq_proxy_api_vtproto.pb.go +++ b/pkg/seqproxyapi/v1/seq_proxy_api_vtproto.pb.go @@ -2098,6 +2098,7 @@ type SeqProxyApiClient interface { DeleteAsyncSearch(ctx context.Context, in *DeleteAsyncSearchRequest, opts ...grpc.CallOption) (*DeleteAsyncSearchResponse, error) // Fetch list of async searches. GetAsyncSearchesList(ctx context.Context, in *GetAsyncSearchesListRequest, opts ...grpc.CallOption) (*GetAsyncSearchesListResponse, error) + OnePhaseSearch(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) } type seqProxyApiClient struct { @@ -2271,6 +2272,15 @@ func (c *seqProxyApiClient) GetAsyncSearchesList(ctx context.Context, in *GetAsy return out, nil } +func (c *seqProxyApiClient) OnePhaseSearch(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { + out := new(SearchResponse) + err := c.cc.Invoke(ctx, "/seqproxyapi.v1.SeqProxyApi/OnePhaseSearch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // SeqProxyApiServer is the server API for SeqProxyApi service. // All implementations must embed UnimplementedSeqProxyApiServer // for forward compatibility @@ -2303,6 +2313,7 @@ type SeqProxyApiServer interface { DeleteAsyncSearch(context.Context, *DeleteAsyncSearchRequest) (*DeleteAsyncSearchResponse, error) // Fetch list of async searches. GetAsyncSearchesList(context.Context, *GetAsyncSearchesListRequest) (*GetAsyncSearchesListResponse, error) + OnePhaseSearch(context.Context, *SearchRequest) (*SearchResponse, error) mustEmbedUnimplementedSeqProxyApiServer() } @@ -2349,6 +2360,9 @@ func (UnimplementedSeqProxyApiServer) DeleteAsyncSearch(context.Context, *Delete func (UnimplementedSeqProxyApiServer) GetAsyncSearchesList(context.Context, *GetAsyncSearchesListRequest) (*GetAsyncSearchesListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAsyncSearchesList not implemented") } +func (UnimplementedSeqProxyApiServer) OnePhaseSearch(context.Context, *SearchRequest) (*SearchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OnePhaseSearch not implemented") +} func (UnimplementedSeqProxyApiServer) mustEmbedUnimplementedSeqProxyApiServer() {} // UnsafeSeqProxyApiServer may be embedded to opt out of forward compatibility for this service. @@ -2602,6 +2616,24 @@ func _SeqProxyApi_GetAsyncSearchesList_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _SeqProxyApi_OnePhaseSearch_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 + } + if interceptor == nil { + return srv.(SeqProxyApiServer).OnePhaseSearch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/seqproxyapi.v1.SeqProxyApi/OnePhaseSearch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SeqProxyApiServer).OnePhaseSearch(ctx, req.(*SearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + // SeqProxyApi_ServiceDesc is the grpc.ServiceDesc for SeqProxyApi service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -2653,6 +2685,10 @@ var SeqProxyApi_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetAsyncSearchesList", Handler: _SeqProxyApi_GetAsyncSearchesList_Handler, }, + { + MethodName: "OnePhaseSearch", + Handler: _SeqProxyApi_OnePhaseSearch_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/pkg/storeapi/store_api.pb.go b/pkg/storeapi/store_api.pb.go index 53e88104..4bb621fd 100644 --- a/pkg/storeapi/store_api.pb.go +++ b/pkg/storeapi/store_api.pb.go @@ -1592,12 +1592,65 @@ func (x *IdWithHint) GetHint() string { return "" } +type FieldsFilter struct { + state protoimpl.MessageState `protogen:"open.v1"` + Fields []string `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` + // see seqproxyapi.FetchRequest.FieldsFilter.allow_list for details. + AllowList bool `protobuf:"varint,2,opt,name=allow_list,json=allowList,proto3" json:"allow_list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FieldsFilter) Reset() { + *x = FieldsFilter{} + mi := &file_storeapi_store_api_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FieldsFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldsFilter) ProtoMessage() {} + +func (x *FieldsFilter) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldsFilter.ProtoReflect.Descriptor instead. +func (*FieldsFilter) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{18} +} + +func (x *FieldsFilter) GetFields() []string { + if x != nil { + return x.Fields + } + return nil +} + +func (x *FieldsFilter) GetAllowList() bool { + if x != nil { + return x.AllowList + } + return false +} + type FetchRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` - Explain bool `protobuf:"varint,3,opt,name=explain,proto3" json:"explain,omitempty"` - IdsWithHints []*IdWithHint `protobuf:"bytes,4,rep,name=ids_with_hints,json=idsWithHints,proto3" json:"ids_with_hints,omitempty"` - FieldsFilter *FetchRequest_FieldsFilter `protobuf:"bytes,5,opt,name=fields_filter,json=fieldsFilter,proto3" json:"fields_filter,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + Explain bool `protobuf:"varint,3,opt,name=explain,proto3" json:"explain,omitempty"` + IdsWithHints []*IdWithHint `protobuf:"bytes,4,rep,name=ids_with_hints,json=idsWithHints,proto3" json:"ids_with_hints,omitempty"` + FieldsFilter *FieldsFilter `protobuf:"bytes,5,opt,name=fields_filter,json=fieldsFilter,proto3" json:"fields_filter,omitempty"` // if false, skip masks will be evaluated // set to true in fetch after search since ids are already skipped NoSkipMasks bool `protobuf:"varint,6,opt,name=noSkipMasks,proto3" json:"noSkipMasks,omitempty"` @@ -1607,7 +1660,7 @@ type FetchRequest struct { func (x *FetchRequest) Reset() { *x = FetchRequest{} - mi := &file_storeapi_store_api_proto_msgTypes[18] + mi := &file_storeapi_store_api_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1619,7 +1672,7 @@ func (x *FetchRequest) String() string { func (*FetchRequest) ProtoMessage() {} func (x *FetchRequest) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[18] + mi := &file_storeapi_store_api_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1632,7 +1685,7 @@ func (x *FetchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FetchRequest.ProtoReflect.Descriptor instead. func (*FetchRequest) Descriptor() ([]byte, []int) { - return file_storeapi_store_api_proto_rawDescGZIP(), []int{18} + return file_storeapi_store_api_proto_rawDescGZIP(), []int{19} } func (x *FetchRequest) GetIds() []string { @@ -1656,7 +1709,7 @@ func (x *FetchRequest) GetIdsWithHints() []*IdWithHint { return nil } -func (x *FetchRequest) GetFieldsFilter() *FetchRequest_FieldsFilter { +func (x *FetchRequest) GetFieldsFilter() *FieldsFilter { if x != nil { return x.FieldsFilter } @@ -1678,7 +1731,7 @@ type StatusRequest struct { func (x *StatusRequest) Reset() { *x = StatusRequest{} - mi := &file_storeapi_store_api_proto_msgTypes[19] + mi := &file_storeapi_store_api_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1690,7 +1743,7 @@ func (x *StatusRequest) String() string { func (*StatusRequest) ProtoMessage() {} func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[19] + mi := &file_storeapi_store_api_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1703,7 +1756,7 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_storeapi_store_api_proto_rawDescGZIP(), []int{19} + return file_storeapi_store_api_proto_rawDescGZIP(), []int{20} } type StatusResponse struct { @@ -1715,7 +1768,7 @@ type StatusResponse struct { func (x *StatusResponse) Reset() { *x = StatusResponse{} - mi := &file_storeapi_store_api_proto_msgTypes[20] + mi := &file_storeapi_store_api_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1727,7 +1780,7 @@ func (x *StatusResponse) String() string { func (*StatusResponse) ProtoMessage() {} func (x *StatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[20] + mi := &file_storeapi_store_api_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1740,7 +1793,7 @@ func (x *StatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_storeapi_store_api_proto_rawDescGZIP(), []int{20} + return file_storeapi_store_api_proto_rawDescGZIP(), []int{21} } func (x *StatusResponse) GetOldestTime() *timestamppb.Timestamp { @@ -1750,6 +1803,316 @@ func (x *StatusResponse) GetOldestTime() *timestamppb.Timestamp { return nil } +type OnePhaseSearchRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + From int64 `protobuf:"varint,2,opt,name=from,proto3" json:"from,omitempty"` + To int64 `protobuf:"varint,3,opt,name=to,proto3" json:"to,omitempty"` + Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` + Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` + Explain bool `protobuf:"varint,6,opt,name=explain,proto3" json:"explain,omitempty"` + WithTotal bool `protobuf:"varint,7,opt,name=with_total,json=withTotal,proto3" json:"with_total,omitempty"` + Order Order `protobuf:"varint,8,opt,name=order,proto3,enum=api.Order" json:"order,omitempty"` + OffsetId string `protobuf:"bytes,9,opt,name=offset_id,json=offsetId,proto3" json:"offset_id,omitempty"` + FieldsFilter *FieldsFilter `protobuf:"bytes,10,opt,name=fields_filter,json=fieldsFilter,proto3" json:"fields_filter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OnePhaseSearchRequest) Reset() { + *x = OnePhaseSearchRequest{} + mi := &file_storeapi_store_api_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OnePhaseSearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OnePhaseSearchRequest) ProtoMessage() {} + +func (x *OnePhaseSearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OnePhaseSearchRequest.ProtoReflect.Descriptor instead. +func (*OnePhaseSearchRequest) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{22} +} + +func (x *OnePhaseSearchRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *OnePhaseSearchRequest) GetFrom() int64 { + if x != nil { + return x.From + } + return 0 +} + +func (x *OnePhaseSearchRequest) GetTo() int64 { + if x != nil { + return x.To + } + return 0 +} + +func (x *OnePhaseSearchRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *OnePhaseSearchRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *OnePhaseSearchRequest) GetExplain() bool { + if x != nil { + return x.Explain + } + return false +} + +func (x *OnePhaseSearchRequest) GetWithTotal() bool { + if x != nil { + return x.WithTotal + } + return false +} + +func (x *OnePhaseSearchRequest) GetOrder() Order { + if x != nil { + return x.Order + } + return Order_ORDER_DESC +} + +func (x *OnePhaseSearchRequest) GetOffsetId() string { + if x != nil { + return x.OffsetId + } + return "" +} + +func (x *OnePhaseSearchRequest) GetFieldsFilter() *FieldsFilter { + if x != nil { + return x.FieldsFilter + } + return nil +} + +type OnePhaseSearchResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to ResponseType: + // + // *OnePhaseSearchResponse_Header + // *OnePhaseSearchResponse_Document + ResponseType isOnePhaseSearchResponse_ResponseType `protobuf_oneof:"ResponseType"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OnePhaseSearchResponse) Reset() { + *x = OnePhaseSearchResponse{} + mi := &file_storeapi_store_api_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OnePhaseSearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OnePhaseSearchResponse) ProtoMessage() {} + +func (x *OnePhaseSearchResponse) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OnePhaseSearchResponse.ProtoReflect.Descriptor instead. +func (*OnePhaseSearchResponse) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{23} +} + +func (x *OnePhaseSearchResponse) GetResponseType() isOnePhaseSearchResponse_ResponseType { + if x != nil { + return x.ResponseType + } + return nil +} + +func (x *OnePhaseSearchResponse) GetHeader() *Header { + if x != nil { + if x, ok := x.ResponseType.(*OnePhaseSearchResponse_Header); ok { + return x.Header + } + } + return nil +} + +func (x *OnePhaseSearchResponse) GetDocument() *Document { + if x != nil { + if x, ok := x.ResponseType.(*OnePhaseSearchResponse_Document); ok { + return x.Document + } + } + return nil +} + +type isOnePhaseSearchResponse_ResponseType interface { + isOnePhaseSearchResponse_ResponseType() +} + +type OnePhaseSearchResponse_Header struct { + Header *Header `protobuf:"bytes,1,opt,name=header,proto3,oneof"` +} + +type OnePhaseSearchResponse_Document struct { + Document *Document `protobuf:"bytes,2,opt,name=document,proto3,oneof"` +} + +func (*OnePhaseSearchResponse_Header) isOnePhaseSearchResponse_ResponseType() {} + +func (*OnePhaseSearchResponse_Document) isOnePhaseSearchResponse_ResponseType() {} + +type Document struct { + state protoimpl.MessageState `protogen:"open.v1"` + Data *BinaryData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Document) Reset() { + *x = Document{} + mi := &file_storeapi_store_api_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Document) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Document) ProtoMessage() {} + +func (x *Document) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{24} +} + +func (x *Document) GetData() *BinaryData { + if x != nil { + return x.Data + } + return nil +} + +type Header struct { + state protoimpl.MessageState `protogen:"open.v1"` + Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Errors []string `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"` + Code SearchErrorCode `protobuf:"varint,3,opt,name=code,proto3,enum=api.SearchErrorCode" json:"code,omitempty"` + Explain *ExplainEntry `protobuf:"bytes,4,opt,name=explain,proto3,oneof" json:"explain,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Header) Reset() { + *x = Header{} + mi := &file_storeapi_store_api_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header) ProtoMessage() {} + +func (x *Header) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Header.ProtoReflect.Descriptor instead. +func (*Header) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{25} +} + +func (x *Header) GetTotal() uint64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *Header) GetErrors() []string { + if x != nil { + return x.Errors + } + return nil +} + +func (x *Header) GetCode() SearchErrorCode { + if x != nil { + return x.Code + } + return SearchErrorCode_NO_ERROR +} + +func (x *Header) GetExplain() *ExplainEntry { + if x != nil { + return x.Explain + } + return nil +} + type SearchResponse_Id struct { state protoimpl.MessageState `protogen:"open.v1"` Mid uint64 `protobuf:"varint,1,opt,name=mid,proto3" json:"mid,omitempty"` @@ -1760,7 +2123,7 @@ type SearchResponse_Id struct { func (x *SearchResponse_Id) Reset() { *x = SearchResponse_Id{} - mi := &file_storeapi_store_api_proto_msgTypes[21] + mi := &file_storeapi_store_api_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1772,7 +2135,7 @@ func (x *SearchResponse_Id) String() string { func (*SearchResponse_Id) ProtoMessage() {} func (x *SearchResponse_Id) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[21] + mi := &file_storeapi_store_api_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1812,7 +2175,7 @@ type SearchResponse_IdWithHint struct { func (x *SearchResponse_IdWithHint) Reset() { *x = SearchResponse_IdWithHint{} - mi := &file_storeapi_store_api_proto_msgTypes[22] + mi := &file_storeapi_store_api_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1824,7 +2187,7 @@ func (x *SearchResponse_IdWithHint) String() string { func (*SearchResponse_IdWithHint) ProtoMessage() {} func (x *SearchResponse_IdWithHint) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[22] + mi := &file_storeapi_store_api_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1869,7 +2232,7 @@ type SearchResponse_Histogram struct { func (x *SearchResponse_Histogram) Reset() { *x = SearchResponse_Histogram{} - mi := &file_storeapi_store_api_proto_msgTypes[23] + mi := &file_storeapi_store_api_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1881,7 +2244,7 @@ func (x *SearchResponse_Histogram) String() string { func (*SearchResponse_Histogram) ProtoMessage() {} func (x *SearchResponse_Histogram) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[23] + mi := &file_storeapi_store_api_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1957,7 +2320,7 @@ type SearchResponse_Bin struct { func (x *SearchResponse_Bin) Reset() { *x = SearchResponse_Bin{} - mi := &file_storeapi_store_api_proto_msgTypes[24] + mi := &file_storeapi_store_api_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1969,7 +2332,7 @@ func (x *SearchResponse_Bin) String() string { func (*SearchResponse_Bin) ProtoMessage() {} func (x *SearchResponse_Bin) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[24] + mi := &file_storeapi_store_api_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2028,7 +2391,7 @@ type SearchResponse_Agg struct { func (x *SearchResponse_Agg) Reset() { *x = SearchResponse_Agg{} - mi := &file_storeapi_store_api_proto_msgTypes[25] + mi := &file_storeapi_store_api_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2040,7 +2403,7 @@ func (x *SearchResponse_Agg) String() string { func (*SearchResponse_Agg) ProtoMessage() {} func (x *SearchResponse_Agg) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[25] + mi := &file_storeapi_store_api_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2092,59 +2455,6 @@ func (x *SearchResponse_Agg) GetValuesPool() []string { return nil } -type FetchRequest_FieldsFilter struct { - state protoimpl.MessageState `protogen:"open.v1"` - Fields []string `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` - // see seqproxyapi.FetchRequest.FieldsFilter.allow_list for details. - AllowList bool `protobuf:"varint,2,opt,name=allow_list,json=allowList,proto3" json:"allow_list,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FetchRequest_FieldsFilter) Reset() { - *x = FetchRequest_FieldsFilter{} - mi := &file_storeapi_store_api_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FetchRequest_FieldsFilter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FetchRequest_FieldsFilter) ProtoMessage() {} - -func (x *FetchRequest_FieldsFilter) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[29] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FetchRequest_FieldsFilter.ProtoReflect.Descriptor instead. -func (*FetchRequest_FieldsFilter) Descriptor() ([]byte, []int) { - return file_storeapi_store_api_proto_rawDescGZIP(), []int{18, 0} -} - -func (x *FetchRequest_FieldsFilter) GetFields() []string { - if x != nil { - return x.Fields - } - return nil -} - -func (x *FetchRequest_FieldsFilter) GetAllowList() bool { - if x != nil { - return x.AllowList - } - return false -} - var File_storeapi_store_api_proto protoreflect.FileDescriptor var file_storeapi_store_api_proto_rawDesc = string([]byte{ @@ -2431,114 +2741,158 @@ var file_storeapi_store_api_proto_rawDesc = string([]byte{ 0x63, 0x65, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x22, 0x30, 0x0a, 0x0a, 0x49, 0x64, 0x57, 0x69, 0x74, 0x68, 0x48, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x69, 0x6e, 0x74, 0x22, 0x9f, 0x02, 0x0a, 0x0c, 0x46, - 0x65, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, - 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x12, 0x18, 0x0a, - 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x12, 0x35, 0x0a, 0x0e, 0x69, 0x64, 0x73, 0x5f, 0x77, - 0x69, 0x74, 0x68, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x64, 0x57, 0x69, 0x74, 0x68, 0x48, 0x69, 0x6e, 0x74, - 0x52, 0x0c, 0x69, 0x64, 0x73, 0x57, 0x69, 0x74, 0x68, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x43, - 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x65, 0x74, 0x63, - 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x6f, 0x53, 0x6b, 0x69, 0x70, 0x4d, 0x61, 0x73, - 0x6b, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6e, 0x6f, 0x53, 0x6b, 0x69, 0x70, - 0x4d, 0x61, 0x73, 0x6b, 0x73, 0x1a, 0x45, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x1d, 0x0a, - 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x0f, 0x0a, 0x0d, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, - 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3b, 0x0a, 0x0b, 0x6f, 0x6c, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0a, 0x6f, 0x6c, 0x64, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x2a, 0xac, 0x01, 0x0a, - 0x07, 0x41, 0x67, 0x67, 0x46, 0x75, 0x6e, 0x63, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x47, 0x47, 0x5f, - 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, - 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x53, 0x55, 0x4d, 0x10, 0x01, 0x12, 0x10, - 0x0a, 0x0c, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x4d, 0x49, 0x4e, 0x10, 0x02, - 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x4d, 0x41, 0x58, - 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x41, - 0x56, 0x47, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, - 0x5f, 0x51, 0x55, 0x41, 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, - 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x10, 0x06, - 0x12, 0x19, 0x0a, 0x15, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x55, 0x4e, 0x49, - 0x51, 0x55, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x07, 0x2a, 0x26, 0x0a, 0x05, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x44, 0x45, - 0x53, 0x43, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x41, 0x53, - 0x43, 0x10, 0x01, 0x2a, 0xe8, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x4f, 0x5f, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x49, 0x4e, 0x47, 0x45, 0x53, 0x54, 0x4f, - 0x52, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x57, 0x41, 0x4e, 0x54, 0x53, 0x5f, 0x4f, 0x4c, - 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x4f, 0x4f, 0x5f, - 0x4d, 0x41, 0x4e, 0x59, 0x5f, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x48, - 0x49, 0x54, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x4f, 0x4f, 0x5f, 0x4d, 0x41, 0x4e, 0x59, - 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x04, 0x12, - 0x19, 0x0a, 0x15, 0x54, 0x4f, 0x4f, 0x5f, 0x4d, 0x41, 0x4e, 0x59, 0x5f, 0x47, 0x52, 0x4f, 0x55, - 0x50, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x05, 0x12, 0x1c, 0x0a, 0x18, 0x54, 0x4f, - 0x4f, 0x5f, 0x4d, 0x41, 0x4e, 0x59, 0x5f, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x06, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x4f, 0x4f, 0x5f, - 0x4d, 0x41, 0x4e, 0x59, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, - 0x53, 0x10, 0x07, 0x12, 0x19, 0x0a, 0x15, 0x4d, 0x45, 0x4d, 0x4f, 0x52, 0x59, 0x5f, 0x4c, 0x49, - 0x4d, 0x49, 0x54, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x08, 0x2a, 0x8a, - 0x01, 0x0a, 0x11, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, 0x6f, 0x6e, 0x65, 0x10, 0x01, - 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, - 0x1a, 0x0a, 0x16, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x03, 0x32, 0x9c, 0x05, 0x0a, 0x08, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x41, 0x70, 0x69, 0x12, 0x32, 0x0a, 0x04, 0x42, 0x75, 0x6c, 0x6b, - 0x12, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x06, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x51, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, - 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x16, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x79, - 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x22, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, - 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x11, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1d, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x73, 0x79, 0x6e, 0x63, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x54, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x73, 0x79, 0x6e, - 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x05, 0x46, 0x65, 0x74, 0x63, 0x68, 0x12, 0x11, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, - 0x61, 0x22, 0x00, 0x30, 0x01, 0x12, 0x33, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x7a, 0x6f, 0x6e, 0x74, 0x65, 0x63, - 0x68, 0x2f, 0x73, 0x65, 0x71, 0x2d, 0x64, 0x62, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x61, 0x70, 0x69, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x61, 0x70, 0x69, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x69, 0x6e, 0x74, 0x22, 0x45, 0x0a, 0x0c, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, + 0x74, 0x22, 0xcb, 0x01, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x03, 0x69, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x12, 0x35, + 0x0a, 0x0e, 0x69, 0x64, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x64, 0x57, + 0x69, 0x74, 0x68, 0x48, 0x69, 0x6e, 0x74, 0x52, 0x0c, 0x69, 0x64, 0x73, 0x57, 0x69, 0x74, 0x68, + 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5f, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, + 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x20, 0x0a, + 0x0b, 0x6e, 0x6f, 0x53, 0x6b, 0x69, 0x70, 0x4d, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0b, 0x6e, 0x6f, 0x53, 0x6b, 0x69, 0x70, 0x4d, 0x61, 0x73, 0x6b, 0x73, 0x22, + 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x4d, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x6c, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6f, 0x6c, 0x64, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, + 0xad, 0x02, 0x0a, 0x15, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66, + 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x69, 0x74, + 0x68, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x77, + 0x69, 0x74, 0x68, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x20, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, + 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, + 0x7c, 0x0a, 0x16, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x2b, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x0e, 0x0a, + 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2f, 0x0a, + 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x69, + 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x9e, + 0x01, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, + 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x28, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x12, 0x30, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x48, 0x00, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x2a, + 0xac, 0x01, 0x0a, 0x07, 0x41, 0x67, 0x67, 0x46, 0x75, 0x6e, 0x63, 0x12, 0x12, 0x0a, 0x0e, 0x41, + 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x00, 0x12, + 0x10, 0x0a, 0x0c, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x53, 0x55, 0x4d, 0x10, + 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x4d, 0x49, + 0x4e, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, + 0x4d, 0x41, 0x58, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, + 0x43, 0x5f, 0x41, 0x56, 0x47, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x47, 0x47, 0x5f, 0x46, + 0x55, 0x4e, 0x43, 0x5f, 0x51, 0x55, 0x41, 0x4e, 0x54, 0x49, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x13, + 0x0a, 0x0f, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x55, 0x4e, 0x49, 0x51, 0x55, + 0x45, 0x10, 0x06, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, + 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x07, 0x2a, 0x26, + 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x52, 0x44, 0x45, 0x52, + 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4f, 0x52, 0x44, 0x45, 0x52, + 0x5f, 0x41, 0x53, 0x43, 0x10, 0x01, 0x2a, 0xe8, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x4f, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x49, 0x4e, 0x47, 0x45, + 0x53, 0x54, 0x4f, 0x52, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x57, 0x41, 0x4e, 0x54, 0x53, + 0x5f, 0x4f, 0x4c, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x54, + 0x4f, 0x4f, 0x5f, 0x4d, 0x41, 0x4e, 0x59, 0x5f, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, + 0x53, 0x5f, 0x48, 0x49, 0x54, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x4f, 0x4f, 0x5f, 0x4d, + 0x41, 0x4e, 0x59, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, + 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x4f, 0x4f, 0x5f, 0x4d, 0x41, 0x4e, 0x59, 0x5f, 0x47, + 0x52, 0x4f, 0x55, 0x50, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x05, 0x12, 0x1c, 0x0a, + 0x18, 0x54, 0x4f, 0x4f, 0x5f, 0x4d, 0x41, 0x4e, 0x59, 0x5f, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x06, 0x12, 0x19, 0x0a, 0x15, 0x54, + 0x4f, 0x4f, 0x5f, 0x4d, 0x41, 0x4e, 0x59, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x56, 0x41, + 0x4c, 0x55, 0x45, 0x53, 0x10, 0x07, 0x12, 0x19, 0x0a, 0x15, 0x4d, 0x45, 0x4d, 0x4f, 0x52, 0x59, + 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, + 0x08, 0x2a, 0x8a, 0x01, 0x0a, 0x11, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x41, 0x73, 0x79, 0x6e, 0x63, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x49, 0x6e, 0x50, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x73, 0x79, 0x6e, + 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, 0x6f, 0x6e, + 0x65, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, + 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x03, 0x32, 0xeb, + 0x05, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x41, 0x70, 0x69, 0x12, 0x32, 0x0a, 0x04, 0x42, + 0x75, 0x6c, 0x6b, 0x12, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, + 0x33, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, 0x73, 0x79, + 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x16, 0x46, 0x65, 0x74, 0x63, 0x68, + 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x79, + 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x65, 0x74, 0x63, + 0x68, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x11, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x73, + 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x73, 0x79, + 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x54, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x79, 0x6e, + 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, + 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x79, 0x6e, + 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x05, 0x46, 0x65, 0x74, 0x63, 0x68, + 0x12, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, + 0x44, 0x61, 0x74, 0x61, 0x22, 0x00, 0x30, 0x01, 0x12, 0x33, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, + 0x0e, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, + 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x32, 0x5a, 0x30, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x7a, 0x6f, 0x6e, 0x74, + 0x65, 0x63, 0x68, 0x2f, 0x73, 0x65, 0x71, 0x2d, 0x64, 0x62, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x61, 0x70, 0x69, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x61, 0x70, 0x69, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var ( @@ -2554,7 +2908,7 @@ func file_storeapi_store_api_proto_rawDescGZIP() []byte { } var file_storeapi_store_api_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_storeapi_store_api_proto_msgTypes = make([]protoimpl.MessageInfo, 30) +var file_storeapi_store_api_proto_msgTypes = make([]protoimpl.MessageInfo, 34) var file_storeapi_store_api_proto_goTypes = []any{ (AggFunc)(0), // 0: api.AggFunc (Order)(0), // 1: api.Order @@ -2578,88 +2932,101 @@ var file_storeapi_store_api_proto_goTypes = []any{ (*GetAsyncSearchesListResponse)(nil), // 19: api.GetAsyncSearchesListResponse (*AsyncSearchesListItem)(nil), // 20: api.AsyncSearchesListItem (*IdWithHint)(nil), // 21: api.IdWithHint - (*FetchRequest)(nil), // 22: api.FetchRequest - (*StatusRequest)(nil), // 23: api.StatusRequest - (*StatusResponse)(nil), // 24: api.StatusResponse - (*SearchResponse_Id)(nil), // 25: api.SearchResponse.Id - (*SearchResponse_IdWithHint)(nil), // 26: api.SearchResponse.IdWithHint - (*SearchResponse_Histogram)(nil), // 27: api.SearchResponse.Histogram - (*SearchResponse_Bin)(nil), // 28: api.SearchResponse.Bin - (*SearchResponse_Agg)(nil), // 29: api.SearchResponse.Agg - nil, // 30: api.SearchResponse.HistogramEntry - nil, // 31: api.SearchResponse.Agg.AggEntry - nil, // 32: api.SearchResponse.Agg.AggHistogramEntry - (*FetchRequest_FieldsFilter)(nil), // 33: api.FetchRequest.FieldsFilter - (*durationpb.Duration)(nil), // 34: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 35: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 36: google.protobuf.Empty + (*FieldsFilter)(nil), // 22: api.FieldsFilter + (*FetchRequest)(nil), // 23: api.FetchRequest + (*StatusRequest)(nil), // 24: api.StatusRequest + (*StatusResponse)(nil), // 25: api.StatusResponse + (*OnePhaseSearchRequest)(nil), // 26: api.OnePhaseSearchRequest + (*OnePhaseSearchResponse)(nil), // 27: api.OnePhaseSearchResponse + (*Document)(nil), // 28: api.Document + (*Header)(nil), // 29: api.Header + (*SearchResponse_Id)(nil), // 30: api.SearchResponse.Id + (*SearchResponse_IdWithHint)(nil), // 31: api.SearchResponse.IdWithHint + (*SearchResponse_Histogram)(nil), // 32: api.SearchResponse.Histogram + (*SearchResponse_Bin)(nil), // 33: api.SearchResponse.Bin + (*SearchResponse_Agg)(nil), // 34: api.SearchResponse.Agg + nil, // 35: api.SearchResponse.HistogramEntry + nil, // 36: api.SearchResponse.Agg.AggEntry + nil, // 37: api.SearchResponse.Agg.AggHistogramEntry + (*durationpb.Duration)(nil), // 38: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 39: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 40: google.protobuf.Empty } var file_storeapi_store_api_proto_depIdxs = []int32{ 0, // 0: api.AggQuery.func:type_name -> api.AggFunc 6, // 1: api.SearchRequest.aggs:type_name -> api.AggQuery 1, // 2: api.SearchRequest.order:type_name -> api.Order - 26, // 3: api.SearchResponse.id_sources:type_name -> api.SearchResponse.IdWithHint - 30, // 4: api.SearchResponse.histogram:type_name -> api.SearchResponse.HistogramEntry - 29, // 5: api.SearchResponse.aggs:type_name -> api.SearchResponse.Agg + 31, // 3: api.SearchResponse.id_sources:type_name -> api.SearchResponse.IdWithHint + 35, // 4: api.SearchResponse.histogram:type_name -> api.SearchResponse.HistogramEntry + 34, // 5: api.SearchResponse.aggs:type_name -> api.SearchResponse.Agg 2, // 6: api.SearchResponse.code:type_name -> api.SearchErrorCode 9, // 7: api.SearchResponse.explain:type_name -> api.ExplainEntry - 34, // 8: api.ExplainEntry.duration:type_name -> google.protobuf.Duration + 38, // 8: api.ExplainEntry.duration:type_name -> google.protobuf.Duration 9, // 9: api.ExplainEntry.children:type_name -> api.ExplainEntry - 34, // 10: api.StartAsyncSearchRequest.retention:type_name -> google.protobuf.Duration + 38, // 10: api.StartAsyncSearchRequest.retention:type_name -> google.protobuf.Duration 6, // 11: api.StartAsyncSearchRequest.aggs:type_name -> api.AggQuery 1, // 12: api.FetchAsyncSearchResultRequest.order:type_name -> api.Order 3, // 13: api.FetchAsyncSearchResultResponse.status:type_name -> api.AsyncSearchStatus 8, // 14: api.FetchAsyncSearchResultResponse.response:type_name -> api.SearchResponse - 35, // 15: api.FetchAsyncSearchResultResponse.started_at:type_name -> google.protobuf.Timestamp - 35, // 16: api.FetchAsyncSearchResultResponse.expires_at:type_name -> google.protobuf.Timestamp - 35, // 17: api.FetchAsyncSearchResultResponse.canceled_at:type_name -> google.protobuf.Timestamp + 39, // 15: api.FetchAsyncSearchResultResponse.started_at:type_name -> google.protobuf.Timestamp + 39, // 16: api.FetchAsyncSearchResultResponse.expires_at:type_name -> google.protobuf.Timestamp + 39, // 17: api.FetchAsyncSearchResultResponse.canceled_at:type_name -> google.protobuf.Timestamp 6, // 18: api.FetchAsyncSearchResultResponse.aggs:type_name -> api.AggQuery - 35, // 19: api.FetchAsyncSearchResultResponse.from:type_name -> google.protobuf.Timestamp - 35, // 20: api.FetchAsyncSearchResultResponse.to:type_name -> google.protobuf.Timestamp - 34, // 21: api.FetchAsyncSearchResultResponse.retention:type_name -> google.protobuf.Duration + 39, // 19: api.FetchAsyncSearchResultResponse.from:type_name -> google.protobuf.Timestamp + 39, // 20: api.FetchAsyncSearchResultResponse.to:type_name -> google.protobuf.Timestamp + 38, // 21: api.FetchAsyncSearchResultResponse.retention:type_name -> google.protobuf.Duration 3, // 22: api.GetAsyncSearchesListRequest.status:type_name -> api.AsyncSearchStatus 20, // 23: api.GetAsyncSearchesListResponse.searches:type_name -> api.AsyncSearchesListItem 3, // 24: api.AsyncSearchesListItem.status:type_name -> api.AsyncSearchStatus - 35, // 25: api.AsyncSearchesListItem.started_at:type_name -> google.protobuf.Timestamp - 35, // 26: api.AsyncSearchesListItem.expires_at:type_name -> google.protobuf.Timestamp - 35, // 27: api.AsyncSearchesListItem.canceled_at:type_name -> google.protobuf.Timestamp + 39, // 25: api.AsyncSearchesListItem.started_at:type_name -> google.protobuf.Timestamp + 39, // 26: api.AsyncSearchesListItem.expires_at:type_name -> google.protobuf.Timestamp + 39, // 27: api.AsyncSearchesListItem.canceled_at:type_name -> google.protobuf.Timestamp 6, // 28: api.AsyncSearchesListItem.aggs:type_name -> api.AggQuery - 35, // 29: api.AsyncSearchesListItem.from:type_name -> google.protobuf.Timestamp - 35, // 30: api.AsyncSearchesListItem.to:type_name -> google.protobuf.Timestamp - 34, // 31: api.AsyncSearchesListItem.retention:type_name -> google.protobuf.Duration + 39, // 29: api.AsyncSearchesListItem.from:type_name -> google.protobuf.Timestamp + 39, // 30: api.AsyncSearchesListItem.to:type_name -> google.protobuf.Timestamp + 38, // 31: api.AsyncSearchesListItem.retention:type_name -> google.protobuf.Duration 21, // 32: api.FetchRequest.ids_with_hints:type_name -> api.IdWithHint - 33, // 33: api.FetchRequest.fields_filter:type_name -> api.FetchRequest.FieldsFilter - 35, // 34: api.StatusResponse.oldest_time:type_name -> google.protobuf.Timestamp - 25, // 35: api.SearchResponse.IdWithHint.id:type_name -> api.SearchResponse.Id - 35, // 36: api.SearchResponse.Bin.ts:type_name -> google.protobuf.Timestamp - 27, // 37: api.SearchResponse.Bin.hist:type_name -> api.SearchResponse.Histogram - 31, // 38: api.SearchResponse.Agg.agg:type_name -> api.SearchResponse.Agg.AggEntry - 32, // 39: api.SearchResponse.Agg.agg_histogram:type_name -> api.SearchResponse.Agg.AggHistogramEntry - 28, // 40: api.SearchResponse.Agg.timeseries:type_name -> api.SearchResponse.Bin - 27, // 41: api.SearchResponse.Agg.AggHistogramEntry.value:type_name -> api.SearchResponse.Histogram - 4, // 42: api.StoreApi.Bulk:input_type -> api.BulkRequest - 7, // 43: api.StoreApi.Search:input_type -> api.SearchRequest - 10, // 44: api.StoreApi.StartAsyncSearch:input_type -> api.StartAsyncSearchRequest - 12, // 45: api.StoreApi.FetchAsyncSearchResult:input_type -> api.FetchAsyncSearchResultRequest - 14, // 46: api.StoreApi.CancelAsyncSearch:input_type -> api.CancelAsyncSearchRequest - 16, // 47: api.StoreApi.DeleteAsyncSearch:input_type -> api.DeleteAsyncSearchRequest - 18, // 48: api.StoreApi.GetAsyncSearchesList:input_type -> api.GetAsyncSearchesListRequest - 22, // 49: api.StoreApi.Fetch:input_type -> api.FetchRequest - 23, // 50: api.StoreApi.Status:input_type -> api.StatusRequest - 36, // 51: api.StoreApi.Bulk:output_type -> google.protobuf.Empty - 8, // 52: api.StoreApi.Search:output_type -> api.SearchResponse - 11, // 53: api.StoreApi.StartAsyncSearch:output_type -> api.StartAsyncSearchResponse - 13, // 54: api.StoreApi.FetchAsyncSearchResult:output_type -> api.FetchAsyncSearchResultResponse - 15, // 55: api.StoreApi.CancelAsyncSearch:output_type -> api.CancelAsyncSearchResponse - 17, // 56: api.StoreApi.DeleteAsyncSearch:output_type -> api.DeleteAsyncSearchResponse - 19, // 57: api.StoreApi.GetAsyncSearchesList:output_type -> api.GetAsyncSearchesListResponse - 5, // 58: api.StoreApi.Fetch:output_type -> api.BinaryData - 24, // 59: api.StoreApi.Status:output_type -> api.StatusResponse - 51, // [51:60] is the sub-list for method output_type - 42, // [42:51] is the sub-list for method input_type - 42, // [42:42] is the sub-list for extension type_name - 42, // [42:42] is the sub-list for extension extendee - 0, // [0:42] is the sub-list for field type_name + 22, // 33: api.FetchRequest.fields_filter:type_name -> api.FieldsFilter + 39, // 34: api.StatusResponse.oldest_time:type_name -> google.protobuf.Timestamp + 1, // 35: api.OnePhaseSearchRequest.order:type_name -> api.Order + 22, // 36: api.OnePhaseSearchRequest.fields_filter:type_name -> api.FieldsFilter + 29, // 37: api.OnePhaseSearchResponse.header:type_name -> api.Header + 28, // 38: api.OnePhaseSearchResponse.document:type_name -> api.Document + 5, // 39: api.Document.data:type_name -> api.BinaryData + 2, // 40: api.Header.code:type_name -> api.SearchErrorCode + 9, // 41: api.Header.explain:type_name -> api.ExplainEntry + 30, // 42: api.SearchResponse.IdWithHint.id:type_name -> api.SearchResponse.Id + 39, // 43: api.SearchResponse.Bin.ts:type_name -> google.protobuf.Timestamp + 32, // 44: api.SearchResponse.Bin.hist:type_name -> api.SearchResponse.Histogram + 36, // 45: api.SearchResponse.Agg.agg:type_name -> api.SearchResponse.Agg.AggEntry + 37, // 46: api.SearchResponse.Agg.agg_histogram:type_name -> api.SearchResponse.Agg.AggHistogramEntry + 33, // 47: api.SearchResponse.Agg.timeseries:type_name -> api.SearchResponse.Bin + 32, // 48: api.SearchResponse.Agg.AggHistogramEntry.value:type_name -> api.SearchResponse.Histogram + 4, // 49: api.StoreApi.Bulk:input_type -> api.BulkRequest + 7, // 50: api.StoreApi.Search:input_type -> api.SearchRequest + 10, // 51: api.StoreApi.StartAsyncSearch:input_type -> api.StartAsyncSearchRequest + 12, // 52: api.StoreApi.FetchAsyncSearchResult:input_type -> api.FetchAsyncSearchResultRequest + 14, // 53: api.StoreApi.CancelAsyncSearch:input_type -> api.CancelAsyncSearchRequest + 16, // 54: api.StoreApi.DeleteAsyncSearch:input_type -> api.DeleteAsyncSearchRequest + 18, // 55: api.StoreApi.GetAsyncSearchesList:input_type -> api.GetAsyncSearchesListRequest + 23, // 56: api.StoreApi.Fetch:input_type -> api.FetchRequest + 24, // 57: api.StoreApi.Status:input_type -> api.StatusRequest + 26, // 58: api.StoreApi.OnePhaseSearch:input_type -> api.OnePhaseSearchRequest + 40, // 59: api.StoreApi.Bulk:output_type -> google.protobuf.Empty + 8, // 60: api.StoreApi.Search:output_type -> api.SearchResponse + 11, // 61: api.StoreApi.StartAsyncSearch:output_type -> api.StartAsyncSearchResponse + 13, // 62: api.StoreApi.FetchAsyncSearchResult:output_type -> api.FetchAsyncSearchResultResponse + 15, // 63: api.StoreApi.CancelAsyncSearch:output_type -> api.CancelAsyncSearchResponse + 17, // 64: api.StoreApi.DeleteAsyncSearch:output_type -> api.DeleteAsyncSearchResponse + 19, // 65: api.StoreApi.GetAsyncSearchesList:output_type -> api.GetAsyncSearchesListResponse + 5, // 66: api.StoreApi.Fetch:output_type -> api.BinaryData + 25, // 67: api.StoreApi.Status:output_type -> api.StatusResponse + 27, // 68: api.StoreApi.OnePhaseSearch:output_type -> api.OnePhaseSearchResponse + 59, // [59:69] is the sub-list for method output_type + 49, // [49:59] is the sub-list for method input_type + 49, // [49:49] is the sub-list for extension type_name + 49, // [49:49] is the sub-list for extension extendee + 0, // [0:49] is the sub-list for field type_name } func init() { file_storeapi_store_api_proto_init() } @@ -2671,13 +3038,18 @@ func file_storeapi_store_api_proto_init() { file_storeapi_store_api_proto_msgTypes[9].OneofWrappers = []any{} file_storeapi_store_api_proto_msgTypes[14].OneofWrappers = []any{} file_storeapi_store_api_proto_msgTypes[16].OneofWrappers = []any{} + file_storeapi_store_api_proto_msgTypes[23].OneofWrappers = []any{ + (*OnePhaseSearchResponse_Header)(nil), + (*OnePhaseSearchResponse_Document)(nil), + } + file_storeapi_store_api_proto_msgTypes[25].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_storeapi_store_api_proto_rawDesc), len(file_storeapi_store_api_proto_rawDesc)), NumEnums: 4, - NumMessages: 30, + NumMessages: 34, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/storeapi/store_api.pb.gw.go b/pkg/storeapi/store_api.pb.gw.go index 385ec993..6d28a8d6 100644 --- a/pkg/storeapi/store_api.pb.gw.go +++ b/pkg/storeapi/store_api.pb.gw.go @@ -247,6 +247,26 @@ func local_request_StoreApi_Status_0(ctx context.Context, marshaler runtime.Mars return msg, metadata, err } +func request_StoreApi_OnePhaseSearch_0(ctx context.Context, marshaler runtime.Marshaler, client StoreApiClient, req *http.Request, pathParams map[string]string) (StoreApi_OnePhaseSearchClient, runtime.ServerMetadata, error) { + var ( + protoReq OnePhaseSearchRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + stream, err := client.OnePhaseSearch(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil +} + // RegisterStoreApiHandlerServer registers the http handlers for service StoreApi to "mux". // UnaryRPC :call StoreApiServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -421,6 +441,13 @@ func RegisterStoreApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, s forward_StoreApi_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_StoreApi_OnePhaseSearch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + return nil } @@ -613,6 +640,23 @@ func RegisterStoreApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, c } forward_StoreApi_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_StoreApi_OnePhaseSearch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/api.StoreApi/OnePhaseSearch", runtime.WithHTTPPathPattern("/api.StoreApi/OnePhaseSearch")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StoreApi_OnePhaseSearch_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_StoreApi_OnePhaseSearch_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + }) return nil } @@ -626,6 +670,7 @@ var ( pattern_StoreApi_GetAsyncSearchesList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api.StoreApi", "GetAsyncSearchesList"}, "")) pattern_StoreApi_Fetch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api.StoreApi", "Fetch"}, "")) pattern_StoreApi_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api.StoreApi", "Status"}, "")) + pattern_StoreApi_OnePhaseSearch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api.StoreApi", "OnePhaseSearch"}, "")) ) var ( @@ -638,4 +683,5 @@ var ( forward_StoreApi_GetAsyncSearchesList_0 = runtime.ForwardResponseMessage forward_StoreApi_Fetch_0 = runtime.ForwardResponseStream forward_StoreApi_Status_0 = runtime.ForwardResponseMessage + forward_StoreApi_OnePhaseSearch_0 = runtime.ForwardResponseStream ) diff --git a/pkg/storeapi/store_api_vtproto.pb.go b/pkg/storeapi/store_api_vtproto.pb.go index 73a4cce3..273678d9 100644 --- a/pkg/storeapi/store_api_vtproto.pb.go +++ b/pkg/storeapi/store_api_vtproto.pb.go @@ -619,11 +619,11 @@ func (m *IdWithHint) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *FetchRequest_FieldsFilter) CloneVT() *FetchRequest_FieldsFilter { +func (m *FieldsFilter) CloneVT() *FieldsFilter { if m == nil { - return (*FetchRequest_FieldsFilter)(nil) + return (*FieldsFilter)(nil) } - r := new(FetchRequest_FieldsFilter) + r := new(FieldsFilter) r.AllowList = m.AllowList if rhs := m.Fields; rhs != nil { tmpContainer := make([]string, len(rhs)) @@ -637,7 +637,7 @@ func (m *FetchRequest_FieldsFilter) CloneVT() *FetchRequest_FieldsFilter { return r } -func (m *FetchRequest_FieldsFilter) CloneMessageVT() proto.Message { +func (m *FieldsFilter) CloneMessageVT() proto.Message { return m.CloneVT() } @@ -705,6 +705,112 @@ func (m *StatusResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *OnePhaseSearchRequest) CloneVT() *OnePhaseSearchRequest { + if m == nil { + return (*OnePhaseSearchRequest)(nil) + } + r := new(OnePhaseSearchRequest) + r.Query = m.Query + r.From = m.From + r.To = m.To + r.Size = m.Size + r.Offset = m.Offset + r.Explain = m.Explain + r.WithTotal = m.WithTotal + r.Order = m.Order + r.OffsetId = m.OffsetId + r.FieldsFilter = m.FieldsFilter.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *OnePhaseSearchRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *OnePhaseSearchResponse) CloneVT() *OnePhaseSearchResponse { + if m == nil { + return (*OnePhaseSearchResponse)(nil) + } + r := new(OnePhaseSearchResponse) + if m.ResponseType != nil { + r.ResponseType = m.ResponseType.(interface { + CloneVT() isOnePhaseSearchResponse_ResponseType + }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *OnePhaseSearchResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *OnePhaseSearchResponse_Header) CloneVT() isOnePhaseSearchResponse_ResponseType { + if m == nil { + return (*OnePhaseSearchResponse_Header)(nil) + } + r := new(OnePhaseSearchResponse_Header) + r.Header = m.Header.CloneVT() + return r +} + +func (m *OnePhaseSearchResponse_Document) CloneVT() isOnePhaseSearchResponse_ResponseType { + if m == nil { + return (*OnePhaseSearchResponse_Document)(nil) + } + r := new(OnePhaseSearchResponse_Document) + r.Document = m.Document.CloneVT() + return r +} + +func (m *Document) CloneVT() *Document { + if m == nil { + return (*Document)(nil) + } + r := new(Document) + r.Data = m.Data.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Document) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Header) CloneVT() *Header { + if m == nil { + return (*Header)(nil) + } + r := new(Header) + r.Total = m.Total + r.Code = m.Code + r.Explain = m.Explain.CloneVT() + if rhs := m.Errors; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Errors = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Header) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (this *BulkRequest) EqualVT(that *BulkRequest) bool { if this == that { return true @@ -1585,7 +1691,7 @@ func (this *IdWithHint) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } -func (this *FetchRequest_FieldsFilter) EqualVT(that *FetchRequest_FieldsFilter) bool { +func (this *FieldsFilter) EqualVT(that *FieldsFilter) bool { if this == that { return true } else if this == nil || that == nil { @@ -1606,8 +1712,8 @@ func (this *FetchRequest_FieldsFilter) EqualVT(that *FetchRequest_FieldsFilter) return string(this.unknownFields) == string(that.unknownFields) } -func (this *FetchRequest_FieldsFilter) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*FetchRequest_FieldsFilter) +func (this *FieldsFilter) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*FieldsFilter) if !ok { return false } @@ -1699,6 +1805,183 @@ func (this *StatusResponse) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *OnePhaseSearchRequest) EqualVT(that *OnePhaseSearchRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Query != that.Query { + return false + } + if this.From != that.From { + return false + } + if this.To != that.To { + return false + } + if this.Size != that.Size { + return false + } + if this.Offset != that.Offset { + return false + } + if this.Explain != that.Explain { + return false + } + if this.WithTotal != that.WithTotal { + return false + } + if this.Order != that.Order { + return false + } + if this.OffsetId != that.OffsetId { + return false + } + if !this.FieldsFilter.EqualVT(that.FieldsFilter) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *OnePhaseSearchRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*OnePhaseSearchRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *OnePhaseSearchResponse) EqualVT(that *OnePhaseSearchResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.ResponseType == nil && that.ResponseType != nil { + return false + } else if this.ResponseType != nil { + if that.ResponseType == nil { + return false + } + if !this.ResponseType.(interface { + EqualVT(isOnePhaseSearchResponse_ResponseType) bool + }).EqualVT(that.ResponseType) { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *OnePhaseSearchResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*OnePhaseSearchResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *OnePhaseSearchResponse_Header) EqualVT(thatIface isOnePhaseSearchResponse_ResponseType) bool { + that, ok := thatIface.(*OnePhaseSearchResponse_Header) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Header, that.Header; p != q { + if p == nil { + p = &Header{} + } + if q == nil { + q = &Header{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *OnePhaseSearchResponse_Document) EqualVT(thatIface isOnePhaseSearchResponse_ResponseType) bool { + that, ok := thatIface.(*OnePhaseSearchResponse_Document) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Document, that.Document; p != q { + if p == nil { + p = &Document{} + } + if q == nil { + q = &Document{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Document) EqualVT(that *Document) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.Data.EqualVT(that.Data) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Document) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Document) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Header) EqualVT(that *Header) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Total != that.Total { + return false + } + if len(this.Errors) != len(that.Errors) { + return false + } + for i, vx := range this.Errors { + vy := that.Errors[i] + if vx != vy { + return false + } + } + if this.Code != that.Code { + return false + } + if !this.Explain.EqualVT(that.Explain) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Header) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Header) + if !ok { + return false + } + return this.EqualVT(that) +} // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -1718,6 +2001,7 @@ type StoreApiClient interface { GetAsyncSearchesList(ctx context.Context, in *GetAsyncSearchesListRequest, opts ...grpc.CallOption) (*GetAsyncSearchesListResponse, error) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (StoreApi_FetchClient, error) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) + OnePhaseSearch(ctx context.Context, in *OnePhaseSearchRequest, opts ...grpc.CallOption) (StoreApi_OnePhaseSearchClient, error) } type storeApiClient struct { @@ -1832,6 +2116,38 @@ func (c *storeApiClient) Status(ctx context.Context, in *StatusRequest, opts ... return out, nil } +func (c *storeApiClient) OnePhaseSearch(ctx context.Context, in *OnePhaseSearchRequest, opts ...grpc.CallOption) (StoreApi_OnePhaseSearchClient, error) { + stream, err := c.cc.NewStream(ctx, &StoreApi_ServiceDesc.Streams[1], "/api.StoreApi/OnePhaseSearch", opts...) + if err != nil { + return nil, err + } + x := &storeApiOnePhaseSearchClient{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 StoreApi_OnePhaseSearchClient interface { + Recv() (*OnePhaseSearchResponse, error) + grpc.ClientStream +} + +type storeApiOnePhaseSearchClient struct { + grpc.ClientStream +} + +func (x *storeApiOnePhaseSearchClient) Recv() (*OnePhaseSearchResponse, error) { + m := new(OnePhaseSearchResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // StoreApiServer is the server API for StoreApi service. // All implementations must embed UnimplementedStoreApiServer // for forward compatibility @@ -1845,6 +2161,7 @@ type StoreApiServer interface { GetAsyncSearchesList(context.Context, *GetAsyncSearchesListRequest) (*GetAsyncSearchesListResponse, error) Fetch(*FetchRequest, StoreApi_FetchServer) error Status(context.Context, *StatusRequest) (*StatusResponse, error) + OnePhaseSearch(*OnePhaseSearchRequest, StoreApi_OnePhaseSearchServer) error mustEmbedUnimplementedStoreApiServer() } @@ -1879,6 +2196,9 @@ func (UnimplementedStoreApiServer) Fetch(*FetchRequest, StoreApi_FetchServer) er func (UnimplementedStoreApiServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") } +func (UnimplementedStoreApiServer) OnePhaseSearch(*OnePhaseSearchRequest, StoreApi_OnePhaseSearchServer) error { + return status.Errorf(codes.Unimplemented, "method OnePhaseSearch not implemented") +} func (UnimplementedStoreApiServer) mustEmbedUnimplementedStoreApiServer() {} // UnsafeStoreApiServer may be embedded to opt out of forward compatibility for this service. @@ -2057,6 +2377,27 @@ func _StoreApi_Status_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _StoreApi_OnePhaseSearch_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(OnePhaseSearchRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(StoreApiServer).OnePhaseSearch(m, &storeApiOnePhaseSearchServer{stream}) +} + +type StoreApi_OnePhaseSearchServer interface { + Send(*OnePhaseSearchResponse) error + grpc.ServerStream +} + +type storeApiOnePhaseSearchServer struct { + grpc.ServerStream +} + +func (x *storeApiOnePhaseSearchServer) Send(m *OnePhaseSearchResponse) error { + return x.ServerStream.SendMsg(m) +} + // StoreApi_ServiceDesc is the grpc.ServiceDesc for StoreApi service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -2103,8 +2444,13 @@ var StoreApi_ServiceDesc = grpc.ServiceDesc{ Handler: _StoreApi_Fetch_Handler, ServerStreams: true, }, - }, - Metadata: "storeapi/store_api.proto", + { + StreamName: "OnePhaseSearch", + Handler: _StoreApi_OnePhaseSearch_Handler, + ServerStreams: true, + }, + }, + Metadata: "storeapi/store_api.proto", } func (m *BulkRequest) MarshalVT() (dAtA []byte, err error) { @@ -3707,7 +4053,7 @@ func (m *IdWithHint) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *FetchRequest_FieldsFilter) MarshalVT() (dAtA []byte, err error) { +func (m *FieldsFilter) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3720,12 +4066,12 @@ func (m *FetchRequest_FieldsFilter) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FetchRequest_FieldsFilter) MarshalToVT(dAtA []byte) (int, error) { +func (m *FieldsFilter) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *FetchRequest_FieldsFilter) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *FieldsFilter) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3919,25 +4265,25 @@ func (m *StatusResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BulkRequest) MarshalVTStrict() (dAtA []byte, err error) { +func (m *OnePhaseSearchRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } size := m.SizeVT() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } -func (m *BulkRequest) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *OnePhaseSearchRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *BulkRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *OnePhaseSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3949,47 +4295,97 @@ func (m *BulkRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Metas) > 0 { - i -= len(m.Metas) - copy(dAtA[i:], m.Metas) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Metas))) + if m.FieldsFilter != nil { + size, err := m.FieldsFilter.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x52 } - if len(m.Docs) > 0 { - i -= len(m.Docs) - copy(dAtA[i:], m.Docs) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Docs))) + if len(m.OffsetId) > 0 { + i -= len(m.OffsetId) + copy(dAtA[i:], m.OffsetId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OffsetId))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x4a } - if m.Count != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Count)) + if m.Order != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) i-- - dAtA[i] = 0x8 + dAtA[i] = 0x40 + } + if m.WithTotal { + i-- + if m.WithTotal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.Explain { + i-- + if m.Explain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Offset != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Offset)) + i-- + dAtA[i] = 0x28 + } + if m.Size != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x20 + } + if m.To != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) + i-- + dAtA[i] = 0x18 + } + if m.From != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) + i-- + dAtA[i] = 0x10 + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *BinaryData) MarshalVTStrict() (dAtA []byte, err error) { +func (m *OnePhaseSearchResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } size := m.SizeVT() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } -func (m *BinaryData) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *OnePhaseSearchResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *BinaryData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *OnePhaseSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4001,35 +4397,83 @@ func (m *BinaryData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) + if vtmsg, ok := m.ResponseType.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *OnePhaseSearchResponse_Header) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OnePhaseSearchResponse_Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Header != nil { + size, err := m.Header.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } +func (m *OnePhaseSearchResponse_Document) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} -func (m *AggQuery) MarshalVTStrict() (dAtA []byte, err error) { +func (m *OnePhaseSearchResponse_Document) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Document != nil { + size, err := m.Document.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Document) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } size := m.SizeVT() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } -func (m *AggQuery) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *Document) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *AggQuery) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *Document) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4041,44 +4485,82 @@ func (m *AggQuery) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Interval != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) + if m.Data != nil { + size, err := m.Data.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0xa } - if len(m.Quantiles) > 0 { - for iNdEx := len(m.Quantiles) - 1; iNdEx >= 0; iNdEx-- { - f1 := math.Float64bits(float64(m.Quantiles[iNdEx])) - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(f1)) + return len(dAtA) - i, nil +} + +func (m *Header) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Header) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Explain != nil { + size, err := m.Explain.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Quantiles)*8)) + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } - if m.Func != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Func)) + if m.Code != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x18 } - if len(m.GroupBy) > 0 { - i -= len(m.GroupBy) - copy(dAtA[i:], m.GroupBy) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GroupBy))) - i-- - dAtA[i] = 0x1a + if len(m.Errors) > 0 { + for iNdEx := len(m.Errors) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Errors[iNdEx]) + copy(dAtA[i:], m.Errors[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Errors[iNdEx]))) + i-- + dAtA[i] = 0x12 + } } - if len(m.Field) > 0 { - i -= len(m.Field) - copy(dAtA[i:], m.Field) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Field))) + if m.Total != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *SearchRequest) MarshalVTStrict() (dAtA []byte, err error) { +func (m *BulkRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -4091,12 +4573,12 @@ func (m *SearchRequest) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *BulkRequest) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *SearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *BulkRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4108,29 +4590,188 @@ func (m *SearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.OffsetId) > 0 { - i -= len(m.OffsetId) - copy(dAtA[i:], m.OffsetId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OffsetId))) + if len(m.Metas) > 0 { + i -= len(m.Metas) + copy(dAtA[i:], m.Metas) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Metas))) i-- - dAtA[i] = 0x72 + dAtA[i] = 0x1a } - if m.Order != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) + if len(m.Docs) > 0 { + i -= len(m.Docs) + copy(dAtA[i:], m.Docs) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Docs))) i-- - dAtA[i] = 0x68 + dAtA[i] = 0x12 } - if len(m.Aggs) > 0 { - for iNdEx := len(m.Aggs) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Aggs[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x62 - } + if m.Count != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BinaryData) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BinaryData) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BinaryData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AggQuery) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AggQuery) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *AggQuery) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Interval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) + i-- + dAtA[i] = 0x30 + } + if len(m.Quantiles) > 0 { + for iNdEx := len(m.Quantiles) - 1; iNdEx >= 0; iNdEx-- { + f1 := math.Float64bits(float64(m.Quantiles[iNdEx])) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(f1)) + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Quantiles)*8)) + i-- + dAtA[i] = 0x2a + } + if m.Func != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Func)) + i-- + dAtA[i] = 0x20 + } + if len(m.GroupBy) > 0 { + i -= len(m.GroupBy) + copy(dAtA[i:], m.GroupBy) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GroupBy))) + i-- + dAtA[i] = 0x1a + } + if len(m.Field) > 0 { + i -= len(m.Field) + copy(dAtA[i:], m.Field) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Field))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SearchRequest) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *SearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.OffsetId) > 0 { + i -= len(m.OffsetId) + copy(dAtA[i:], m.OffsetId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OffsetId))) + i-- + dAtA[i] = 0x72 + } + if m.Order != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) + i-- + dAtA[i] = 0x68 + } + if len(m.Aggs) > 0 { + for iNdEx := len(m.Aggs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Aggs[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x62 + } } if len(m.AggregationFilter) > 0 { i -= len(m.AggregationFilter) @@ -5519,7 +6160,7 @@ func (m *IdWithHint) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *FetchRequest_FieldsFilter) MarshalVTStrict() (dAtA []byte, err error) { +func (m *FieldsFilter) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5532,12 +6173,12 @@ func (m *FetchRequest_FieldsFilter) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FetchRequest_FieldsFilter) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *FieldsFilter) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *FetchRequest_FieldsFilter) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *FieldsFilter) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5731,151 +6372,334 @@ func (m *StatusResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *BulkRequest) SizeVT() (n int) { +func (m *OnePhaseSearchRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 - } - var l int - _ = l - if m.Count != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Count)) - } - l = len(m.Docs) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return nil, nil } - l = len(m.Metas) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err } - n += len(m.unknownFields) - return n + return dAtA[:n], nil } -func (m *BinaryData) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - n += len(m.unknownFields) - return n +func (m *OnePhaseSearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *AggQuery) SizeVT() (n int) { +func (m *OnePhaseSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Field) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - l = len(m.GroupBy) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.FieldsFilter != nil { + size, err := m.FieldsFilter.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 } - if m.Func != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Func)) + if len(m.OffsetId) > 0 { + i -= len(m.OffsetId) + copy(dAtA[i:], m.OffsetId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OffsetId))) + i-- + dAtA[i] = 0x4a } - if len(m.Quantiles) > 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(len(m.Quantiles)*8)) + len(m.Quantiles)*8 + if m.Order != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) + i-- + dAtA[i] = 0x40 } - if m.Interval != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Interval)) + if m.WithTotal { + i-- + if m.WithTotal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 } - n += len(m.unknownFields) - return n -} - -func (m *SearchRequest) SizeVT() (n int) { + if m.Explain { + i-- + if m.Explain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Offset != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Offset)) + i-- + dAtA[i] = 0x28 + } + if m.Size != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x20 + } + if m.To != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) + i-- + dAtA[i] = 0x18 + } + if m.From != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) + i-- + dAtA[i] = 0x10 + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OnePhaseSearchResponse) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *OnePhaseSearchResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *OnePhaseSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Query) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - if m.From != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.From)) + if msg, ok := m.ResponseType.(*OnePhaseSearchResponse_Document); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size } - if m.To != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.To)) + if msg, ok := m.ResponseType.(*OnePhaseSearchResponse_Header); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size } - if m.Size != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Size)) + return len(dAtA) - i, nil +} + +func (m *OnePhaseSearchResponse_Header) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *OnePhaseSearchResponse_Header) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Header != nil { + size, err := m.Header.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa } - if m.Offset != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Offset)) + return len(dAtA) - i, nil +} +func (m *OnePhaseSearchResponse_Document) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *OnePhaseSearchResponse_Document) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Document != nil { + size, err := m.Document.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 } - if m.Interval != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Interval)) + return len(dAtA) - i, nil +} +func (m *Document) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil } - l = len(m.Aggregation) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err } - if m.Explain { - n += 2 + return dAtA[:n], nil +} + +func (m *Document) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Document) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil } - if m.WithTotal { - n += 2 + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - l = len(m.AggregationFilter) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.Data != nil { + size, err := m.Data.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - if len(m.Aggs) > 0 { - for _, e := range m.Aggs { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *Header) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Header) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Header) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Explain != nil { + size, err := m.Explain.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 } - if m.Order != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Order)) + if m.Code != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x18 } - l = len(m.OffsetId) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if len(m.Errors) > 0 { + for iNdEx := len(m.Errors) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Errors[iNdEx]) + copy(dAtA[i:], m.Errors[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Errors[iNdEx]))) + i-- + dAtA[i] = 0x12 + } } - n += len(m.unknownFields) - return n + if m.Total != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } -func (m *SearchResponse_Id) SizeVT() (n int) { +func (m *BulkRequest) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if m.Mid != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Mid)) + if m.Count != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Count)) } - if m.Rid != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Rid)) + l = len(m.Docs) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Metas) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n } -func (m *SearchResponse_IdWithHint) SizeVT() (n int) { +func (m *BinaryData) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if m.Id != nil { - l = m.Id.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - l = len(m.Hint) + l = len(m.Data) if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } @@ -5883,14 +6707,131 @@ func (m *SearchResponse_IdWithHint) SizeVT() (n int) { return n } -func (m *SearchResponse_Histogram) SizeVT() (n int) { +func (m *AggQuery) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if m.Min != 0 { - n += 9 + l = len(m.Field) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.GroupBy) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Func != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Func)) + } + if len(m.Quantiles) > 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.Quantiles)*8)) + len(m.Quantiles)*8 + } + if m.Interval != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Interval)) + } + n += len(m.unknownFields) + return n +} + +func (m *SearchRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Query) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.From != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.From)) + } + if m.To != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.To)) + } + if m.Size != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Size)) + } + if m.Offset != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Offset)) + } + if m.Interval != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Interval)) + } + l = len(m.Aggregation) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Explain { + n += 2 + } + if m.WithTotal { + n += 2 + } + l = len(m.AggregationFilter) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Aggs) > 0 { + for _, e := range m.Aggs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Order != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Order)) + } + l = len(m.OffsetId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SearchResponse_Id) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Mid != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Mid)) + } + if m.Rid != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Rid)) + } + n += len(m.unknownFields) + return n +} + +func (m *SearchResponse_IdWithHint) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != nil { + l = m.Id.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Hint) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SearchResponse_Histogram) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Min != 0 { + n += 9 } if m.Max != 0 { n += 9 @@ -6379,7 +7320,7 @@ func (m *IdWithHint) SizeVT() (n int) { return n } -func (m *FetchRequest_FieldsFilter) SizeVT() (n int) { +func (m *FieldsFilter) SizeVT() (n int) { if m == nil { return 0 } @@ -6454,6 +7395,130 @@ func (m *StatusResponse) SizeVT() (n int) { return n } +func (m *OnePhaseSearchRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Query) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.From != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.From)) + } + if m.To != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.To)) + } + if m.Size != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Size)) + } + if m.Offset != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Offset)) + } + if m.Explain { + n += 2 + } + if m.WithTotal { + n += 2 + } + if m.Order != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Order)) + } + l = len(m.OffsetId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FieldsFilter != nil { + l = m.FieldsFilter.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *OnePhaseSearchResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.ResponseType.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *OnePhaseSearchResponse_Header) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Header != nil { + l = m.Header.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 3 + } + return n +} +func (m *OnePhaseSearchResponse_Document) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Document != nil { + l = m.Document.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 3 + } + return n +} +func (m *Document) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Data != nil { + l = m.Data.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Header) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Total)) + } + if len(m.Errors) > 0 { + for _, s := range m.Errors { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Code != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Code)) + } + if m.Explain != nil { + l = m.Explain.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + func (m *BulkRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6487,7 +7552,636 @@ func (m *BulkRequest) UnmarshalVT(dAtA []byte) error { if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) } - m.Count = 0 + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Docs", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Docs = append(m.Docs[:0], dAtA[iNdEx:postIndex]...) + if m.Docs == nil { + m.Docs = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metas = append(m.Metas[:0], dAtA[iNdEx:postIndex]...) + if m.Metas == nil { + m.Metas = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BinaryData) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: BinaryData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BinaryData: 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 protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + 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 := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AggQuery) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: AggQuery: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AggQuery: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupBy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GroupBy = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) + } + m.Func = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Func |= AggFunc(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.Quantiles = append(m.Quantiles, v2) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.Quantiles) == 0 { + m.Quantiles = make([]float64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.Quantiles = append(m.Quantiles, v2) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Quantiles", wireType) + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + m.Interval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Interval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SearchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + m.From = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.From |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + m.To = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.To |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + } + m.Offset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Offset |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + m.Interval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Interval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aggregation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aggregation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Explain = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WithTotal = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregationFilter", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6497,16 +8191,29 @@ func (m *BulkRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Count |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 2: + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AggregationFilter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Docs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6516,31 +8223,50 @@ func (m *BulkRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Docs = append(m.Docs[:0], dAtA[iNdEx:postIndex]...) - if m.Docs == nil { - m.Docs = []byte{} + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - case 3: + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + m.Order = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Order |= Order(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6550,25 +8276,23 @@ func (m *BulkRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metas = append(m.Metas[:0], dAtA[iNdEx:postIndex]...) - if m.Metas == nil { - m.Metas = []byte{} - } + m.OffsetId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6592,7 +8316,7 @@ func (m *BulkRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *BinaryData) UnmarshalVT(dAtA []byte) error { +func (m *SearchResponse_Id) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6615,17 +8339,17 @@ func (m *BinaryData) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BinaryData: wiretype end group for non-group") + return fmt.Errorf("proto: SearchResponse_Id: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BinaryData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SearchResponse_Id: 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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mid", wireType) } - var byteLen int + m.Mid = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6635,26 +8359,30 @@ func (m *BinaryData) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.Mid |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Rid", wireType) } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} + m.Rid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Rid |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -6677,7 +8405,7 @@ func (m *BinaryData) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *AggQuery) UnmarshalVT(dAtA []byte) error { +func (m *SearchResponse_IdWithHint) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6700,15 +8428,51 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AggQuery: wiretype end group for non-group") + return fmt.Errorf("proto: SearchResponse_IdWithHint: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AggQuery: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SearchResponse_IdWithHint: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &SearchResponse_Id{} + } + if err := m.Id.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6736,13 +8500,97 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Field = string(dAtA[iNdEx:postIndex]) + m.Hint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchResponse_Histogram) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SearchResponse_Histogram: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchResponse_Histogram: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Min = float64(math.Float64frombits(v)) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Max = float64(math.Float64frombits(v)) case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupBy", wireType) + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Sum = float64(math.Float64frombits(v)) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) } - var stringLen uint64 + m.Total = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6752,29 +8600,16 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Total |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GroupBy = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) } - m.Func = 0 + m.NotExists = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6784,12 +8619,12 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Func |= AggFunc(b&0x7F) << shift + m.NotExists |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 5: + case 6: if wireType == 1 { var v uint64 if (iNdEx + 8) > l { @@ -6798,7 +8633,7 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 v2 := float64(math.Float64frombits(v)) - m.Quantiles = append(m.Quantiles, v2) + m.Samples = append(m.Samples, v2) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { @@ -6827,8 +8662,8 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { } var elementCount int elementCount = packedLen / 8 - if elementCount != 0 && len(m.Quantiles) == 0 { - m.Quantiles = make([]float64, 0, elementCount) + if elementCount != 0 && len(m.Samples) == 0 { + m.Samples = make([]float64, 0, elementCount) } for iNdEx < postIndex { var v uint64 @@ -6838,29 +8673,86 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 v2 := float64(math.Float64frombits(v)) - m.Quantiles = append(m.Quantiles, v2) + m.Samples = append(m.Samples, v2) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field Quantiles", wireType) - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) } - m.Interval = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow + case 7: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { + m.Values = append(m.Values, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - m.Interval |= int64(b&0x7F) << shift - if b < 0x80 { - break + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Values) == 0 { + m.Values = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Values = append(m.Values, v) } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) } default: iNdEx = preIndex @@ -6884,7 +8776,7 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { +func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6894,155 +8786,28 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { if shift >= 64 { return protohelpers.ErrIntOverflow } - 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: SearchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - 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 protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - m.From = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.From |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - m.To = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.To |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) - } - m.Size = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Size |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) - } - m.Offset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Offset |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) - } - m.Interval = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Interval |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - case 7: + 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: SearchResponse_Bin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchResponse_Bin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggregation", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7070,13 +8835,13 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Aggregation = string(dAtA[iNdEx:postIndex]) + m.Label = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7086,37 +8851,33 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.Explain = bool(v != 0) - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) + if msglen < 0 { + return protohelpers.ErrInvalidLength } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - m.WithTotal = bool(v != 0) - case 11: + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ts == nil { + m.Ts = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.Ts).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregationFilter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hist", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7126,27 +8887,82 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.AggregationFilter = string(dAtA[iNdEx:postIndex]) + if m.Hist == nil { + m.Hist = &SearchResponse_Histogram{} + } + if err := m.Hist.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 12: + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchResponse_Agg) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SearchResponse_Agg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchResponse_Agg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Agg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7173,35 +8989,95 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Aggs = append(m.Aggs, &AggQuery{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + if m.Agg == nil { + m.Agg = make(map[string]uint64) } - m.Order = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var mapkey string + var mapvalue uint64 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - m.Order |= Order(b&0x7F) << shift - if b < 0x80 { - break + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - case 14: + m.Agg[mapkey] = mapvalue + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggHistogram", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7211,99 +9087,126 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.OffsetId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SearchResponse_Id) UnmarshalVT(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 protohelpers.ErrIntOverflow - } - 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: SearchResponse_Id: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Id: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mid", wireType) + if m.AggHistogram == nil { + m.AggHistogram = make(map[string]*SearchResponse_Histogram) } - m.Mid = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var mapkey string + var mapvalue *SearchResponse_Histogram + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - m.Mid |= uint64(b&0x7F) << shift - if b < 0x80 { - break + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SearchResponse_Histogram{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - case 2: + m.AggHistogram[mapkey] = mapvalue + iNdEx = postIndex + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Rid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) } - m.Rid = 0 + m.NotExists = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7313,65 +9216,14 @@ func (m *SearchResponse_Id) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Rid |= uint64(b&0x7F) << shift + m.NotExists |= int64(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SearchResponse_IdWithHint) UnmarshalVT(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 protohelpers.ErrIntOverflow - } - 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: SearchResponse_IdWithHint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_IdWithHint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7398,16 +9250,14 @@ func (m *SearchResponse_IdWithHint) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Id == nil { - m.Id = &SearchResponse_Id{} - } - if err := m.Id.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Timeseries = append(m.Timeseries, &SearchResponse_Bin{}) + if err := m.Timeseries[len(m.Timeseries)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValuesPool", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7435,7 +9285,7 @@ func (m *SearchResponse_IdWithHint) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Hint = string(dAtA[iNdEx:postIndex]) + m.ValuesPool = append(m.ValuesPool, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -7459,7 +9309,7 @@ func (m *SearchResponse_IdWithHint) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchResponse_Histogram) UnmarshalVT(dAtA []byte) error { +func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7482,50 +9332,51 @@ func (m *SearchResponse_Histogram) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse_Histogram: wiretype end group for non-group") + return fmt.Errorf("proto: SearchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Histogram: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Min = float64(math.Float64frombits(v)) - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF + if byteLen < 0 { + return protohelpers.ErrInvalidLength } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Max = float64(math.Float64frombits(v)) - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - var v uint64 - if (iNdEx + 8) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Sum = float64(math.Float64frombits(v)) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} } - m.Total = 0 + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdSources", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7535,16 +9386,31 @@ func (m *SearchResponse_Histogram) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Total |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + if msglen < 0 { + return protohelpers.ErrInvalidLength } - m.NotExists = 0 + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IdSources = append(m.IdSources, &SearchResponse_IdWithHint{}) + if err := m.IdSources[len(m.IdSources)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Histogram", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7554,23 +9420,29 @@ func (m *SearchResponse_Histogram) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NotExists |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType == 1 { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.Samples = append(m.Samples, v2) - } else if wireType == 2 { - var packedLen int + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Histogram == nil { + m.Histogram = make(map[uint64]uint64) + } + var mapkey uint64 + var mapvalue uint64 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7580,115 +9452,199 @@ func (m *SearchResponse_Histogram) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - packedLen |= int(b&0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if packedLen < 0 { - return protohelpers.ErrInvalidLength + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength + } + m.Histogram[mapkey] = mapvalue + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.Samples) == 0 { - m.Samples = make([]float64, 0, elementCount) + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break } - for iNdEx < postIndex { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.Samples = append(m.Samples, v2) + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aggs = append(m.Aggs, &SearchResponse_Agg{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + m.Total = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Total |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) } - case 7: - if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow } - m.Values = append(m.Values, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - if packedLen < 0 { - return protohelpers.ErrInvalidLength + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Errors = append(m.Errors, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= SearchErrorCode(b&0x7F) << shift + if b < 0x80 { + break } - elementCount = count - if elementCount != 0 && len(m.Values) == 0 { - m.Values = make([]uint32, 0, elementCount) + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Values = append(m.Values, v) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Explain == nil { + m.Explain = &ExplainEntry{} + } + if err := m.Explain.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -7711,7 +9667,7 @@ func (m *SearchResponse_Histogram) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { +func (m *ExplainEntry) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7734,15 +9690,15 @@ func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse_Bin: wiretype end group for non-group") + return fmt.Errorf("proto: ExplainEntry: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Bin: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExplainEntry: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7770,11 +9726,11 @@ func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Label = string(dAtA[iNdEx:postIndex]) + m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7801,16 +9757,16 @@ func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Ts == nil { - m.Ts = ×tamppb.Timestamp{} + if m.Duration == nil { + m.Duration = &durationpb.Duration{} } - if err := (*timestamppb1.Timestamp)(m.Ts).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := (*durationpb1.Duration)(m.Duration).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Children", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7837,10 +9793,8 @@ func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Hist == nil { - m.Hist = &SearchResponse_Histogram{} - } - if err := m.Hist.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Children = append(m.Children, &ExplainEntry{}) + if err := m.Children[len(m.Children)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7866,7 +9820,7 @@ func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { +func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7889,17 +9843,17 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse_Agg: wiretype end group for non-group") + return fmt.Errorf("proto: StartAsyncSearchRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Agg: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: StartAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Agg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7909,108 +9863,27 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Agg == nil { - m.Agg = make(map[string]uint64) - } - var mapkey string - var mapvalue uint64 - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protohelpers.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protohelpers.ErrInvalidLength - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else { - iNdEx = entryPreIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + break } } - m.Agg[mapkey] = mapvalue + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SearchId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggHistogram", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8037,111 +9910,50 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AggHistogram == nil { - m.AggHistogram = make(map[string]*SearchResponse_Histogram) + if m.Retention == nil { + m.Retention = &durationpb.Duration{} } - var mapkey string - var mapvalue *SearchResponse_Histogram - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if err := (*durationpb1.Duration)(m.Retention).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protohelpers.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protohelpers.ErrInvalidLength - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return protohelpers.ErrInvalidLength - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &SearchResponse_Histogram{} - if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break } } - m.AggHistogram[mapkey] = mapvalue + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - m.NotExists = 0 + m.From = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8151,14 +9963,33 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NotExists |= int64(b&0x7F) << shift + m.From |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 4: + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + m.To = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.To |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8185,16 +10016,16 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Timeseries = append(m.Timeseries, &SearchResponse_Bin{}) - if err := m.Timeseries[len(m.Timeseries)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValuesPool", wireType) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) } - var stringLen uint64 + m.HistogramInterval = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8204,24 +10035,101 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.HistogramInterval |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WithDocs = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { return protohelpers.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StartAsyncSearchResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.ValuesPool = append(m.ValuesPool, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex + 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: StartAsyncSearchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StartAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -8244,7 +10152,7 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { +func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8267,17 +10175,17 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: FetchAsyncSearchResultRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FetchAsyncSearchResultRequest: 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) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8287,217 +10195,29 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } + m.SearchId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdSources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IdSources = append(m.IdSources, &SearchResponse_IdWithHint{}) - if err := m.IdSources[len(m.IdSources)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Histogram", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Histogram == nil { - m.Histogram = make(map[uint64]uint64) - } - var mapkey uint64 - var mapvalue uint64 - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else if fieldNum == 2 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else { - iNdEx = entryPreIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Histogram[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Aggs = append(m.Aggs, &SearchResponse_Agg{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } - var stringLen uint64 + m.Size = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8507,29 +10227,16 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Size |= int32(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Errors = append(m.Errors, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - m.Code = 0 + m.Offset = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8539,16 +10246,16 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= SearchErrorCode(b&0x7F) << shift + m.Offset |= int32(b&0x7F) << shift if b < 0x80 { break } } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) } - var msglen int + m.Order = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8558,28 +10265,11 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Order |= Order(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Explain == nil { - m.Explain = &ExplainEntry{} - } - if err := m.Explain.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -8602,7 +10292,7 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ExplainEntry) UnmarshalVT(dAtA []byte) error { +func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8625,17 +10315,36 @@ func (m *ExplainEntry) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExplainEntry: wiretype end group for non-group") + return fmt.Errorf("proto: FetchAsyncSearchResultResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExplainEntry: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FetchAsyncSearchResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= AsyncSearchStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8645,27 +10354,31 @@ func (m *ExplainEntry) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Message = string(dAtA[iNdEx:postIndex]) + if m.Response == nil { + m.Response = &SearchResponse{} + } + if err := m.Response.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8692,16 +10405,16 @@ func (m *ExplainEntry) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Duration == nil { - m.Duration = &durationpb.Duration{} + if m.StartedAt == nil { + m.StartedAt = ×tamppb.Timestamp{} } - if err := (*durationpb1.Duration)(m.Duration).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Children", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8728,65 +10441,162 @@ func (m *ExplainEntry) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Children = append(m.Children, &ExplainEntry{}) - if err := m.Children[len(m.Children)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if m.ExpiresAt == nil { + m.ExpiresAt = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CanceledAt", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return protohelpers.ErrInvalidLength } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { return io.ErrUnexpectedEOF } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StartAsyncSearchRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + if m.CanceledAt == nil { + m.CanceledAt = ×tamppb.Timestamp{} } - if iNdEx >= l { + if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) + } + m.FracsDone = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FracsDone |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) + } + m.FracsQueue = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FracsQueue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + } + m.DiskUsage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DiskUsage |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + } + m.HistogramInterval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HistogramInterval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StartAsyncSearchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StartAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8814,11 +10624,11 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SearchId = string(dAtA[iNdEx:postIndex]) + m.Query = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8845,18 +10655,18 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Retention == nil { - m.Retention = &durationpb.Duration{} + if m.From == nil { + m.From = ×tamppb.Timestamp{} } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8866,29 +10676,33 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Query = string(dAtA[iNdEx:postIndex]) + if m.To == nil { + m.To = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) } - m.From = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8898,16 +10712,33 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.From |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 5: + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Retention == nil { + m.Retention = &durationpb.Duration{} + } + if err := (*durationpb1.Duration)(m.Retention).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) } - m.To = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8917,16 +10748,17 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.To |= int64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + m.WithDocs = bool(v != 0) + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } - var msglen int + m.Size = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8936,31 +10768,67 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Size |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protohelpers.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Aggs = append(m.Aggs, &AggQuery{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CancelAsyncSearchRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.HistogramInterval = 0 + 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: CancelAsyncSearchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CancelAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8970,36 +10838,131 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.HistogramInterval |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SearchId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CancelAsyncSearchResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: CancelAsyncSearchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CancelAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteAsyncSearchRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - m.WithDocs = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteAsyncSearchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } - m.Size = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9009,11 +10972,24 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Size |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SearchId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -9036,7 +11012,7 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *StartAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { +func (m *DeleteAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9059,10 +11035,10 @@ func (m *StartAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StartAsyncSearchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: DeleteAsyncSearchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StartAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeleteAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -9087,7 +11063,7 @@ func (m *StartAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { +func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9110,15 +11086,35 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FetchAsyncSearchResultRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetAsyncSearchesListRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FetchAsyncSearchResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetAsyncSearchesListRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var v AsyncSearchStatus + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= AsyncSearchStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = &v + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9146,51 +11142,64 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SearchId = string(dAtA[iNdEx:postIndex]) + m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - m.Size = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Size |= int32(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - m.Offset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Offset |= int32(b&0x7F) << shift - if b < 0x80 { - break - } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetAsyncSearchesListResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.Order = 0 + 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: GetAsyncSearchesListResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetAsyncSearchesListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9200,11 +11209,26 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Order |= Order(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Searches = append(m.Searches, &AsyncSearchesListItem{}) + if err := m.Searches[len(m.Searches)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -9227,7 +11251,7 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { +func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9250,36 +11274,17 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FetchAsyncSearchResultResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AsyncSearchesListItem: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FetchAsyncSearchResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AsyncSearchesListItem: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= AsyncSearchStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9289,28 +11294,43 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Response == nil { - m.Response = &SearchResponse{} + m.SearchId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - if err := m.Response.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= AsyncSearchStatus(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) @@ -9708,194 +11728,9 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { break } } - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CancelAsyncSearchRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow - } - 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: CancelAsyncSearchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CancelAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - 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 protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SearchId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CancelAsyncSearchResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow - } - 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: CancelAsyncSearchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CancelAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteAsyncSearchRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow - } - 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: DeleteAsyncSearchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9923,7 +11758,7 @@ func (m *DeleteAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SearchId = string(dAtA[iNdEx:postIndex]) + m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -9947,58 +11782,7 @@ func (m *DeleteAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *DeleteAsyncSearchResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow - } - 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: DeleteAsyncSearchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { +func (m *IdWithHint) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10021,17 +11805,17 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetAsyncSearchesListRequest: wiretype end group for non-group") + return fmt.Errorf("proto: IdWithHint: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetAsyncSearchesListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IdWithHint: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var v AsyncSearchStatus + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10041,15 +11825,27 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= AsyncSearchStatus(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.Status = &v + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10077,7 +11873,7 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) + m.Hint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -10101,7 +11897,7 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *GetAsyncSearchesListResponse) UnmarshalVT(dAtA []byte) error { +func (m *FieldsFilter) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10124,17 +11920,17 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetAsyncSearchesListResponse: wiretype end group for non-group") + return fmt.Errorf("proto: FieldsFilter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetAsyncSearchesListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FieldsFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10144,26 +11940,44 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Searches = append(m.Searches, &AsyncSearchesListItem{}) - if err := m.Searches[len(m.Searches)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Fields = append(m.Fields, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowList", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowList = bool(v != 0) default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -10186,7 +12000,7 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { +func (m *FetchRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10209,15 +12023,15 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AsyncSearchesListItem: wiretype end group for non-group") + return fmt.Errorf("proto: FetchRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AsyncSearchesListItem: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FetchRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10245,13 +12059,13 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SearchId = string(dAtA[iNdEx:postIndex]) + m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } - m.Status = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10261,14 +12075,15 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= AsyncSearchStatus(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: + m.Explain = bool(v != 0) + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IdsWithHints", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10295,16 +12110,14 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.StartedAt == nil { - m.StartedAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.IdsWithHints = append(m.IdsWithHints, &IdWithHint{}) + if err := m.IdsWithHints[len(m.IdsWithHints)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10331,18 +12144,18 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ExpiresAt == nil { - m.ExpiresAt = ×tamppb.Timestamp{} + if m.FieldsFilter == nil { + m.FieldsFilter = &FieldsFilter{} } - if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FieldsFilter.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CanceledAt", wireType) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoSkipMasks", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10352,88 +12165,117 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength + m.NoSkipMasks = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protohelpers.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.CanceledAt == nil { - m.CanceledAt = ×tamppb.Timestamp{} + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow } - if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - m.FracsDone = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FracsDone |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength } - m.FracsQueue = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FracsQueue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow } - m.DiskUsage = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DiskUsage |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - case 9: + 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: StatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OldestTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10460,31 +12302,65 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Aggs = append(m.Aggs, &AggQuery{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if m.OldestTime == nil { + m.OldestTime = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - m.HistogramInterval = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HistogramInterval |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength } - case 11: + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OnePhaseSearchRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: OnePhaseSearchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OnePhaseSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } @@ -10516,11 +12392,11 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } m.Query = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 12: - if wireType != 2 { + case 2: + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - var msglen int + m.From = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10530,33 +12406,16 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.From |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.From == nil { - m.From = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 2 { + case 3: + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - var msglen int + m.To = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10566,33 +12425,16 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.To |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.To == nil { - m.To = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } - var msglen int + m.Size = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10602,31 +12444,33 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Size |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Retention == nil { - m.Retention = &durationpb.Duration{} + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Offset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Offset |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex - case 15: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -10643,12 +12487,12 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { break } } - m.WithDocs = bool(v != 0) - case 16: + m.Explain = bool(v != 0) + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) } - m.Size = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10658,16 +12502,17 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Size |= int64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + m.WithTotal = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) } - var stringLen uint64 + m.Order = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10677,78 +12522,14 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Order |= Order(b&0x7F) << shift if b < 0x80 { break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IdWithHint) UnmarshalVT(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 protohelpers.ErrIntOverflow - } - 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: IdWithHint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IdWithHint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10776,13 +12557,13 @@ func (m *IdWithHint) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + m.OffsetId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10792,23 +12573,27 @@ func (m *IdWithHint) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Hint = string(dAtA[iNdEx:postIndex]) + if m.FieldsFilter == nil { + m.FieldsFilter = &FieldsFilter{} + } + if err := m.FieldsFilter.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -10832,7 +12617,7 @@ func (m *IdWithHint) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *FetchRequest_FieldsFilter) UnmarshalVT(dAtA []byte) error { +func (m *OnePhaseSearchResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10855,17 +12640,17 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FetchRequest_FieldsFilter: wiretype end group for non-group") + return fmt.Errorf("proto: OnePhaseSearchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FetchRequest_FieldsFilter: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OnePhaseSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10875,29 +12660,38 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Fields = append(m.Fields, string(dAtA[iNdEx:postIndex])) + if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Header); ok { + if err := oneof.Header.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Header{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &OnePhaseSearchResponse_Header{Header: v} + } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowList", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10907,12 +12701,33 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.AllowList = bool(v != 0) + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Document); ok { + if err := oneof.Document.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Document{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &OnePhaseSearchResponse_Document{Document: v} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -10935,7 +12750,7 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *FetchRequest) UnmarshalVT(dAtA []byte) error { +func (m *Document) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10958,101 +12773,15 @@ func (m *FetchRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FetchRequest: wiretype end group for non-group") + return fmt.Errorf("proto: Document: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FetchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - 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 protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Explain = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdsWithHints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IdsWithHints = append(m.IdsWithHints, &IdWithHint{}) - if err := m.IdsWithHints[len(m.IdsWithHints)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11079,33 +12808,13 @@ func (m *FetchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.FieldsFilter == nil { - m.FieldsFilter = &FetchRequest_FieldsFilter{} + if m.Data == nil { + m.Data = &BinaryData{} } - if err := m.FieldsFilter.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Data.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NoSkipMasks", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NoSkipMasks = bool(v != 0) default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -11128,7 +12837,7 @@ func (m *FetchRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *StatusRequest) UnmarshalVT(dAtA []byte) error { +func (m *Header) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11151,66 +12860,85 @@ func (m *StatusRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + return fmt.Errorf("proto: Header: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength + m.Total = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Total |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StatusResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength } - if iNdEx >= l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Errors = append(m.Errors, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= SearchErrorCode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OldestTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11237,10 +12965,10 @@ func (m *StatusResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.OldestTime == nil { - m.OldestTime = ×tamppb.Timestamp{} + if m.Explain == nil { + m.Explain = &ExplainEntry{} } - if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Explain.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -12020,9 +13748,221 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { break } } - case 14: + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.OffsetId = stringValue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchResponse_Id) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: SearchResponse_Id: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchResponse_Id: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mid", wireType) + } + m.Mid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Mid |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Rid", wireType) + } + m.Rid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Rid |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: SearchResponse_IdWithHint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchResponse_IdWithHint: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &SearchResponse_Id{} + } + if err := m.Id.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -12054,7 +13994,7 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.OffsetId = stringValue + m.Hint = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -12078,7 +14018,7 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12101,17 +14041,50 @@ func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse_Id: wiretype end group for non-group") + return fmt.Errorf("proto: SearchResponse_Histogram: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Id: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SearchResponse_Histogram: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Min = float64(math.Float64frombits(v)) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Max = float64(math.Float64frombits(v)) + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Sum = float64(math.Float64frombits(v)) + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) } - m.Mid = 0 + m.Total = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12121,16 +14094,16 @@ func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Mid |= uint64(b&0x7F) << shift + m.Total |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 2: + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Rid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) } - m.Rid = 0 + m.NotExists = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12140,11 +14113,141 @@ func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Rid |= uint64(b&0x7F) << shift + m.NotExists |= int64(b&0x7F) << shift if b < 0x80 { break } } + case 6: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.Samples = append(m.Samples, v2) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.Samples) == 0 { + m.Samples = make([]float64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.Samples = append(m.Samples, v2) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) + } + case 7: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Values = append(m.Values, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Values) == 0 { + m.Values = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Values = append(m.Values, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -12167,7 +14270,7 @@ func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12190,15 +14293,51 @@ func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse_IdWithHint: wiretype end group for non-group") + return fmt.Errorf("proto: SearchResponse_Bin: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_IdWithHint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SearchResponse_Bin: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Label = stringValue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12225,18 +14364,18 @@ func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Id == nil { - m.Id = &SearchResponse_Id{} + if m.Ts == nil { + m.Ts = ×tamppb.Timestamp{} } - if err := m.Id.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.Ts).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hist", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12246,27 +14385,27 @@ func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } - } - intStringLen := int(stringLen) - if intStringLen < 0 { + } + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + if m.Hist == nil { + m.Hist = &SearchResponse_Histogram{} + } + if err := m.Hist.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Hint = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -12290,7 +14429,7 @@ func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12313,50 +14452,17 @@ func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse_Histogram: wiretype end group for non-group") + return fmt.Errorf("proto: SearchResponse_Agg: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Histogram: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SearchResponse_Agg: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Min = float64(math.Float64frombits(v)) - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Max = float64(math.Float64frombits(v)) - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Sum = float64(math.Float64frombits(v)) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Agg", wireType) } - m.Total = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12366,42 +14472,29 @@ func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Total |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + if msglen < 0 { + return protohelpers.ErrInvalidLength } - m.NotExists = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NotExists |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - case 6: - if wireType == 1 { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.Samples = append(m.Samples, v2) - } else if wireType == 2 { - var packedLen int + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Agg == nil { + m.Agg = make(map[string]uint64) + } + var mapkey string + var mapvalue uint64 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12411,42 +14504,114 @@ func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - packedLen |= int(b&0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if packedLen < 0 { - return protohelpers.ErrInvalidLength + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + if intStringLenmapkey == 0 { + mapkey = "" + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) + } + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength + } + m.Agg[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AggHistogram", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.Samples) == 0 { - m.Samples = make([]float64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.Samples = append(m.Samples, v2) + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) } - case 7: - if wireType == 0 { - var v uint32 + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AggHistogram == nil { + m.AggHistogram = make(map[string]*SearchResponse_Histogram) + } + var mapkey string + var mapvalue *SearchResponse_Histogram + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12456,51 +14621,47 @@ func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= uint32(b&0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.Values = append(m.Values, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength } - if iNdEx >= l { - return io.ErrUnexpectedEOF + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF } - } - if packedLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ + if intStringLenmapkey == 0 { + mapkey = "" + } else { + mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) } - } - elementCount = count - if elementCount != 0 && len(m.Values) == 0 { - m.Values = make([]uint32, 0, elementCount) - } - for iNdEx < postIndex { - var v uint32 + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12510,72 +14671,48 @@ func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= uint32(b&0x7F) << shift + mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.Values = append(m.Values, v) + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SearchResponse_Histogram{} + if err := mapvalue.UnmarshalVTUnsafe(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SearchResponse_Bin) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow - } - 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: SearchResponse_Bin: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Bin: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + m.AggHistogram[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) } - var stringLen uint64 + m.NotExists = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12585,31 +14722,14 @@ func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.NotExists |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.Label = stringValue - iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12636,18 +14756,16 @@ func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Ts == nil { - m.Ts = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.Ts).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.Timeseries = append(m.Timeseries, &SearchResponse_Bin{}) + if err := m.Timeseries[len(m.Timeseries)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValuesPool", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12657,27 +14775,27 @@ func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Hist == nil { - m.Hist = &SearchResponse_Histogram{} - } - if err := m.Hist.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + m.ValuesPool = append(m.ValuesPool, stringValue) iNdEx = postIndex default: iNdEx = preIndex @@ -12701,7 +14819,7 @@ func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12711,28 +14829,93 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { if shift >= 64 { return protohelpers.ErrIntOverflow } - if iNdEx >= l { + 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: SearchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchResponse: 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 protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = dAtA[iNdEx:postIndex] + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdSources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.IdSources = append(m.IdSources, &SearchResponse_IdWithHint{}) + if err := m.IdSources[len(m.IdSources)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SearchResponse_Agg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Agg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Agg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Histogram", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12759,10 +14942,10 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Agg == nil { - m.Agg = make(map[string]uint64) + if m.Histogram == nil { + m.Histogram = make(map[uint64]uint64) } - var mapkey string + var mapkey uint64 var mapvalue uint64 for iNdEx < postIndex { entryPreIndex := iNdEx @@ -12783,7 +14966,6 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { } fieldNum := int32(wire >> 3) if fieldNum == 1 { - var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12793,28 +14975,11 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift + mapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protohelpers.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protohelpers.ErrInvalidLength - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - if intStringLenmapkey == 0 { - mapkey = "" - } else { - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) - } - iNdEx = postStringIndexmapkey } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { @@ -12845,11 +15010,11 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { iNdEx += skippy } } - m.Agg[mapkey] = mapvalue + m.Histogram[mapkey] = mapvalue iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggHistogram", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12876,115 +15041,177 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AggHistogram == nil { - m.AggHistogram = make(map[string]*SearchResponse_Histogram) + m.Aggs = append(m.Aggs, &SearchResponse_Agg{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - var mapkey string - var mapvalue *SearchResponse_Histogram - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + m.Total = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protohelpers.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protohelpers.ErrInvalidLength - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - if intStringLenmapkey == 0 { - mapkey = "" - } else { - mapkey = unsafe.String(&dAtA[iNdEx], intStringLenmapkey) - } - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return protohelpers.ErrInvalidLength - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &SearchResponse_Histogram{} - if err := mapvalue.UnmarshalVTUnsafe(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Total |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Errors = append(m.Errors, stringValue) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= SearchErrorCode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break } } - m.AggHistogram[mapkey] = mapvalue + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Explain == nil { + m.Explain = &ExplainEntry{} + } + if err := m.Explain.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - m.NotExists = 0 + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExplainEntry) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: ExplainEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExplainEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12994,14 +15221,31 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NotExists |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 4: + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Message = stringValue + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13028,16 +15272,18 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Timeseries = append(m.Timeseries, &SearchResponse_Bin{}) - if err := m.Timeseries[len(m.Timeseries)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if m.Duration == nil { + m.Duration = &durationpb.Duration{} + } + if err := (*durationpb1.Duration)(m.Duration).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValuesPool", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Children", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13047,27 +15293,25 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + m.Children = append(m.Children, &ExplainEntry{}) + if err := m.Children[len(m.Children)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.ValuesPool = append(m.ValuesPool, stringValue) iNdEx = postIndex default: iNdEx = preIndex @@ -13091,7 +15335,7 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13114,17 +15358,17 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: StartAsyncSearchRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: StartAsyncSearchRequest: 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) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13134,26 +15378,31 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = dAtA[iNdEx:postIndex] + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.SearchId = stringValue iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdSources", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13180,16 +15429,18 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IdSources = append(m.IdSources, &SearchResponse_IdWithHint{}) - if err := m.IdSources[len(m.IdSources)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if m.Retention == nil { + m.Retention = &durationpb.Duration{} + } + if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Histogram", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13199,92 +15450,67 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Histogram == nil { - m.Histogram = make(map[uint64]uint64) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - var mapkey uint64 - var mapvalue uint64 - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + m.Query = stringValue + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + m.From = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else if fieldNum == 2 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else { - iNdEx = entryPreIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.From |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + m.To = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.To |= int64(b&0x7F) << shift + if b < 0x80 { + break } } - m.Histogram[mapkey] = mapvalue - iNdEx = postIndex - case 4: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } @@ -13313,16 +15539,16 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Aggs = append(m.Aggs, &SearchResponse_Agg{}) + m.Aggs = append(m.Aggs, &AggQuery{}) if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) } - m.Total = 0 + m.HistogramInterval = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13332,14 +15558,155 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Total |= uint64(b&0x7F) << shift + m.HistogramInterval |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 6: + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WithDocs = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StartAsyncSearchResponse) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: StartAsyncSearchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StartAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FetchAsyncSearchResultRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: FetchAsyncSearchResultRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FetchAsyncSearchResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -13371,13 +15738,13 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Errors = append(m.Errors, stringValue) + m.SearchId = stringValue iNdEx = postIndex - case 7: + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } - m.Code = 0 + m.Size = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13387,16 +15754,16 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= SearchErrorCode(b&0x7F) << shift + m.Size |= int32(b&0x7F) << shift if b < 0x80 { break } } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - var msglen int + m.Offset = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13406,28 +15773,30 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Offset |= int32(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Explain == nil { - m.Explain = &ExplainEntry{} + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) } - if err := m.Explain.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Order = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Order |= Order(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -13450,7 +15819,7 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *ExplainEntry) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13473,17 +15842,36 @@ func (m *ExplainEntry) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExplainEntry: wiretype end group for non-group") + return fmt.Errorf("proto: FetchAsyncSearchResultResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExplainEntry: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FetchAsyncSearchResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= AsyncSearchStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13493,31 +15881,31 @@ func (m *ExplainEntry) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + if m.Response == nil { + m.Response = &SearchResponse{} + } + if err := m.Response.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Message = stringValue iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13544,16 +15932,16 @@ func (m *ExplainEntry) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Duration == nil { - m.Duration = &durationpb.Duration{} + if m.StartedAt == nil { + m.StartedAt = ×tamppb.Timestamp{} } - if err := (*durationpb1.Duration)(m.Duration).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Children", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13580,67 +15968,18 @@ func (m *ExplainEntry) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Children = append(m.Children, &ExplainEntry{}) - if err := m.Children[len(m.Children)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.ExpiresAt == nil { + m.ExpiresAt = ×tamppb.Timestamp{} } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { + if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow - } - 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: StartAsyncSearchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StartAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CanceledAt", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13650,31 +15989,88 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + if m.CanceledAt == nil { + m.CanceledAt = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.SearchId = stringValue iNdEx = postIndex - case 2: + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) + } + m.FracsDone = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FracsDone |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) + } + m.FracsQueue = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FracsQueue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + } + m.DiskUsage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DiskUsage |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13701,14 +16097,31 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Retention == nil { - m.Retention = &durationpb.Duration{} - } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + } + m.HistogramInterval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HistogramInterval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } @@ -13744,11 +16157,11 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } m.Query = stringValue iNdEx = postIndex - case 4: - if wireType != 0 { + case 12: + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - m.From = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13758,16 +16171,33 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.From |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.From == nil { + m.From = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - m.To = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13777,14 +16207,31 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.To |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.To == nil { + m.To = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13811,16 +16258,18 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Aggs = append(m.Aggs, &AggQuery{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if m.Retention == nil { + m.Retention = &durationpb.Duration{} + } + if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + case 15: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) } - m.HistogramInterval = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13830,16 +16279,17 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.HistogramInterval |= int64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - case 8: + m.WithDocs = bool(v != 0) + case 16: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } - var v int + m.Size = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13849,17 +16299,67 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Size |= int64(b&0x7F) << shift if b < 0x80 { break } } - m.WithDocs = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - m.Size = 0 + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CancelAsyncSearchRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: CancelAsyncSearchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CancelAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13869,11 +16369,28 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Size |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.SearchId = stringValue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -13896,7 +16413,7 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *StartAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *CancelAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13919,10 +16436,10 @@ func (m *StartAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StartAsyncSearchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: CancelAsyncSearchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StartAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CancelAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -13947,7 +16464,7 @@ func (m *StartAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *FetchAsyncSearchResultRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *DeleteAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13970,10 +16487,10 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FetchAsyncSearchResultRequest: wiretype end group for non-group") + return fmt.Errorf("proto: DeleteAsyncSearchRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FetchAsyncSearchResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeleteAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -14012,63 +16529,6 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVTUnsafe(dAtA []byte) error { } m.SearchId = stringValue iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) - } - m.Size = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Size |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) - } - m.Offset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Offset |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) - } - m.Order = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Order |= Order(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -14091,7 +16551,7 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *DeleteAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14114,108 +16574,68 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FetchAsyncSearchResultResponse: wiretype end group for non-group") + return fmt.Errorf("proto: DeleteAsyncSearchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FetchAsyncSearchResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeleteAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= AsyncSearchStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Response == nil { - m.Response = &SearchResponse{} - } - if err := m.Response.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { + } + if (skippy < 0) || (iNdEx+skippy) < 0 { return protohelpers.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.StartedAt == nil { - m.StartedAt = ×tamppb.Timestamp{} + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetAsyncSearchesListRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow } - if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - var msglen int + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetAsyncSearchesListRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetAsyncSearchesListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var v AsyncSearchStatus for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14225,33 +16645,17 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= AsyncSearchStatus(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExpiresAt == nil { - m.ExpiresAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: + m.Status = &v + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CanceledAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14261,88 +16665,82 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.CanceledAt == nil { - m.CanceledAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + m.Ids = append(m.Ids, stringValue) iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - m.FracsDone = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FracsDone |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - m.FracsQueue = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FracsQueue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetAsyncSearchesListResponse) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.DiskUsage = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DiskUsage |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - case 9: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetAsyncSearchesListResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetAsyncSearchesListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -14369,33 +16767,65 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Aggs = append(m.Aggs, &AggQuery{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.Searches = append(m.Searches, &AsyncSearchesListItem{}) + if err := m.Searches[len(m.Searches)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - m.HistogramInterval = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HistogramInterval |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - case 11: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AsyncSearchesListItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AsyncSearchesListItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -14427,11 +16857,30 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Query = stringValue + m.SearchId = stringValue iNdEx = postIndex - case 12: + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= AsyncSearchStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -14458,16 +16907,16 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.From == nil { - m.From = ×tamppb.Timestamp{} + if m.StartedAt == nil { + m.StartedAt = ×tamppb.Timestamp{} } - if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 13: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -14494,16 +16943,16 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.To == nil { - m.To = ×tamppb.Timestamp{} + if m.ExpiresAt == nil { + m.ExpiresAt = ×tamppb.Timestamp{} } - if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 14: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CanceledAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -14530,18 +16979,18 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Retention == nil { - m.Retention = &durationpb.Duration{} + if m.CanceledAt == nil { + m.CanceledAt = ×tamppb.Timestamp{} } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 15: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) } - var v int + m.FracsDone = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14551,17 +17000,16 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.FracsDone |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.WithDocs = bool(v != 0) - case 16: + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) } - m.Size = 0 + m.FracsQueue = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14571,67 +17019,35 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Size |= int64(b&0x7F) << shift + m.FracsQueue |= uint64(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CancelAsyncSearchRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.DiskUsage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DiskUsage |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CancelAsyncSearchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CancelAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14641,133 +17057,48 @@ func (m *CancelAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.SearchId = stringValue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CancelAsyncSearchResponse) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow - } - 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: CancelAsyncSearchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CancelAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteAsyncSearchRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + if msglen < 0 { + return protohelpers.ErrInvalidLength } - if iNdEx >= l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteAsyncSearchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + } + m.HistogramInterval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HistogramInterval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -14799,115 +17130,121 @@ func (m *DeleteAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.SearchId = stringValue + m.Query = stringValue iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + if msglen < 0 { + return protohelpers.ErrInvalidLength } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteAsyncSearchResponse) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if m.From == nil { + m.From = ×tamppb.Timestamp{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteAsyncSearchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { + if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return protohelpers.ErrInvalidLength } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { return io.ErrUnexpectedEOF } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetAsyncSearchesListRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + if m.To == nil { + m.To = ×tamppb.Timestamp{} } - if iNdEx >= l { + if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if m.Retention == nil { + m.Retention = &durationpb.Duration{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetAsyncSearchesListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetAsyncSearchesListRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) } - var v AsyncSearchStatus + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14917,15 +17254,34 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= AsyncSearchStatus(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - m.Status = &v - case 2: + m.WithDocs = bool(v != 0) + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -14957,7 +17313,7 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Ids = append(m.Ids, stringValue) + m.Error = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -14981,7 +17337,7 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *GetAsyncSearchesListResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15004,17 +17360,17 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetAsyncSearchesListResponse: wiretype end group for non-group") + return fmt.Errorf("proto: IdWithHint: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetAsyncSearchesListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IdWithHint: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15024,25 +17380,63 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Searches = append(m.Searches, &AsyncSearchesListItem{}) - if err := m.Searches[len(m.Searches)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Id = stringValue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + m.Hint = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -15066,7 +17460,7 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15089,199 +17483,17 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AsyncSearchesListItem: wiretype end group for non-group") + return fmt.Errorf("proto: FieldsFilter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AsyncSearchesListItem: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - 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 protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.SearchId = stringValue - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= AsyncSearchStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.StartedAt == nil { - m.StartedAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExpiresAt == nil { - m.ExpiresAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CanceledAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CanceledAt == nil { - m.CanceledAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) - } - m.FracsDone = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FracsDone |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) + return fmt.Errorf("proto: FieldsFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) } - m.FracsQueue = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15291,16 +17503,33 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.FracsQueue |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 8: + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Fields = append(m.Fields, stringValue) + iNdEx = postIndex + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowList", wireType) } - m.DiskUsage = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15310,16 +17539,68 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DiskUsage |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - case 9: + m.AllowList = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FetchRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: FetchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FetchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15329,31 +17610,33 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Aggs = append(m.Aggs, &AggQuery{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + m.Ids = append(m.Ids, stringValue) iNdEx = postIndex - case 10: + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } - m.HistogramInterval = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15363,16 +17646,17 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.HistogramInterval |= int64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - case 11: + m.Explain = bool(v != 0) + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IdsWithHints", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15382,31 +17666,29 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + m.IdsWithHints = append(m.IdsWithHints, &IdWithHint{}) + if err := m.IdsWithHints[len(m.IdsWithHints)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Query = stringValue iNdEx = postIndex - case 12: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15433,18 +17715,18 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.From == nil { - m.From = ×tamppb.Timestamp{} + if m.FieldsFilter == nil { + m.FieldsFilter = &FieldsFilter{} } - if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FieldsFilter.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoSkipMasks", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15454,31 +17736,117 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength + m.NoSkipMasks = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protohelpers.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.To == nil { - m.To = ×tamppb.Timestamp{} + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow } - if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + 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: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 14: + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusResponse) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: StatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OldestTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15505,88 +17873,13 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Retention == nil { - m.Retention = &durationpb.Duration{} + if m.OldestTime == nil { + m.OldestTime = ×tamppb.Timestamp{} } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.WithDocs = bool(v != 0) - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) - } - m.Size = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Size |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - 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 protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.Error = stringValue - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -15609,7 +17902,7 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15632,15 +17925,15 @@ func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: IdWithHint: wiretype end group for non-group") + return fmt.Errorf("proto: OnePhaseSearchRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: IdWithHint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OnePhaseSearchRequest: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -15672,13 +17965,13 @@ func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Id = stringValue + m.Query = stringValue iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - var stringLen uint64 + m.From = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15688,82 +17981,130 @@ func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.From |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength + m.To = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.To |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - if postIndex > l { - return io.ErrUnexpectedEOF + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - m.Hint = stringValue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength + m.Offset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Offset |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FetchRequest_FieldsFilter) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { - return io.ErrUnexpectedEOF + m.Explain = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FetchRequest_FieldsFilter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FetchRequest_FieldsFilter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.WithTotal = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + m.Order = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Order |= Order(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -15795,13 +18136,13 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Fields = append(m.Fields, stringValue) + m.OffsetId = stringValue iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowList", wireType) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15811,12 +18152,28 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.AllowList = bool(v != 0) + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FieldsFilter == nil { + m.FieldsFilter = &FieldsFilter{} + } + if err := m.FieldsFilter.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -15839,7 +18196,7 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *OnePhaseSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15862,71 +18219,15 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FetchRequest: wiretype end group for non-group") + return fmt.Errorf("proto: OnePhaseSearchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FetchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OnePhaseSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - 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 protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.Ids = append(m.Ids, stringValue) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Explain = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdsWithHints", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15953,14 +18254,21 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IdsWithHints = append(m.IdsWithHints, &IdWithHint{}) - if err := m.IdsWithHints[len(m.IdsWithHints)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Header); ok { + if err := oneof.Header.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Header{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &OnePhaseSearchResponse_Header{Header: v} } iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15987,33 +18295,18 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.FieldsFilter == nil { - m.FieldsFilter = &FetchRequest_FieldsFilter{} - } - if err := m.FieldsFilter.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NoSkipMasks", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Document); ok { + if err := oneof.Document.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break + } else { + v := &Document{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.ResponseType = &OnePhaseSearchResponse_Document{Document: v} } - m.NoSkipMasks = bool(v != 0) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -16036,7 +18329,7 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *StatusRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Document) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16059,12 +18352,48 @@ func (m *StatusRequest) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + return fmt.Errorf("proto: Document: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Document: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = &BinaryData{} + } + if err := m.Data.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -16087,7 +18416,7 @@ func (m *StatusRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *StatusResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Header) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16110,15 +18439,89 @@ func (m *StatusResponse) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") + return fmt.Errorf("proto: Header: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + m.Total = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Total |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OldestTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Errors = append(m.Errors, stringValue) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= SearchErrorCode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -16145,10 +18548,10 @@ func (m *StatusResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.OldestTime == nil { - m.OldestTime = ×tamppb.Timestamp{} + if m.Explain == nil { + m.Explain = &ExplainEntry{} } - if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Explain.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/proxy/search/ingestor.go b/proxy/search/ingestor.go index bc81220f..7c300768 100644 --- a/proxy/search/ingestor.go +++ b/proxy/search/ingestor.go @@ -386,7 +386,7 @@ func (si *Ingestor) makeFetchReq(ids []seq.IDSource, explain, noSkipMasks bool, Ids: idsStr, Explain: explain, IdsWithHints: idsWithHints, - FieldsFilter: &storeapi.FetchRequest_FieldsFilter{ + FieldsFilter: &storeapi.FieldsFilter{ Fields: ff.Fields, AllowList: ff.AllowList, }, diff --git a/proxy/search/mock/store_api_client_mock.go b/proxy/search/mock/store_api_client_mock.go index 3f593d18..069975b2 100644 --- a/proxy/search/mock/store_api_client_mock.go +++ b/proxy/search/mock/store_api_client_mock.go @@ -157,6 +157,26 @@ func (mr *MockStoreApiClientMockRecorder) GetAsyncSearchesList(arg0, arg1 interf return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAsyncSearchesList", reflect.TypeOf((*MockStoreApiClient)(nil).GetAsyncSearchesList), varargs...) } +// OnePhaseSearch mocks base method. +func (m *MockStoreApiClient) OnePhaseSearch(arg0 context.Context, arg1 *storeapi.OnePhaseSearchRequest, arg2 ...grpc.CallOption) (storeapi.StoreApi_OnePhaseSearchClient, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "OnePhaseSearch", varargs...) + ret0, _ := ret[0].(storeapi.StoreApi_OnePhaseSearchClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// OnePhaseSearch indicates an expected call of OnePhaseSearch. +func (mr *MockStoreApiClientMockRecorder) OnePhaseSearch(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnePhaseSearch", reflect.TypeOf((*MockStoreApiClient)(nil).OnePhaseSearch), varargs...) +} + // Search mocks base method. func (m *MockStoreApiClient) Search(arg0 context.Context, arg1 *storeapi.SearchRequest, arg2 ...grpc.CallOption) (*storeapi.SearchResponse, error) { m.ctrl.T.Helper() diff --git a/proxy/search/one_phase_search.go b/proxy/search/one_phase_search.go new file mode 100644 index 00000000..b91f4f29 --- /dev/null +++ b/proxy/search/one_phase_search.go @@ -0,0 +1,113 @@ +package search + +import ( + "context" + "errors" + "fmt" + "io" + + "github.com/alecthomas/units" + "google.golang.org/grpc" + + "github.com/ozontech/seq-db/pkg/storeapi" + "github.com/ozontech/seq-db/querytracer" + "github.com/ozontech/seq-db/seq" + "github.com/ozontech/seq-db/storage" +) + +func (si *Ingestor) OnePhaseSearch( + ctx context.Context, + sr *SearchRequest, + tr *querytracer.Tracer, +) (*seq.QPR, DocsIterator, error) { + searchStores := si.config.HotStores + if si.config.HotReadStores != nil && len(si.config.HotReadStores.Shards) > 0 { + searchStores = si.config.HotReadStores + } + + host := searchStores.Shards[0][0] // TODO: handle multiple stores and shards + + client, has := si.clients[host] + if !has { + return nil, nil, fmt.Errorf("can't fetch: no client for host %s", host) + } + + fieldsFilter := tryParseFieldsFilter(string(sr.Q)) + req := &storeapi.OnePhaseSearchRequest{ + Query: string(sr.Q), + From: int64(sr.From), + To: int64(sr.To), + Size: int64(sr.Size), + Offset: int64(sr.Offset), + Explain: sr.Explain, + WithTotal: sr.WithTotal, + Order: storeapi.Order(sr.Order), + OffsetId: sr.OffsetId, + FieldsFilter: &storeapi.FieldsFilter{ + Fields: fieldsFilter.Fields, + AllowList: fieldsFilter.AllowList, + }, + } + + stream, err := client.OnePhaseSearch(ctx, req, + grpc.MaxCallRecvMsgSize(256*int(units.MiB)), + grpc.MaxCallSendMsgSize(256*int(units.MiB)), + ) + if err != nil { + return nil, nil, fmt.Errorf("can't fetch docs: %s", err.Error()) + } + + msg, err := stream.Recv() + if err != nil { + return nil, nil, nil + } + + header := msg.GetHeader() + + errs := make([]seq.ErrorSource, 0, len(header.Errors)) + for _, err := range header.Errors { + errs = append(errs, seq.ErrorSource{ErrStr: err}) + } + + qpr := &seq.QPR{ + Total: header.Total, + Errors: errs, + } + + return qpr, &OnePhaseSearchIterator{stream: stream, limit: sr.Size}, nil +} + +type OnePhaseSearchIterator struct { + stream storeapi.StoreApi_OnePhaseSearchClient + + fetched int + limit int +} + +func (it *OnePhaseSearchIterator) Next() (StreamingDoc, error) { + if it.fetched >= it.limit { + return StreamingDoc{}, io.EOF + } + + data, err := it.stream.Recv() + if errors.Is(err, io.EOF) { + return StreamingDoc{}, io.EOF + } + if err != nil { + return StreamingDoc{}, err + } + + doc := data.GetDocument() + block := storage.DocBlock(doc.Data.Data) + mid := block.GetExt1() + + it.fetched++ + + return StreamingDoc{ + ID: seq.ID{ + MID: seq.MID(mid), + RID: seq.RID(block.GetExt2()), + }, + Data: block.Payload(), + }, nil +} diff --git a/proxyapi/grpc_one_phase_search.go b/proxyapi/grpc_one_phase_search.go new file mode 100644 index 00000000..23b8ce49 --- /dev/null +++ b/proxyapi/grpc_one_phase_search.go @@ -0,0 +1,165 @@ +package proxyapi + +import ( + "context" + "errors" + "time" + + "go.opencensus.io/trace" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/ozontech/seq-db/consts" + "github.com/ozontech/seq-db/metric" + "github.com/ozontech/seq-db/pkg/seqproxyapi/v1" + "github.com/ozontech/seq-db/proxy/search" + "github.com/ozontech/seq-db/querytracer" + "github.com/ozontech/seq-db/seq" +) + +func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequest) (*seqproxyapi.SearchResponse, error) { + ctx, cancel := context.WithTimeout(ctx, g.config.SearchTimeout) + defer cancel() + + if req.Size <= 0 { + return nil, status.Error(codes.InvalidArgument, `"size" must be greater than 0`) + } + + proxyReq := &seqproxyapi.ComplexSearchRequest{ + Query: req.Query, + Size: req.Size, + Offset: req.Offset, + OffsetId: req.OffsetId, + WithTotal: req.WithTotal, + Order: req.Order, + } + sResp, err := g.doOnePhaseSearch(ctx, proxyReq, true) + if err != nil { + return nil, err + } + if sResp.err != nil && !shouldHaveResponse(sResp.err.Code) { + return &seqproxyapi.SearchResponse{Error: sResp.err}, nil + } + + resp := &seqproxyapi.SearchResponse{ + Docs: makeProtoDocsKek(sResp.docsStream), + Total: int64(sResp.qpr.Total), + Error: &seqproxyapi.Error{ + Code: seqproxyapi.ErrorCode_ERROR_CODE_NO, + }, + } + if sResp.err != nil { + resp.Error = sResp.err + } + + return resp, nil +} + +func makeProtoDocsKek(docs search.DocsIterator) []*seqproxyapi.Document { + // TODO: paginate here (???) + respDocs := make([]*seqproxyapi.Document, 0) + for doc, err := docs.Next(); err == nil; doc, err = docs.Next() { + respDocs = append(respDocs, &seqproxyapi.Document{ + Id: doc.ID.String(), + Data: doc.Data, + Time: timestamppb.New(doc.ID.MID.Time()), + }) + } + return respDocs +} + +func (g *grpcV1) doOnePhaseSearch( + ctx context.Context, + req *seqproxyapi.ComplexSearchRequest, + shouldFetch bool, +) (*proxySearchResponse, error) { + metric.SearchOverall.Add(1) + + span := trace.FromContext(ctx) + defer span.End() + + if req.Query == nil { + return nil, status.Error(codes.InvalidArgument, "search query must be provided") + } + if req.Query.From == nil || req.Query.To == nil { + return nil, status.Error(codes.InvalidArgument, `search query "from" and "to" fields must be provided`) + } + if req.Offset != 0 && req.OffsetId != "" { + return nil, status.Error(codes.InvalidArgument, `only one of "offset" and "offset_id" must be provided`) + } + + fromTime := req.Query.From.AsTime() + toTime := req.Query.To.AsTime() + if span.IsRecordingEvents() { + span.AddAttributes( + trace.StringAttribute("query", req.Query.Query), + trace.StringAttribute("from", fromTime.UTC().Format(time.RFC3339Nano)), + trace.StringAttribute("to", toTime.UTC().Format(time.RFC3339Nano)), + trace.BoolAttribute("explain", req.Query.Explain), + trace.Int64Attribute("size", req.Size), + trace.Int64Attribute("offset", req.Offset), + trace.StringAttribute("offset_id", req.OffsetId), + trace.BoolAttribute("with_total", req.WithTotal), + trace.StringAttribute("order", req.Order.String()), + ) + } + + rlQuery := getSearchQueryFromGRPCReqForRateLimiter(req) + if !g.rateLimiter.Account(rlQuery) { + return nil, status.Error(codes.ResourceExhausted, consts.ErrRequestWasRateLimited.Error()) + } + + proxyReq := &search.SearchRequest{ + Q: []byte(req.Query.Query), + From: seq.MID(fromTime.UnixNano()), + To: seq.MID(toTime.UnixNano()), + Explain: req.Query.Explain, + Size: int(req.Size), + Offset: int(req.Offset), + OffsetId: req.OffsetId, + WithTotal: req.WithTotal, + ShouldFetch: shouldFetch, + Order: req.Order.MustDocsOrder(), + } + + tr := querytracer.New(req.Query.Explain, "proxy/OnePhaseSearch") + qpr, docsStream, err := g.searchIngestor.OnePhaseSearch(ctx, proxyReq, tr) + psr := &proxySearchResponse{ + qpr: qpr, + docsStream: docsStream, + } + + if e, ok := parseProxyError(err); ok { + psr.err = e + return psr, nil + } + + if errors.Is(err, consts.ErrInvalidArgument) { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + if st, ok := status.FromError(err); ok { + // could not parse a query + if st.Code() == codes.InvalidArgument { + return nil, err + } + } + + if errors.Is(err, consts.ErrPartialResponse) { + metric.SearchPartial.Inc() + psr.err = &seqproxyapi.Error{ + Code: seqproxyapi.ErrorCode_ERROR_CODE_PARTIAL_RESPONSE, + Message: err.Error(), + } + return psr, nil + } + if err = processSearchErrors(qpr, err); err != nil { + metric.SearchErrors.Inc() + return nil, err + } + + g.tryMirrorRequest(req) + + return psr, nil +} diff --git a/proxyapi/grpc_v1.go b/proxyapi/grpc_v1.go index 90611a29..2679fedc 100644 --- a/proxyapi/grpc_v1.go +++ b/proxyapi/grpc_v1.go @@ -37,6 +37,7 @@ type SearchIngestor interface { CancelAsyncSearch(ctx context.Context, id string) error DeleteAsyncSearch(ctx context.Context, id string) error GetAsyncSearchesList(context.Context, search.GetAsyncSearchesListRequest) ([]*search.AsyncSearchesListItem, error) + OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, error) } type MappingProvider interface { diff --git a/proxyapi/mock/grpc_v1.go b/proxyapi/mock/grpc_v1.go index 40f1e694..12e3f7ed 100644 --- a/proxyapi/mock/grpc_v1.go +++ b/proxyapi/mock/grpc_v1.go @@ -115,6 +115,22 @@ func (mr *MockSearchIngestorMockRecorder) GetAsyncSearchesList(arg0, arg1 interf return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAsyncSearchesList", reflect.TypeOf((*MockSearchIngestor)(nil).GetAsyncSearchesList), arg0, arg1) } +// OnePhaseSearch mocks base method. +func (m *MockSearchIngestor) OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnePhaseSearch", ctx, sr, tr) + ret0, _ := ret[0].(*seq.QPR) + ret1, _ := ret[1].(search.DocsIterator) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// OnePhaseSearch indicates an expected call of OnePhaseSearch. +func (mr *MockSearchIngestorMockRecorder) OnePhaseSearch(ctx, sr, tr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnePhaseSearch", reflect.TypeOf((*MockSearchIngestor)(nil).OnePhaseSearch), ctx, sr, tr) +} + // Search mocks base method. func (m *MockSearchIngestor) Search(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, time.Duration, error) { m.ctrl.T.Helper() diff --git a/storeapi/client.go b/storeapi/client.go index 3da87929..665b85bf 100644 --- a/storeapi/client.go +++ b/storeapi/client.go @@ -129,3 +129,58 @@ func (i inMemoryAPIClient) Fetch(ctx context.Context, in *storeapi.FetchRequest, func (i inMemoryAPIClient) Status(ctx context.Context, in *storeapi.StatusRequest, _ ...grpc.CallOption) (*storeapi.StatusResponse, error) { return i.store.GrpcV1().Status(ctx, in) } + +type storeAPIOnePhaseSearchServer struct { + grpc.ServerStream + ctx context.Context + buf []*storeapi.OnePhaseSearchResponse +} + +func newStoreAPIOnePhaseSearchServer(ctx context.Context) *storeAPIOnePhaseSearchServer { + return &storeAPIOnePhaseSearchServer{ctx: ctx} +} + +func (x *storeAPIOnePhaseSearchServer) Send(m *storeapi.OnePhaseSearchResponse) error { + x.buf = append(x.buf, m.CloneVT()) + return nil +} + +func (x *storeAPIOnePhaseSearchServer) Context() context.Context { + return x.ctx +} + +type storeAPIOnePhaseSearchClient struct { + grpc.ClientStream + buf []*storeapi.OnePhaseSearchResponse + readPos int +} + +func newStoreAPIOnePhaseSearchClient(b []*storeapi.OnePhaseSearchResponse) *storeAPIOnePhaseSearchClient { + return &storeAPIOnePhaseSearchClient{buf: b} +} + +func (x *storeAPIOnePhaseSearchClient) Header() (metadata.MD, error) { + md := make(metadata.MD) + md[consts.StoreProtocolVersionHeader] = []string{config.StoreProtocolVersion2.String()} + return md, nil +} + +func (x *storeAPIOnePhaseSearchClient) Recv() (*storeapi.OnePhaseSearchResponse, error) { + if x.readPos >= len(x.buf) { + return nil, io.EOF + } + + res := x.buf[x.readPos] + x.readPos++ + + return res, nil +} + +func (i inMemoryAPIClient) OnePhaseSearch(ctx context.Context, in *storeapi.OnePhaseSearchRequest, opts ...grpc.CallOption) (storeapi.StoreApi_OnePhaseSearchClient, error) { + s := newStoreAPIOnePhaseSearchServer(ctx) + setProtocolVersionHeader(opts...) + if err := i.store.GrpcV1().OnePhaseSearch(in, s); err != nil { + return nil, err + } + return newStoreAPIOnePhaseSearchClient(s.buf), nil +} diff --git a/storeapi/grpc_fetch.go b/storeapi/grpc_fetch.go index 5cdb9cda..090fa479 100644 --- a/storeapi/grpc_fetch.go +++ b/storeapi/grpc_fetch.go @@ -31,7 +31,17 @@ func (g *GrpcV1) Fetch(req *storeapi.FetchRequest, stream storeapi.StoreApi_Fetc span.AddAttributes(trace.BoolAttribute("explain", req.Explain)) } - err := g.doFetch(ctx, req, stream) + ids, err := extractIDs(req) + if err != nil { + span.SetStatus(trace.Status{Code: 1, Message: err.Error()}) + logger.Error("fetch error", zap.Error(err)) + return fmt.Errorf("ids extract errors: %s", err.Error()) + } + + send := func(block []byte) error { + return stream.Send(&storeapi.BinaryData{Data: block}) + } + err = g.doFetch(ctx, ids, req.FieldsFilter, req.Explain, send) if err != nil { span.SetStatus(trace.Status{Code: 1, Message: err.Error()}) logger.Error("fetch error", zap.Error(err)) @@ -39,7 +49,13 @@ func (g *GrpcV1) Fetch(req *storeapi.FetchRequest, stream storeapi.StoreApi_Fetc return err } -func (g *GrpcV1) doFetch(ctx context.Context, req *storeapi.FetchRequest, stream storeapi.StoreApi_FetchServer) error { +func (g *GrpcV1) doFetch( + ctx context.Context, + ids seq.IDSources, + fieldsFilter *storeapi.FieldsFilter, + explain bool, + send func(block []byte) error, +) error { metric.FetchInFlightQueriesTotal.Inc() defer metric.FetchInFlightQueriesTotal.Dec() @@ -48,11 +64,6 @@ func (g *GrpcV1) doFetch(ctx context.Context, req *storeapi.FetchRequest, stream start := time.Now() - ids, err := extractIDs(req) - if err != nil { - return fmt.Errorf("ids extract errors: %s", err.Error()) - } - notFound := 0 docsFetched := 0 bytesFetched := int64(0) @@ -65,7 +76,7 @@ func (g *GrpcV1) doFetch(ctx context.Context, req *storeapi.FetchRequest, stream buf []byte ) - dp := acquireDocFieldsFilter(req.FieldsFilter) + dp := acquireDocFieldsFilter(fieldsFilter) defer releaseDocFieldsFilter(dp) docsStream := newDocsStream(ctx, ids, g.fetchData.docFetcher, g.fracManager.Fractions(), req.NoSkipMasks) @@ -93,7 +104,7 @@ func (g *GrpcV1) doFetch(ctx context.Context, req *storeapi.FetchRequest, stream block.SetExt1(uint64(id.ID.MID)) block.SetExt2(uint64(id.ID.RID)) - if err := stream.Send(&storeapi.BinaryData{Data: block}); err != nil { + if err := send(block); err != nil { if util.IsCancelled(ctx) { logger.Info("fetch request is canceled", zap.Int("requested", len(ids)), @@ -124,7 +135,7 @@ func (g *GrpcV1) doFetch(ctx context.Context, req *storeapi.FetchRequest, stream ) } - if req.Explain { + if explain { logger.Info("fetch result", zap.Int("requested", len(ids)), zap.Int("fetched", docsFetched), @@ -139,7 +150,7 @@ func (g *GrpcV1) doFetch(ctx context.Context, req *storeapi.FetchRequest, stream } type docFieldsFilter struct { - filter *storeapi.FetchRequest_FieldsFilter + filter *storeapi.FieldsFilter decoder *insaneJSON.Root decoderBuf []byte @@ -151,7 +162,7 @@ var docFieldsFilterPool = sync.Pool{ }, } -func acquireDocFieldsFilter(filter *storeapi.FetchRequest_FieldsFilter) *docFieldsFilter { +func acquireDocFieldsFilter(filter *storeapi.FieldsFilter) *docFieldsFilter { dp := docFieldsFilterPool.Get().(*docFieldsFilter) if dp.decoder == nil { dp.decoder = insaneJSON.Spawn() diff --git a/storeapi/grpc_one_phase_search.go b/storeapi/grpc_one_phase_search.go new file mode 100644 index 00000000..c3538071 --- /dev/null +++ b/storeapi/grpc_one_phase_search.go @@ -0,0 +1,111 @@ +package storeapi + +import ( + "context" + "fmt" + + "go.opencensus.io/trace" + "go.uber.org/zap" + + "github.com/ozontech/seq-db/logger" + "github.com/ozontech/seq-db/pkg/storeapi" + "github.com/ozontech/seq-db/querytracer" + "github.com/ozontech/seq-db/seq" + "github.com/ozontech/seq-db/tracing" + "github.com/ozontech/seq-db/util" +) + +func (g *GrpcV1) OnePhaseSearch( + req *storeapi.OnePhaseSearchRequest, + stream storeapi.StoreApi_OnePhaseSearchServer, +) error { + ctx, span := tracing.StartSpan(stream.Context(), "store-server/OnePhaseSearch") + defer span.End() + + if span.IsRecordingEvents() { + span.AddAttributes(trace.StringAttribute("request", req.Query)) + span.AddAttributes(trace.Int64Attribute("from", req.From)) + span.AddAttributes(trace.Int64Attribute("to", req.From)) + span.AddAttributes(trace.Int64Attribute("size", req.Size)) + span.AddAttributes(trace.Int64Attribute("offset", req.Offset)) + span.AddAttributes(trace.StringAttribute("offset_id", req.OffsetId)) + span.AddAttributes(trace.BoolAttribute("explain", req.Explain)) + span.AddAttributes(trace.BoolAttribute("with_total", req.WithTotal)) + } + + err := g.doOnePhaseSearch(ctx, req, stream) + if err != nil { + span.SetStatus(trace.Status{Code: 1, Message: err.Error()}) + logger.Error("one phase search error", zap.Error(err)) + } + return err +} + +func (g *GrpcV1) doOnePhaseSearch( + ctx context.Context, + req *storeapi.OnePhaseSearchRequest, + stream storeapi.StoreApi_OnePhaseSearchServer, +) error { + tr := querytracer.New(req.Explain, "store/Search") + data, err := g.doSearch(ctx, &storeapi.SearchRequest{ + Query: req.Query, + From: req.From, + To: req.To, + Size: req.Size, + Offset: req.Offset, + Explain: req.Explain, + WithTotal: req.WithTotal, + Order: req.Order, + OffsetId: req.OffsetId, + }, tr) + if err != nil { + return fmt.Errorf("search error: %w", err) + } + + tr.Done() + if req.Explain && data != nil { + data.Explain = tracerSpanToExplainEntry(tr.ToSpan()) + } + + err = stream.Send(&storeapi.OnePhaseSearchResponse{ + ResponseType: &storeapi.OnePhaseSearchResponse_Header{ + Header: &storeapi.Header{ + Total: data.Total, + Errors: data.Errors, + Code: data.Code, + Explain: data.Explain, + }, + }, + }) + if err != nil { + if util.IsCancelled(ctx) { + logger.Info("one phase search request is canceled") + return nil + } + return fmt.Errorf("error sending fetched docs: %w", err) + } + + ids := make(seq.IDSources, 0, len(data.IdSources)) + for _, id := range data.IdSources { + ids = append(ids, seq.IDSource{ + ID: seq.ID{MID: seq.MID(id.Id.Mid), RID: seq.RID(id.Id.Rid)}, + Hint: id.Hint, + }) + } + + send := func(block []byte) error { + return stream.Send(&storeapi.OnePhaseSearchResponse{ + ResponseType: &storeapi.OnePhaseSearchResponse_Document{ + Document: &storeapi.Document{ + Data: &storeapi.BinaryData{Data: block}, + }, + }, + }) + } + err = g.doFetch(ctx, ids, req.FieldsFilter, req.Explain, send) + if err != nil { + return fmt.Errorf("fetch error: %w", err) + } + + return nil +} From aa9ab9897eb4169eaee34c1f775f160d851ed05c Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Tue, 14 Apr 2026 14:09:24 +0500 Subject: [PATCH 02/14] feat: add stats pipe --- parser/seqql_pipes.go | 161 +++++++++++++++++++++++++++++++++- parser/seqql_pipes_test.go | 41 +++++++++ proxyapi/grpc_async_search.go | 25 +++++- proxyapi/grpc_v1.go | 138 ++++++++++++++++++++++++++++- 4 files changed, 361 insertions(+), 4 deletions(-) diff --git a/parser/seqql_pipes.go b/parser/seqql_pipes.go index 6e005472..788fa9d5 100644 --- a/parser/seqql_pipes.go +++ b/parser/seqql_pipes.go @@ -29,6 +29,12 @@ func parsePipes(lex *lexer) ([]Pipe, error) { } pipes = append(pipes, p) fieldFilters++ + case lex.IsKeyword("stats"): + p, err := parsePipeStats(lex) + if err != nil { + return nil, fmt.Errorf("parsing 'stats' pipe: %s", err) + } + pipes = append(pipes, p) default: return nil, fmt.Errorf("unknown pipe: %s", lex.Token) } @@ -62,6 +68,50 @@ func (f *PipeFields) DumpSeqQL(o *strings.Builder) { } } +type StatsAgg struct { + Func string + Field string + GroupBy string + Interval string + Quantiles []float64 +} + +type PipeStats struct { + Aggs []StatsAgg +} + +func (p *PipeStats) Name() string { + return "stats" +} + +func (p *PipeStats) DumpSeqQL(o *strings.Builder) { + o.WriteString("stats ") + for i, agg := range p.Aggs { + if i > 0 { + o.WriteString(", ") + } + o.WriteString(agg.Func) + if agg.Field != "" { + o.WriteString("(") + o.WriteString(quoteTokenIfNeeded(agg.Field)) + for _, q := range agg.Quantiles { + o.WriteString(fmt.Sprintf(", %v", q)) + } + o.WriteString(")") + } + if agg.GroupBy != "" { + o.WriteString(" by (") + o.WriteString(quoteTokenIfNeeded(agg.GroupBy)) + o.WriteString(")") + } + if agg.Interval != "" { + o.WriteString(" interval(") + o.WriteString(agg.Interval) + o.WriteString(")") + } + } +} + func parsePipeFields(lex *lexer) (*PipeFields, error) { if !lex.IsKeyword("fields") { return nil, fmt.Errorf("missing 'fields' keyword") @@ -85,6 +135,115 @@ func parsePipeFields(lex *lexer) (*PipeFields, error) { }, nil } +func parsePipeStats(lex *lexer) (*PipeStats, error) { + if !lex.IsKeyword("stats") { + return nil, fmt.Errorf("missing 'stats' keyword") + } + lex.Next() + + var aggs []StatsAgg + for { + agg, err := parseStatsAgg(lex) + if err != nil { + return nil, err + } + aggs = append(aggs, agg) + + if !lex.IsKeyword(",") { + break + } + lex.Next() + } + + if len(aggs) == 0 { + return nil, fmt.Errorf("at least one aggregation is required") + } + + return &PipeStats{Aggs: aggs}, nil +} + +func parseStatsAgg(lex *lexer) (StatsAgg, error) { + var agg StatsAgg + + if !lex.IsKeywords("count", "sum", "min", "max", "avg", "quantile", "unique", "unique_count") { + return agg, fmt.Errorf("expected aggregation function (count, sum, min, max, avg, quantile, unique, unique_count), got %s", lex.Token) + } + agg.Func = strings.ToLower(lex.Token) + lex.Next() + + if lex.IsKeyword("(") { + lex.Next() + field, err := parseCompositeTokenReplaceWildcards(lex) + if err != nil { + return agg, err + } + agg.Field = field + + for lex.IsKeyword(",") { + lex.Next() + q, err := parseNumber(lex) + if err != nil { + return agg, fmt.Errorf("failed to parse quantile: %w", err) + } + agg.Quantiles = append(agg.Quantiles, q) + } + + if !lex.IsKeyword(")") { + return agg, fmt.Errorf("expected ')' after field, got %s", lex.Token) + } + lex.Next() + } + + if lex.IsKeyword("by") { + lex.Next() + if !lex.IsKeyword("(") { + return agg, fmt.Errorf("expected '(' after 'by', got %s", lex.Token) + } + lex.Next() + groupBy, err := parseCompositeTokenReplaceWildcards(lex) + if err != nil { + return agg, err + } + agg.GroupBy = groupBy + if !lex.IsKeyword(")") { + return agg, fmt.Errorf("expected ')' after groupBy, got %s", lex.Token) + } + lex.Next() + } + + if lex.IsKeyword("interval") { + lex.Next() + if !lex.IsKeyword("(") { + return agg, fmt.Errorf("expected '(' after 'interval', got %s", lex.Token) + } + lex.Next() + interval := lex.Token + if interval == "" { + return agg, fmt.Errorf("expected interval value, got %s", lex.Token) + } + agg.Interval = interval + lex.Next() + if !lex.IsKeyword(")") { + return agg, fmt.Errorf("expected ')' after interval, got %s", lex.Token) + } + lex.Next() + } + + return agg, nil +} + +func parseNumber(lex *lexer) (float64, error) { + if lex.Token == "" { + return 0, fmt.Errorf("expected number, got empty token") + } + q, err := strconv.ParseFloat(lex.Token, 64) + if err != nil { + return 0, fmt.Errorf("failed to parse number %s: %w", lex.Token, err) + } + lex.Next() + return q, nil +} + func parseFieldList(lex *lexer) ([]string, error) { var fields []string trailingComma := false @@ -149,7 +308,7 @@ var reservedKeywords = uniqueTokens([]string{ "|", // Pipe specific keywords. - "fields", "except", + "fields", "except", "stats", "by", "interval", "unique_count", }) func needQuoteToken(s string) bool { diff --git a/parser/seqql_pipes_test.go b/parser/seqql_pipes_test.go index 2313b20d..41b91891 100644 --- a/parser/seqql_pipes_test.go +++ b/parser/seqql_pipes_test.go @@ -38,3 +38,44 @@ func TestParsePipeFieldsExcept(t *testing.T) { test(`* | fields except "_\\message*"`, `* | fields except "_\\message\*"`) test(`* | fields except k8s_namespace`, `* | fields except k8s_namespace`) } + +func TestParsePipeStats(t *testing.T) { + test := func(q, expected string) { + t.Helper() + query, err := ParseSeqQL(q, nil) + require.NoError(t, err) + require.Equal(t, expected, query.SeqQLString()) + } + + test("service:my-service | stats count by (service)", "service:my-service | stats count by (service)") + test("service:my-service | stats sum(level) by (service)", "service:my-service | stats sum(level) by (service)") + test("service:my-service | stats count by (service) interval(1m)", "service:my-service | stats count by (service) interval(1m)") + test("service:my-service | stats min(response_time) by (service)", "service:my-service | stats min(response_time) by (service)") + test("service:my-service | stats max(response_time) by (service)", "service:my-service | stats max(response_time) by (service)") + test("service:my-service | stats avg(response_time) by (service)", "service:my-service | stats avg(response_time) by (service)") + test("service:my-service | stats unique by (service)", "service:my-service | stats unique by (service)") + test("service:my-service | stats unique_count by (service)", "service:my-service | stats unique_count by (service)") +} + +func TestParsePipeStatsMultiple(t *testing.T) { + test := func(q, expected string) { + t.Helper() + query, err := ParseSeqQL(q, nil) + require.NoError(t, err) + require.Equal(t, expected, query.SeqQLString()) + } + + test("service:my-service | stats count by (service), sum(level) by (service)", "service:my-service | stats count by (service), sum(level) by (service)") + test("service:my-service | stats count by (service) interval(1m), sum(level) by (service) interval(1m)", "service:my-service | stats count by (service) interval(1m), sum(level) by (service) interval(1m)") +} + +func TestParsePipeStatsQuantile(t *testing.T) { + test := func(q, expected string) { + t.Helper() + query, err := ParseSeqQL(q, nil) + require.NoError(t, err) + require.Equal(t, expected, query.SeqQLString()) + } + + test("service:my-service | stats quantile(response_time, 0.5, 0.95) by (service)", "service:my-service | stats quantile(response_time, 0.5, 0.95) by (service)") +} diff --git a/proxyapi/grpc_async_search.go b/proxyapi/grpc_async_search.go index cd58d09f..6e32dbc0 100644 --- a/proxyapi/grpc_async_search.go +++ b/proxyapi/grpc_async_search.go @@ -33,9 +33,30 @@ func (g *grpcV1) StartAsyncSearch( return nil, status.Error(codes.InvalidArgument, "can't serve empty request: fill aggs, hist or withDocs") } - aggs, err := convertAggsQuery(r.Aggs) + statsAggs, err := ExtractStatsPipes(r.GetQuery().GetQuery()) if err != nil { - return nil, err + return nil, status.Errorf(codes.InvalidArgument, "failed to parse stats pipe: %v", err) + } + + hasAggsParam := len(r.Aggs) > 0 + hasStatsPipe := len(statsAggs) > 0 + + if hasAggsParam && hasStatsPipe { + return nil, status.Error(codes.InvalidArgument, + "aggregation can be specified either via 'aggs' parameter or 'stats' pipe, not both") + } + + var aggs []search.AggQuery + if hasStatsPipe { + aggs, err = ConvertStatsPipesToAggs(statsAggs) + if err != nil { + return nil, err + } + } else if hasAggsParam { + aggs, err = convertAggsQuery(r.Aggs) + if err != nil { + return nil, err + } } var histInterval time.Duration diff --git a/proxyapi/grpc_v1.go b/proxyapi/grpc_v1.go index 2679fedc..65cf91e0 100644 --- a/proxyapi/grpc_v1.go +++ b/proxyapi/grpc_v1.go @@ -21,6 +21,7 @@ import ( "github.com/ozontech/seq-db/consts" "github.com/ozontech/seq-db/logger" "github.com/ozontech/seq-db/metric" + "github.com/ozontech/seq-db/parser" "github.com/ozontech/seq-db/pkg/seqproxyapi/v1" "github.com/ozontech/seq-db/proxy/search" "github.com/ozontech/seq-db/querytracer" @@ -245,7 +246,26 @@ func (g *grpcV1) doSearch( Order: req.Order.MustDocsOrder(), } - if len(req.Aggs) > 0 { + statsAggs, err := ExtractStatsPipes(req.Query.Query) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "failed to parse stats pipe: %v", err) + } + + hasAggsParam := len(req.Aggs) > 0 + hasStatsPipe := len(statsAggs) > 0 + + if hasAggsParam && hasStatsPipe { + return nil, status.Error(codes.InvalidArgument, + "aggregation can be specified either via 'aggs' parameter or 'stats' pipe, not both") + } + + if hasStatsPipe { + aggs, err := ConvertStatsPipesToAggs(statsAggs) + if err != nil { + return nil, err + } + proxyReq.AggQ = aggs + } else if hasAggsParam { aggs, err := convertAggsQuery(req.Aggs) if err != nil { return nil, err @@ -453,3 +473,119 @@ func shouldFailPartialResponse(ctx context.Context) bool { func shouldHaveResponse(code seqproxyapi.ErrorCode) bool { return code == seqproxyapi.ErrorCode_ERROR_CODE_NO || code == seqproxyapi.ErrorCode_ERROR_CODE_PARTIAL_RESPONSE } + +func ExtractStatsPipes(query string) ([]parser.StatsAgg, error) { + if query == "" { + return nil, nil + } + + seqql, err := parser.ParseSeqQL(query, nil) + if err != nil { + return nil, err + } + + var result []parser.StatsAgg + for _, pipe := range seqql.Pipes { + statsPipe, ok := pipe.(*parser.PipeStats) + if !ok { + continue + } + result = append(result, statsPipe.Aggs...) + } + return result, nil +} + +func ConvertStatsPipesToAggs(statsAggs []parser.StatsAgg) ([]search.AggQuery, error) { + var result []search.AggQuery + for _, agg := range statsAggs { + aggFunc, err := convertFuncToSeqAggFunc(agg.Func) + if err != nil { + return nil, err + } + + searchAgg := search.AggQuery{ + Field: agg.Field, + GroupBy: agg.GroupBy, + Func: aggFunc, + Quantiles: agg.Quantiles, + } + + if agg.Interval != "" { + interval, err := util.ParseDuration(agg.Interval) + if err != nil { + return nil, status.Errorf( + codes.InvalidArgument, + "failed to parse 'interval': %v", + err, + ) + } + searchAgg.Interval = seq.MID(interval.Nanoseconds()) + } + + if err := validateSearchAgg(&searchAgg); err != nil { + return nil, err + } + + result = append(result, searchAgg) + } + return result, nil +} + +func convertFuncToSeqAggFunc(funcName string) (seq.AggFunc, error) { + switch funcName { + case "count": + return seq.AggFuncCount, nil + case "sum": + return seq.AggFuncSum, nil + case "min": + return seq.AggFuncMin, nil + case "max": + return seq.AggFuncMax, nil + case "avg": + return seq.AggFuncAvg, nil + case "quantile": + return seq.AggFuncQuantile, nil + case "unique": + return seq.AggFuncUnique, nil + case "unique_count": + return seq.AggFuncUniqueCount, nil + default: + return 0, status.Errorf(codes.InvalidArgument, "unknown aggregation function: %s", funcName) + } +} + +func validateSearchAgg(agg *search.AggQuery) error { + switch agg.Func { + case seq.AggFuncUnique, seq.AggFuncUniqueCount: + if agg.GroupBy == "" { + return status.Error(codes.InvalidArgument, "'groupBy' must be set for unique/unique_count") + } + if agg.Interval != 0 { + return status.Error( + codes.InvalidArgument, + "'unique' and 'unique_count' aggregations do not support timeseries", + ) + } + case seq.AggFuncQuantile: + if agg.Field == "" { + return status.Error(codes.InvalidArgument, "'field' must be set for quantile") + } + if len(agg.Quantiles) == 0 { + return status.Error(codes.InvalidArgument, "quantile aggregation must contain at least one quantile") + } + for _, q := range agg.Quantiles { + if q < 0 || q > 1 { + return status.Error(codes.InvalidArgument, "quantile must be between 0 and 1") + } + } + case seq.AggFuncCount: + if agg.GroupBy == "" && agg.Field == "" { + return status.Error(codes.InvalidArgument, "'groupBy' or 'field' must be set for count") + } + case seq.AggFuncSum, seq.AggFuncMin, seq.AggFuncMax, seq.AggFuncAvg: + if agg.Field == "" { + return status.Errorf(codes.InvalidArgument, "'field' must be set for %s", agg.Func.String()) + } + } + return nil +} From 621bea9818f5701aecbc16e13fe95ff49cb9e183 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Tue, 21 Apr 2026 17:37:38 +0500 Subject: [PATCH 03/14] feat(one phase search): new grcp api on storeapi/ --- api/seqproxyapi/v1/seq_proxy_api.proto | 2 +- api/storeapi/store_api.proto | 42 +- parser/seqql_pipes.go | 2 +- pkg/seqproxyapi/v1/seq_proxy_api.pb.go | 24 +- .../v1/seq_proxy_api_vtproto.pb.go | 10 +- pkg/storeapi/store_api.pb.go | 640 ++- pkg/storeapi/store_api_vtproto.pb.go | 3840 +++++++++++------ proxy/search/one_phase_search.go | 117 +- proxyapi/grpc_one_phase_search.go | 138 +- proxyapi/grpc_v1.go | 2 +- proxyapi/mock/grpc_v1.go | 7 +- storeapi/grpc_one_phase_search.go | 243 +- 12 files changed, 3467 insertions(+), 1600 deletions(-) diff --git a/api/seqproxyapi/v1/seq_proxy_api.proto b/api/seqproxyapi/v1/seq_proxy_api.proto index 659c05e5..d0226cb7 100644 --- a/api/seqproxyapi/v1/seq_proxy_api.proto +++ b/api/seqproxyapi/v1/seq_proxy_api.proto @@ -112,7 +112,7 @@ service SeqProxyApi { }; } - rpc OnePhaseSearch(SearchRequest) returns (SearchResponse) { + rpc OnePhaseSearch(SearchRequest) returns (ComplexSearchResponse) { option (google.api.http) = { post: "/one-phase-search" body: "*" diff --git a/api/storeapi/store_api.proto b/api/storeapi/store_api.proto index c5ae31d7..72ac8f85 100644 --- a/api/storeapi/store_api.proto +++ b/api/storeapi/store_api.proto @@ -270,8 +270,8 @@ message StatusResponse { message OnePhaseSearchRequest { string query = 1; - int64 from = 2; - int64 to = 3; + google.protobuf.Timestamp from = 2; + google.protobuf.Timestamp to = 3; int64 size = 4; int64 offset = 5; bool explain = 6; @@ -284,17 +284,43 @@ message OnePhaseSearchRequest { message OnePhaseSearchResponse { oneof ResponseType { Header header = 1; - Document document = 2; + RecordsBatch batch = 2; } } -message Document { - BinaryData data = 1; +message Header { + Metadata metadata = 1; + repeated Typing typing = 2; } -message Header { +message Metadata { uint64 total = 1; - repeated string errors = 2; - SearchErrorCode code = 3; + SearchErrorCode code = 2; + repeated string errors = 3; optional ExplainEntry explain = 4; } + +enum DataType { + BYTES = 0; + RAW_DOCUMENT = 1; + STRING = 2; + UINT32 = 3; + UINT64 = 4; + INT32 = 5; + INT64 = 6; + FLOAT64 = 7; + // TODO: array data types: StringArray, Uin64Array, Float64Array etc. +} + +message Typing { + string title = 1; + DataType type = 2; +} + +message RecordsBatch { + repeated Record records = 1; +} + +message Record { + repeated bytes raw_data = 1; +} diff --git a/parser/seqql_pipes.go b/parser/seqql_pipes.go index 788fa9d5..81553bec 100644 --- a/parser/seqql_pipes.go +++ b/parser/seqql_pipes.go @@ -95,7 +95,7 @@ func (p *PipeStats) DumpSeqQL(o *strings.Builder) { o.WriteString("(") o.WriteString(quoteTokenIfNeeded(agg.Field)) for _, q := range agg.Quantiles { - o.WriteString(fmt.Sprintf(", %v", q)) + fmt.Fprintf(o, ", %v", q) } o.WriteString(")") } diff --git a/pkg/seqproxyapi/v1/seq_proxy_api.pb.go b/pkg/seqproxyapi/v1/seq_proxy_api.pb.go index 9665df6b..88acb4b7 100644 --- a/pkg/seqproxyapi/v1/seq_proxy_api.pb.go +++ b/pkg/seqproxyapi/v1/seq_proxy_api.pb.go @@ -3042,7 +3042,7 @@ var file_seqproxyapi_v1_seq_proxy_api_proto_rawDesc = string([]byte{ 0x19, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x03, 0x32, 0x87, 0x0d, 0x0a, 0x0b, 0x53, 0x65, 0x71, + 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x03, 0x32, 0x8e, 0x0d, 0x0a, 0x0b, 0x53, 0x65, 0x71, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x41, 0x70, 0x69, 0x12, 0x5b, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, @@ -3140,18 +3140,18 @@ var file_seqproxyapi_v1_seq_proxy_api_proto_rawDesc = string([]byte{ 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x2d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x2f, 0x6c, - 0x69, 0x73, 0x74, 0x12, 0x6d, 0x0a, 0x0e, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, + 0x69, 0x73, 0x74, 0x12, 0x74, 0x0a, 0x0e, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, - 0x11, 0x2f, 0x6f, 0x6e, 0x65, 0x2d, 0x70, 0x68, 0x61, 0x73, 0x65, 0x2d, 0x73, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6f, 0x7a, 0x6f, 0x6e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x73, 0x65, 0x71, 0x2d, 0x64, 0x62, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x71, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x6f, 0x6e, 0x65, 0x2d, 0x70, 0x68, 0x61, + 0x73, 0x65, 0x2d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x7a, 0x6f, 0x6e, 0x74, 0x65, 0x63, 0x68, + 0x2f, 0x73, 0x65, 0x71, 0x2d, 0x64, 0x62, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x71, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x71, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var ( @@ -3302,7 +3302,7 @@ var file_seqproxyapi_v1_seq_proxy_api_proto_depIdxs = []int32{ 21, // 83: seqproxyapi.v1.SeqProxyApi.CancelAsyncSearch:output_type -> seqproxyapi.v1.CancelAsyncSearchResponse 23, // 84: seqproxyapi.v1.SeqProxyApi.DeleteAsyncSearch:output_type -> seqproxyapi.v1.DeleteAsyncSearchResponse 25, // 85: seqproxyapi.v1.SeqProxyApi.GetAsyncSearchesList:output_type -> seqproxyapi.v1.GetAsyncSearchesListResponse - 14, // 86: seqproxyapi.v1.SeqProxyApi.OnePhaseSearch:output_type -> seqproxyapi.v1.SearchResponse + 15, // 86: seqproxyapi.v1.SeqProxyApi.OnePhaseSearch:output_type -> seqproxyapi.v1.ComplexSearchResponse 73, // [73:87] is the sub-list for method output_type 59, // [59:73] is the sub-list for method input_type 59, // [59:59] is the sub-list for extension type_name diff --git a/pkg/seqproxyapi/v1/seq_proxy_api_vtproto.pb.go b/pkg/seqproxyapi/v1/seq_proxy_api_vtproto.pb.go index 56011acf..0eed09c5 100644 --- a/pkg/seqproxyapi/v1/seq_proxy_api_vtproto.pb.go +++ b/pkg/seqproxyapi/v1/seq_proxy_api_vtproto.pb.go @@ -2098,7 +2098,7 @@ type SeqProxyApiClient interface { DeleteAsyncSearch(ctx context.Context, in *DeleteAsyncSearchRequest, opts ...grpc.CallOption) (*DeleteAsyncSearchResponse, error) // Fetch list of async searches. GetAsyncSearchesList(ctx context.Context, in *GetAsyncSearchesListRequest, opts ...grpc.CallOption) (*GetAsyncSearchesListResponse, error) - OnePhaseSearch(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) + OnePhaseSearch(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*ComplexSearchResponse, error) } type seqProxyApiClient struct { @@ -2272,8 +2272,8 @@ func (c *seqProxyApiClient) GetAsyncSearchesList(ctx context.Context, in *GetAsy return out, nil } -func (c *seqProxyApiClient) OnePhaseSearch(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { - out := new(SearchResponse) +func (c *seqProxyApiClient) OnePhaseSearch(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*ComplexSearchResponse, error) { + out := new(ComplexSearchResponse) err := c.cc.Invoke(ctx, "/seqproxyapi.v1.SeqProxyApi/OnePhaseSearch", in, out, opts...) if err != nil { return nil, err @@ -2313,7 +2313,7 @@ type SeqProxyApiServer interface { DeleteAsyncSearch(context.Context, *DeleteAsyncSearchRequest) (*DeleteAsyncSearchResponse, error) // Fetch list of async searches. GetAsyncSearchesList(context.Context, *GetAsyncSearchesListRequest) (*GetAsyncSearchesListResponse, error) - OnePhaseSearch(context.Context, *SearchRequest) (*SearchResponse, error) + OnePhaseSearch(context.Context, *SearchRequest) (*ComplexSearchResponse, error) mustEmbedUnimplementedSeqProxyApiServer() } @@ -2360,7 +2360,7 @@ func (UnimplementedSeqProxyApiServer) DeleteAsyncSearch(context.Context, *Delete func (UnimplementedSeqProxyApiServer) GetAsyncSearchesList(context.Context, *GetAsyncSearchesListRequest) (*GetAsyncSearchesListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAsyncSearchesList not implemented") } -func (UnimplementedSeqProxyApiServer) OnePhaseSearch(context.Context, *SearchRequest) (*SearchResponse, error) { +func (UnimplementedSeqProxyApiServer) OnePhaseSearch(context.Context, *SearchRequest) (*ComplexSearchResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method OnePhaseSearch not implemented") } func (UnimplementedSeqProxyApiServer) mustEmbedUnimplementedSeqProxyApiServer() {} diff --git a/pkg/storeapi/store_api.pb.go b/pkg/storeapi/store_api.pb.go index 4bb621fd..e8f9d75c 100644 --- a/pkg/storeapi/store_api.pb.go +++ b/pkg/storeapi/store_api.pb.go @@ -250,6 +250,70 @@ func (AsyncSearchStatus) EnumDescriptor() ([]byte, []int) { return file_storeapi_store_api_proto_rawDescGZIP(), []int{3} } +type DataType int32 + +const ( + DataType_BYTES DataType = 0 + DataType_RAW_DOCUMENT DataType = 1 + DataType_STRING DataType = 2 + DataType_UINT32 DataType = 3 + DataType_UINT64 DataType = 4 + DataType_INT32 DataType = 5 + DataType_INT64 DataType = 6 + DataType_FLOAT64 DataType = 7 // TODO: array data types: StringArray, Uin64Array, Float64Array etc. +) + +// Enum value maps for DataType. +var ( + DataType_name = map[int32]string{ + 0: "BYTES", + 1: "RAW_DOCUMENT", + 2: "STRING", + 3: "UINT32", + 4: "UINT64", + 5: "INT32", + 6: "INT64", + 7: "FLOAT64", + } + DataType_value = map[string]int32{ + "BYTES": 0, + "RAW_DOCUMENT": 1, + "STRING": 2, + "UINT32": 3, + "UINT64": 4, + "INT32": 5, + "INT64": 6, + "FLOAT64": 7, + } +) + +func (x DataType) Enum() *DataType { + p := new(DataType) + *p = x + return p +} + +func (x DataType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DataType) Descriptor() protoreflect.EnumDescriptor { + return file_storeapi_store_api_proto_enumTypes[4].Descriptor() +} + +func (DataType) Type() protoreflect.EnumType { + return &file_storeapi_store_api_proto_enumTypes[4] +} + +func (x DataType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DataType.Descriptor instead. +func (DataType) EnumDescriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{4} +} + type BulkRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` @@ -1806,8 +1870,8 @@ func (x *StatusResponse) GetOldestTime() *timestamppb.Timestamp { type OnePhaseSearchRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - From int64 `protobuf:"varint,2,opt,name=from,proto3" json:"from,omitempty"` - To int64 `protobuf:"varint,3,opt,name=to,proto3" json:"to,omitempty"` + From *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` Explain bool `protobuf:"varint,6,opt,name=explain,proto3" json:"explain,omitempty"` @@ -1856,18 +1920,18 @@ func (x *OnePhaseSearchRequest) GetQuery() string { return "" } -func (x *OnePhaseSearchRequest) GetFrom() int64 { +func (x *OnePhaseSearchRequest) GetFrom() *timestamppb.Timestamp { if x != nil { return x.From } - return 0 + return nil } -func (x *OnePhaseSearchRequest) GetTo() int64 { +func (x *OnePhaseSearchRequest) GetTo() *timestamppb.Timestamp { if x != nil { return x.To } - return 0 + return nil } func (x *OnePhaseSearchRequest) GetSize() int64 { @@ -1924,7 +1988,7 @@ type OnePhaseSearchResponse struct { // Types that are valid to be assigned to ResponseType: // // *OnePhaseSearchResponse_Header - // *OnePhaseSearchResponse_Document + // *OnePhaseSearchResponse_Batch ResponseType isOnePhaseSearchResponse_ResponseType `protobuf_oneof:"ResponseType"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -1976,10 +2040,10 @@ func (x *OnePhaseSearchResponse) GetHeader() *Header { return nil } -func (x *OnePhaseSearchResponse) GetDocument() *Document { +func (x *OnePhaseSearchResponse) GetBatch() *RecordsBatch { if x != nil { - if x, ok := x.ResponseType.(*OnePhaseSearchResponse_Document); ok { - return x.Document + if x, ok := x.ResponseType.(*OnePhaseSearchResponse_Batch); ok { + return x.Batch } } return nil @@ -1993,35 +2057,36 @@ type OnePhaseSearchResponse_Header struct { Header *Header `protobuf:"bytes,1,opt,name=header,proto3,oneof"` } -type OnePhaseSearchResponse_Document struct { - Document *Document `protobuf:"bytes,2,opt,name=document,proto3,oneof"` +type OnePhaseSearchResponse_Batch struct { + Batch *RecordsBatch `protobuf:"bytes,2,opt,name=batch,proto3,oneof"` } func (*OnePhaseSearchResponse_Header) isOnePhaseSearchResponse_ResponseType() {} -func (*OnePhaseSearchResponse_Document) isOnePhaseSearchResponse_ResponseType() {} +func (*OnePhaseSearchResponse_Batch) isOnePhaseSearchResponse_ResponseType() {} -type Document struct { +type Header struct { state protoimpl.MessageState `protogen:"open.v1"` - Data *BinaryData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Typing []*Typing `protobuf:"bytes,2,rep,name=typing,proto3" json:"typing,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *Document) Reset() { - *x = Document{} +func (x *Header) Reset() { + *x = Header{} mi := &file_storeapi_store_api_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Document) String() string { +func (x *Header) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Document) ProtoMessage() {} +func (*Header) ProtoMessage() {} -func (x *Document) ProtoReflect() protoreflect.Message { +func (x *Header) ProtoReflect() protoreflect.Message { mi := &file_storeapi_store_api_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2033,42 +2098,49 @@ func (x *Document) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Document.ProtoReflect.Descriptor instead. -func (*Document) Descriptor() ([]byte, []int) { +// Deprecated: Use Header.ProtoReflect.Descriptor instead. +func (*Header) Descriptor() ([]byte, []int) { return file_storeapi_store_api_proto_rawDescGZIP(), []int{24} } -func (x *Document) GetData() *BinaryData { +func (x *Header) GetMetadata() *Metadata { if x != nil { - return x.Data + return x.Metadata } return nil } -type Header struct { +func (x *Header) GetTyping() []*Typing { + if x != nil { + return x.Typing + } + return nil +} + +type Metadata struct { state protoimpl.MessageState `protogen:"open.v1"` Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Errors []string `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"` - Code SearchErrorCode `protobuf:"varint,3,opt,name=code,proto3,enum=api.SearchErrorCode" json:"code,omitempty"` + Code SearchErrorCode `protobuf:"varint,2,opt,name=code,proto3,enum=api.SearchErrorCode" json:"code,omitempty"` + Errors []string `protobuf:"bytes,3,rep,name=errors,proto3" json:"errors,omitempty"` Explain *ExplainEntry `protobuf:"bytes,4,opt,name=explain,proto3,oneof" json:"explain,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *Header) Reset() { - *x = Header{} +func (x *Metadata) Reset() { + *x = Metadata{} mi := &file_storeapi_store_api_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Header) String() string { +func (x *Metadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Header) ProtoMessage() {} +func (*Metadata) ProtoMessage() {} -func (x *Header) ProtoReflect() protoreflect.Message { +func (x *Metadata) ProtoReflect() protoreflect.Message { mi := &file_storeapi_store_api_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2080,35 +2152,175 @@ func (x *Header) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Header.ProtoReflect.Descriptor instead. -func (*Header) Descriptor() ([]byte, []int) { +// Deprecated: Use Metadata.ProtoReflect.Descriptor instead. +func (*Metadata) Descriptor() ([]byte, []int) { return file_storeapi_store_api_proto_rawDescGZIP(), []int{25} } -func (x *Header) GetTotal() uint64 { +func (x *Metadata) GetTotal() uint64 { if x != nil { return x.Total } return 0 } -func (x *Header) GetErrors() []string { +func (x *Metadata) GetCode() SearchErrorCode { + if x != nil { + return x.Code + } + return SearchErrorCode_NO_ERROR +} + +func (x *Metadata) GetErrors() []string { if x != nil { return x.Errors } return nil } -func (x *Header) GetCode() SearchErrorCode { +func (x *Metadata) GetExplain() *ExplainEntry { if x != nil { - return x.Code + return x.Explain } - return SearchErrorCode_NO_ERROR + return nil } -func (x *Header) GetExplain() *ExplainEntry { +type Typing struct { + state protoimpl.MessageState `protogen:"open.v1"` + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Type DataType `protobuf:"varint,2,opt,name=type,proto3,enum=api.DataType" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Typing) Reset() { + *x = Typing{} + mi := &file_storeapi_store_api_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Typing) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Typing) ProtoMessage() {} + +func (x *Typing) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[26] if x != nil { - return x.Explain + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Typing.ProtoReflect.Descriptor instead. +func (*Typing) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{26} +} + +func (x *Typing) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Typing) GetType() DataType { + if x != nil { + return x.Type + } + return DataType_BYTES +} + +type RecordsBatch struct { + state protoimpl.MessageState `protogen:"open.v1"` + Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RecordsBatch) Reset() { + *x = RecordsBatch{} + mi := &file_storeapi_store_api_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RecordsBatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecordsBatch) ProtoMessage() {} + +func (x *RecordsBatch) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecordsBatch.ProtoReflect.Descriptor instead. +func (*RecordsBatch) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{27} +} + +func (x *RecordsBatch) GetRecords() []*Record { + if x != nil { + return x.Records + } + return nil +} + +type Record struct { + state protoimpl.MessageState `protogen:"open.v1"` + RawData [][]byte `protobuf:"bytes,1,rep,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Record) Reset() { + *x = Record{} + mi := &file_storeapi_store_api_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Record) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Record) ProtoMessage() {} + +func (x *Record) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Record.ProtoReflect.Descriptor instead. +func (*Record) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{28} +} + +func (x *Record) GetRawData() [][]byte { + if x != nil { + return x.RawData } return nil } @@ -2123,7 +2335,7 @@ type SearchResponse_Id struct { func (x *SearchResponse_Id) Reset() { *x = SearchResponse_Id{} - mi := &file_storeapi_store_api_proto_msgTypes[26] + mi := &file_storeapi_store_api_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2135,7 +2347,7 @@ func (x *SearchResponse_Id) String() string { func (*SearchResponse_Id) ProtoMessage() {} func (x *SearchResponse_Id) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[26] + mi := &file_storeapi_store_api_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2175,7 +2387,7 @@ type SearchResponse_IdWithHint struct { func (x *SearchResponse_IdWithHint) Reset() { *x = SearchResponse_IdWithHint{} - mi := &file_storeapi_store_api_proto_msgTypes[27] + mi := &file_storeapi_store_api_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2187,7 +2399,7 @@ func (x *SearchResponse_IdWithHint) String() string { func (*SearchResponse_IdWithHint) ProtoMessage() {} func (x *SearchResponse_IdWithHint) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[27] + mi := &file_storeapi_store_api_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2232,7 +2444,7 @@ type SearchResponse_Histogram struct { func (x *SearchResponse_Histogram) Reset() { *x = SearchResponse_Histogram{} - mi := &file_storeapi_store_api_proto_msgTypes[28] + mi := &file_storeapi_store_api_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2244,7 +2456,7 @@ func (x *SearchResponse_Histogram) String() string { func (*SearchResponse_Histogram) ProtoMessage() {} func (x *SearchResponse_Histogram) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[28] + mi := &file_storeapi_store_api_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2320,7 +2532,7 @@ type SearchResponse_Bin struct { func (x *SearchResponse_Bin) Reset() { *x = SearchResponse_Bin{} - mi := &file_storeapi_store_api_proto_msgTypes[29] + mi := &file_storeapi_store_api_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2332,7 +2544,7 @@ func (x *SearchResponse_Bin) String() string { func (*SearchResponse_Bin) ProtoMessage() {} func (x *SearchResponse_Bin) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[29] + mi := &file_storeapi_store_api_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2391,7 +2603,7 @@ type SearchResponse_Agg struct { func (x *SearchResponse_Agg) Reset() { *x = SearchResponse_Agg{} - mi := &file_storeapi_store_api_proto_msgTypes[30] + mi := &file_storeapi_store_api_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2403,7 +2615,7 @@ func (x *SearchResponse_Agg) String() string { func (*SearchResponse_Agg) ProtoMessage() {} func (x *SearchResponse_Agg) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[30] + mi := &file_storeapi_store_api_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2765,46 +2977,62 @@ var file_storeapi_store_api_proto_rawDesc = string([]byte{ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6f, 0x6c, 0x64, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, - 0xad, 0x02, 0x0a, 0x15, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, + 0xe5, 0x02, 0x0a, 0x15, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66, - 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x02, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x69, 0x74, - 0x68, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x77, - 0x69, 0x74, 0x68, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x20, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, - 0x7c, 0x0a, 0x16, 0x4f, 0x6e, 0x65, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x2b, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x0e, 0x0a, - 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2f, 0x0a, - 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x69, - 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x9e, - 0x01, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, - 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x28, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, - 0x65, 0x12, 0x30, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x48, 0x00, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, - 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x2a, + 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, + 0x2a, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, + 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x77, 0x69, 0x74, 0x68, 0x54, 0x6f, 0x74, 0x61, 0x6c, + 0x12, 0x20, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x0a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x49, 0x64, 0x12, + 0x36, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x7a, 0x0a, 0x16, 0x4f, 0x6e, 0x65, 0x50, 0x68, + 0x61, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x25, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x05, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x42, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x22, 0x58, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x29, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x69, + 0x6e, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, + 0x79, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x74, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x22, 0xa0, 0x01, + 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x12, 0x28, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x73, 0x12, 0x30, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x48, 0x00, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x22, 0x41, 0x0a, 0x06, 0x54, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x21, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x22, 0x35, 0x0a, 0x0c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x12, 0x25, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0x23, 0x0a, 0x06, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x61, 0x77, 0x44, 0x61, 0x74, 0x61, 0x2a, 0xac, 0x01, 0x0a, 0x07, 0x41, 0x67, 0x67, 0x46, 0x75, 0x6e, 0x63, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x47, 0x47, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x5f, 0x53, 0x55, 0x4d, 0x10, @@ -2841,7 +3069,14 @@ var file_storeapi_store_api_proto_rawDesc = string([]byte{ 0x65, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x03, 0x32, 0xeb, + 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x03, 0x2a, 0x6e, + 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x59, + 0x54, 0x45, 0x53, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x41, 0x57, 0x5f, 0x44, 0x4f, 0x43, + 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, + 0x47, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x03, 0x12, + 0x0a, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x49, + 0x4e, 0x54, 0x33, 0x32, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, + 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x07, 0x32, 0xeb, 0x05, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x41, 0x70, 0x69, 0x12, 0x32, 0x0a, 0x04, 0x42, 0x75, 0x6c, 0x6b, 0x12, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, @@ -2907,126 +3142,135 @@ func file_storeapi_store_api_proto_rawDescGZIP() []byte { return file_storeapi_store_api_proto_rawDescData } -var file_storeapi_store_api_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_storeapi_store_api_proto_msgTypes = make([]protoimpl.MessageInfo, 34) +var file_storeapi_store_api_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_storeapi_store_api_proto_msgTypes = make([]protoimpl.MessageInfo, 37) var file_storeapi_store_api_proto_goTypes = []any{ (AggFunc)(0), // 0: api.AggFunc (Order)(0), // 1: api.Order (SearchErrorCode)(0), // 2: api.SearchErrorCode (AsyncSearchStatus)(0), // 3: api.AsyncSearchStatus - (*BulkRequest)(nil), // 4: api.BulkRequest - (*BinaryData)(nil), // 5: api.BinaryData - (*AggQuery)(nil), // 6: api.AggQuery - (*SearchRequest)(nil), // 7: api.SearchRequest - (*SearchResponse)(nil), // 8: api.SearchResponse - (*ExplainEntry)(nil), // 9: api.ExplainEntry - (*StartAsyncSearchRequest)(nil), // 10: api.StartAsyncSearchRequest - (*StartAsyncSearchResponse)(nil), // 11: api.StartAsyncSearchResponse - (*FetchAsyncSearchResultRequest)(nil), // 12: api.FetchAsyncSearchResultRequest - (*FetchAsyncSearchResultResponse)(nil), // 13: api.FetchAsyncSearchResultResponse - (*CancelAsyncSearchRequest)(nil), // 14: api.CancelAsyncSearchRequest - (*CancelAsyncSearchResponse)(nil), // 15: api.CancelAsyncSearchResponse - (*DeleteAsyncSearchRequest)(nil), // 16: api.DeleteAsyncSearchRequest - (*DeleteAsyncSearchResponse)(nil), // 17: api.DeleteAsyncSearchResponse - (*GetAsyncSearchesListRequest)(nil), // 18: api.GetAsyncSearchesListRequest - (*GetAsyncSearchesListResponse)(nil), // 19: api.GetAsyncSearchesListResponse - (*AsyncSearchesListItem)(nil), // 20: api.AsyncSearchesListItem - (*IdWithHint)(nil), // 21: api.IdWithHint - (*FieldsFilter)(nil), // 22: api.FieldsFilter - (*FetchRequest)(nil), // 23: api.FetchRequest - (*StatusRequest)(nil), // 24: api.StatusRequest - (*StatusResponse)(nil), // 25: api.StatusResponse - (*OnePhaseSearchRequest)(nil), // 26: api.OnePhaseSearchRequest - (*OnePhaseSearchResponse)(nil), // 27: api.OnePhaseSearchResponse - (*Document)(nil), // 28: api.Document + (DataType)(0), // 4: api.DataType + (*BulkRequest)(nil), // 5: api.BulkRequest + (*BinaryData)(nil), // 6: api.BinaryData + (*AggQuery)(nil), // 7: api.AggQuery + (*SearchRequest)(nil), // 8: api.SearchRequest + (*SearchResponse)(nil), // 9: api.SearchResponse + (*ExplainEntry)(nil), // 10: api.ExplainEntry + (*StartAsyncSearchRequest)(nil), // 11: api.StartAsyncSearchRequest + (*StartAsyncSearchResponse)(nil), // 12: api.StartAsyncSearchResponse + (*FetchAsyncSearchResultRequest)(nil), // 13: api.FetchAsyncSearchResultRequest + (*FetchAsyncSearchResultResponse)(nil), // 14: api.FetchAsyncSearchResultResponse + (*CancelAsyncSearchRequest)(nil), // 15: api.CancelAsyncSearchRequest + (*CancelAsyncSearchResponse)(nil), // 16: api.CancelAsyncSearchResponse + (*DeleteAsyncSearchRequest)(nil), // 17: api.DeleteAsyncSearchRequest + (*DeleteAsyncSearchResponse)(nil), // 18: api.DeleteAsyncSearchResponse + (*GetAsyncSearchesListRequest)(nil), // 19: api.GetAsyncSearchesListRequest + (*GetAsyncSearchesListResponse)(nil), // 20: api.GetAsyncSearchesListResponse + (*AsyncSearchesListItem)(nil), // 21: api.AsyncSearchesListItem + (*IdWithHint)(nil), // 22: api.IdWithHint + (*FieldsFilter)(nil), // 23: api.FieldsFilter + (*FetchRequest)(nil), // 24: api.FetchRequest + (*StatusRequest)(nil), // 25: api.StatusRequest + (*StatusResponse)(nil), // 26: api.StatusResponse + (*OnePhaseSearchRequest)(nil), // 27: api.OnePhaseSearchRequest + (*OnePhaseSearchResponse)(nil), // 28: api.OnePhaseSearchResponse (*Header)(nil), // 29: api.Header - (*SearchResponse_Id)(nil), // 30: api.SearchResponse.Id - (*SearchResponse_IdWithHint)(nil), // 31: api.SearchResponse.IdWithHint - (*SearchResponse_Histogram)(nil), // 32: api.SearchResponse.Histogram - (*SearchResponse_Bin)(nil), // 33: api.SearchResponse.Bin - (*SearchResponse_Agg)(nil), // 34: api.SearchResponse.Agg - nil, // 35: api.SearchResponse.HistogramEntry - nil, // 36: api.SearchResponse.Agg.AggEntry - nil, // 37: api.SearchResponse.Agg.AggHistogramEntry - (*durationpb.Duration)(nil), // 38: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 39: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 40: google.protobuf.Empty + (*Metadata)(nil), // 30: api.Metadata + (*Typing)(nil), // 31: api.Typing + (*RecordsBatch)(nil), // 32: api.RecordsBatch + (*Record)(nil), // 33: api.Record + (*SearchResponse_Id)(nil), // 34: api.SearchResponse.Id + (*SearchResponse_IdWithHint)(nil), // 35: api.SearchResponse.IdWithHint + (*SearchResponse_Histogram)(nil), // 36: api.SearchResponse.Histogram + (*SearchResponse_Bin)(nil), // 37: api.SearchResponse.Bin + (*SearchResponse_Agg)(nil), // 38: api.SearchResponse.Agg + nil, // 39: api.SearchResponse.HistogramEntry + nil, // 40: api.SearchResponse.Agg.AggEntry + nil, // 41: api.SearchResponse.Agg.AggHistogramEntry + (*durationpb.Duration)(nil), // 42: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 43: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 44: google.protobuf.Empty } var file_storeapi_store_api_proto_depIdxs = []int32{ 0, // 0: api.AggQuery.func:type_name -> api.AggFunc - 6, // 1: api.SearchRequest.aggs:type_name -> api.AggQuery + 7, // 1: api.SearchRequest.aggs:type_name -> api.AggQuery 1, // 2: api.SearchRequest.order:type_name -> api.Order - 31, // 3: api.SearchResponse.id_sources:type_name -> api.SearchResponse.IdWithHint - 35, // 4: api.SearchResponse.histogram:type_name -> api.SearchResponse.HistogramEntry - 34, // 5: api.SearchResponse.aggs:type_name -> api.SearchResponse.Agg + 35, // 3: api.SearchResponse.id_sources:type_name -> api.SearchResponse.IdWithHint + 39, // 4: api.SearchResponse.histogram:type_name -> api.SearchResponse.HistogramEntry + 38, // 5: api.SearchResponse.aggs:type_name -> api.SearchResponse.Agg 2, // 6: api.SearchResponse.code:type_name -> api.SearchErrorCode - 9, // 7: api.SearchResponse.explain:type_name -> api.ExplainEntry - 38, // 8: api.ExplainEntry.duration:type_name -> google.protobuf.Duration - 9, // 9: api.ExplainEntry.children:type_name -> api.ExplainEntry - 38, // 10: api.StartAsyncSearchRequest.retention:type_name -> google.protobuf.Duration - 6, // 11: api.StartAsyncSearchRequest.aggs:type_name -> api.AggQuery + 10, // 7: api.SearchResponse.explain:type_name -> api.ExplainEntry + 42, // 8: api.ExplainEntry.duration:type_name -> google.protobuf.Duration + 10, // 9: api.ExplainEntry.children:type_name -> api.ExplainEntry + 42, // 10: api.StartAsyncSearchRequest.retention:type_name -> google.protobuf.Duration + 7, // 11: api.StartAsyncSearchRequest.aggs:type_name -> api.AggQuery 1, // 12: api.FetchAsyncSearchResultRequest.order:type_name -> api.Order 3, // 13: api.FetchAsyncSearchResultResponse.status:type_name -> api.AsyncSearchStatus - 8, // 14: api.FetchAsyncSearchResultResponse.response:type_name -> api.SearchResponse - 39, // 15: api.FetchAsyncSearchResultResponse.started_at:type_name -> google.protobuf.Timestamp - 39, // 16: api.FetchAsyncSearchResultResponse.expires_at:type_name -> google.protobuf.Timestamp - 39, // 17: api.FetchAsyncSearchResultResponse.canceled_at:type_name -> google.protobuf.Timestamp - 6, // 18: api.FetchAsyncSearchResultResponse.aggs:type_name -> api.AggQuery - 39, // 19: api.FetchAsyncSearchResultResponse.from:type_name -> google.protobuf.Timestamp - 39, // 20: api.FetchAsyncSearchResultResponse.to:type_name -> google.protobuf.Timestamp - 38, // 21: api.FetchAsyncSearchResultResponse.retention:type_name -> google.protobuf.Duration + 9, // 14: api.FetchAsyncSearchResultResponse.response:type_name -> api.SearchResponse + 43, // 15: api.FetchAsyncSearchResultResponse.started_at:type_name -> google.protobuf.Timestamp + 43, // 16: api.FetchAsyncSearchResultResponse.expires_at:type_name -> google.protobuf.Timestamp + 43, // 17: api.FetchAsyncSearchResultResponse.canceled_at:type_name -> google.protobuf.Timestamp + 7, // 18: api.FetchAsyncSearchResultResponse.aggs:type_name -> api.AggQuery + 43, // 19: api.FetchAsyncSearchResultResponse.from:type_name -> google.protobuf.Timestamp + 43, // 20: api.FetchAsyncSearchResultResponse.to:type_name -> google.protobuf.Timestamp + 42, // 21: api.FetchAsyncSearchResultResponse.retention:type_name -> google.protobuf.Duration 3, // 22: api.GetAsyncSearchesListRequest.status:type_name -> api.AsyncSearchStatus - 20, // 23: api.GetAsyncSearchesListResponse.searches:type_name -> api.AsyncSearchesListItem + 21, // 23: api.GetAsyncSearchesListResponse.searches:type_name -> api.AsyncSearchesListItem 3, // 24: api.AsyncSearchesListItem.status:type_name -> api.AsyncSearchStatus - 39, // 25: api.AsyncSearchesListItem.started_at:type_name -> google.protobuf.Timestamp - 39, // 26: api.AsyncSearchesListItem.expires_at:type_name -> google.protobuf.Timestamp - 39, // 27: api.AsyncSearchesListItem.canceled_at:type_name -> google.protobuf.Timestamp - 6, // 28: api.AsyncSearchesListItem.aggs:type_name -> api.AggQuery - 39, // 29: api.AsyncSearchesListItem.from:type_name -> google.protobuf.Timestamp - 39, // 30: api.AsyncSearchesListItem.to:type_name -> google.protobuf.Timestamp - 38, // 31: api.AsyncSearchesListItem.retention:type_name -> google.protobuf.Duration - 21, // 32: api.FetchRequest.ids_with_hints:type_name -> api.IdWithHint - 22, // 33: api.FetchRequest.fields_filter:type_name -> api.FieldsFilter - 39, // 34: api.StatusResponse.oldest_time:type_name -> google.protobuf.Timestamp - 1, // 35: api.OnePhaseSearchRequest.order:type_name -> api.Order - 22, // 36: api.OnePhaseSearchRequest.fields_filter:type_name -> api.FieldsFilter - 29, // 37: api.OnePhaseSearchResponse.header:type_name -> api.Header - 28, // 38: api.OnePhaseSearchResponse.document:type_name -> api.Document - 5, // 39: api.Document.data:type_name -> api.BinaryData - 2, // 40: api.Header.code:type_name -> api.SearchErrorCode - 9, // 41: api.Header.explain:type_name -> api.ExplainEntry - 30, // 42: api.SearchResponse.IdWithHint.id:type_name -> api.SearchResponse.Id - 39, // 43: api.SearchResponse.Bin.ts:type_name -> google.protobuf.Timestamp - 32, // 44: api.SearchResponse.Bin.hist:type_name -> api.SearchResponse.Histogram - 36, // 45: api.SearchResponse.Agg.agg:type_name -> api.SearchResponse.Agg.AggEntry - 37, // 46: api.SearchResponse.Agg.agg_histogram:type_name -> api.SearchResponse.Agg.AggHistogramEntry - 33, // 47: api.SearchResponse.Agg.timeseries:type_name -> api.SearchResponse.Bin - 32, // 48: api.SearchResponse.Agg.AggHistogramEntry.value:type_name -> api.SearchResponse.Histogram - 4, // 49: api.StoreApi.Bulk:input_type -> api.BulkRequest - 7, // 50: api.StoreApi.Search:input_type -> api.SearchRequest - 10, // 51: api.StoreApi.StartAsyncSearch:input_type -> api.StartAsyncSearchRequest - 12, // 52: api.StoreApi.FetchAsyncSearchResult:input_type -> api.FetchAsyncSearchResultRequest - 14, // 53: api.StoreApi.CancelAsyncSearch:input_type -> api.CancelAsyncSearchRequest - 16, // 54: api.StoreApi.DeleteAsyncSearch:input_type -> api.DeleteAsyncSearchRequest - 18, // 55: api.StoreApi.GetAsyncSearchesList:input_type -> api.GetAsyncSearchesListRequest - 23, // 56: api.StoreApi.Fetch:input_type -> api.FetchRequest - 24, // 57: api.StoreApi.Status:input_type -> api.StatusRequest - 26, // 58: api.StoreApi.OnePhaseSearch:input_type -> api.OnePhaseSearchRequest - 40, // 59: api.StoreApi.Bulk:output_type -> google.protobuf.Empty - 8, // 60: api.StoreApi.Search:output_type -> api.SearchResponse - 11, // 61: api.StoreApi.StartAsyncSearch:output_type -> api.StartAsyncSearchResponse - 13, // 62: api.StoreApi.FetchAsyncSearchResult:output_type -> api.FetchAsyncSearchResultResponse - 15, // 63: api.StoreApi.CancelAsyncSearch:output_type -> api.CancelAsyncSearchResponse - 17, // 64: api.StoreApi.DeleteAsyncSearch:output_type -> api.DeleteAsyncSearchResponse - 19, // 65: api.StoreApi.GetAsyncSearchesList:output_type -> api.GetAsyncSearchesListResponse - 5, // 66: api.StoreApi.Fetch:output_type -> api.BinaryData - 25, // 67: api.StoreApi.Status:output_type -> api.StatusResponse - 27, // 68: api.StoreApi.OnePhaseSearch:output_type -> api.OnePhaseSearchResponse - 59, // [59:69] is the sub-list for method output_type - 49, // [49:59] is the sub-list for method input_type - 49, // [49:49] is the sub-list for extension type_name - 49, // [49:49] is the sub-list for extension extendee - 0, // [0:49] is the sub-list for field type_name + 43, // 25: api.AsyncSearchesListItem.started_at:type_name -> google.protobuf.Timestamp + 43, // 26: api.AsyncSearchesListItem.expires_at:type_name -> google.protobuf.Timestamp + 43, // 27: api.AsyncSearchesListItem.canceled_at:type_name -> google.protobuf.Timestamp + 7, // 28: api.AsyncSearchesListItem.aggs:type_name -> api.AggQuery + 43, // 29: api.AsyncSearchesListItem.from:type_name -> google.protobuf.Timestamp + 43, // 30: api.AsyncSearchesListItem.to:type_name -> google.protobuf.Timestamp + 42, // 31: api.AsyncSearchesListItem.retention:type_name -> google.protobuf.Duration + 22, // 32: api.FetchRequest.ids_with_hints:type_name -> api.IdWithHint + 23, // 33: api.FetchRequest.fields_filter:type_name -> api.FieldsFilter + 43, // 34: api.StatusResponse.oldest_time:type_name -> google.protobuf.Timestamp + 43, // 35: api.OnePhaseSearchRequest.from:type_name -> google.protobuf.Timestamp + 43, // 36: api.OnePhaseSearchRequest.to:type_name -> google.protobuf.Timestamp + 1, // 37: api.OnePhaseSearchRequest.order:type_name -> api.Order + 23, // 38: api.OnePhaseSearchRequest.fields_filter:type_name -> api.FieldsFilter + 29, // 39: api.OnePhaseSearchResponse.header:type_name -> api.Header + 32, // 40: api.OnePhaseSearchResponse.batch:type_name -> api.RecordsBatch + 30, // 41: api.Header.metadata:type_name -> api.Metadata + 31, // 42: api.Header.typing:type_name -> api.Typing + 2, // 43: api.Metadata.code:type_name -> api.SearchErrorCode + 10, // 44: api.Metadata.explain:type_name -> api.ExplainEntry + 4, // 45: api.Typing.type:type_name -> api.DataType + 33, // 46: api.RecordsBatch.records:type_name -> api.Record + 34, // 47: api.SearchResponse.IdWithHint.id:type_name -> api.SearchResponse.Id + 43, // 48: api.SearchResponse.Bin.ts:type_name -> google.protobuf.Timestamp + 36, // 49: api.SearchResponse.Bin.hist:type_name -> api.SearchResponse.Histogram + 40, // 50: api.SearchResponse.Agg.agg:type_name -> api.SearchResponse.Agg.AggEntry + 41, // 51: api.SearchResponse.Agg.agg_histogram:type_name -> api.SearchResponse.Agg.AggHistogramEntry + 37, // 52: api.SearchResponse.Agg.timeseries:type_name -> api.SearchResponse.Bin + 36, // 53: api.SearchResponse.Agg.AggHistogramEntry.value:type_name -> api.SearchResponse.Histogram + 5, // 54: api.StoreApi.Bulk:input_type -> api.BulkRequest + 8, // 55: api.StoreApi.Search:input_type -> api.SearchRequest + 11, // 56: api.StoreApi.StartAsyncSearch:input_type -> api.StartAsyncSearchRequest + 13, // 57: api.StoreApi.FetchAsyncSearchResult:input_type -> api.FetchAsyncSearchResultRequest + 15, // 58: api.StoreApi.CancelAsyncSearch:input_type -> api.CancelAsyncSearchRequest + 17, // 59: api.StoreApi.DeleteAsyncSearch:input_type -> api.DeleteAsyncSearchRequest + 19, // 60: api.StoreApi.GetAsyncSearchesList:input_type -> api.GetAsyncSearchesListRequest + 24, // 61: api.StoreApi.Fetch:input_type -> api.FetchRequest + 25, // 62: api.StoreApi.Status:input_type -> api.StatusRequest + 27, // 63: api.StoreApi.OnePhaseSearch:input_type -> api.OnePhaseSearchRequest + 44, // 64: api.StoreApi.Bulk:output_type -> google.protobuf.Empty + 9, // 65: api.StoreApi.Search:output_type -> api.SearchResponse + 12, // 66: api.StoreApi.StartAsyncSearch:output_type -> api.StartAsyncSearchResponse + 14, // 67: api.StoreApi.FetchAsyncSearchResult:output_type -> api.FetchAsyncSearchResultResponse + 16, // 68: api.StoreApi.CancelAsyncSearch:output_type -> api.CancelAsyncSearchResponse + 18, // 69: api.StoreApi.DeleteAsyncSearch:output_type -> api.DeleteAsyncSearchResponse + 20, // 70: api.StoreApi.GetAsyncSearchesList:output_type -> api.GetAsyncSearchesListResponse + 6, // 71: api.StoreApi.Fetch:output_type -> api.BinaryData + 26, // 72: api.StoreApi.Status:output_type -> api.StatusResponse + 28, // 73: api.StoreApi.OnePhaseSearch:output_type -> api.OnePhaseSearchResponse + 64, // [64:74] is the sub-list for method output_type + 54, // [54:64] is the sub-list for method input_type + 54, // [54:54] is the sub-list for extension type_name + 54, // [54:54] is the sub-list for extension extendee + 0, // [0:54] is the sub-list for field type_name } func init() { file_storeapi_store_api_proto_init() } @@ -3040,7 +3284,7 @@ func file_storeapi_store_api_proto_init() { file_storeapi_store_api_proto_msgTypes[16].OneofWrappers = []any{} file_storeapi_store_api_proto_msgTypes[23].OneofWrappers = []any{ (*OnePhaseSearchResponse_Header)(nil), - (*OnePhaseSearchResponse_Document)(nil), + (*OnePhaseSearchResponse_Batch)(nil), } file_storeapi_store_api_proto_msgTypes[25].OneofWrappers = []any{} type x struct{} @@ -3048,8 +3292,8 @@ func file_storeapi_store_api_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_storeapi_store_api_proto_rawDesc), len(file_storeapi_store_api_proto_rawDesc)), - NumEnums: 4, - NumMessages: 34, + NumEnums: 5, + NumMessages: 37, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/storeapi/store_api_vtproto.pb.go b/pkg/storeapi/store_api_vtproto.pb.go index 273678d9..4851cc86 100644 --- a/pkg/storeapi/store_api_vtproto.pb.go +++ b/pkg/storeapi/store_api_vtproto.pb.go @@ -711,8 +711,8 @@ func (m *OnePhaseSearchRequest) CloneVT() *OnePhaseSearchRequest { } r := new(OnePhaseSearchRequest) r.Query = m.Query - r.From = m.From - r.To = m.To + r.From = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.From).CloneVT()) + r.To = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.To).CloneVT()) r.Size = m.Size r.Offset = m.Offset r.Explain = m.Explain @@ -761,21 +761,28 @@ func (m *OnePhaseSearchResponse_Header) CloneVT() isOnePhaseSearchResponse_Respo return r } -func (m *OnePhaseSearchResponse_Document) CloneVT() isOnePhaseSearchResponse_ResponseType { +func (m *OnePhaseSearchResponse_Batch) CloneVT() isOnePhaseSearchResponse_ResponseType { if m == nil { - return (*OnePhaseSearchResponse_Document)(nil) + return (*OnePhaseSearchResponse_Batch)(nil) } - r := new(OnePhaseSearchResponse_Document) - r.Document = m.Document.CloneVT() + r := new(OnePhaseSearchResponse_Batch) + r.Batch = m.Batch.CloneVT() return r } -func (m *Document) CloneVT() *Document { +func (m *Header) CloneVT() *Header { if m == nil { - return (*Document)(nil) + return (*Header)(nil) + } + r := new(Header) + r.Metadata = m.Metadata.CloneVT() + if rhs := m.Typing; rhs != nil { + tmpContainer := make([]*Typing, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Typing = tmpContainer } - r := new(Document) - r.Data = m.Data.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -783,15 +790,15 @@ func (m *Document) CloneVT() *Document { return r } -func (m *Document) CloneMessageVT() proto.Message { +func (m *Header) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *Header) CloneVT() *Header { +func (m *Metadata) CloneVT() *Metadata { if m == nil { - return (*Header)(nil) + return (*Metadata)(nil) } - r := new(Header) + r := new(Metadata) r.Total = m.Total r.Code = m.Code r.Explain = m.Explain.CloneVT() @@ -807,7 +814,73 @@ func (m *Header) CloneVT() *Header { return r } -func (m *Header) CloneMessageVT() proto.Message { +func (m *Metadata) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Typing) CloneVT() *Typing { + if m == nil { + return (*Typing)(nil) + } + r := new(Typing) + r.Title = m.Title + r.Type = m.Type + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Typing) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *RecordsBatch) CloneVT() *RecordsBatch { + if m == nil { + return (*RecordsBatch)(nil) + } + r := new(RecordsBatch) + if rhs := m.Records; rhs != nil { + tmpContainer := make([]*Record, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Records = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *RecordsBatch) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Record) CloneVT() *Record { + if m == nil { + return (*Record)(nil) + } + r := new(Record) + if rhs := m.RawData; rhs != nil { + tmpContainer := make([][]byte, len(rhs)) + for k, v := range rhs { + tmpBytes := make([]byte, len(v)) + copy(tmpBytes, v) + tmpContainer[k] = tmpBytes + } + r.RawData = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Record) CloneMessageVT() proto.Message { return m.CloneVT() } @@ -1814,10 +1887,10 @@ func (this *OnePhaseSearchRequest) EqualVT(that *OnePhaseSearchRequest) bool { if this.Query != that.Query { return false } - if this.From != that.From { + if !(*timestamppb1.Timestamp)(this.From).EqualVT((*timestamppb1.Timestamp)(that.From)) { return false } - if this.To != that.To { + if !(*timestamppb1.Timestamp)(this.To).EqualVT((*timestamppb1.Timestamp)(that.To)) { return false } if this.Size != that.Size { @@ -1904,8 +1977,8 @@ func (this *OnePhaseSearchResponse_Header) EqualVT(thatIface isOnePhaseSearchRes return true } -func (this *OnePhaseSearchResponse_Document) EqualVT(thatIface isOnePhaseSearchResponse_ResponseType) bool { - that, ok := thatIface.(*OnePhaseSearchResponse_Document) +func (this *OnePhaseSearchResponse_Batch) EqualVT(thatIface isOnePhaseSearchResponse_ResponseType) bool { + that, ok := thatIface.(*OnePhaseSearchResponse_Batch) if !ok { return false } @@ -1915,12 +1988,12 @@ func (this *OnePhaseSearchResponse_Document) EqualVT(thatIface isOnePhaseSearchR if this == nil && that != nil || this != nil && that == nil { return false } - if p, q := this.Document, that.Document; p != q { + if p, q := this.Batch, that.Batch; p != q { if p == nil { - p = &Document{} + p = &RecordsBatch{} } if q == nil { - q = &Document{} + q = &RecordsBatch{} } if !p.EqualVT(q) { return false @@ -1929,26 +2002,43 @@ func (this *OnePhaseSearchResponse_Document) EqualVT(thatIface isOnePhaseSearchR return true } -func (this *Document) EqualVT(that *Document) bool { +func (this *Header) EqualVT(that *Header) bool { if this == that { return true } else if this == nil || that == nil { return false } - if !this.Data.EqualVT(that.Data) { + if !this.Metadata.EqualVT(that.Metadata) { return false } + if len(this.Typing) != len(that.Typing) { + return false + } + for i, vx := range this.Typing { + vy := that.Typing[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Typing{} + } + if q == nil { + q = &Typing{} + } + if !p.EqualVT(q) { + return false + } + } + } return string(this.unknownFields) == string(that.unknownFields) } -func (this *Document) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*Document) +func (this *Header) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Header) if !ok { return false } return this.EqualVT(that) } -func (this *Header) EqualVT(that *Header) bool { +func (this *Metadata) EqualVT(that *Metadata) bool { if this == that { return true } else if this == nil || that == nil { @@ -1957,6 +2047,9 @@ func (this *Header) EqualVT(that *Header) bool { if this.Total != that.Total { return false } + if this.Code != that.Code { + return false + } if len(this.Errors) != len(that.Errors) { return false } @@ -1966,17 +2059,94 @@ func (this *Header) EqualVT(that *Header) bool { return false } } - if this.Code != that.Code { + if !this.Explain.EqualVT(that.Explain) { return false } - if !this.Explain.EqualVT(that.Explain) { + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Metadata) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Metadata) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Typing) EqualVT(that *Typing) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Title != that.Title { + return false + } + if this.Type != that.Type { return false } return string(this.unknownFields) == string(that.unknownFields) } -func (this *Header) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*Header) +func (this *Typing) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Typing) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *RecordsBatch) EqualVT(that *RecordsBatch) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Records) != len(that.Records) { + return false + } + for i, vx := range this.Records { + vy := that.Records[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Record{} + } + if q == nil { + q = &Record{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *RecordsBatch) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RecordsBatch) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Record) EqualVT(that *Record) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.RawData) != len(that.RawData) { + return false + } + for i, vx := range this.RawData { + vy := that.RawData[i] + if string(vx) != string(vy) { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Record) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Record) if !ok { return false } @@ -4347,15 +4517,25 @@ func (m *OnePhaseSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) i-- dAtA[i] = 0x20 } - if m.To != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) + if m.To != nil { + size, err := (*timestamppb1.Timestamp)(m.To).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } - if m.From != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) + if m.From != nil { + size, err := (*timestamppb1.Timestamp)(m.From).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } if len(m.Query) > 0 { i -= len(m.Query) @@ -4432,15 +4612,15 @@ func (m *OnePhaseSearchResponse_Header) MarshalToSizedBufferVT(dAtA []byte) (int } return len(dAtA) - i, nil } -func (m *OnePhaseSearchResponse_Document) MarshalToVT(dAtA []byte) (int, error) { +func (m *OnePhaseSearchResponse_Batch) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *OnePhaseSearchResponse_Document) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *OnePhaseSearchResponse_Batch) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) - if m.Document != nil { - size, err := m.Document.MarshalToSizedBufferVT(dAtA[:i]) + if m.Batch != nil { + size, err := m.Batch.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -4455,7 +4635,7 @@ func (m *OnePhaseSearchResponse_Document) MarshalToSizedBufferVT(dAtA []byte) (i } return len(dAtA) - i, nil } -func (m *Document) MarshalVT() (dAtA []byte, err error) { +func (m *Header) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -4468,12 +4648,12 @@ func (m *Document) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Document) MarshalToVT(dAtA []byte) (int, error) { +func (m *Header) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *Document) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4485,8 +4665,20 @@ func (m *Document) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Data != nil { - size, err := m.Data.MarshalToSizedBufferVT(dAtA[:i]) + if len(m.Typing) > 0 { + for iNdEx := len(m.Typing) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Typing[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if m.Metadata != nil { + size, err := m.Metadata.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -4498,7 +4690,7 @@ func (m *Document) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Header) MarshalVT() (dAtA []byte, err error) { +func (m *Metadata) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -4511,12 +4703,12 @@ func (m *Header) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Header) MarshalToVT(dAtA []byte) (int, error) { +func (m *Metadata) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *Metadata) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4538,20 +4730,20 @@ func (m *Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Code != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x18 - } if len(m.Errors) > 0 { for iNdEx := len(m.Errors) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Errors[iNdEx]) copy(dAtA[i:], m.Errors[iNdEx]) i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Errors[iNdEx]))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } } + if m.Code != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x10 + } if m.Total != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) i-- @@ -4560,25 +4752,25 @@ func (m *Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BulkRequest) MarshalVTStrict() (dAtA []byte, err error) { +func (m *Typing) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } size := m.SizeVT() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } -func (m *BulkRequest) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *Typing) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *BulkRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *Typing) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4590,47 +4782,40 @@ func (m *BulkRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Metas) > 0 { - i -= len(m.Metas) - copy(dAtA[i:], m.Metas) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Metas))) - i-- - dAtA[i] = 0x1a - } - if len(m.Docs) > 0 { - i -= len(m.Docs) - copy(dAtA[i:], m.Docs) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Docs))) + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if m.Count != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Count)) + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Title))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *BinaryData) MarshalVTStrict() (dAtA []byte, err error) { +func (m *RecordsBatch) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } size := m.SizeVT() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } -func (m *BinaryData) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *RecordsBatch) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *BinaryData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *RecordsBatch) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4642,35 +4827,40 @@ func (m *BinaryData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Records[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } -func (m *AggQuery) MarshalVTStrict() (dAtA []byte, err error) { +func (m *Record) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } size := m.SizeVT() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } -func (m *AggQuery) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *Record) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *AggQuery) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *Record) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4682,14 +4872,148 @@ func (m *AggQuery) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Interval != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) - i-- - dAtA[i] = 0x30 + if len(m.RawData) > 0 { + for iNdEx := len(m.RawData) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RawData[iNdEx]) + copy(dAtA[i:], m.RawData[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RawData[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - if len(m.Quantiles) > 0 { - for iNdEx := len(m.Quantiles) - 1; iNdEx >= 0; iNdEx-- { - f1 := math.Float64bits(float64(m.Quantiles[iNdEx])) + return len(dAtA) - i, nil +} + +func (m *BulkRequest) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BulkRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BulkRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Metas) > 0 { + i -= len(m.Metas) + copy(dAtA[i:], m.Metas) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Metas))) + i-- + dAtA[i] = 0x1a + } + if len(m.Docs) > 0 { + i -= len(m.Docs) + copy(dAtA[i:], m.Docs) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Docs))) + i-- + dAtA[i] = 0x12 + } + if m.Count != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BinaryData) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BinaryData) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *BinaryData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AggQuery) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AggQuery) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *AggQuery) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Interval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) + i-- + dAtA[i] = 0x30 + } + if len(m.Quantiles) > 0 { + for iNdEx := len(m.Quantiles) - 1; iNdEx >= 0; iNdEx-- { + f1 := math.Float64bits(float64(m.Quantiles[iNdEx])) i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(f1)) } @@ -6454,15 +6778,25 @@ func (m *OnePhaseSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, i-- dAtA[i] = 0x20 } - if m.To != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) + if m.To != nil { + size, err := (*timestamppb1.Timestamp)(m.To).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } - if m.From != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) + if m.From != nil { + size, err := (*timestamppb1.Timestamp)(m.From).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } if len(m.Query) > 0 { i -= len(m.Query) @@ -6504,7 +6838,7 @@ func (m *OnePhaseSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if msg, ok := m.ResponseType.(*OnePhaseSearchResponse_Document); ok { + if msg, ok := m.ResponseType.(*OnePhaseSearchResponse_Batch); ok { size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err @@ -6544,15 +6878,15 @@ func (m *OnePhaseSearchResponse_Header) MarshalToSizedBufferVTStrict(dAtA []byte } return len(dAtA) - i, nil } -func (m *OnePhaseSearchResponse_Document) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *OnePhaseSearchResponse_Batch) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *OnePhaseSearchResponse_Document) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *OnePhaseSearchResponse_Batch) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i := len(dAtA) - if m.Document != nil { - size, err := m.Document.MarshalToSizedBufferVTStrict(dAtA[:i]) + if m.Batch != nil { + size, err := m.Batch.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } @@ -6567,7 +6901,7 @@ func (m *OnePhaseSearchResponse_Document) MarshalToSizedBufferVTStrict(dAtA []by } return len(dAtA) - i, nil } -func (m *Document) MarshalVTStrict() (dAtA []byte, err error) { +func (m *Header) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -6580,12 +6914,12 @@ func (m *Document) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Document) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *Header) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *Document) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *Header) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -6597,8 +6931,20 @@ func (m *Document) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Data != nil { - size, err := m.Data.MarshalToSizedBufferVTStrict(dAtA[:i]) + if len(m.Typing) > 0 { + for iNdEx := len(m.Typing) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Typing[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if m.Metadata != nil { + size, err := m.Metadata.MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { return 0, err } @@ -6610,7 +6956,7 @@ func (m *Document) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Header) MarshalVTStrict() (dAtA []byte, err error) { +func (m *Metadata) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -6623,12 +6969,12 @@ func (m *Header) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Header) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *Metadata) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *Header) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *Metadata) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -6650,20 +6996,20 @@ func (m *Header) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Code != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x18 - } if len(m.Errors) > 0 { for iNdEx := len(m.Errors) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Errors[iNdEx]) copy(dAtA[i:], m.Errors[iNdEx]) i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Errors[iNdEx]))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } } + if m.Code != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x10 + } if m.Total != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) i-- @@ -6672,54 +7018,186 @@ func (m *Header) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BulkRequest) SizeVT() (n int) { +func (m *Typing) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Typing) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Typing) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - if m.Count != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Count)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - l = len(m.Docs) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 } - l = len(m.Metas) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa } - n += len(m.unknownFields) - return n + return len(dAtA) - i, nil } -func (m *BinaryData) SizeVT() (n int) { +func (m *RecordsBatch) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err } - n += len(m.unknownFields) - return n + return dAtA[:n], nil } -func (m *AggQuery) SizeVT() (n int) { +func (m *RecordsBatch) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *RecordsBatch) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Field) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - l = len(m.GroupBy) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Records[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Record) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Record) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Record) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.RawData) > 0 { + for iNdEx := len(m.RawData) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RawData[iNdEx]) + copy(dAtA[i:], m.RawData[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RawData[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *BulkRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Count != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Count)) + } + l = len(m.Docs) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Metas) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BinaryData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *AggQuery) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Field) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.GroupBy) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Func != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.Func)) @@ -7405,11 +7883,13 @@ func (m *OnePhaseSearchRequest) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.From != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.From)) + if m.From != nil { + l = (*timestamppb1.Timestamp)(m.From).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.To != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.To)) + if m.To != nil { + l = (*timestamppb1.Timestamp)(m.To).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Size != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.Size)) @@ -7465,35 +7945,41 @@ func (m *OnePhaseSearchResponse_Header) SizeVT() (n int) { } return n } -func (m *OnePhaseSearchResponse_Document) SizeVT() (n int) { +func (m *OnePhaseSearchResponse_Batch) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if m.Document != nil { - l = m.Document.SizeVT() + if m.Batch != nil { + l = m.Batch.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } else { n += 3 } return n } -func (m *Document) SizeVT() (n int) { +func (m *Header) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if m.Data != nil { - l = m.Data.SizeVT() + if m.Metadata != nil { + l = m.Metadata.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if len(m.Typing) > 0 { + for _, e := range m.Typing { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } n += len(m.unknownFields) return n } -func (m *Header) SizeVT() (n int) { +func (m *Metadata) SizeVT() (n int) { if m == nil { return 0 } @@ -7502,15 +7988,15 @@ func (m *Header) SizeVT() (n int) { if m.Total != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.Total)) } + if m.Code != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Code)) + } if len(m.Errors) > 0 { for _, s := range m.Errors { l = len(s) n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } - if m.Code != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Code)) - } if m.Explain != nil { l = m.Explain.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) @@ -7519,6 +8005,55 @@ func (m *Header) SizeVT() (n int) { return n } +func (m *Typing) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Type != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) + } + n += len(m.unknownFields) + return n +} + +func (m *RecordsBatch) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Records) > 0 { + for _, e := range m.Records { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Record) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RawData) > 0 { + for _, b := range m.RawData { + l = len(b) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + func (m *BulkRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -12393,10 +12928,10 @@ func (m *OnePhaseSearchRequest) UnmarshalVT(dAtA []byte) error { m.Query = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - m.From = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12406,16 +12941,33 @@ func (m *OnePhaseSearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.From |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.From == nil { + m.From = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - m.To = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12425,11 +12977,28 @@ func (m *OnePhaseSearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.To |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.To == nil { + m.To = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) @@ -12689,7 +13258,7 @@ func (m *OnePhaseSearchResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Batch", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12716,16 +13285,16 @@ func (m *OnePhaseSearchResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Document); ok { - if err := oneof.Document.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Batch); ok { + if err := oneof.Batch.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } } else { - v := &Document{} + v := &RecordsBatch{} if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } - m.ResponseType = &OnePhaseSearchResponse_Document{Document: v} + m.ResponseType = &OnePhaseSearchResponse_Batch{Batch: v} } iNdEx = postIndex default: @@ -12750,7 +13319,7 @@ func (m *OnePhaseSearchResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *Document) UnmarshalVT(dAtA []byte) error { +func (m *Header) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12773,15 +13342,15 @@ func (m *Document) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Document: wiretype end group for non-group") + return fmt.Errorf("proto: Header: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Header: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12808,10 +13377,44 @@ func (m *Document) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Data == nil { - m.Data = &BinaryData{} + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Typing", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF } - if err := m.Data.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Typing = append(m.Typing, &Typing{}) + if err := m.Typing[len(m.Typing)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -12837,7 +13440,7 @@ func (m *Document) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *Header) UnmarshalVT(dAtA []byte) error { +func (m *Metadata) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12860,10 +13463,10 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Header: wiretype end group for non-group") + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -12886,10 +13489,10 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { } } case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - var stringLen uint64 + m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12899,29 +13502,16 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Code |= SearchErrorCode(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Errors = append(m.Errors, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12931,11 +13521,24 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= SearchErrorCode(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Errors = append(m.Errors, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) @@ -12994,7 +13597,7 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *BulkRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Typing) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13017,36 +13620,17 @@ func (m *BulkRequest) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BulkRequest: wiretype end group for non-group") + return fmt.Errorf("proto: Typing: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BulkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Typing: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Docs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13056,28 +13640,29 @@ func (m *BulkRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Docs = dAtA[iNdEx:postIndex] + m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - var byteLen int + m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13087,23 +13672,11 @@ func (m *BulkRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.Type |= DataType(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metas = dAtA[iNdEx:postIndex] - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -13126,7 +13699,7 @@ func (m *BulkRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *BinaryData) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *RecordsBatch) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13149,17 +13722,17 @@ func (m *BinaryData) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BinaryData: wiretype end group for non-group") + return fmt.Errorf("proto: RecordsBatch: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BinaryData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RecordsBatch: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13169,22 +13742,25 @@ func (m *BinaryData) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = dAtA[iNdEx:postIndex] + m.Records = append(m.Records, &Record{}) + if err := m.Records[len(m.Records)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -13208,7 +13784,7 @@ func (m *BinaryData) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *AggQuery) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Record) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13231,53 +13807,17 @@ func (m *AggQuery) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AggQuery: wiretype end group for non-group") + return fmt.Errorf("proto: Record: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AggQuery: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Record: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - 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 protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.Field = stringValue - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupBy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RawData", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13287,120 +13827,24 @@ func (m *AggQuery) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.GroupBy = stringValue + m.RawData = append(m.RawData, make([]byte, postIndex-iNdEx)) + copy(m.RawData[len(m.RawData)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) - } - m.Func = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Func |= AggFunc(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType == 1 { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.Quantiles = append(m.Quantiles, v2) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.Quantiles) == 0 { - m.Quantiles = make([]float64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.Quantiles = append(m.Quantiles, v2) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Quantiles", wireType) - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) - } - m.Interval = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Interval |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -13423,7 +13867,7 @@ func (m *AggQuery) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *BulkRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13446,17 +13890,17 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchRequest: wiretype end group for non-group") + return fmt.Errorf("proto: BulkRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BulkRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) } - var stringLen uint64 + m.Count = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13466,33 +13910,16 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Count |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.Query = stringValue - iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Docs", wireType) } - m.From = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13502,16 +13929,28 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.From |= int64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Docs = dAtA[iNdEx:postIndex] + iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) } - m.To = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13521,54 +13960,79 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.To |= int64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + if byteLen < 0 { + return protohelpers.ErrInvalidLength } - m.Size = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Size |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + if postIndex > l { + return io.ErrUnexpectedEOF } - m.Offset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Offset |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + m.Metas = dAtA[iNdEx:postIndex] + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength } - m.Interval = 0 + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BinaryData) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: BinaryData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BinaryData: 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 protohelpers.ErrIntOverflow @@ -13578,14 +14042,77 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Interval |= int64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 7: + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = dAtA[iNdEx:postIndex] + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AggQuery) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: AggQuery: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AggQuery: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggregation", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -13617,13 +14144,13 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Aggregation = stringValue + m.Field = stringValue iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupBy", wireType) } - var v int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13633,17 +14160,33 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.Explain = bool(v != 0) - case 10: + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.GroupBy = stringValue + iNdEx = postIndex + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) } - var v int + m.Func = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13653,106 +14196,70 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Func |= AggFunc(b&0x7F) << shift if b < 0x80 { break } } - m.WithTotal = bool(v != 0) - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregationFilter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { + case 5: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.AggregationFilter = stringValue - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.Quantiles = append(m.Quantiles, v2) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break + if packedLen < 0 { + return protohelpers.ErrInvalidLength } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Aggs = append(m.Aggs, &AggQuery{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) - } - m.Order = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - m.Order |= Order(b&0x7F) << shift - if b < 0x80 { - break + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.Quantiles) == 0 { + m.Quantiles = make([]float64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.Quantiles = append(m.Quantiles, v2) } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Quantiles", wireType) } - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) } - var stringLen uint64 + m.Interval = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13762,28 +14269,11 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Interval |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.OffsetId = stringValue - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -13806,7 +14296,7 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13829,17 +14319,17 @@ func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse_Id: wiretype end group for non-group") + return fmt.Errorf("proto: SearchRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Id: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mid", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } - m.Mid = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13849,16 +14339,33 @@ func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Mid |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Query = stringValue + iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Rid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - m.Rid = 0 + m.From = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13868,67 +14375,16 @@ func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Rid |= uint64(b&0x7F) << shift + m.From |= int64(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow - } - 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: SearchResponse_IdWithHint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_IdWithHint: 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) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - var msglen int + m.To = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13938,31 +14394,236 @@ func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.To |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + } + m.Offset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Offset |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + m.Interval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Interval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aggregation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Id == nil { - m.Id = &SearchResponse_Id{} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - if err := m.Id.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.Aggregation = stringValue + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Explain = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WithTotal = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregationFilter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.AggregationFilter = stringValue + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + m.Order = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Order |= Order(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -13994,7 +14655,7 @@ func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Hint = stringValue + m.OffsetId = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -14018,7 +14679,7 @@ func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14041,29 +14702,241 @@ func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SearchResponse_Histogram: wiretype end group for non-group") + return fmt.Errorf("proto: SearchResponse_Id: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse_Histogram: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SearchResponse_Id: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mid", wireType) } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF + m.Mid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Mid |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Min = float64(math.Float64frombits(v)) case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Rid", wireType) } - var v uint64 - if (iNdEx + 8) > l { + m.Rid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Rid |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: SearchResponse_IdWithHint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchResponse_IdWithHint: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &SearchResponse_Id{} + } + if err := m.Id.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Hint = stringValue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: SearchResponse_Histogram: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchResponse_Histogram: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Min = float64(math.Float64frombits(v)) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + var v uint64 + if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) @@ -16813,19 +17686,292 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if b < 0x80 { break } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AsyncSearchesListItem: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AsyncSearchesListItem: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AsyncSearchesListItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AsyncSearchesListItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + 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 protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.SearchId = stringValue + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= AsyncSearchStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StartedAt == nil { + m.StartedAt = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExpiresAt == nil { + m.ExpiresAt = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CanceledAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CanceledAt == nil { + m.CanceledAt = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) + } + m.FracsDone = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FracsDone |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) + } + m.FracsQueue = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FracsQueue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + } + m.DiskUsage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DiskUsage |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + } + m.HistogramInterval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HistogramInterval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -16857,13 +18003,13 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.SearchId = stringValue + m.Query = stringValue iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - m.Status = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -16873,14 +18019,31 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= AsyncSearchStatus(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.From == nil { + m.From = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -16907,16 +18070,16 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.StartedAt == nil { - m.StartedAt = ×tamppb.Timestamp{} + if m.To == nil { + m.To = ×tamppb.Timestamp{} } - if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -16943,18 +18106,57 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ExpiresAt == nil { - m.ExpiresAt = ×tamppb.Timestamp{} + if m.Retention == nil { + m.Retention = &durationpb.Duration{} } - if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WithDocs = bool(v != 0) + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CanceledAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -16964,33 +18166,84 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.CanceledAt == nil { - m.CanceledAt = ×tamppb.Timestamp{} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.Error = stringValue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength } - m.FracsDone = 0 + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IdWithHint) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: IdWithHint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IdWithHint: 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 stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17000,16 +18253,33 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.FracsDone |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength } - m.FracsQueue = 0 + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Id = stringValue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17019,35 +18289,84 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.FracsQueue |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Hint = stringValue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FieldsFilter) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.DiskUsage = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DiskUsage |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - case 9: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FieldsFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FieldsFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17057,31 +18376,33 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Aggs = append(m.Aggs, &AggQuery{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + m.Fields = append(m.Fields, stringValue) iNdEx = postIndex - case 10: + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowList", wireType) } - m.HistogramInterval = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17091,14 +18412,66 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.HistogramInterval |= int64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - case 11: + m.AllowList = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FetchRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: FetchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FetchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17130,13 +18503,13 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Query = stringValue + m.Ids = append(m.Ids, stringValue) iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17146,31 +18519,15 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.From == nil { - m.From = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: + m.Explain = bool(v != 0) + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IdsWithHints", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17197,16 +18554,14 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.To == nil { - m.To = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.IdsWithHints = append(m.IdsWithHints, &IdWithHint{}) + if err := m.IdsWithHints[len(m.IdsWithHints)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 14: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17233,16 +18588,16 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Retention == nil { - m.Retention = &durationpb.Duration{} + if m.FieldsFilter == nil { + m.FieldsFilter = &FieldsFilter{} } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FieldsFilter.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 15: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NoSkipMasks", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -17259,62 +18614,58 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { break } } - m.WithDocs = bool(v != 0) - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) - } - m.Size = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Size |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + m.NoSkipMasks = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - intStringLen := int(stringLen) - if intStringLen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - m.Error = stringValue - iNdEx = postIndex + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -17337,7 +18688,7 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *StatusResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17360,17 +18711,17 @@ func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: IdWithHint: wiretype end group for non-group") + return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: IdWithHint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: StatusResponse: 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) + return fmt.Errorf("proto: wrong wireType = %d for field OldestTime", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17380,63 +18731,27 @@ func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.Id = stringValue - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - 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 protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF + if m.OldestTime == nil { + m.OldestTime = ×tamppb.Timestamp{} } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Hint = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -17460,7 +18775,7 @@ func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17483,15 +18798,15 @@ func (m *FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FieldsFilter: wiretype end group for non-group") + return fmt.Errorf("proto: OnePhaseSearchRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FieldsFilter: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OnePhaseSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17523,13 +18838,13 @@ func (m *FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Fields = append(m.Fields, stringValue) + m.Query = stringValue iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowList", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17539,68 +18854,33 @@ func (m *FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.AllowList = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err + if msglen < 0 { + return protohelpers.ErrInvalidLength } - if (skippy < 0) || (iNdEx+skippy) < 0 { + postIndex := iNdEx + msglen + if postIndex < 0 { return protohelpers.ErrInvalidLength } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FetchRequest) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if m.From == nil { + m.From = ×tamppb.Timestamp{} } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FetchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FetchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17610,33 +18890,111 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + if m.To == nil { + m.To = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + } + m.Offset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Offset |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Explain = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - m.Ids = append(m.Ids, stringValue) - iNdEx = postIndex - case 3: + m.WithTotal = bool(v != 0) + case 8: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) } - var v int + m.Order = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17646,17 +19004,16 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Order |= Order(b&0x7F) << shift if b < 0x80 { break } } - m.Explain = bool(v != 0) - case 4: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdsWithHints", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17666,27 +19023,29 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.IdsWithHints = append(m.IdsWithHints, &IdWithHint{}) - if err := m.IdsWithHints[len(m.IdsWithHints)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + m.OffsetId = stringValue iNdEx = postIndex - case 5: + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) } @@ -17722,26 +19081,6 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { return err } iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NoSkipMasks", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NoSkipMasks = bool(v != 0) default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -17764,7 +19103,7 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *StatusRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *OnePhaseSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17787,66 +19126,56 @@ func (m *StatusRequest) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + return fmt.Errorf("proto: OnePhaseSearchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OnePhaseSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + if msglen < 0 { + return protohelpers.ErrInvalidLength } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StatusResponse) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Header); ok { + if err := oneof.Header.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Header{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &OnePhaseSearchResponse_Header{Header: v} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OldestTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Batch", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17873,11 +19202,16 @@ func (m *StatusResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.OldestTime == nil { - m.OldestTime = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Batch); ok { + if err := oneof.Batch.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &RecordsBatch{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &OnePhaseSearchResponse_Batch{Batch: v} } iNdEx = postIndex default: @@ -17902,7 +19236,7 @@ func (m *StatusResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Header) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17925,17 +19259,17 @@ func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OnePhaseSearchRequest: wiretype end group for non-group") + return fmt.Errorf("proto: Header: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OnePhaseSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -17945,109 +19279,33 @@ func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.Query = stringValue - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - m.From = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.From |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - m.To = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.To |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) - } - m.Size = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Size |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) - } - m.Offset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Offset |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + if postIndex > l { + return io.ErrUnexpectedEOF } - var v int + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Typing", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -18057,17 +19315,82 @@ func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.Explain = bool(v != 0) - case 7: + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Typing = append(m.Typing, &Typing{}) + if err := m.Typing[len(m.Typing)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Metadata) UnmarshalVTUnsafe(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 protohelpers.ErrIntOverflow + } + 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: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) } - var v int + m.Total = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -18077,17 +19400,16 @@ func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Total |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.WithTotal = bool(v != 0) - case 8: + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - m.Order = 0 + m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -18097,14 +19419,14 @@ func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Order |= Order(b&0x7F) << shift + m.Code |= SearchErrorCode(b&0x7F) << shift if b < 0x80 { break } } - case 9: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OffsetId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -18136,11 +19458,11 @@ func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.OffsetId = stringValue + m.Errors = append(m.Errors, stringValue) iNdEx = postIndex - case 10: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18167,10 +19489,10 @@ func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.FieldsFilter == nil { - m.FieldsFilter = &FieldsFilter{} + if m.Explain == nil { + m.Explain = &ExplainEntry{} } - if err := m.FieldsFilter.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Explain.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -18196,7 +19518,7 @@ func (m *OnePhaseSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *OnePhaseSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Typing) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18219,17 +19541,17 @@ func (m *OnePhaseSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OnePhaseSearchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: Typing: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OnePhaseSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Typing: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -18239,38 +19561,33 @@ func (m *OnePhaseSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Header); ok { - if err := oneof.Header.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - v := &Header{} - if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.ResponseType = &OnePhaseSearchResponse_Header{Header: v} + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + m.Title = stringValue iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - var msglen int + m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -18280,33 +19597,11 @@ func (m *OnePhaseSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Type |= DataType(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if oneof, ok := m.ResponseType.(*OnePhaseSearchResponse_Document); ok { - if err := oneof.Document.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - v := &Document{} - if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.ResponseType = &OnePhaseSearchResponse_Document{Document: v} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -18329,7 +19624,7 @@ func (m *OnePhaseSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *Document) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *RecordsBatch) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18352,15 +19647,15 @@ func (m *Document) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Document: wiretype end group for non-group") + return fmt.Errorf("proto: RecordsBatch: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RecordsBatch: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18387,10 +19682,8 @@ func (m *Document) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Data == nil { - m.Data = &BinaryData{} - } - if err := m.Data.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.Records = append(m.Records, &Record{}) + if err := m.Records[len(m.Records)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -18416,7 +19709,7 @@ func (m *Document) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *Header) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Record) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18439,91 +19732,17 @@ func (m *Header) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Header: wiretype end group for non-group") + return fmt.Errorf("proto: Record: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Record: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - 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 protohelpers.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) - } - m.Errors = append(m.Errors, stringValue) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= SearchErrorCode(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RawData", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -18533,27 +19752,22 @@ func (m *Header) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Explain == nil { - m.Explain = &ExplainEntry{} - } - if err := m.Explain.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RawData = append(m.RawData, dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/proxy/search/one_phase_search.go b/proxy/search/one_phase_search.go index b91f4f29..8d319f15 100644 --- a/proxy/search/one_phase_search.go +++ b/proxy/search/one_phase_search.go @@ -2,24 +2,26 @@ package search import ( "context" + "encoding/binary" "errors" "fmt" "io" + "math" "github.com/alecthomas/units" "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/timestamppb" "github.com/ozontech/seq-db/pkg/storeapi" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" - "github.com/ozontech/seq-db/storage" ) func (si *Ingestor) OnePhaseSearch( ctx context.Context, sr *SearchRequest, tr *querytracer.Tracer, -) (*seq.QPR, DocsIterator, error) { +) (*seq.QPR, DocsIterator, AggsIterator, error) { searchStores := si.config.HotStores if si.config.HotReadStores != nil && len(si.config.HotReadStores.Shards) > 0 { searchStores = si.config.HotReadStores @@ -29,14 +31,14 @@ func (si *Ingestor) OnePhaseSearch( client, has := si.clients[host] if !has { - return nil, nil, fmt.Errorf("can't fetch: no client for host %s", host) + return nil, nil, nil, fmt.Errorf("can't fetch: no client for host %s", host) } fieldsFilter := tryParseFieldsFilter(string(sr.Q)) req := &storeapi.OnePhaseSearchRequest{ Query: string(sr.Q), - From: int64(sr.From), - To: int64(sr.To), + From: timestamppb.New(sr.From.Time()), + To: timestamppb.New(sr.To.Time()), Size: int64(sr.Size), Offset: int64(sr.Offset), Explain: sr.Explain, @@ -54,60 +56,125 @@ func (si *Ingestor) OnePhaseSearch( grpc.MaxCallSendMsgSize(256*int(units.MiB)), ) if err != nil { - return nil, nil, fmt.Errorf("can't fetch docs: %s", err.Error()) + return nil, nil, nil, fmt.Errorf("can't fetch docs: %s", err.Error()) } msg, err := stream.Recv() if err != nil { - return nil, nil, nil + return nil, nil, nil, nil } header := msg.GetHeader() - errs := make([]seq.ErrorSource, 0, len(header.Errors)) - for _, err := range header.Errors { + errs := make([]seq.ErrorSource, 0, len(header.Metadata.Errors)) + for _, err := range header.Metadata.Errors { errs = append(errs, seq.ErrorSource{ErrStr: err}) } qpr := &seq.QPR{ - Total: header.Total, + Total: header.Metadata.Total, Errors: errs, } - return qpr, &OnePhaseSearchIterator{stream: stream, limit: sr.Size}, nil + return qpr, &OnePhaseSearchDocsIterator{stream: stream, limit: sr.Size}, &OnePhaseSearchAggsIterator{stream: stream, limit: sr.Size}, nil } -type OnePhaseSearchIterator struct { +type OnePhaseSearchDocsIterator struct { stream storeapi.StoreApi_OnePhaseSearchClient + curBatch []*storeapi.Record + fetched int limit int } -func (it *OnePhaseSearchIterator) Next() (StreamingDoc, error) { +func (it *OnePhaseSearchDocsIterator) Next() (StreamingDoc, error) { if it.fetched >= it.limit { return StreamingDoc{}, io.EOF } - data, err := it.stream.Recv() - if errors.Is(err, io.EOF) { - return StreamingDoc{}, io.EOF - } - if err != nil { - return StreamingDoc{}, err + if len(it.curBatch) == 0 { + data, err := it.stream.Recv() + if errors.Is(err, io.EOF) { + return StreamingDoc{}, io.EOF + } + if err != nil { + return StreamingDoc{}, err + } + it.curBatch = data.GetBatch().Records } - doc := data.GetDocument() - block := storage.DocBlock(doc.Data.Data) - mid := block.GetExt1() + // TODO: get fields values from columns info + + record := it.curBatch[0] + it.curBatch = it.curBatch[1:] it.fetched++ return StreamingDoc{ ID: seq.ID{ - MID: seq.MID(mid), - RID: seq.RID(block.GetExt2()), + MID: seq.MID(binary.LittleEndian.Uint64(record.RawData[0])), + RID: seq.RID(binary.LittleEndian.Uint64(record.RawData[1])), }, - Data: block.Payload(), + Data: record.RawData[2], + }, nil +} + +type StreamingAgg struct { + Label string + Min float64 + Max float64 + Sum float64 + Total uint64 + NotExists uint64 +} + +type AggsIterator interface { + Next() (StreamingAgg, error) +} + +type OnePhaseSearchAggsIterator struct { + stream storeapi.StoreApi_OnePhaseSearchClient + + curBatch []*storeapi.Record + + fetched int + limit int +} + +func (it *OnePhaseSearchAggsIterator) Next() (StreamingAgg, error) { + if it.fetched >= it.limit { + return StreamingAgg{}, io.EOF + } + + if len(it.curBatch) == 0 { + data, err := it.stream.Recv() + if errors.Is(err, io.EOF) { + return StreamingAgg{}, io.EOF + } + if err != nil { + return StreamingAgg{}, err + } + it.curBatch = data.GetBatch().Records + } + + // TODO: get fields values from columns info + + record := it.curBatch[0] + it.curBatch = it.curBatch[1:] + + it.fetched++ + + return StreamingAgg{ + Label: string(record.RawData[0]), + Min: Float64FromBytes(record.RawData[1]), + Max: Float64FromBytes(record.RawData[2]), + Sum: Float64FromBytes(record.RawData[3]), + Total: binary.LittleEndian.Uint64(record.RawData[4]), + NotExists: binary.LittleEndian.Uint64(record.RawData[5]), }, nil } + +func Float64FromBytes(in []byte) float64 { + return math.Float64frombits(binary.LittleEndian.Uint64(in)) +} diff --git a/proxyapi/grpc_one_phase_search.go b/proxyapi/grpc_one_phase_search.go index 23b8ce49..05d309ab 100644 --- a/proxyapi/grpc_one_phase_search.go +++ b/proxyapi/grpc_one_phase_search.go @@ -3,6 +3,7 @@ package proxyapi import ( "context" "errors" + "fmt" "time" "go.opencensus.io/trace" @@ -12,13 +13,14 @@ import ( "github.com/ozontech/seq-db/consts" "github.com/ozontech/seq-db/metric" + "github.com/ozontech/seq-db/parser" "github.com/ozontech/seq-db/pkg/seqproxyapi/v1" "github.com/ozontech/seq-db/proxy/search" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" ) -func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequest) (*seqproxyapi.SearchResponse, error) { +func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequest) (*seqproxyapi.ComplexSearchResponse, error) { ctx, cancel := context.WithTimeout(ctx, g.config.SearchTimeout) defer cancel() @@ -34,30 +36,68 @@ func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequ WithTotal: req.WithTotal, Order: req.Order, } - sResp, err := g.doOnePhaseSearch(ctx, proxyReq, true) + sResp, aggsStream, err := g.doOnePhaseSearch(ctx, proxyReq, true) if err != nil { return nil, err } - if sResp.err != nil && !shouldHaveResponse(sResp.err.Code) { - return &seqproxyapi.SearchResponse{Error: sResp.err}, nil - } - resp := &seqproxyapi.SearchResponse{ - Docs: makeProtoDocsKek(sResp.docsStream), + resp := &seqproxyapi.ComplexSearchResponse{ Total: int64(sResp.qpr.Total), Error: &seqproxyapi.Error{ Code: seqproxyapi.ErrorCode_ERROR_CODE_NO, }, } + if sResp.err != nil { - resp.Error = sResp.err + if shouldHaveResponse(sResp.err.Code) { + resp.Error = sResp.err + } else { + return &seqproxyapi.ComplexSearchResponse{Error: sResp.err}, nil + } + } + + statsAggs := extractStatsPipesFromQuery(req.Query.Query) + hasAggs := len(statsAggs) > 0 + + if hasAggs { + sResp.qpr.Aggs = convertAggsStreamToAggregationResults(aggsStream) + kek := aggregationArgsFromStatsAggs(statsAggs) + allAggs := sResp.qpr.Aggregate(kek) + resp.Aggs = makeProtoAggregation(allAggs) + } else { + resp.Docs = makeProtoDocsKek(sResp.docsStream) } return resp, nil } +func convertAggsStreamToAggregationResults(aggs search.AggsIterator) []seq.AggregatableSamples { + result := make([]seq.AggregatableSamples, 0) + to := make(map[seq.AggBin]*seq.SamplesContainer) + for agg, err := aggs.Next(); err == nil; agg, err = aggs.Next() { + + tbin := seq.AggBin{ + MID: consts.DummyMID, + Token: agg.Label, + } + + to[tbin] = &seq.SamplesContainer{ + Min: agg.Min, + Max: agg.Max, + Sum: agg.Sum, + Total: int64(agg.Total), + NotExists: int64(agg.NotExists), + } + } + result = append(result, seq.AggregatableSamples{ + SamplesByBin: to, + // NotExists: int64(agg.NotExists), + }) + return result +} + func makeProtoDocsKek(docs search.DocsIterator) []*seqproxyapi.Document { - // TODO: paginate here (???) + // TODO: paginate (???) respDocs := make([]*seqproxyapi.Document, 0) for doc, err := docs.Next(); err == nil; doc, err = docs.Next() { respDocs = append(respDocs, &seqproxyapi.Document{ @@ -73,20 +113,20 @@ func (g *grpcV1) doOnePhaseSearch( ctx context.Context, req *seqproxyapi.ComplexSearchRequest, shouldFetch bool, -) (*proxySearchResponse, error) { +) (*proxySearchResponse, search.AggsIterator, error) { metric.SearchOverall.Add(1) span := trace.FromContext(ctx) defer span.End() if req.Query == nil { - return nil, status.Error(codes.InvalidArgument, "search query must be provided") + return nil, nil, status.Error(codes.InvalidArgument, "search query must be provided") } if req.Query.From == nil || req.Query.To == nil { - return nil, status.Error(codes.InvalidArgument, `search query "from" and "to" fields must be provided`) + return nil, nil, status.Error(codes.InvalidArgument, `search query "from" and "to" fields must be provided`) } if req.Offset != 0 && req.OffsetId != "" { - return nil, status.Error(codes.InvalidArgument, `only one of "offset" and "offset_id" must be provided`) + return nil, nil, status.Error(codes.InvalidArgument, `only one of "offset" and "offset_id" must be provided`) } fromTime := req.Query.From.AsTime() @@ -107,7 +147,7 @@ func (g *grpcV1) doOnePhaseSearch( rlQuery := getSearchQueryFromGRPCReqForRateLimiter(req) if !g.rateLimiter.Account(rlQuery) { - return nil, status.Error(codes.ResourceExhausted, consts.ErrRequestWasRateLimited.Error()) + return nil, nil, status.Error(codes.ResourceExhausted, consts.ErrRequestWasRateLimited.Error()) } proxyReq := &search.SearchRequest{ @@ -124,7 +164,7 @@ func (g *grpcV1) doOnePhaseSearch( } tr := querytracer.New(req.Query.Explain, "proxy/OnePhaseSearch") - qpr, docsStream, err := g.searchIngestor.OnePhaseSearch(ctx, proxyReq, tr) + qpr, docsStream, aggsStream, err := g.searchIngestor.OnePhaseSearch(ctx, proxyReq, tr) psr := &proxySearchResponse{ qpr: qpr, docsStream: docsStream, @@ -132,17 +172,17 @@ func (g *grpcV1) doOnePhaseSearch( if e, ok := parseProxyError(err); ok { psr.err = e - return psr, nil + return psr, nil, nil } if errors.Is(err, consts.ErrInvalidArgument) { - return nil, status.Error(codes.InvalidArgument, err.Error()) + return nil, nil, status.Error(codes.InvalidArgument, err.Error()) } if st, ok := status.FromError(err); ok { // could not parse a query if st.Code() == codes.InvalidArgument { - return nil, err + return nil, nil, err } } @@ -152,14 +192,70 @@ func (g *grpcV1) doOnePhaseSearch( Code: seqproxyapi.ErrorCode_ERROR_CODE_PARTIAL_RESPONSE, Message: err.Error(), } - return psr, nil + return psr, aggsStream, nil } if err = processSearchErrors(qpr, err); err != nil { metric.SearchErrors.Inc() - return nil, err + return nil, nil, err } g.tryMirrorRequest(req) - return psr, nil + return psr, aggsStream, nil +} + +func extractStatsPipesFromQuery(query string) []parser.StatsAgg { + if query == "" { + return nil + } + + seqql, err := parser.ParseSeqQL(query, nil) + if err != nil { + return nil + } + + var result []parser.StatsAgg + for _, pipe := range seqql.Pipes { + statsPipe, ok := pipe.(*parser.PipeStats) + if !ok { + continue + } + result = append(result, statsPipe.Aggs...) + } + return result +} + +func aggregationArgsFromStatsAggs(aggs []parser.StatsAgg) []seq.AggregateArgs { + args := make([]seq.AggregateArgs, len(aggs)) + for i, agg := range aggs { + args[i] = seq.AggregateArgs{ + Func: mustConvertStringToAggFunc(agg.Func), + Quantiles: agg.Quantiles, + SkipWithoutTimestamp: agg.Interval != "", + } + } + return args +} + +func mustConvertStringToAggFunc(funcName string) seq.AggFunc { + switch funcName { + case "count": + return seq.AggFuncCount + case "sum": + return seq.AggFuncSum + case "min": + return seq.AggFuncMin + case "max": + return seq.AggFuncMax + case "avg": + return seq.AggFuncAvg + case "quantile": + return seq.AggFuncQuantile + case "unique": + return seq.AggFuncUnique + case "unique_count": + return seq.AggFuncUniqueCount + default: + panic(fmt.Errorf("unknown aggregation function: %s", funcName)) + } } diff --git a/proxyapi/grpc_v1.go b/proxyapi/grpc_v1.go index 65cf91e0..2299ba06 100644 --- a/proxyapi/grpc_v1.go +++ b/proxyapi/grpc_v1.go @@ -38,7 +38,7 @@ type SearchIngestor interface { CancelAsyncSearch(ctx context.Context, id string) error DeleteAsyncSearch(ctx context.Context, id string) error GetAsyncSearchesList(context.Context, search.GetAsyncSearchesListRequest) ([]*search.AsyncSearchesListItem, error) - OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, error) + OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, search.AggsIterator, error) } type MappingProvider interface { diff --git a/proxyapi/mock/grpc_v1.go b/proxyapi/mock/grpc_v1.go index 12e3f7ed..30c83fcc 100644 --- a/proxyapi/mock/grpc_v1.go +++ b/proxyapi/mock/grpc_v1.go @@ -116,13 +116,14 @@ func (mr *MockSearchIngestorMockRecorder) GetAsyncSearchesList(arg0, arg1 interf } // OnePhaseSearch mocks base method. -func (m *MockSearchIngestor) OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, error) { +func (m *MockSearchIngestor) OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, search.AggsIterator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OnePhaseSearch", ctx, sr, tr) ret0, _ := ret[0].(*seq.QPR) ret1, _ := ret[1].(search.DocsIterator) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 + ret2, _ := ret[2].(search.AggsIterator) + ret3, _ := ret[3].(error) + return ret0, ret1, ret2, ret3 } // OnePhaseSearch indicates an expected call of OnePhaseSearch. diff --git a/storeapi/grpc_one_phase_search.go b/storeapi/grpc_one_phase_search.go index c3538071..ca7d6229 100644 --- a/storeapi/grpc_one_phase_search.go +++ b/storeapi/grpc_one_phase_search.go @@ -2,15 +2,20 @@ package storeapi import ( "context" + "encoding/binary" "fmt" + "math" + "time" "go.opencensus.io/trace" "go.uber.org/zap" "github.com/ozontech/seq-db/logger" + "github.com/ozontech/seq-db/parser" "github.com/ozontech/seq-db/pkg/storeapi" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" + "github.com/ozontech/seq-db/storage" "github.com/ozontech/seq-db/tracing" "github.com/ozontech/seq-db/util" ) @@ -24,8 +29,8 @@ func (g *GrpcV1) OnePhaseSearch( if span.IsRecordingEvents() { span.AddAttributes(trace.StringAttribute("request", req.Query)) - span.AddAttributes(trace.Int64Attribute("from", req.From)) - span.AddAttributes(trace.Int64Attribute("to", req.From)) + span.AddAttributes(trace.StringAttribute("from", req.From.AsTime().Format(time.RFC3339Nano))) + span.AddAttributes(trace.StringAttribute("to", req.To.AsTime().Format(time.RFC3339Nano))) span.AddAttributes(trace.Int64Attribute("size", req.Size)) span.AddAttributes(trace.Int64Attribute("offset", req.Offset)) span.AddAttributes(trace.StringAttribute("offset_id", req.OffsetId)) @@ -46,11 +51,26 @@ func (g *GrpcV1) doOnePhaseSearch( req *storeapi.OnePhaseSearchRequest, stream storeapi.StoreApi_OnePhaseSearchServer, ) error { - tr := querytracer.New(req.Explain, "store/Search") + statsAggs := extractStatsPipesFromQuery(req.Query) + hasAggs := len(statsAggs) > 0 + + if hasAggs { + return g.doOnePhaseSearchWithAggs(ctx, req, stream, statsAggs) + } + + return g.doOnePhaseSearchDocs(ctx, req, stream) +} + +func (g *GrpcV1) doOnePhaseSearchDocs( + ctx context.Context, + req *storeapi.OnePhaseSearchRequest, + stream storeapi.StoreApi_OnePhaseSearchServer, +) error { + tr := querytracer.New(req.Explain, "store/OnePhaseSearchDocs") data, err := g.doSearch(ctx, &storeapi.SearchRequest{ Query: req.Query, - From: req.From, - To: req.To, + From: int64(seq.TimeToMID(req.From.AsTime())), + To: int64(seq.TimeToMID(req.To.AsTime())), Size: req.Size, Offset: req.Offset, Explain: req.Explain, @@ -70,10 +90,18 @@ func (g *GrpcV1) doOnePhaseSearch( err = stream.Send(&storeapi.OnePhaseSearchResponse{ ResponseType: &storeapi.OnePhaseSearchResponse_Header{ Header: &storeapi.Header{ - Total: data.Total, - Errors: data.Errors, - Code: data.Code, - Explain: data.Explain, + Metadata: &storeapi.Metadata{ + Total: data.Total, + Code: data.Code, + Errors: data.Errors, + Explain: data.Explain, + }, + Typing: []*storeapi.Typing{ + // TODO: conditional typing + {Title: "mid", Type: storeapi.DataType_UINT64}, + {Title: "rid", Type: storeapi.DataType_UINT64}, + {Title: "data", Type: storeapi.DataType_RAW_DOCUMENT}, + }, }, }, }) @@ -94,10 +122,21 @@ func (g *GrpcV1) doOnePhaseSearch( } send := func(block []byte) error { + // TODO: get rid of hardcode + docBlock := storage.DocBlock(block) return stream.Send(&storeapi.OnePhaseSearchResponse{ - ResponseType: &storeapi.OnePhaseSearchResponse_Document{ - Document: &storeapi.Document{ - Data: &storeapi.BinaryData{Data: block}, + ResponseType: &storeapi.OnePhaseSearchResponse_Batch{ + Batch: &storeapi.RecordsBatch{ + // TODO: batch + Records: []*storeapi.Record{ + { + RawData: [][]byte{ + Uint64ToBytes(docBlock.GetExt1()), + Uint64ToBytes(docBlock.GetExt2()), + docBlock.Payload(), + }, + }, + }, }, }, }) @@ -109,3 +148,183 @@ func (g *GrpcV1) doOnePhaseSearch( return nil } + +// TODO: bytes pool (???), varint (???) +func Uint64ToBytes(val uint64) []byte { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, val) + return b +} + +func Float64ToBytes(val float64) []byte { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, math.Float64bits(val)) + return b +} + +func (g *GrpcV1) doOnePhaseSearchWithAggs( + ctx context.Context, + req *storeapi.OnePhaseSearchRequest, + stream storeapi.StoreApi_OnePhaseSearchServer, + statsAggs []parser.StatsAgg, +) error { + tr := querytracer.New(req.Explain, "store/OnePhaseSearchWithAggs") + + aggQ, err := convertStatsAggsToStoreApiAgg(statsAggs) + if err != nil { + return fmt.Errorf("failed to convert stats aggs: %w", err) + } + + data, err := g.doSearch(ctx, &storeapi.SearchRequest{ + Query: req.Query, + From: int64(seq.TimeToMID(req.From.AsTime())), + To: int64(seq.TimeToMID(req.To.AsTime())), + Size: req.Size, + Offset: req.Offset, + Explain: req.Explain, + WithTotal: req.WithTotal, + Order: req.Order, + OffsetId: req.OffsetId, + Aggs: aggQ, + }, tr) + if err != nil { + return fmt.Errorf("search error: %w", err) + } + tr.Done() + + err = stream.Send(&storeapi.OnePhaseSearchResponse{ + ResponseType: &storeapi.OnePhaseSearchResponse_Header{ + Header: &storeapi.Header{ + Metadata: &storeapi.Metadata{ + Total: data.Total, + Code: data.Code, + Errors: data.Errors, + Explain: data.Explain, + }, + Typing: []*storeapi.Typing{ + // TODO: conditional typing + {Title: "token", Type: storeapi.DataType_STRING}, + {Title: "min", Type: storeapi.DataType_FLOAT64}, + {Title: "max", Type: storeapi.DataType_FLOAT64}, + {Title: "sum", Type: storeapi.DataType_FLOAT64}, + {Title: "total", Type: storeapi.DataType_UINT64}, + {Title: "not_exists", Type: storeapi.DataType_UINT64}, + }, + }, + }, + }) + if err != nil { + if util.IsCancelled(ctx) { + logger.Info("one phase search request is canceled") + return nil + } + return fmt.Errorf("error sending aggs: %w", err) + } + + for _, agg := range data.Aggs { + for _, bin := range agg.Timeseries { + err := stream.Send(&storeapi.OnePhaseSearchResponse{ + ResponseType: &storeapi.OnePhaseSearchResponse_Batch{ + Batch: &storeapi.RecordsBatch{ + // TODO: batch + Records: []*storeapi.Record{ + { + RawData: [][]byte{ + []byte(bin.Label), + Float64ToBytes(bin.Hist.Min), + Float64ToBytes(bin.Hist.Max), + Float64ToBytes(bin.Hist.Sum), + Uint64ToBytes(uint64(bin.Hist.Total)), + Uint64ToBytes(uint64(bin.Hist.NotExists)), + }, + }, + }, + }, + }, + }) + if err != nil { + if util.IsCancelled(ctx) { + logger.Info("one phase search request is canceled") + return nil + } + return fmt.Errorf("error sending aggs: %w", err) + } + } + } + + return nil +} + +func extractStatsPipesFromQuery(query string) []parser.StatsAgg { + if query == "" { + return nil + } + + seqql, err := parser.ParseSeqQL(query, nil) + if err != nil { + return nil + } + + var result []parser.StatsAgg + for _, pipe := range seqql.Pipes { + statsPipe, ok := pipe.(*parser.PipeStats) + if !ok { + continue + } + result = append(result, statsPipe.Aggs...) + } + return result +} + +func convertStatsAggsToStoreApiAgg(statsAggs []parser.StatsAgg) ([]*storeapi.AggQuery, error) { + result := make([]*storeapi.AggQuery, 0, len(statsAggs)) + + for _, agg := range statsAggs { + aggFunc, err := convertStringToAggFunc(agg.Func) + if err != nil { + return nil, err + } + + procAgg := &storeapi.AggQuery{ + Field: agg.Field, + GroupBy: agg.GroupBy, + Func: aggFunc, + Quantiles: agg.Quantiles, + } + + if agg.Interval != "" { + interval, err := util.ParseDuration(agg.Interval) + if err != nil { + return nil, fmt.Errorf("failed to parse interval: %w", err) + } + procAgg.Interval = interval.Nanoseconds() + } + + result = append(result, procAgg) + } + + return result, nil +} + +func convertStringToAggFunc(funcName string) (storeapi.AggFunc, error) { + switch funcName { + case "count": + return storeapi.AggFunc_AGG_FUNC_COUNT, nil + case "sum": + return storeapi.AggFunc_AGG_FUNC_SUM, nil + case "min": + return storeapi.AggFunc_AGG_FUNC_MIN, nil + case "max": + return storeapi.AggFunc_AGG_FUNC_MAX, nil + case "avg": + return storeapi.AggFunc_AGG_FUNC_AVG, nil + case "quantile": + return storeapi.AggFunc_AGG_FUNC_QUANTILE, nil + case "unique": + return storeapi.AggFunc_AGG_FUNC_UNIQUE, nil + case "unique_count": + return storeapi.AggFunc_AGG_FUNC_UNIQUE_COUNT, nil + default: + return 0, fmt.Errorf("unknown aggregation function: %s", funcName) + } +} From 6e9675264bcd4242bb9829afaa3247f99d40e9c8 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Tue, 28 Apr 2026 16:40:41 +0500 Subject: [PATCH 04/14] feat(query engine): init --- query/data_source.go | 22 ++++++ query/exec/aggregator.go | 5 ++ query/exec/executor_combination_test.go | 36 ++++++++++ query/exec/filter.go | 92 +++++++++++++++++++++++++ query/exec/filter_test.go | 67 ++++++++++++++++++ query/exec/limiter.go | 35 ++++++++++ query/exec/limiter_test.go | 72 +++++++++++++++++++ query/exec/projector.go | 5 ++ query/producer.go | 10 +++ query/record.go | 82 ++++++++++++++++++++++ 10 files changed, 426 insertions(+) create mode 100644 query/data_source.go create mode 100644 query/exec/aggregator.go create mode 100644 query/exec/executor_combination_test.go create mode 100644 query/exec/filter.go create mode 100644 query/exec/filter_test.go create mode 100644 query/exec/limiter.go create mode 100644 query/exec/limiter_test.go create mode 100644 query/exec/projector.go create mode 100644 query/producer.go create mode 100644 query/record.go diff --git a/query/data_source.go b/query/data_source.go new file mode 100644 index 00000000..bd515813 --- /dev/null +++ b/query/data_source.go @@ -0,0 +1,22 @@ +package query + +import "github.com/ozontech/seq-db/frac" + +type DataSource interface { + Scan() (*Record, bool) +} + +type FractionDataSource struct { + frac frac.Fraction + // TODO: +} + +func NewFractionDatasource() *FractionDataSource { + // TODO: + return &FractionDataSource{} +} + +func (s *FractionDataSource) Next() (*Record, bool) { + // TODO: + return nil, false +} diff --git a/query/exec/aggregator.go b/query/exec/aggregator.go new file mode 100644 index 00000000..e03f2b6c --- /dev/null +++ b/query/exec/aggregator.go @@ -0,0 +1,5 @@ +package exec + +type Aggregator struct { + // TODO: aggregate +} diff --git a/query/exec/executor_combination_test.go b/query/exec/executor_combination_test.go new file mode 100644 index 00000000..7832c314 --- /dev/null +++ b/query/exec/executor_combination_test.go @@ -0,0 +1,36 @@ +package exec + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" +) + +func TestExecutorsCombination(t *testing.T) { + inputData := makeTestInputRecords(10) + producer := testProducer{data: inputData} + + const ( + cond = 5 + limit = 2 + ) + + wantData := make([]*query.Record, 0) + for _, r := range inputData { + if r.Vals[0].Decoded().(uint32) > uint32(cond) { + wantData = append(wantData, r) + } + } + + filter := NewFilter(&producer, 0, NewGt[uint32](cond)) + limiter := NewLimiter(filter, limit) + + outputData := make([]*query.Record, 0) + for r, has := limiter.Next(); has; r, has = limiter.Next() { + outputData = append(outputData, r) + } + + assert.Equal(t, wantData[:limit], outputData) +} diff --git a/query/exec/filter.go b/query/exec/filter.go new file mode 100644 index 00000000..a337c4fe --- /dev/null +++ b/query/exec/filter.go @@ -0,0 +1,92 @@ +package exec + +import ( + "cmp" + + "github.com/ozontech/seq-db/query" +) + +type FilterExpr[T any] interface { + Eval(T) bool +} + +type Filter[T any] struct { + input query.RecordProducer + + colIdx int + expr FilterExpr[T] +} + +func NewFilter[T any]( + input query.RecordProducer, + colIdx int, + expr FilterExpr[T], +) *Filter[T] { + return &Filter[T]{ + input: input, + expr: expr, + } +} + +func (f *Filter[T]) Next() (*query.Record, bool) { + for { + r, has := f.input.Next() + if !has { + return nil, false + } + + // TODO: some comparisons don't need decoded data + passes := f.expr.Eval(r.Vals[f.colIdx].Decoded().(T)) + if passes { + return r, true + } + } +} + +type Eq[T comparable] struct { + pred T +} + +func NewEq[T comparable]( + pred T, +) *Eq[T] { + return &Eq[T]{ + pred: pred, + } +} + +func (e *Eq[T]) Eval(other T) bool { + return other == e.pred +} + +type Gt[T cmp.Ordered] struct { + pred T +} + +func NewGt[T cmp.Ordered]( + pred T, +) *Gt[T] { + return &Gt[T]{ + pred: pred, + } +} + +func (e *Gt[T]) Eval(other T) bool { + return other > e.pred +} + +type Lt[T cmp.Ordered] struct { + pred T +} + +func NewLt[T cmp.Ordered]( + pred T, +) *Lt[T] { + return &Lt[T]{ + pred: pred, + } +} + +func (e *Lt[T]) Eval(other T) bool { + return other < e.pred +} diff --git a/query/exec/filter_test.go b/query/exec/filter_test.go new file mode 100644 index 00000000..a5f9292b --- /dev/null +++ b/query/exec/filter_test.go @@ -0,0 +1,67 @@ +package exec + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" +) + +func TestFilterEq(t *testing.T) { + const cond = 5 + + filterExpr := NewEq[uint32](cond) + + testFilter(t, 0, filterExpr, func(r *query.Record) bool { + return r.Vals[0].Decoded().(uint32) == uint32(cond) + }) +} + +func TestFilterGt(t *testing.T) { + const cond = 5 + + filterExpr := NewGt[uint32](cond) + + testFilter(t, 0, filterExpr, func(r *query.Record) bool { + return r.Vals[0].Decoded().(uint32) > uint32(cond) + }) +} + +func TestFilterLt(t *testing.T) { + const cond = 5 + + filterExpr := NewLt[uint32](cond) + + testFilter(t, 0, filterExpr, func(r *query.Record) bool { + return r.Vals[0].Decoded().(uint32) < uint32(cond) + }) +} + +func testFilter( + t *testing.T, + colIdx int, + filterExpr FilterExpr[uint32], + wantFilterFunc func(*query.Record) bool, +) { + t.Helper() + + inputData := makeTestInputRecords(10) + input := testProducer{data: inputData} + + wantData := make([]*query.Record, 0) + for _, r := range inputData { + if wantFilterFunc(r) { + wantData = append(wantData, r) + } + } + + filter := NewFilter(&input, colIdx, filterExpr) + + outputData := make([]*query.Record, 0) + for r, has := filter.Next(); has; r, has = filter.Next() { + outputData = append(outputData, r) + } + + assert.Equal(t, wantData, outputData) +} diff --git a/query/exec/limiter.go b/query/exec/limiter.go new file mode 100644 index 00000000..134c6d7c --- /dev/null +++ b/query/exec/limiter.go @@ -0,0 +1,35 @@ +package exec + +import "github.com/ozontech/seq-db/query" + +type Limiter struct { + input query.RecordProducer + + limit uint32 + produced uint32 +} + +func NewLimiter( + input query.RecordProducer, + limit uint32, +) *Limiter { + return &Limiter{ + input: input, + limit: limit, + } +} + +func (l *Limiter) Next() (*query.Record, bool) { + if l.produced >= l.limit { + return nil, false + } + + r, has := l.input.Next() + if !has { + return nil, false + } + + l.produced++ + + return r, true +} diff --git a/query/exec/limiter_test.go b/query/exec/limiter_test.go new file mode 100644 index 00000000..f108ccae --- /dev/null +++ b/query/exec/limiter_test.go @@ -0,0 +1,72 @@ +package exec + +import ( + "encoding/binary" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" +) + +func TestLimiterLessThanInputLen(t *testing.T) { + const limit = 5 + testLimiter(t, limit) +} + +func TestLimiterGreaterThanInputLen(t *testing.T) { + const limit = 50 + testLimiter(t, limit) +} + +func testLimiter(t *testing.T, limit uint32) { + t.Helper() + + inputData := makeTestInputRecords(10) + input := testProducer{data: inputData} + + limiter := NewLimiter(&input, limit) + + outputData := make([]*query.Record, 0) + for r, has := limiter.Next(); has; r, has = limiter.Next() { + outputData = append(outputData, r) + } + + assert.Equal(t, inputData[:min(len(inputData), int(limit))], outputData) +} + +type testProducer struct { + data []*query.Record + cur int +} + +func (p *testProducer) Next() (*query.Record, bool) { + if p.cur >= len(p.data) { + return nil, false + } + + r := p.data[p.cur] + p.cur++ + + return r, true +} + +func makeTestInputRecords(count int) []*query.Record { + out := make([]*query.Record, 0, count) + + for i := range count { + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeUint32, Uint32ToBytes(uint32(i))), + }, + }) + } + + return out +} + +func Uint32ToBytes(val uint32) []byte { + b := make([]byte, 8) + binary.LittleEndian.PutUint32(b, val) + return b +} diff --git a/query/exec/projector.go b/query/exec/projector.go new file mode 100644 index 00000000..092189d6 --- /dev/null +++ b/query/exec/projector.go @@ -0,0 +1,5 @@ +package exec + +type Projection struct { + // TODO: project (now it's fields filter) +} diff --git a/query/producer.go b/query/producer.go new file mode 100644 index 00000000..39bab6d7 --- /dev/null +++ b/query/producer.go @@ -0,0 +1,10 @@ +package query + +type RecordProducer interface { + // TODO: Next() (*Record, metadata) // где в мете ошибка + какая-нибудь дополнительная инфа + Next() (*Record, bool) // TODO: record as interface (???) +} + +type BatchedRecordProducer interface { + NextBatch() ([]*Record, bool) +} diff --git a/query/record.go b/query/record.go new file mode 100644 index 00000000..4d0fbeb5 --- /dev/null +++ b/query/record.go @@ -0,0 +1,82 @@ +package query + +import ( + "encoding/binary" + "fmt" +) + +type RecordType byte + +// TODO: do we need it? only AggState? +const ( + RecordTypeDocument RecordType = iota + RecordTypeAggregation +) + +// executors make use of val's index, executor's parameters has colIdx field +type Record struct { + Vals []*RecordVals +} + +func NewRecord(vals []*RecordVals) *Record { + return &Record{ + Vals: vals, + } +} + +type DataType byte + +const ( + DataTypeBytes DataType = iota + DataTypeDocument + DataTypeString + DataTypeUint32 + DataTypeUint64 + DataTypeInt32 + DataTypeInt64 + DataTypeFloat64 + // TODO: the rest of types +) + +// TODO: executors make use of val's index. the plan knows which executors use which col indexes +type RecordVals struct { + Type DataType + + // for lazy decoding + rawData []byte // raw data + + // TODO: which type: + // 1 - any + type switch/assert + // 2 - interface with Eval() method, (like Datum in cockroach) + decoded any +} + +func NewRecordVals(dataType DataType, rawData []byte) *RecordVals { + return &RecordVals{ + Type: dataType, + rawData: rawData, + } +} + +func (rv *RecordVals) Decoded() any { + if rv.decoded == nil { + rv.ensureDecoded() + } + return rv.decoded +} + +func (rv *RecordVals) ensureDecoded() { + // TODO: all types + switch rv.Type { + case DataTypeBytes: + rv.decoded = rv.rawData + case DataTypeString: + rv.decoded = string(rv.rawData) + case DataTypeUint32: + rv.decoded = binary.LittleEndian.Uint32(rv.rawData) + case DataTypeUint64: + rv.decoded = binary.LittleEndian.Uint64(rv.rawData) + default: + panic(fmt.Errorf("unknown data type")) // TODO: ??? + } +} From 12f6ac0f42b8cc39e9d80ca76992a173cb8b1605 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Mon, 4 May 2026 17:22:28 +0500 Subject: [PATCH 05/14] feat(query engine): init data source --- query/data_source.go | 22 ------ query/exec/data_source.go | 83 +++++++++++++++++++++ query/exec/data_source_test.go | 131 +++++++++++++++++++++++++++++++++ query/exec/filter.go | 2 + query/producer.go | 3 +- query/record.go | 18 +++-- 6 files changed, 229 insertions(+), 30 deletions(-) delete mode 100644 query/data_source.go create mode 100644 query/exec/data_source.go create mode 100644 query/exec/data_source_test.go diff --git a/query/data_source.go b/query/data_source.go deleted file mode 100644 index bd515813..00000000 --- a/query/data_source.go +++ /dev/null @@ -1,22 +0,0 @@ -package query - -import "github.com/ozontech/seq-db/frac" - -type DataSource interface { - Scan() (*Record, bool) -} - -type FractionDataSource struct { - frac frac.Fraction - // TODO: -} - -func NewFractionDatasource() *FractionDataSource { - // TODO: - return &FractionDataSource{} -} - -func (s *FractionDataSource) Next() (*Record, bool) { - // TODO: - return nil, false -} diff --git a/query/exec/data_source.go b/query/exec/data_source.go new file mode 100644 index 00000000..c9662127 --- /dev/null +++ b/query/exec/data_source.go @@ -0,0 +1,83 @@ +package exec + +import ( + "context" + "encoding/binary" + + "github.com/ozontech/seq-db/frac" + "github.com/ozontech/seq-db/frac/processor" + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/seq" +) + +type FractionDataSource struct { + ctx context.Context + + frac frac.Fraction + searchParams processor.SearchParams + + qpr *seq.QPR + curIdIdx int +} + +func NewFractionDatasource( + ctx context.Context, + fraction frac.Fraction, + searchParams processor.SearchParams, +) *FractionDataSource { + return &FractionDataSource{ + ctx: ctx, + frac: fraction, + searchParams: searchParams, + } +} + +func (s *FractionDataSource) Next() (*query.Record, bool) { + if s.qpr == nil { + s.scan() + } + + if s.curIdIdx >= len(s.qpr.IDs) { + return nil, false + } + + curId := s.qpr.IDs[s.curIdIdx] + fetched, err := s.frac.Fetch(s.Ctx(), []seq.ID{curId.ID}) // TODO: fetch all ids in single request + if err != nil { + panic(err) // TODO: error handling + } + + s.curIdIdx++ + return makeDocumentRecord(curId.ID, fetched[0]), true +} + +func (s *FractionDataSource) Ctx() context.Context { + if s.ctx == nil { + return context.Background() + } + return s.ctx +} + +func (s *FractionDataSource) scan() { + qpr, err := s.frac.Search(s.Ctx(), s.searchParams) + if err != nil { + panic(err) // TODO: error handling + } + s.qpr = qpr +} + +func makeDocumentRecord(id seq.ID, payload []byte) *query.Record { + return &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeUint64, Uint64ToBytes(uint64(id.MID))), + query.NewRecordVals(query.DataTypeUint64, Uint64ToBytes(uint64(id.RID))), + query.NewRecordVals(query.DataTypeDocument, payload), + }, + } +} + +func Uint64ToBytes(val uint64) []byte { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, val) + return b +} diff --git a/query/exec/data_source_test.go b/query/exec/data_source_test.go new file mode 100644 index 00000000..44b40c3a --- /dev/null +++ b/query/exec/data_source_test.go @@ -0,0 +1,131 @@ +package exec + +import ( + "math" + "path/filepath" + "slices" + "sync" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/ozontech/seq-db/cache" + "github.com/ozontech/seq-db/frac" + "github.com/ozontech/seq-db/frac/processor" + "github.com/ozontech/seq-db/indexer" + "github.com/ozontech/seq-db/node" + "github.com/ozontech/seq-db/parser" + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/seq" + "github.com/ozontech/seq-db/storage" + "github.com/ozontech/seq-db/tokenizer" +) + +func TestFractionDataSource(t *testing.T) { + ctx := t.Context() + + mapping := seq.Mapping{ + "level": seq.NewSingleType(seq.TokenizerTypeKeyword, "", 0), + "service": seq.NewSingleType(seq.TokenizerTypeKeyword, "", 0), + } + + docs := []string{ + `{"timestamp":"2000-01-01T13:00:00.000Z","service":"service1", "level":3}`, + `{"timestamp":"2000-01-01T13:00:00.001Z","service":"service1", "level":5}`, + `{"timestamp":"2000-01-01T13:00:00.002Z","service":"service2", "level":3}`, + `{"timestamp":"2000-01-01T13:00:00.003Z","service":"service2", "level":3}`, + `{"timestamp":"2000-01-01T13:00:00.004Z","service":"service3", "level":3}`, + `{"timestamp":"2000-01-01T13:00:00.005Z","service":"service3", "level":3}`, + `{"timestamp":"2000-01-01T13:00:00.006Z","service":"service4", "level":3}`, + `{"timestamp":"2000-01-01T13:00:00.007Z","service":"service4", "level":5}`, + `{"timestamp":"2000-01-01T13:00:00.008Z","service":"service5", "level":3}`, + `{"timestamp":"2000-01-01T13:00:00.009Z","service":"service5", "level":3}`, + } + fraction := setupFraction(t, mapping, docs) + + queryString := "level:in(3, 5)" + + // TODO: make search params inside FractionDataSource (???) + queryAst, err := parser.ParseSeqQL(queryString, mapping) + require.NoError(t, err, "failed to parse query: %s", queryString) + params := processor.SearchParams{ + AST: queryAst.Root, + From: seq.MID(0), + To: seq.MID(math.MaxUint64), + Limit: math.MaxInt32, + } + + dataSource := NewFractionDatasource(ctx, fraction, params) + + // test combination with executor + const limit = 5 + limiter := NewLimiter(dataSource, limit) + + outputData := make([]*query.Record, 0) + for r, has := limiter.Next(); has; r, has = limiter.Next() { + outputData = append(outputData, r) + } + + for i := range limit { + // compare only rawData val because ids are not known in advance + assert.Equal(t, []byte(docs[len(docs)-i-1]), outputData[i].Vals[2].RawData()) + } +} + +// TODO: cleanup +func setupFraction(t *testing.T, mapping seq.Mapping, bulks ...[]string) frac.Fraction { + t.Helper() + + tmpDir := t.TempDir() + activeIndexer, _ := frac.NewActiveIndexer(4, 10) + baseName := filepath.Join(tmpDir, "test_fraction") + active := frac.NewActive( + baseName, + activeIndexer, + storage.NewReadLimiter(1, nil), + cache.NewCache[[]byte](nil, nil), + cache.NewCache[[]byte](nil, nil), + &frac.Config{}, + testSkipMaskProvider{}, + ) + tokenizers := map[seq.TokenizerType]tokenizer.Tokenizer{ + seq.TokenizerTypeKeyword: tokenizer.NewKeywordTokenizer(20, false, true), + } + + var wg sync.WaitGroup + for _, docs := range bulks { + docsCopy := slices.Clone(docs) + idx := 0 + readNext := func() ([]byte, error) { + if idx >= len(docsCopy) { + return nil, nil + } + d := []byte(docsCopy[idx]) + idx++ + return d, nil + } + + proc := indexer.NewProcessor(mapping, tokenizers, 0, 0, 0) + compressor := indexer.GetDocsMetasCompressor(3, 3) + _, binaryDocs, binaryMeta, err := proc.ProcessBulk(time.Now(), nil, nil, readNext) + require.NoError(t, err, "processing bulk failed") + + compressor.CompressDocsAndMetas(binaryDocs, binaryMeta) + docsBlock, metasBlock := compressor.DocsMetas() + + wg.Add(1) + err = active.Append(docsBlock, metasBlock, &wg) + require.NoError(t, err, "append to active failed") + } + wg.Wait() + return active +} + +type testSkipMaskProvider struct{} + +func (testSkipMaskProvider) GetIDsIteratorByFrac(fracName string, minLID, maxLID uint32, reverse bool) (node.Node, bool, error) { + return node.NewStatic([]uint32{}, false), false, nil +} +func (testSkipMaskProvider) RemoveFrac(_ string) {} diff --git a/query/exec/filter.go b/query/exec/filter.go index a337c4fe..ff44b281 100644 --- a/query/exec/filter.go +++ b/query/exec/filter.go @@ -7,6 +7,8 @@ import ( ) type FilterExpr[T any] interface { + // TODO: maybe we need to pass Record or RecordVals here + // TODO: filter for json data (to filter unindexed fields) Eval(T) bool } diff --git a/query/producer.go b/query/producer.go index 39bab6d7..e5407bc7 100644 --- a/query/producer.go +++ b/query/producer.go @@ -1,8 +1,9 @@ package query type RecordProducer interface { - // TODO: Next() (*Record, metadata) // где в мете ошибка + какая-нибудь дополнительная инфа + // TODO: Next() (*Record, metadata) // meta has error plus some additional info Next() (*Record, bool) // TODO: record as interface (???) + // TODO: we need a method to release all the resources down the producer call stack } type BatchedRecordProducer interface { diff --git a/query/record.go b/query/record.go index 4d0fbeb5..b1925ee6 100644 --- a/query/record.go +++ b/query/record.go @@ -5,13 +5,13 @@ import ( "fmt" ) -type RecordType byte +// type RecordType byte -// TODO: do we need it? only AggState? -const ( - RecordTypeDocument RecordType = iota - RecordTypeAggregation -) +// // TODO: do we need it? only AggState? +// const ( +// RecordTypeDocument RecordType = iota +// RecordTypeAggregation +// ) // executors make use of val's index, executor's parameters has colIdx field type Record struct { @@ -58,6 +58,10 @@ func NewRecordVals(dataType DataType, rawData []byte) *RecordVals { } } +func (rv *RecordVals) RawData() []byte { + return rv.rawData +} + func (rv *RecordVals) Decoded() any { if rv.decoded == nil { rv.ensureDecoded() @@ -77,6 +81,6 @@ func (rv *RecordVals) ensureDecoded() { case DataTypeUint64: rv.decoded = binary.LittleEndian.Uint64(rv.rawData) default: - panic(fmt.Errorf("unknown data type")) // TODO: ??? + panic(fmt.Errorf("unknown data type")) // TODO: error handling } } From 7af16748043d828b6bbcf7ea5e4b970a2d2c9b67 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Thu, 7 May 2026 18:56:32 +0500 Subject: [PATCH 06/14] feat(query engine): json filter --- query/exec/filter.go | 27 ++++++++++++++++++++++++--- query/exec/filter_test.go | 19 +++++++++++++++++-- query/exec/limiter_test.go | 2 ++ query/record.go | 20 ++++++++++++-------- 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/query/exec/filter.go b/query/exec/filter.go index ff44b281..99265df9 100644 --- a/query/exec/filter.go +++ b/query/exec/filter.go @@ -3,12 +3,12 @@ package exec import ( "cmp" + insaneJSON "github.com/ozontech/insane-json" "github.com/ozontech/seq-db/query" ) type FilterExpr[T any] interface { // TODO: maybe we need to pass Record or RecordVals here - // TODO: filter for json data (to filter unindexed fields) Eval(T) bool } @@ -25,8 +25,9 @@ func NewFilter[T any]( expr FilterExpr[T], ) *Filter[T] { return &Filter[T]{ - input: input, - expr: expr, + input: input, + colIdx: colIdx, + expr: expr, } } @@ -92,3 +93,23 @@ func NewLt[T cmp.Ordered]( func (e *Lt[T]) Eval(other T) bool { return other < e.pred } + +type DocFilter struct { + field string + filter FilterExpr[string] // TODO: all types (???) +} + +func NewDocFilter( + field string, + filter FilterExpr[string], +) *DocFilter { + return &DocFilter{ + field: field, + filter: filter, + } +} + +func (e *DocFilter) Eval(root *insaneJSON.Root) bool { + field := root.Dig(e.field) + return e.filter.Eval(field.AsString()) +} diff --git a/query/exec/filter_test.go b/query/exec/filter_test.go index a5f9292b..07867782 100644 --- a/query/exec/filter_test.go +++ b/query/exec/filter_test.go @@ -5,6 +5,7 @@ import ( "github.com/stretchr/testify/assert" + insaneJSON "github.com/ozontech/insane-json" "github.com/ozontech/seq-db/query" ) @@ -38,10 +39,24 @@ func TestFilterLt(t *testing.T) { }) } -func testFilter( +func TestDocumentFilter(t *testing.T) { + const ( + field = "service" + cond = "service-5" + ) + + filterExpr := NewDocFilter(field, NewEq[string](cond)) + + testFilter(t, 1, filterExpr, func(r *query.Record) bool { + field := r.Vals[1].Decoded().(*insaneJSON.Root).Dig(field) + return field.AsString() == cond + }) +} + +func testFilter[T any]( t *testing.T, colIdx int, - filterExpr FilterExpr[uint32], + filterExpr FilterExpr[T], wantFilterFunc func(*query.Record) bool, ) { t.Helper() diff --git a/query/exec/limiter_test.go b/query/exec/limiter_test.go index f108ccae..b93d9c70 100644 --- a/query/exec/limiter_test.go +++ b/query/exec/limiter_test.go @@ -2,6 +2,7 @@ package exec import ( "encoding/binary" + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -58,6 +59,7 @@ func makeTestInputRecords(count int) []*query.Record { out = append(out, &query.Record{ Vals: []*query.RecordVals{ query.NewRecordVals(query.DataTypeUint32, Uint32ToBytes(uint32(i))), + query.NewRecordVals(query.DataTypeDocument, fmt.Appendf([]byte{}, `{"service":"service-%d"}`, i)), }, }) } diff --git a/query/record.go b/query/record.go index b1925ee6..c057b37d 100644 --- a/query/record.go +++ b/query/record.go @@ -3,15 +3,9 @@ package query import ( "encoding/binary" "fmt" -) - -// type RecordType byte -// // TODO: do we need it? only AggState? -// const ( -// RecordTypeDocument RecordType = iota -// RecordTypeAggregation -// ) + insaneJSON "github.com/ozontech/insane-json" +) // executors make use of val's index, executor's parameters has colIdx field type Record struct { @@ -74,6 +68,16 @@ func (rv *RecordVals) ensureDecoded() { switch rv.Type { case DataTypeBytes: rv.decoded = rv.rawData + case DataTypeDocument: + root := insaneJSON.Spawn() // TODO: release root (???) + err := root.DecodeBytes(rv.rawData) + if err != nil { + panic(fmt.Errorf("error decoding document: %w", err)) // TODO: error handling + } + if !root.IsObject() { + panic(fmt.Errorf("document is not an object: %s", rv.rawData)) // TODO: error handling + } + rv.decoded = root case DataTypeString: rv.decoded = string(rv.rawData) case DataTypeUint32: From 3c23df41aa5d71d773c8904ca0470d68365d1326 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Wed, 13 May 2026 14:11:10 +0500 Subject: [PATCH 07/14] chore(query engine): RecordProducer returns Metadata --- query/exec/data_source.go | 39 +++++++++++++++---------- query/exec/data_source_test.go | 2 +- query/exec/executor_combination_test.go | 2 +- query/exec/filter.go | 14 +++++---- query/exec/filter_test.go | 2 +- query/exec/limiter.go | 15 ++++++---- query/exec/limiter_test.go | 8 ++--- query/exec/merger.go | 28 ++++++++++++++++++ query/producer.go | 11 +++++-- 9 files changed, 83 insertions(+), 38 deletions(-) create mode 100644 query/exec/merger.go diff --git a/query/exec/data_source.go b/query/exec/data_source.go index c9662127..2cf3841b 100644 --- a/query/exec/data_source.go +++ b/query/exec/data_source.go @@ -16,8 +16,9 @@ type FractionDataSource struct { frac frac.Fraction searchParams processor.SearchParams - qpr *seq.QPR - curIdIdx int + qpr *seq.QPR + docs [][]byte + curDocIdx int } func NewFractionDatasource( @@ -32,23 +33,21 @@ func NewFractionDatasource( } } -func (s *FractionDataSource) Next() (*query.Record, bool) { - if s.qpr == nil { - s.scan() +func (s *FractionDataSource) Next() (*query.Record, *query.Metadata) { + if len(s.docs) == 0 { + if err := s.scan(); err != nil { + return nil, &query.Metadata{Err: err} + } } - if s.curIdIdx >= len(s.qpr.IDs) { - return nil, false + if s.curDocIdx >= len(s.docs) { + return nil, nil } - curId := s.qpr.IDs[s.curIdIdx] - fetched, err := s.frac.Fetch(s.Ctx(), []seq.ID{curId.ID}) // TODO: fetch all ids in single request - if err != nil { - panic(err) // TODO: error handling - } + docRecord := makeDocumentRecord(s.qpr.IDs[s.curDocIdx].ID, s.docs[s.curDocIdx]) + s.curDocIdx++ - s.curIdIdx++ - return makeDocumentRecord(curId.ID, fetched[0]), true + return docRecord, nil } func (s *FractionDataSource) Ctx() context.Context { @@ -58,12 +57,20 @@ func (s *FractionDataSource) Ctx() context.Context { return s.ctx } -func (s *FractionDataSource) scan() { +func (s *FractionDataSource) scan() error { qpr, err := s.frac.Search(s.Ctx(), s.searchParams) if err != nil { - panic(err) // TODO: error handling + return err + } + docs, err := s.frac.Fetch(s.Ctx(), qpr.IDs.IDs()) + if err != nil { + return err } + s.qpr = qpr + s.docs = docs + + return nil } func makeDocumentRecord(id seq.ID, payload []byte) *query.Record { diff --git a/query/exec/data_source_test.go b/query/exec/data_source_test.go index 44b40c3a..3348ea82 100644 --- a/query/exec/data_source_test.go +++ b/query/exec/data_source_test.go @@ -64,7 +64,7 @@ func TestFractionDataSource(t *testing.T) { limiter := NewLimiter(dataSource, limit) outputData := make([]*query.Record, 0) - for r, has := limiter.Next(); has; r, has = limiter.Next() { + for r, _ := limiter.Next(); r != nil; r, _ = limiter.Next() { outputData = append(outputData, r) } diff --git a/query/exec/executor_combination_test.go b/query/exec/executor_combination_test.go index 7832c314..9faa113b 100644 --- a/query/exec/executor_combination_test.go +++ b/query/exec/executor_combination_test.go @@ -28,7 +28,7 @@ func TestExecutorsCombination(t *testing.T) { limiter := NewLimiter(filter, limit) outputData := make([]*query.Record, 0) - for r, has := limiter.Next(); has; r, has = limiter.Next() { + for r, _ := limiter.Next(); r != nil; r, _ = limiter.Next() { outputData = append(outputData, r) } diff --git a/query/exec/filter.go b/query/exec/filter.go index 99265df9..b86958b6 100644 --- a/query/exec/filter.go +++ b/query/exec/filter.go @@ -31,17 +31,19 @@ func NewFilter[T any]( } } -func (f *Filter[T]) Next() (*query.Record, bool) { +func (f *Filter[T]) Next() (*query.Record, *query.Metadata) { for { - r, has := f.input.Next() - if !has { - return nil, false + r, meta := f.input.Next() + if meta != nil { + return nil, meta + } + if r == nil { + return nil, nil } - // TODO: some comparisons don't need decoded data passes := f.expr.Eval(r.Vals[f.colIdx].Decoded().(T)) if passes { - return r, true + return r, nil } } } diff --git a/query/exec/filter_test.go b/query/exec/filter_test.go index 07867782..cb13dada 100644 --- a/query/exec/filter_test.go +++ b/query/exec/filter_test.go @@ -74,7 +74,7 @@ func testFilter[T any]( filter := NewFilter(&input, colIdx, filterExpr) outputData := make([]*query.Record, 0) - for r, has := filter.Next(); has; r, has = filter.Next() { + for r, _ := filter.Next(); r != nil; r, _ = filter.Next() { outputData = append(outputData, r) } diff --git a/query/exec/limiter.go b/query/exec/limiter.go index 134c6d7c..a3157044 100644 --- a/query/exec/limiter.go +++ b/query/exec/limiter.go @@ -19,17 +19,20 @@ func NewLimiter( } } -func (l *Limiter) Next() (*query.Record, bool) { +func (l *Limiter) Next() (*query.Record, *query.Metadata) { if l.produced >= l.limit { - return nil, false + return nil, nil } - r, has := l.input.Next() - if !has { - return nil, false + r, meta := l.input.Next() + if meta != nil { + return nil, meta + } + if r == nil { + return nil, nil } l.produced++ - return r, true + return r, nil } diff --git a/query/exec/limiter_test.go b/query/exec/limiter_test.go index b93d9c70..cf46c1a9 100644 --- a/query/exec/limiter_test.go +++ b/query/exec/limiter_test.go @@ -29,7 +29,7 @@ func testLimiter(t *testing.T, limit uint32) { limiter := NewLimiter(&input, limit) outputData := make([]*query.Record, 0) - for r, has := limiter.Next(); has; r, has = limiter.Next() { + for r, _ := limiter.Next(); r != nil; r, _ = limiter.Next() { outputData = append(outputData, r) } @@ -41,15 +41,15 @@ type testProducer struct { cur int } -func (p *testProducer) Next() (*query.Record, bool) { +func (p *testProducer) Next() (*query.Record, *query.Metadata) { if p.cur >= len(p.data) { - return nil, false + return nil, nil } r := p.data[p.cur] p.cur++ - return r, true + return r, nil } func makeTestInputRecords(count int) []*query.Record { diff --git a/query/exec/merger.go b/query/exec/merger.go new file mode 100644 index 00000000..5aae9b58 --- /dev/null +++ b/query/exec/merger.go @@ -0,0 +1,28 @@ +package exec + +import "github.com/ozontech/seq-db/query" + +// nolint:unused // TODO: +type Merger struct { + left query.RecordProducer + right query.RecordProducer + + curLeft *query.Record + curRight *query.Record + + colIdx int +} + +func NewMerger( + left query.RecordProducer, + right query.RecordProducer, +) *Merger { + return &Merger{ + left: left, + right: right, + } +} + +func (m *Merger) Next() (*query.Record, *query.Metadata) { + return nil, nil +} diff --git a/query/producer.go b/query/producer.go index e5407bc7..676b97f0 100644 --- a/query/producer.go +++ b/query/producer.go @@ -1,11 +1,16 @@ package query type RecordProducer interface { - // TODO: Next() (*Record, metadata) // meta has error plus some additional info - Next() (*Record, bool) // TODO: record as interface (???) + Next() (*Record, *Metadata) // TODO: we need a method to release all the resources down the producer call stack + // Release() +} + +type Metadata struct { + Err error + // TODO: some additional info like explain data, tracing data, etc } type BatchedRecordProducer interface { - NextBatch() ([]*Record, bool) + NextBatch() ([]*Record, *Metadata) } From cc1dee061429db8d0b6ba98fd05985200816444c Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Wed, 13 May 2026 17:33:22 +0500 Subject: [PATCH 08/14] feat(query engine): onePhaseSearch method uses new executors --- query/exec/data_source.go | 83 ++++++++++++++++++++++++++ storeapi/grpc_one_phase_search.go | 97 +++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+) diff --git a/query/exec/data_source.go b/query/exec/data_source.go index 2cf3841b..1d51362b 100644 --- a/query/exec/data_source.go +++ b/query/exec/data_source.go @@ -6,7 +6,9 @@ import ( "github.com/ozontech/seq-db/frac" "github.com/ozontech/seq-db/frac/processor" + "github.com/ozontech/seq-db/fracmanager" "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" ) @@ -62,6 +64,9 @@ func (s *FractionDataSource) scan() error { if err != nil { return err } + if len(qpr.IDs) == 0 { + return nil + } docs, err := s.frac.Fetch(s.Ctx(), qpr.IDs.IDs()) if err != nil { return err @@ -73,6 +78,84 @@ func (s *FractionDataSource) scan() error { return nil } +type SearcherDataSource struct { + ctx context.Context + tr *querytracer.Tracer + + searchParams processor.SearchParams // TODO: ??? + + fracManager *fracmanager.FracManager + searcher *fracmanager.Searcher + fetcher *fracmanager.Fetcher + + qpr *seq.QPR + docs [][]byte + curDocIdx int +} + +func NewSearcherDataSource( + ctx context.Context, + tr *querytracer.Tracer, + searchParams processor.SearchParams, + fracManager *fracmanager.FracManager, + searcher *fracmanager.Searcher, + fetcher *fracmanager.Fetcher, +) *SearcherDataSource { + return &SearcherDataSource{ + ctx: ctx, + tr: tr, + searchParams: searchParams, + fracManager: fracManager, + searcher: searcher, + fetcher: fetcher, + } +} + +func (s *SearcherDataSource) Next() (*query.Record, *query.Metadata) { + if len(s.docs) == 0 { + if err := s.scan(); err != nil { + return nil, &query.Metadata{Err: err} + } + } + + if s.curDocIdx >= len(s.docs) { + return nil, nil + } + + docRecord := makeDocumentRecord(s.qpr.IDs[s.curDocIdx].ID, s.docs[s.curDocIdx]) + s.curDocIdx++ + + return docRecord, nil +} + +func (s *SearcherDataSource) Ctx() context.Context { + if s.ctx == nil { + return context.Background() + } + return s.ctx +} + +func (s *SearcherDataSource) scan() error { + qpr, err := s.searcher.SearchDocs(s.Ctx(), s.fracManager.Fractions(), s.searchParams, s.tr) + if err != nil { + return err + } + + if len(qpr.IDs) == 0 { + return nil + } + + docs, err := s.fetcher.FetchDocs(s.Ctx(), s.fracManager.Fractions(), qpr.IDs) + if err != nil { + return err + } + + s.qpr = qpr + s.docs = docs + + return nil +} + func makeDocumentRecord(id seq.ID, payload []byte) *query.Record { return &query.Record{ Vals: []*query.RecordVals{ diff --git a/storeapi/grpc_one_phase_search.go b/storeapi/grpc_one_phase_search.go index ca7d6229..9c35f2a3 100644 --- a/storeapi/grpc_one_phase_search.go +++ b/storeapi/grpc_one_phase_search.go @@ -10,9 +10,11 @@ import ( "go.opencensus.io/trace" "go.uber.org/zap" + "github.com/ozontech/seq-db/frac/processor" "github.com/ozontech/seq-db/logger" "github.com/ozontech/seq-db/parser" "github.com/ozontech/seq-db/pkg/storeapi" + "github.com/ozontech/seq-db/query/exec" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" "github.com/ozontech/seq-db/storage" @@ -54,6 +56,11 @@ func (g *GrpcV1) doOnePhaseSearch( statsAggs := extractStatsPipesFromQuery(req.Query) hasAggs := len(statsAggs) > 0 + useNewQueryEngine := true + if useNewQueryEngine { + return g.doOnePhaseSearchNewQueryEngine(ctx, req, stream) + } + if hasAggs { return g.doOnePhaseSearchWithAggs(ctx, req, stream, statsAggs) } @@ -61,6 +68,96 @@ func (g *GrpcV1) doOnePhaseSearch( return g.doOnePhaseSearchDocs(ctx, req, stream) } +func (g *GrpcV1) doOnePhaseSearchNewQueryEngine( + ctx context.Context, + req *storeapi.OnePhaseSearchRequest, + stream storeapi.StoreApi_OnePhaseSearchServer, +) error { + tr := querytracer.New(req.Explain, "store/OnePhaseSearchDocs") + + ast, err := g.parseQuery(req.Query) + if err != nil { + return fmt.Errorf("parseQuery error: %w", err) + } + + from := seq.MillisToMID(uint64(seq.TimeToMID(req.From.AsTime()))) + to := seq.MillisToMID(uint64(seq.TimeToMID(req.To.AsTime()))) + + searchParams := processor.SearchParams{ + AST: ast, + From: from, + To: to, + Limit: int(req.Size + req.Offset), + WithTotal: req.WithTotal, + Order: req.Order.MustDocsOrder(), + } + + err = stream.Send(&storeapi.OnePhaseSearchResponse{ + ResponseType: &storeapi.OnePhaseSearchResponse_Header{ + Header: &storeapi.Header{ + Metadata: &storeapi.Metadata{}, // TODO: fill metadata + Typing: []*storeapi.Typing{ + // TODO: conditional typing + {Title: "mid", Type: storeapi.DataType_UINT64}, + {Title: "rid", Type: storeapi.DataType_UINT64}, + {Title: "data", Type: storeapi.DataType_RAW_DOCUMENT}, + }, + }, + }, + }) + if err != nil { + if util.IsCancelled(ctx) { + logger.Info("one phase search request is canceled") + return nil + } + return fmt.Errorf("error sending header: %w", err) + } + + dataSource := exec.NewSearcherDataSource(ctx, tr, searchParams, g.fracManager, g.searchData.searcher, g.fetchData.docFetcher) + // TODO: configurable executors + filter := exec.NewFilter(dataSource, 2, exec.NewDocFilter("message", exec.NewEq("dg guillotine 2"))) + limiter := exec.NewLimiter(filter, 5) + + producer := limiter + curRecord, curMeta := producer.Next() + for { + if curMeta != nil && curMeta.Err != nil { + return fmt.Errorf("producer.Next() error: %w", err) + } + if curRecord == nil { + break + } + + err = stream.Send(&storeapi.OnePhaseSearchResponse{ + ResponseType: &storeapi.OnePhaseSearchResponse_Batch{ + Batch: &storeapi.RecordsBatch{ + // TODO: batch + Records: []*storeapi.Record{ + { + RawData: [][]byte{ + curRecord.Vals[0].RawData(), + curRecord.Vals[1].RawData(), + curRecord.Vals[2].RawData(), + }, + }, + }, + }, + }, + }) + if err != nil { + if util.IsCancelled(ctx) { + logger.Info("one phase search request is canceled") + return nil + } + return fmt.Errorf("error sending fetched docs: %w", err) + } + + curRecord, curMeta = producer.Next() + } + + return nil +} + func (g *GrpcV1) doOnePhaseSearchDocs( ctx context.Context, req *storeapi.OnePhaseSearchRequest, From ce4d7f109ded29447768049ebca488ceeaca7805 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Thu, 14 May 2026 12:14:22 +0500 Subject: [PATCH 09/14] feat(query engine): add doc projector executor --- query/exec/limiter_test.go | 3 +- query/exec/projector.go | 75 +++++++++++++++++++++++++- query/exec/projector_test.go | 53 +++++++++++++++++++ storeapi/grpc_one_phase_search.go | 88 +++++++++++++++++++++++-------- 4 files changed, 193 insertions(+), 26 deletions(-) create mode 100644 query/exec/projector_test.go diff --git a/query/exec/limiter_test.go b/query/exec/limiter_test.go index cf46c1a9..2f8a00e5 100644 --- a/query/exec/limiter_test.go +++ b/query/exec/limiter_test.go @@ -56,10 +56,11 @@ func makeTestInputRecords(count int) []*query.Record { out := make([]*query.Record, 0, count) for i := range count { + doc := fmt.Sprintf(`{"service":"service-%d","level":3,"k8s_pod":"pod-%d"}`, i, i) out = append(out, &query.Record{ Vals: []*query.RecordVals{ query.NewRecordVals(query.DataTypeUint32, Uint32ToBytes(uint32(i))), - query.NewRecordVals(query.DataTypeDocument, fmt.Appendf([]byte{}, `{"service":"service-%d"}`, i)), + query.NewRecordVals(query.DataTypeDocument, []byte(doc)), }, }) } diff --git a/query/exec/projector.go b/query/exec/projector.go index 092189d6..25ebe0f8 100644 --- a/query/exec/projector.go +++ b/query/exec/projector.go @@ -1,5 +1,76 @@ package exec -type Projection struct { - // TODO: project (now it's fields filter) +import ( + "slices" + + insaneJSON "github.com/ozontech/insane-json" + + "github.com/ozontech/seq-db/pkg/storeapi" + "github.com/ozontech/seq-db/query" +) + +type DocProjector struct { + input query.RecordProducer + colIdx int + filter *storeapi.FieldsFilter + decoderBuf []byte +} + +func NewDocPrejector( + input query.RecordProducer, + colIdx int, + filter *storeapi.FieldsFilter, +) *DocProjector { + return &DocProjector{ + input: input, + colIdx: colIdx, + filter: filter, + } +} + +func (p *DocProjector) Next() (*query.Record, *query.Metadata) { + r, meta := p.input.Next() + if meta != nil { + return nil, meta + } + if r == nil { + return nil, nil + } + + decoder := r.Vals[p.colIdx].Decoded().(*insaneJSON.Root) + + if !p.filter.AllowList { + // It is block list, so remove given fields from document. + for _, field := range p.filter.Fields { + decoder.Dig(field).Suicide() + } + return p.makeRecordWithNewVals(r, decoder.Encode(p.decoderBuf[:0])), nil + } + + // Keep only given fields. + // fieldsToRemove contains fields that should be removed. + // It is complex to do it in-place because decoder.Suicide makes decoder.AsFields() invalid. + var fieldsToRemove []*insaneJSON.Node + for _, field := range decoder.AsFields() { + fieldName := field.AsString() + if !slices.Contains(p.filter.Fields, fieldName) { + fieldsToRemove = append(fieldsToRemove, field.AsFieldValue()) + } + } + for _, field := range fieldsToRemove { + field.Suicide() + } + return p.makeRecordWithNewVals(r, decoder.Encode(p.decoderBuf[:0])), nil +} + +func (p *DocProjector) makeRecordWithNewVals(old *query.Record, newRawData []byte) *query.Record { + newRecordVals := make([]*query.RecordVals, len(old.Vals)) + for i := range len(old.Vals) { + rawData := old.Vals[i].RawData() + if i == p.colIdx { + rawData = newRawData + } + newRecordVals[i] = query.NewRecordVals(old.Vals[i].Type, rawData) + } + return query.NewRecord(newRecordVals) } diff --git a/query/exec/projector_test.go b/query/exec/projector_test.go new file mode 100644 index 00000000..67362d63 --- /dev/null +++ b/query/exec/projector_test.go @@ -0,0 +1,53 @@ +package exec + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/pkg/storeapi" + "github.com/ozontech/seq-db/query" +) + +func TestDocProjectorFields(t *testing.T) { + testDocProjector( + t, + &storeapi.FieldsFilter{Fields: []string{"service", "level"}, AllowList: true}, + []string{ + `{"service":"service-0","level":3}`, + `{"service":"service-1","level":3}`, + }, + ) +} + +func TestProjectorFieldsExcepr(t *testing.T) { + testDocProjector( + t, + &storeapi.FieldsFilter{Fields: []string{"level"}, AllowList: false}, + []string{ + `{"service":"service-0","k8s_pod":"pod-0"}`, + `{"service":"service-1","k8s_pod":"pod-1"}`, + }, + ) +} + +func testDocProjector(t *testing.T, fieldsFilter *storeapi.FieldsFilter, wantDocs []string) { + t.Helper() + + inputData := makeTestInputRecords(2) + input := testProducer{data: inputData} + + projector := NewDocPrejector(&input, 1, fieldsFilter) + + outputData := make([]*query.Record, 0) + for r, _ := projector.Next(); r != nil; r, _ = projector.Next() { + outputData = append(outputData, r) + } + + outputDocs := make([]string, 0, len(outputData)) + for _, r := range outputData { + outputDocs = append(outputDocs, string(r.Vals[1].RawData())) + } + + assert.Equal(t, wantDocs, outputDocs) +} diff --git a/storeapi/grpc_one_phase_search.go b/storeapi/grpc_one_phase_search.go index 9c35f2a3..b7535636 100644 --- a/storeapi/grpc_one_phase_search.go +++ b/storeapi/grpc_one_phase_search.go @@ -12,8 +12,10 @@ import ( "github.com/ozontech/seq-db/frac/processor" "github.com/ozontech/seq-db/logger" + "github.com/ozontech/seq-db/metric" "github.com/ozontech/seq-db/parser" "github.com/ozontech/seq-db/pkg/storeapi" + "github.com/ozontech/seq-db/query" "github.com/ozontech/seq-db/query/exec" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" @@ -73,26 +75,33 @@ func (g *GrpcV1) doOnePhaseSearchNewQueryEngine( req *storeapi.OnePhaseSearchRequest, stream storeapi.StoreApi_OnePhaseSearchServer, ) error { - tr := querytracer.New(req.Explain, "store/OnePhaseSearchDocs") + metric.SearchInFlightQueriesTotal.Inc() + defer metric.SearchInFlightQueriesTotal.Dec() - ast, err := g.parseQuery(req.Query) - if err != nil { - return fmt.Errorf("parseQuery error: %w", err) + inflightRequests := g.searchData.inflight.Inc() + defer g.searchData.inflight.Dec() + + if inflightRequests > int64(g.config.Search.RequestsLimit) { + metric.RejectedRequests.WithLabelValues("search", "limit_exceeding").Inc() + return fmt.Errorf("too many search requests: %d > %d", inflightRequests, g.config.Search.RequestsLimit) } - from := seq.MillisToMID(uint64(seq.TimeToMID(req.From.AsTime()))) - to := seq.MillisToMID(uint64(seq.TimeToMID(req.To.AsTime()))) + ctx, cancel := context.WithCancel(ctx) + defer cancel() - searchParams := processor.SearchParams{ - AST: ast, - From: from, - To: to, - Limit: int(req.Size + req.Offset), - WithTotal: req.WithTotal, - Order: req.Order.MustDocsOrder(), - } + start := time.Now() - err = stream.Send(&storeapi.OnePhaseSearchResponse{ + // in store mode hot we return error in case request wants data, that we've already rotated + // if g.config.StoreMode == StoreModeHot { + // if g.fracManager.Flags().IsCapacityExceeded() && g.earlierThanOldestFrac(uint64(req.From)) { + // metric.RejectedRequests.WithLabelValues("search", "old_data").Inc() + // return &storeapi.SearchResponse{Code: storeapi.SearchErrorCode_INGESTOR_QUERY_WANTS_OLD_DATA}, nil + // } + // } + + tr := querytracer.New(req.Explain, "store/OnePhaseSearchDocs") + + err := stream.Send(&storeapi.OnePhaseSearchResponse{ ResponseType: &storeapi.OnePhaseSearchResponse_Header{ Header: &storeapi.Header{ Metadata: &storeapi.Metadata{}, // TODO: fill metadata @@ -113,12 +122,8 @@ func (g *GrpcV1) doOnePhaseSearchNewQueryEngine( return fmt.Errorf("error sending header: %w", err) } - dataSource := exec.NewSearcherDataSource(ctx, tr, searchParams, g.fracManager, g.searchData.searcher, g.fetchData.docFetcher) - // TODO: configurable executors - filter := exec.NewFilter(dataSource, 2, exec.NewDocFilter("message", exec.NewEq("dg guillotine 2"))) - limiter := exec.NewLimiter(filter, 5) + producer, err := g.buildProducer(ctx, req, tr) - producer := limiter curRecord, curMeta := producer.Next() for { if curMeta != nil && curMeta.Err != nil { @@ -155,9 +160,46 @@ func (g *GrpcV1) doOnePhaseSearchNewQueryEngine( curRecord, curMeta = producer.Next() } + metric.SearchDurationSeconds.Observe(time.Since(start).Seconds()) + return nil } +func (g *GrpcV1) buildProducer( + ctx context.Context, + req *storeapi.OnePhaseSearchRequest, + tr *querytracer.Tracer, +) (query.RecordProducer, error) { + ast, err := g.parseQuery(req.Query) + if err != nil { + return nil, fmt.Errorf("parseQuery error: %w", err) + } + + searchParams := processor.SearchParams{ + AST: ast, + From: seq.MillisToMID(uint64(seq.TimeToMID(req.From.AsTime()))), + To: seq.MillisToMID(uint64(seq.TimeToMID(req.To.AsTime()))), + Limit: int(req.Size + req.Offset), + WithTotal: req.WithTotal, + Order: req.Order.MustDocsOrder(), + } + + var producer query.RecordProducer + + dataSource := exec.NewSearcherDataSource(ctx, tr, searchParams, g.fracManager, g.searchData.searcher, g.fetchData.docFetcher) + // TODO: extract filter and limit parameters to seq-ql + filter := exec.NewFilter(dataSource, 2, exec.NewDocFilter("message", exec.NewEq("dg guillotine 2"))) + limiter := exec.NewLimiter(filter, 5) + producer = limiter + + if req.FieldsFilter != nil && len(req.FieldsFilter.Fields) > 0 { + projector := exec.NewDocPrejector(limiter, 2, req.FieldsFilter) + producer = projector + } + + return producer, nil +} + func (g *GrpcV1) doOnePhaseSearchDocs( ctx context.Context, req *storeapi.OnePhaseSearchRequest, @@ -352,12 +394,12 @@ func (g *GrpcV1) doOnePhaseSearchWithAggs( return nil } -func extractStatsPipesFromQuery(query string) []parser.StatsAgg { - if query == "" { +func extractStatsPipesFromQuery(searchQuery string) []parser.StatsAgg { + if searchQuery == "" { return nil } - seqql, err := parser.ParseSeqQL(query, nil) + seqql, err := parser.ParseSeqQL(searchQuery, nil) if err != nil { return nil } From b44d61e3a91a219df8b4df3de559880578a1efa8 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Thu, 14 May 2026 16:12:43 +0500 Subject: [PATCH 10/14] feat(query engine): add filter and limit pipes to seq-ql and use them in one phase search --- parser/seqql_pipes.go | 119 ++++++++++++++++++++++++- parser/seqql_pipes_test.go | 52 +++++++++++ storeapi/grpc_one_phase_search.go | 143 +++++------------------------- 3 files changed, 193 insertions(+), 121 deletions(-) diff --git a/parser/seqql_pipes.go b/parser/seqql_pipes.go index 81553bec..12274661 100644 --- a/parser/seqql_pipes.go +++ b/parser/seqql_pipes.go @@ -12,8 +12,9 @@ type Pipe interface { } func parsePipes(lex *lexer) ([]Pipe, error) { - // Counter of 'fields' pipes. fieldFilters := 0 + filterPipes := 0 + limitPipes := 0 var pipes []Pipe for !lex.IsEnd() { if !lex.IsKeyword("|") { @@ -35,6 +36,20 @@ func parsePipes(lex *lexer) ([]Pipe, error) { return nil, fmt.Errorf("parsing 'stats' pipe: %s", err) } pipes = append(pipes, p) + case lex.IsKeyword("filter"): + p, err := parsePipeFilter(lex) + if err != nil { + return nil, fmt.Errorf("parsing 'filter' pipe: %s", err) + } + pipes = append(pipes, p) + filterPipes++ + case lex.IsKeyword("limit"): + p, err := parsePipeLimit(lex) + if err != nil { + return nil, fmt.Errorf("parsing 'limit' pipe: %s", err) + } + pipes = append(pipes, p) + limitPipes++ default: return nil, fmt.Errorf("unknown pipe: %s", lex.Token) } @@ -42,6 +57,12 @@ func parsePipes(lex *lexer) ([]Pipe, error) { if fieldFilters > 1 { return nil, fmt.Errorf("multiple field filters is not allowed") } + if filterPipes > 1 { + return nil, fmt.Errorf("multiple filter pipes is not allowed") + } + if limitPipes > 1 { + return nil, fmt.Errorf("multiple limit pipes is not allowed") + } } return pipes, nil } @@ -112,6 +133,26 @@ func (p *PipeStats) DumpSeqQL(o *strings.Builder) { } } +type FilterCondition struct { + Field string + Value string +} + +type PipeFilter struct { + Condition FilterCondition +} + +func (f *PipeFilter) Name() string { + return "filter" +} + +func (f *PipeFilter) DumpSeqQL(o *strings.Builder) { + o.WriteString("filter ") + o.WriteString(quoteTokenIfNeeded(f.Condition.Field)) + o.WriteString(":") + o.WriteString(quoteTokenIfNeeded(f.Condition.Value)) +} + func parsePipeFields(lex *lexer) (*PipeFields, error) { if !lex.IsKeyword("fields") { return nil, fmt.Errorf("missing 'fields' keyword") @@ -162,6 +203,80 @@ func parsePipeStats(lex *lexer) (*PipeStats, error) { return &PipeStats{Aggs: aggs}, nil } +func parsePipeFilter(lex *lexer) (*PipeFilter, error) { + if !lex.IsKeyword("filter") { + return nil, fmt.Errorf("missing 'filter' keyword") + } + lex.Next() + + field, err := parseCompositeTokenReplaceWildcards(lex) + if err != nil { + return nil, fmt.Errorf("parsing field name: %s", err) + } + if field == "" { + return nil, fmt.Errorf("empty field name") + } + + if !lex.IsKeyword(":") { + return nil, fmt.Errorf("missing ':' after %q", field) + } + lex.Next() + + if lex.IsKeyword("") { + return nil, fmt.Errorf("missing filter value for field %q", field) + } + + value, err := parseCompositeTokenReplaceWildcards(lex) + if err != nil { + return nil, fmt.Errorf("parsing filter value: %s", err) + } + + return &PipeFilter{ + Condition: FilterCondition{ + Field: field, + Value: value, + }, + }, nil +} + +type PipeLimit struct { + Limit int +} + +func (l *PipeLimit) Name() string { + return "limit" +} + +func (l *PipeLimit) DumpSeqQL(o *strings.Builder) { + o.WriteString("limit ") + o.WriteString(strconv.Itoa(l.Limit)) +} + +func parsePipeLimit(lex *lexer) (*PipeLimit, error) { + if !lex.IsKeyword("limit") { + return nil, fmt.Errorf("missing 'limit' keyword") + } + lex.Next() + + limitStr := lex.Token + if limitStr == "" { + return nil, fmt.Errorf("missing limit value") + } + + limit, err := strconv.Atoi(limitStr) + if err != nil { + return nil, fmt.Errorf("invalid limit value: %s", limitStr) + } + + if limit <= 0 { + return nil, fmt.Errorf("limit must be greater than 0, got %d", limit) + } + + lex.Next() + + return &PipeLimit{Limit: limit}, nil +} + func parseStatsAgg(lex *lexer) (StatsAgg, error) { var agg StatsAgg @@ -308,7 +423,7 @@ var reservedKeywords = uniqueTokens([]string{ "|", // Pipe specific keywords. - "fields", "except", "stats", "by", "interval", "unique_count", + "fields", "except", "filter", "limit", "stats", "by", "interval", "unique_count", }) func needQuoteToken(s string) bool { diff --git a/parser/seqql_pipes_test.go b/parser/seqql_pipes_test.go index 41b91891..0ff4e51e 100644 --- a/parser/seqql_pipes_test.go +++ b/parser/seqql_pipes_test.go @@ -79,3 +79,55 @@ func TestParsePipeStatsQuantile(t *testing.T) { test("service:my-service | stats quantile(response_time, 0.5, 0.95) by (service)", "service:my-service | stats quantile(response_time, 0.5, 0.95) by (service)") } + +func TestParsePipeFilter(t *testing.T) { + test := func(q, expected string) { + t.Helper() + query, err := ParseSeqQL(q, nil) + require.NoError(t, err) + require.Equal(t, expected, query.SeqQLString()) + } + + test(`service:my_service | filter field:"some value"`, `service:my_service | filter field:"some value"`) + test(`service:my_service | filter field:value`, `service:my_service | filter field:value`) +} + +func TestParsePipeFilterErrors(t *testing.T) { + test := func(q string) { + t.Helper() + _, err := ParseSeqQL(q, nil) + require.Error(t, err) + } + + test(`service:my_service | filter`) + test(`service:my_service | filter field`) + test(`service:my_service | filter :value`) + test(`service:my_service | filter a:1 | filter b:2`) +} + +func TestParsePipeLimit(t *testing.T) { + test := func(q, expected string) { + t.Helper() + query, err := ParseSeqQL(q, nil) + require.NoError(t, err) + require.Equal(t, expected, query.SeqQLString()) + } + + test("service:my_service | limit 10", "service:my_service | limit 10") + test("service:my_service | limit 100", "service:my_service | limit 100") + test(`service:my_service | filter unindexed_field:"value" | limit 50`, `service:my_service | filter unindexed_field:value | limit 50`) +} + +func TestParsePipeLimitErrors(t *testing.T) { + test := func(q string) { + t.Helper() + _, err := ParseSeqQL(q, nil) + require.Error(t, err) + } + + test(`service:my_service | limit`) + test(`service:my_service | limit abc`) + test(`service:my_service | limit 0`) + test(`service:my_service | limit -1`) + test(`service:my_service | limit 10 | limit 20`) +} diff --git a/storeapi/grpc_one_phase_search.go b/storeapi/grpc_one_phase_search.go index b7535636..770ebd75 100644 --- a/storeapi/grpc_one_phase_search.go +++ b/storeapi/grpc_one_phase_search.go @@ -19,7 +19,6 @@ import ( "github.com/ozontech/seq-db/query/exec" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" - "github.com/ozontech/seq-db/storage" "github.com/ozontech/seq-db/tracing" "github.com/ozontech/seq-db/util" ) @@ -55,25 +54,25 @@ func (g *GrpcV1) doOnePhaseSearch( req *storeapi.OnePhaseSearchRequest, stream storeapi.StoreApi_OnePhaseSearchServer, ) error { - statsAggs := extractStatsPipesFromQuery(req.Query) - hasAggs := len(statsAggs) > 0 - - useNewQueryEngine := true - if useNewQueryEngine { - return g.doOnePhaseSearchNewQueryEngine(ctx, req, stream) + seqql, err := parser.ParseSeqQL(req.Query, g.mappingProvider.GetMapping()) + if err != nil { + return fmt.Errorf("parse query error: %w", err) } + statsAggs := extractStatsPipesFromSeqQL(seqql) + hasAggs := len(statsAggs) > 0 if hasAggs { return g.doOnePhaseSearchWithAggs(ctx, req, stream, statsAggs) } - return g.doOnePhaseSearchDocs(ctx, req, stream) + return g.doOnePhaseSearchDocs(ctx, req, stream, seqql) } -func (g *GrpcV1) doOnePhaseSearchNewQueryEngine( +func (g *GrpcV1) doOnePhaseSearchDocs( ctx context.Context, req *storeapi.OnePhaseSearchRequest, stream storeapi.StoreApi_OnePhaseSearchServer, + seqql parser.SeqQLQuery, ) error { metric.SearchInFlightQueriesTotal.Inc() defer metric.SearchInFlightQueriesTotal.Dec() @@ -122,7 +121,7 @@ func (g *GrpcV1) doOnePhaseSearchNewQueryEngine( return fmt.Errorf("error sending header: %w", err) } - producer, err := g.buildProducer(ctx, req, tr) + producer, err := g.buildProducer(ctx, req, tr, seqql) curRecord, curMeta := producer.Next() for { @@ -169,14 +168,10 @@ func (g *GrpcV1) buildProducer( ctx context.Context, req *storeapi.OnePhaseSearchRequest, tr *querytracer.Tracer, + seqql parser.SeqQLQuery, ) (query.RecordProducer, error) { - ast, err := g.parseQuery(req.Query) - if err != nil { - return nil, fmt.Errorf("parseQuery error: %w", err) - } - searchParams := processor.SearchParams{ - AST: ast, + AST: seqql.Root, From: seq.MillisToMID(uint64(seq.TimeToMID(req.From.AsTime()))), To: seq.MillisToMID(uint64(seq.TimeToMID(req.To.AsTime()))), Limit: int(req.Size + req.Offset), @@ -187,105 +182,24 @@ func (g *GrpcV1) buildProducer( var producer query.RecordProducer dataSource := exec.NewSearcherDataSource(ctx, tr, searchParams, g.fracManager, g.searchData.searcher, g.fetchData.docFetcher) - // TODO: extract filter and limit parameters to seq-ql - filter := exec.NewFilter(dataSource, 2, exec.NewDocFilter("message", exec.NewEq("dg guillotine 2"))) - limiter := exec.NewLimiter(filter, 5) - producer = limiter - - if req.FieldsFilter != nil && len(req.FieldsFilter.Fields) > 0 { - projector := exec.NewDocPrejector(limiter, 2, req.FieldsFilter) - producer = projector - } - - return producer, nil -} - -func (g *GrpcV1) doOnePhaseSearchDocs( - ctx context.Context, - req *storeapi.OnePhaseSearchRequest, - stream storeapi.StoreApi_OnePhaseSearchServer, -) error { - tr := querytracer.New(req.Explain, "store/OnePhaseSearchDocs") - data, err := g.doSearch(ctx, &storeapi.SearchRequest{ - Query: req.Query, - From: int64(seq.TimeToMID(req.From.AsTime())), - To: int64(seq.TimeToMID(req.To.AsTime())), - Size: req.Size, - Offset: req.Offset, - Explain: req.Explain, - WithTotal: req.WithTotal, - Order: req.Order, - OffsetId: req.OffsetId, - }, tr) - if err != nil { - return fmt.Errorf("search error: %w", err) - } - - tr.Done() - if req.Explain && data != nil { - data.Explain = tracerSpanToExplainEntry(tr.ToSpan()) - } + producer = dataSource - err = stream.Send(&storeapi.OnePhaseSearchResponse{ - ResponseType: &storeapi.OnePhaseSearchResponse_Header{ - Header: &storeapi.Header{ - Metadata: &storeapi.Metadata{ - Total: data.Total, - Code: data.Code, - Errors: data.Errors, - Explain: data.Explain, - }, - Typing: []*storeapi.Typing{ - // TODO: conditional typing - {Title: "mid", Type: storeapi.DataType_UINT64}, - {Title: "rid", Type: storeapi.DataType_UINT64}, - {Title: "data", Type: storeapi.DataType_RAW_DOCUMENT}, - }, - }, - }, - }) - if err != nil { - if util.IsCancelled(ctx) { - logger.Info("one phase search request is canceled") - return nil + for _, pipe := range seqql.Pipes { + switch p := pipe.(type) { + case *parser.PipeFilter: + producer = exec.NewFilter(producer, 2, exec.NewDocFilter(p.Condition.Field, exec.NewEq(p.Condition.Value))) + case *parser.PipeLimit: + producer = exec.NewLimiter(producer, uint32(p.Limit)) + default: + continue } - return fmt.Errorf("error sending fetched docs: %w", err) } - ids := make(seq.IDSources, 0, len(data.IdSources)) - for _, id := range data.IdSources { - ids = append(ids, seq.IDSource{ - ID: seq.ID{MID: seq.MID(id.Id.Mid), RID: seq.RID(id.Id.Rid)}, - Hint: id.Hint, - }) - } - - send := func(block []byte) error { - // TODO: get rid of hardcode - docBlock := storage.DocBlock(block) - return stream.Send(&storeapi.OnePhaseSearchResponse{ - ResponseType: &storeapi.OnePhaseSearchResponse_Batch{ - Batch: &storeapi.RecordsBatch{ - // TODO: batch - Records: []*storeapi.Record{ - { - RawData: [][]byte{ - Uint64ToBytes(docBlock.GetExt1()), - Uint64ToBytes(docBlock.GetExt2()), - docBlock.Payload(), - }, - }, - }, - }, - }, - }) - } - err = g.doFetch(ctx, ids, req.FieldsFilter, req.Explain, send) - if err != nil { - return fmt.Errorf("fetch error: %w", err) + if req.FieldsFilter != nil && len(req.FieldsFilter.Fields) > 0 { + producer = exec.NewDocPrejector(producer, 2, req.FieldsFilter) } - return nil + return producer, nil } // TODO: bytes pool (???), varint (???) @@ -394,16 +308,7 @@ func (g *GrpcV1) doOnePhaseSearchWithAggs( return nil } -func extractStatsPipesFromQuery(searchQuery string) []parser.StatsAgg { - if searchQuery == "" { - return nil - } - - seqql, err := parser.ParseSeqQL(searchQuery, nil) - if err != nil { - return nil - } - +func extractStatsPipesFromSeqQL(seqql parser.SeqQLQuery) []parser.StatsAgg { var result []parser.StatsAgg for _, pipe := range seqql.Pipes { statsPipe, ok := pipe.(*parser.PipeStats) From fd8ed9f5d590ab4c685dbad761fef14f66c2ce08 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Fri, 15 May 2026 14:19:26 +0500 Subject: [PATCH 11/14] feat(query engine): add sort pipe to seq-ql, add sorter executor --- parser/seqql_pipes.go | 55 ++++++++++++++- parser/seqql_pipes_test.go | 26 +++++++ proxy/search/one_phase_search.go | 11 ++- proxyapi/grpc_one_phase_search.go | 7 +- query/exec/filter.go | 1 + query/exec/filter_test.go | 2 +- query/exec/projector.go | 2 +- query/exec/projector_test.go | 2 +- query/exec/sorter.go | 104 ++++++++++++++++++++++++++++ query/exec/sorter_test.go | 109 ++++++++++++++++++++++++++++++ storeapi/grpc_one_phase_search.go | 8 ++- 11 files changed, 317 insertions(+), 10 deletions(-) create mode 100644 query/exec/sorter.go create mode 100644 query/exec/sorter_test.go diff --git a/parser/seqql_pipes.go b/parser/seqql_pipes.go index 12274661..13fa56e7 100644 --- a/parser/seqql_pipes.go +++ b/parser/seqql_pipes.go @@ -15,6 +15,7 @@ func parsePipes(lex *lexer) ([]Pipe, error) { fieldFilters := 0 filterPipes := 0 limitPipes := 0 + sortPipes := 0 var pipes []Pipe for !lex.IsEnd() { if !lex.IsKeyword("|") { @@ -50,6 +51,13 @@ func parsePipes(lex *lexer) ([]Pipe, error) { } pipes = append(pipes, p) limitPipes++ + case lex.IsKeyword("sort"): + p, err := parsePipeSort(lex) + if err != nil { + return nil, fmt.Errorf("parsing 'sort' pipe: %s", err) + } + pipes = append(pipes, p) + sortPipes++ default: return nil, fmt.Errorf("unknown pipe: %s", lex.Token) } @@ -63,6 +71,9 @@ func parsePipes(lex *lexer) ([]Pipe, error) { if limitPipes > 1 { return nil, fmt.Errorf("multiple limit pipes is not allowed") } + if sortPipes > 1 { + return nil, fmt.Errorf("multiple sort pipes is not allowed") + } } return pipes, nil } @@ -277,6 +288,48 @@ func parsePipeLimit(lex *lexer) (*PipeLimit, error) { return &PipeLimit{Limit: limit}, nil } +type PipeSort struct { + Field string + Order string +} + +func (s *PipeSort) Name() string { + return "sort" +} + +func (s *PipeSort) DumpSeqQL(o *strings.Builder) { + o.WriteString("sort ") + o.WriteString(quoteTokenIfNeeded(s.Field)) + o.WriteString(" ") + o.WriteString(s.Order) +} + +func parsePipeSort(lex *lexer) (*PipeSort, error) { + if !lex.IsKeyword("sort") { + return nil, fmt.Errorf("missing 'sort' keyword") + } + lex.Next() + + field, err := parseCompositeTokenReplaceWildcards(lex) + if err != nil { + return nil, fmt.Errorf("parsing field name: %s", err) + } + if field == "" { + return nil, fmt.Errorf("empty field name") + } + + order := "asc" + if lex.IsKeywords("asc", "desc") { + order = lex.Token + lex.Next() + } + + return &PipeSort{ + Field: field, + Order: order, + }, nil +} + func parseStatsAgg(lex *lexer) (StatsAgg, error) { var agg StatsAgg @@ -423,7 +476,7 @@ var reservedKeywords = uniqueTokens([]string{ "|", // Pipe specific keywords. - "fields", "except", "filter", "limit", "stats", "by", "interval", "unique_count", + "fields", "except", "filter", "limit", "sort", "stats", "by", "interval", "unique_count", "asc", "desc", }) func needQuoteToken(s string) bool { diff --git a/parser/seqql_pipes_test.go b/parser/seqql_pipes_test.go index 0ff4e51e..e42b3f5d 100644 --- a/parser/seqql_pipes_test.go +++ b/parser/seqql_pipes_test.go @@ -131,3 +131,29 @@ func TestParsePipeLimitErrors(t *testing.T) { test(`service:my_service | limit -1`) test(`service:my_service | limit 10 | limit 20`) } + +func TestParsePipeSort(t *testing.T) { + test := func(q, expected string) { + t.Helper() + query, err := ParseSeqQL(q, nil) + require.NoError(t, err) + require.Equal(t, expected, query.SeqQLString()) + } + + test("service:my_service | sort message asc", "service:my_service | sort message asc") + test("service:my_service | sort message desc", "service:my_service | sort message desc") + test("service:my_service | sort message", "service:my_service | sort message asc") + test(`service:my_service | filter unindexed_field:"value" | sort message asc | limit 10`, `service:my_service | filter unindexed_field:value | sort message asc | limit 10`) +} + +func TestParsePipeSortErrors(t *testing.T) { + test := func(q string) { + t.Helper() + _, err := ParseSeqQL(q, nil) + require.Error(t, err) + } + + test(`service:my_service | sort`) + test(`service:my_service | sort field invalid_order`) + test(`service:my_service | sort a:1 | sort b:2`) +} diff --git a/proxy/search/one_phase_search.go b/proxy/search/one_phase_search.go index 8d319f15..ba32501e 100644 --- a/proxy/search/one_phase_search.go +++ b/proxy/search/one_phase_search.go @@ -22,12 +22,13 @@ func (si *Ingestor) OnePhaseSearch( sr *SearchRequest, tr *querytracer.Tracer, ) (*seq.QPR, DocsIterator, AggsIterator, error) { + // TODO: handle consts.ErrIngestorQueryWantsOldData searchStores := si.config.HotStores if si.config.HotReadStores != nil && len(si.config.HotReadStores.Shards) > 0 { searchStores = si.config.HotReadStores } - host := searchStores.Shards[0][0] // TODO: handle multiple stores and shards + host := searchStores.Shards[0][0] // TODO: handle multiple stores and shards !!! client, has := si.clients[host] if !has { @@ -79,6 +80,14 @@ func (si *Ingestor) OnePhaseSearch( return qpr, &OnePhaseSearchDocsIterator{stream: stream, limit: sr.Size}, &OnePhaseSearchAggsIterator{stream: stream, limit: sr.Size}, nil } +func (si *Ingestor) searchShardOnePhase() { + // TODO: +} + +func (si *Ingestor) searchHostOnePhase() { + // TODO: +} + type OnePhaseSearchDocsIterator struct { stream storeapi.StoreApi_OnePhaseSearchClient diff --git a/proxyapi/grpc_one_phase_search.go b/proxyapi/grpc_one_phase_search.go index 05d309ab..6d709e5a 100644 --- a/proxyapi/grpc_one_phase_search.go +++ b/proxyapi/grpc_one_phase_search.go @@ -61,11 +61,10 @@ func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequ if hasAggs { sResp.qpr.Aggs = convertAggsStreamToAggregationResults(aggsStream) - kek := aggregationArgsFromStatsAggs(statsAggs) - allAggs := sResp.qpr.Aggregate(kek) + allAggs := sResp.qpr.Aggregate(aggregationArgsFromStatsAggs(statsAggs)) resp.Aggs = makeProtoAggregation(allAggs) } else { - resp.Docs = makeProtoDocsKek(sResp.docsStream) + resp.Docs = makeProtoDocsOnePhase(sResp.docsStream) } return resp, nil @@ -96,7 +95,7 @@ func convertAggsStreamToAggregationResults(aggs search.AggsIterator) []seq.Aggre return result } -func makeProtoDocsKek(docs search.DocsIterator) []*seqproxyapi.Document { +func makeProtoDocsOnePhase(docs search.DocsIterator) []*seqproxyapi.Document { // TODO: paginate (???) respDocs := make([]*seqproxyapi.Document, 0) for doc, err := docs.Next(); err == nil; doc, err = docs.Next() { diff --git a/query/exec/filter.go b/query/exec/filter.go index b86958b6..dc1b2784 100644 --- a/query/exec/filter.go +++ b/query/exec/filter.go @@ -4,6 +4,7 @@ import ( "cmp" insaneJSON "github.com/ozontech/insane-json" + "github.com/ozontech/seq-db/query" ) diff --git a/query/exec/filter_test.go b/query/exec/filter_test.go index cb13dada..5ad3d93c 100644 --- a/query/exec/filter_test.go +++ b/query/exec/filter_test.go @@ -3,9 +3,9 @@ package exec import ( "testing" + insaneJSON "github.com/ozontech/insane-json" "github.com/stretchr/testify/assert" - insaneJSON "github.com/ozontech/insane-json" "github.com/ozontech/seq-db/query" ) diff --git a/query/exec/projector.go b/query/exec/projector.go index 25ebe0f8..ed829959 100644 --- a/query/exec/projector.go +++ b/query/exec/projector.go @@ -16,7 +16,7 @@ type DocProjector struct { decoderBuf []byte } -func NewDocPrejector( +func NewDocProjector( input query.RecordProducer, colIdx int, filter *storeapi.FieldsFilter, diff --git a/query/exec/projector_test.go b/query/exec/projector_test.go index 67362d63..3602e326 100644 --- a/query/exec/projector_test.go +++ b/query/exec/projector_test.go @@ -37,7 +37,7 @@ func testDocProjector(t *testing.T, fieldsFilter *storeapi.FieldsFilter, wantDoc inputData := makeTestInputRecords(2) input := testProducer{data: inputData} - projector := NewDocPrejector(&input, 1, fieldsFilter) + projector := NewDocProjector(&input, 1, fieldsFilter) outputData := make([]*query.Record, 0) for r, _ := projector.Next(); r != nil; r, _ = projector.Next() { diff --git a/query/exec/sorter.go b/query/exec/sorter.go new file mode 100644 index 00000000..6ca41c88 --- /dev/null +++ b/query/exec/sorter.go @@ -0,0 +1,104 @@ +package exec + +import ( + "slices" + + insaneJSON "github.com/ozontech/insane-json" + + "github.com/ozontech/seq-db/query" +) + +// TODO: use existing type ??? +type Order byte + +const ( + OrderAsc Order = iota + OrderDesc +) + +// TODO: ??? +type ExecutorState byte + +const ( + ExecutorStateReadingInput ExecutorState = iota + ExecutorStateProducingOutput + ExecutorStateDone +) + +type DocSorter struct { + state ExecutorState + input query.RecordProducer + + colIdx int + field string + less func(string, string) bool + + sortingBuf []*query.Record + + curIdx int +} + +func NewDocSorter( + input query.RecordProducer, + colIdx int, + field string, + order Order, +) *DocSorter { + less := func(a, b string) bool { + return a < b + } + if order == OrderDesc { + less = func(a, b string) bool { + return a > b + } + } + + return &DocSorter{ + input: input, + colIdx: colIdx, + field: field, + less: less, + } +} + +func (s *DocSorter) Next() (*query.Record, *query.Metadata) { + for s.state == ExecutorStateReadingInput { + r, meta := s.input.Next() + if meta != nil { + return nil, meta + } + if r == nil { + s.state = ExecutorStateProducingOutput + break + } + + s.sortingBuf = append(s.sortingBuf, r) + } + + slices.SortFunc(s.sortingBuf, func(a, b *query.Record) int { + if a == nil || b == nil { + return 0 // TODO: ??? + } + + aVal := a.Vals[s.colIdx].Decoded().(*insaneJSON.Root).Dig(s.field).AsString() + bVal := b.Vals[s.colIdx].Decoded().(*insaneJSON.Root).Dig(s.field).AsString() + + if aVal == bVal { + return 0 + } + if s.less(aVal, bVal) { + return -1 + } + return 1 + }) + + if s.curIdx >= len(s.sortingBuf) { + s.state = ExecutorStateDone + return nil, nil + } + + r := s.sortingBuf[s.curIdx] + s.curIdx++ + + return r, nil +} diff --git a/query/exec/sorter_test.go b/query/exec/sorter_test.go new file mode 100644 index 00000000..de414a1e --- /dev/null +++ b/query/exec/sorter_test.go @@ -0,0 +1,109 @@ +package exec + +import ( + "fmt" + "testing" + + insaneJSON "github.com/ozontech/insane-json" + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" +) + +func TestSorterAsc(t *testing.T) { + const field = "service" + + inputData := makeDocSorterTestRecords([]string{ + "service-03", + "service-01", + "service-02", + }) + input := testProducer{data: inputData} + + sorter := NewDocSorter(&input, 1, field, OrderAsc) + + outputData := collectRecords(sorter) + + assert.Equal(t, []string{"service-01", "service-02", "service-03"}, extractFieldValues(outputData, field)) +} + +func TestSorterDesc(t *testing.T) { + const field = "service" + + inputData := makeDocSorterTestRecords([]string{ + "service-01", + "service-03", + "service-02", + }) + input := testProducer{data: inputData} + + sorter := NewDocSorter(&input, 1, field, OrderDesc) + + outputData := collectRecords(sorter) + + assert.Equal(t, []string{"service-03", "service-02", "service-01"}, extractFieldValues(outputData, field)) +} + +func TestSorterEmptyInput(t *testing.T) { + const field = "service" + + inputData := make([]*query.Record, 0) + input := testProducer{data: inputData} + + sorter := NewDocSorter(&input, 1, field, OrderAsc) + + outputData := collectRecords(sorter) + + assert.Empty(t, outputData) +} + +func TestSorterEqualValues(t *testing.T) { + const field = "service" + + inputData := makeDocSorterTestRecords([]string{ + "service-02", + "service-02", + "service-01", + "service-02", + }) + input := testProducer{data: inputData} + + sorter := NewDocSorter(&input, 1, field, OrderAsc) + + outputData := collectRecords(sorter) + + assert.Equal(t, []string{"service-01", "service-02", "service-02", "service-02"}, extractFieldValues(outputData, field)) +} + +func makeDocSorterTestRecords(values []string) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + doc := fmt.Sprintf(`{"service":%q,"level":3}`, v) + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeUint32, Uint32ToBytes(1)), + query.NewRecordVals(query.DataTypeDocument, []byte(doc)), + }, + }) + } + + return out +} + +func collectRecords(p query.RecordProducer) []*query.Record { + out := make([]*query.Record, 0) + for r, _ := p.Next(); r != nil; r, _ = p.Next() { + out = append(out, r) + } + return out +} + +func extractFieldValues(records []*query.Record, field string) []string { + out := make([]string, 0, len(records)) + for _, r := range records { + val := r.Vals[1].Decoded().(*insaneJSON.Root).Dig(field).AsString() + out = append(out, val) + } + return out +} diff --git a/storeapi/grpc_one_phase_search.go b/storeapi/grpc_one_phase_search.go index 770ebd75..65584f34 100644 --- a/storeapi/grpc_one_phase_search.go +++ b/storeapi/grpc_one_phase_search.go @@ -188,6 +188,12 @@ func (g *GrpcV1) buildProducer( switch p := pipe.(type) { case *parser.PipeFilter: producer = exec.NewFilter(producer, 2, exec.NewDocFilter(p.Condition.Field, exec.NewEq(p.Condition.Value))) + case *parser.PipeSort: + order := exec.OrderAsc + if p.Order == "desc" { + order = exec.OrderDesc + } + producer = exec.NewDocSorter(producer, 2, p.Field, order) case *parser.PipeLimit: producer = exec.NewLimiter(producer, uint32(p.Limit)) default: @@ -196,7 +202,7 @@ func (g *GrpcV1) buildProducer( } if req.FieldsFilter != nil && len(req.FieldsFilter.Fields) > 0 { - producer = exec.NewDocPrejector(producer, 2, req.FieldsFilter) + producer = exec.NewDocProjector(producer, 2, req.FieldsFilter) } return producer, nil From 9239540c0f73fc0c3c7426f476a544a79ce86184 Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Fri, 22 May 2026 15:42:54 +0500 Subject: [PATCH 12/14] chore(query engine): merge stores responses --- proxy/search/one_phase_search.go | 245 +++++++++++--- proxyapi/grpc_one_phase_search.go | 67 ++-- proxyapi/grpc_v1.go | 9 +- proxyapi/mock/grpc_v1.go | 5 +- query/exec/merger.go | 197 +++++++++++- query/exec/merger_test.go | 513 ++++++++++++++++++++++++++++++ query/record.go | 7 + storeapi/grpc_one_phase_search.go | 23 +- 8 files changed, 976 insertions(+), 90 deletions(-) create mode 100644 query/exec/merger_test.go diff --git a/proxy/search/one_phase_search.go b/proxy/search/one_phase_search.go index ba32501e..db58ec2d 100644 --- a/proxy/search/one_phase_search.go +++ b/proxy/search/one_phase_search.go @@ -7,45 +7,199 @@ import ( "fmt" "io" "math" + "sync" "github.com/alecthomas/units" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/timestamppb" + "github.com/ozontech/seq-db/consts" + "github.com/ozontech/seq-db/logger" + "github.com/ozontech/seq-db/metric" "github.com/ozontech/seq-db/pkg/storeapi" + "github.com/ozontech/seq-db/proxy/stores" + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/query/exec" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" + "github.com/ozontech/seq-db/util" ) func (si *Ingestor) OnePhaseSearch( ctx context.Context, sr *SearchRequest, tr *querytracer.Tracer, -) (*seq.QPR, DocsIterator, AggsIterator, error) { - // TODO: handle consts.ErrIngestorQueryWantsOldData +) (*seq.QPR, query.RecordProducer, AggsIterator, error) { searchStores := si.config.HotStores if si.config.HotReadStores != nil && len(si.config.HotReadStores.Shards) > 0 { searchStores = si.config.HotReadStores } - host := searchStores.Shards[0][0] // TODO: handle multiple stores and shards !!! + var partialRespErr error + qprs, docs, aggs, err := si.searchStoresOnePhase(ctx, sr, searchStores, tr) + if err != nil { + switch { + case errors.Is(err, consts.ErrIngestorQueryWantsOldData): + if len(si.config.ReadStores.Shards) == 0 { + logger.Error("no cold stores, but hot mode is enabled, bad configuration of stores!") + return nil, nil, nil, err + } + metric.SearchColdTotal.Inc() + qprs, docs, aggs, err = si.searchStoresOnePhase(ctx, sr, si.config.ReadStores, tr) + if err != nil { + metric.SearchColdErrors.Add(1) + if errors.Is(err, consts.ErrPartialResponse) { + partialRespErr = err // consider partial response from cold stores as a result + } else { + // errors from both hot and cold stores, return error + return nil, nil, nil, err + } + } + case errors.Is(err, consts.ErrPartialResponse): + partialRespErr = err // consider partial response from hot stores as a result + default: + // unexpected error on all hot replica sets (usually bad query) + return nil, nil, nil, err + } + } + + // TODO: do we really need QPR (???) + resQpr := &seq.QPR{ + Histogram: make(map[seq.MID]uint64), + Aggs: make([]seq.AggregatableSamples, len(sr.AggQ)), + } + seq.MergeQPRs(resQpr, qprs, sr.Offset+sr.Size, sr.Interval, sr.Order) + + mergedDocsStream := exec.NewNMergedProducers(docs, 0, "", query.DataTypeUint64, execOrderFromSeqOrder(sr.Order)) + limiter := exec.NewLimiter(mergedDocsStream, uint32(sr.Size)) // TODO: offset + + return resQpr, limiter, aggs[0], partialRespErr +} + +func (si *Ingestor) searchStoresOnePhase( + ctx context.Context, + sr *SearchRequest, + s *stores.Stores, + tr *querytracer.Tracer, +) ([]*seq.QPR, []query.RecordProducer, []AggsIterator, error) { + type ShardResponse struct { + QPR *seq.QPR + Docs query.RecordProducer + Aggs AggsIterator + Err error + } + + wg := sync.WaitGroup{} + wg.Add(len(s.Shards)) + respChan := make(chan ShardResponse, len(s.Shards)) + for _, shard := range s.Shards { + searchShardTr := tr.NewChild("proxy/searchShardOnePhase") + go func(shard []string, tr *querytracer.Tracer) { + defer wg.Done() + defer tr.Done() + + qpr, docs, aggs, err := si.searchShardOnePhase(ctx, shard, sr, tr) + respChan <- ShardResponse{ + QPR: qpr, + Docs: docs, + Aggs: aggs, + Err: err, + } + }(shard, searchShardTr) + } + + go func() { + wg.Wait() + close(respChan) + }() + + qprs := make([]*seq.QPR, 0, len(s.Shards)) + docs := make([]query.RecordProducer, 0, len(s.Shards)) + aggs := make([]AggsIterator, 0, len(s.Shards)) + var errs []error + for resp := range respChan { + if err := resp.Err; err != nil { + if errors.Is(err, consts.ErrIngestorQueryWantsOldData) { + // At least one hot store doesn't have such old data + return nil, nil, nil, err + } + if errors.Is(err, consts.ErrTooManyFractionsHit) { + return nil, nil, nil, err + } + errs = append(errs, err) + continue + } + + qprs = append(qprs, resp.QPR) + docs = append(docs, resp.Docs) + aggs = append(aggs, resp.Aggs) + } + + if err := util.DeduplicateErrors(errs); err != nil { + if len(qprs) != 0 { + // There are errors, but some Shards returned data, so provide it to user + return qprs, docs, aggs, fmt.Errorf("%w: %s", consts.ErrPartialResponse, err) + } + return nil, nil, nil, err + } + + return qprs, docs, aggs, nil +} + +func (si *Ingestor) searchShardOnePhase( + ctx context.Context, + hosts []string, + request *SearchRequest, + tr *querytracer.Tracer, +) (*seq.QPR, query.RecordProducer, AggsIterator, error) { + var idx []int + if si.config.ShuffleReplicas { + idx = util.IdxShuffle(len(hosts)) + } else { + idx = util.IdxFill(len(hosts)) + } + + var errs []error + for i := range len(hosts) { + host := hosts[idx[i]] + tr.Printf("Making search request to %s", host) + qpr, docs, aggs, err := si.searchHostOnePhase(ctx, hosts[i], request, tr) // TODO: + if err != nil { + if errors.Is(err, consts.ErrIngestorQueryWantsOldData) { + return nil, nil, nil, err + } + errs = append(errs, err) + continue + } + return qpr, docs, aggs, nil + } + + return nil, nil, nil, util.DeduplicateErrors(errs) +} + +func (si *Ingestor) searchHostOnePhase( + ctx context.Context, + host string, + request *SearchRequest, + _ *querytracer.Tracer, +) (*seq.QPR, query.RecordProducer, AggsIterator, error) { client, has := si.clients[host] if !has { return nil, nil, nil, fmt.Errorf("can't fetch: no client for host %s", host) } - fieldsFilter := tryParseFieldsFilter(string(sr.Q)) + fieldsFilter := tryParseFieldsFilter(string(request.Q)) req := &storeapi.OnePhaseSearchRequest{ - Query: string(sr.Q), - From: timestamppb.New(sr.From.Time()), - To: timestamppb.New(sr.To.Time()), - Size: int64(sr.Size), - Offset: int64(sr.Offset), - Explain: sr.Explain, - WithTotal: sr.WithTotal, - Order: storeapi.Order(sr.Order), - OffsetId: sr.OffsetId, + Query: string(request.Q), + From: timestamppb.New(request.From.Time()), + To: timestamppb.New(request.To.Time()), + Size: int64(request.Size), + Offset: int64(request.Offset), + Explain: request.Explain, + WithTotal: request.WithTotal, + Order: storeapi.Order(request.Order), + OffsetId: request.OffsetId, FieldsFilter: &storeapi.FieldsFilter{ Fields: fieldsFilter.Fields, AllowList: fieldsFilter.AllowList, @@ -57,7 +211,7 @@ func (si *Ingestor) OnePhaseSearch( grpc.MaxCallSendMsgSize(256*int(units.MiB)), ) if err != nil { - return nil, nil, nil, fmt.Errorf("can't fetch docs: %s", err.Error()) + return nil, nil, nil, fmt.Errorf("can't open stream: %s", err.Error()) } msg, err := stream.Recv() @@ -67,6 +221,14 @@ func (si *Ingestor) OnePhaseSearch( header := msg.GetHeader() + if header == nil { + return nil, nil, nil, fmt.Errorf("can't read header") + } + + if header.Metadata.Code == storeapi.SearchErrorCode_INGESTOR_QUERY_WANTS_OLD_DATA { + return nil, nil, nil, fmt.Errorf("hot store refuses: %w", consts.ErrIngestorQueryWantsOldData) + } + errs := make([]seq.ErrorSource, 0, len(header.Metadata.Errors)) for _, err := range header.Metadata.Errors { errs = append(errs, seq.ErrorSource{ErrStr: err}) @@ -77,56 +239,40 @@ func (si *Ingestor) OnePhaseSearch( Errors: errs, } - return qpr, &OnePhaseSearchDocsIterator{stream: stream, limit: sr.Size}, &OnePhaseSearchAggsIterator{stream: stream, limit: sr.Size}, nil -} - -func (si *Ingestor) searchShardOnePhase() { - // TODO: -} - -func (si *Ingestor) searchHostOnePhase() { - // TODO: + return qpr, + &OnePhaseSearchDocsIterator{typing: header.Typing, stream: stream}, + &OnePhaseSearchAggsIterator{stream: stream, limit: request.Size}, + nil } +// TODO: move to executor (???) type OnePhaseSearchDocsIterator struct { + typing []*storeapi.Typing stream storeapi.StoreApi_OnePhaseSearchClient curBatch []*storeapi.Record - - fetched int - limit int } -func (it *OnePhaseSearchDocsIterator) Next() (StreamingDoc, error) { - if it.fetched >= it.limit { - return StreamingDoc{}, io.EOF - } - +func (it *OnePhaseSearchDocsIterator) Next() (*query.Record, *query.Metadata) { if len(it.curBatch) == 0 { data, err := it.stream.Recv() if errors.Is(err, io.EOF) { - return StreamingDoc{}, io.EOF + return nil, &query.Metadata{Err: io.EOF} } if err != nil { - return StreamingDoc{}, err + return nil, &query.Metadata{Err: err} } it.curBatch = data.GetBatch().Records } - // TODO: get fields values from columns info - record := it.curBatch[0] it.curBatch = it.curBatch[1:] - it.fetched++ - - return StreamingDoc{ - ID: seq.ID{ - MID: seq.MID(binary.LittleEndian.Uint64(record.RawData[0])), - RID: seq.RID(binary.LittleEndian.Uint64(record.RawData[1])), - }, - Data: record.RawData[2], - }, nil + recordVals := make([]*query.RecordVals, 0, len(record.RawData)) + for i, rawData := range record.RawData { + recordVals = append(recordVals, query.NewRecordVals(query.DataType(it.typing[i].Type), rawData)) + } + return query.NewRecord(recordVals), nil } type StreamingAgg struct { @@ -187,3 +333,14 @@ func (it *OnePhaseSearchAggsIterator) Next() (StreamingAgg, error) { func Float64FromBytes(in []byte) float64 { return math.Float64frombits(binary.LittleEndian.Uint64(in)) } + +func execOrderFromSeqOrder(in seq.DocsOrder) exec.Order { + switch in { + case seq.DocsOrderAsc: + return exec.OrderAsc + case seq.DocsOrderDesc: + return exec.OrderDesc + default: + panic("unexpected") + } +} diff --git a/proxyapi/grpc_one_phase_search.go b/proxyapi/grpc_one_phase_search.go index 6d709e5a..83dd1b85 100644 --- a/proxyapi/grpc_one_phase_search.go +++ b/proxyapi/grpc_one_phase_search.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "io" "time" "go.opencensus.io/trace" @@ -16,6 +17,7 @@ import ( "github.com/ozontech/seq-db/parser" "github.com/ozontech/seq-db/pkg/seqproxyapi/v1" "github.com/ozontech/seq-db/proxy/search" + "github.com/ozontech/seq-db/query" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" ) @@ -36,7 +38,7 @@ func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequ WithTotal: req.WithTotal, Order: req.Order, } - sResp, aggsStream, err := g.doOnePhaseSearch(ctx, proxyReq, true) + sResp, docsStream, aggsStream, err := g.doOnePhaseSearch(ctx, proxyReq, true) if err != nil { return nil, err } @@ -64,7 +66,7 @@ func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequ allAggs := sResp.qpr.Aggregate(aggregationArgsFromStatsAggs(statsAggs)) resp.Aggs = makeProtoAggregation(allAggs) } else { - resp.Docs = makeProtoDocsOnePhase(sResp.docsStream) + resp.Docs = makeProtoDocsOnePhase(docsStream) } return resp, nil @@ -95,16 +97,33 @@ func convertAggsStreamToAggregationResults(aggs search.AggsIterator) []seq.Aggre return result } -func makeProtoDocsOnePhase(docs search.DocsIterator) []*seqproxyapi.Document { - // TODO: paginate (???) +func makeProtoDocsOnePhase(input query.RecordProducer) []*seqproxyapi.Document { respDocs := make([]*seqproxyapi.Document, 0) - for doc, err := docs.Next(); err == nil; doc, err = docs.Next() { + + for { + r, meta := input.Next() + if meta != nil { + if !errors.Is(meta.Err, io.EOF) { + // TODO: handle error + panic(fmt.Errorf("stream error: %w", meta.Err)) + } + break + } + if r == nil { + break + } + + docID := seq.ID{ + MID: seq.MID(r.Vals[0].Decoded().(uint64)), + RID: seq.RID(r.Vals[1].Decoded().(uint64)), + } respDocs = append(respDocs, &seqproxyapi.Document{ - Id: doc.ID.String(), - Data: doc.Data, - Time: timestamppb.New(doc.ID.MID.Time()), + Id: docID.String(), + Data: r.Vals[2].RawData(), + Time: timestamppb.New(docID.MID.Time()), }) } + return respDocs } @@ -112,20 +131,20 @@ func (g *grpcV1) doOnePhaseSearch( ctx context.Context, req *seqproxyapi.ComplexSearchRequest, shouldFetch bool, -) (*proxySearchResponse, search.AggsIterator, error) { +) (*proxySearchResponse, query.RecordProducer, search.AggsIterator, error) { metric.SearchOverall.Add(1) span := trace.FromContext(ctx) defer span.End() if req.Query == nil { - return nil, nil, status.Error(codes.InvalidArgument, "search query must be provided") + return nil, nil, nil, status.Error(codes.InvalidArgument, "search query must be provided") } if req.Query.From == nil || req.Query.To == nil { - return nil, nil, status.Error(codes.InvalidArgument, `search query "from" and "to" fields must be provided`) + return nil, nil, nil, status.Error(codes.InvalidArgument, `search query "from" and "to" fields must be provided`) } if req.Offset != 0 && req.OffsetId != "" { - return nil, nil, status.Error(codes.InvalidArgument, `only one of "offset" and "offset_id" must be provided`) + return nil, nil, nil, status.Error(codes.InvalidArgument, `only one of "offset" and "offset_id" must be provided`) } fromTime := req.Query.From.AsTime() @@ -146,7 +165,7 @@ func (g *grpcV1) doOnePhaseSearch( rlQuery := getSearchQueryFromGRPCReqForRateLimiter(req) if !g.rateLimiter.Account(rlQuery) { - return nil, nil, status.Error(codes.ResourceExhausted, consts.ErrRequestWasRateLimited.Error()) + return nil, nil, nil, status.Error(codes.ResourceExhausted, consts.ErrRequestWasRateLimited.Error()) } proxyReq := &search.SearchRequest{ @@ -163,25 +182,25 @@ func (g *grpcV1) doOnePhaseSearch( } tr := querytracer.New(req.Query.Explain, "proxy/OnePhaseSearch") + // TODO: do we really need QPR here (???) qpr, docsStream, aggsStream, err := g.searchIngestor.OnePhaseSearch(ctx, proxyReq, tr) psr := &proxySearchResponse{ - qpr: qpr, - docsStream: docsStream, + qpr: qpr, } if e, ok := parseProxyError(err); ok { psr.err = e - return psr, nil, nil + return psr, nil, nil, nil } if errors.Is(err, consts.ErrInvalidArgument) { - return nil, nil, status.Error(codes.InvalidArgument, err.Error()) + return nil, nil, nil, status.Error(codes.InvalidArgument, err.Error()) } if st, ok := status.FromError(err); ok { // could not parse a query if st.Code() == codes.InvalidArgument { - return nil, nil, err + return nil, nil, nil, err } } @@ -191,24 +210,24 @@ func (g *grpcV1) doOnePhaseSearch( Code: seqproxyapi.ErrorCode_ERROR_CODE_PARTIAL_RESPONSE, Message: err.Error(), } - return psr, aggsStream, nil + return psr, docsStream, aggsStream, nil } if err = processSearchErrors(qpr, err); err != nil { metric.SearchErrors.Inc() - return nil, nil, err + return nil, nil, nil, err } g.tryMirrorRequest(req) - return psr, aggsStream, nil + return psr, docsStream, aggsStream, nil } -func extractStatsPipesFromQuery(query string) []parser.StatsAgg { - if query == "" { +func extractStatsPipesFromQuery(q string) []parser.StatsAgg { + if q == "" { return nil } - seqql, err := parser.ParseSeqQL(query, nil) + seqql, err := parser.ParseSeqQL(q, nil) if err != nil { return nil } diff --git a/proxyapi/grpc_v1.go b/proxyapi/grpc_v1.go index 2299ba06..ebf79d00 100644 --- a/proxyapi/grpc_v1.go +++ b/proxyapi/grpc_v1.go @@ -24,6 +24,7 @@ import ( "github.com/ozontech/seq-db/parser" "github.com/ozontech/seq-db/pkg/seqproxyapi/v1" "github.com/ozontech/seq-db/proxy/search" + "github.com/ozontech/seq-db/query" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" "github.com/ozontech/seq-db/util" @@ -38,7 +39,7 @@ type SearchIngestor interface { CancelAsyncSearch(ctx context.Context, id string) error DeleteAsyncSearch(ctx context.Context, id string) error GetAsyncSearchesList(context.Context, search.GetAsyncSearchesListRequest) ([]*search.AsyncSearchesListItem, error) - OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, search.AggsIterator, error) + OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, query.RecordProducer, search.AggsIterator, error) } type MappingProvider interface { @@ -474,12 +475,12 @@ func shouldHaveResponse(code seqproxyapi.ErrorCode) bool { return code == seqproxyapi.ErrorCode_ERROR_CODE_NO || code == seqproxyapi.ErrorCode_ERROR_CODE_PARTIAL_RESPONSE } -func ExtractStatsPipes(query string) ([]parser.StatsAgg, error) { - if query == "" { +func ExtractStatsPipes(q string) ([]parser.StatsAgg, error) { + if q == "" { return nil, nil } - seqql, err := parser.ParseSeqQL(query, nil) + seqql, err := parser.ParseSeqQL(q, nil) if err != nil { return nil, err } diff --git a/proxyapi/mock/grpc_v1.go b/proxyapi/mock/grpc_v1.go index 30c83fcc..16a663d5 100644 --- a/proxyapi/mock/grpc_v1.go +++ b/proxyapi/mock/grpc_v1.go @@ -14,6 +14,7 @@ import ( seqproxyapi "github.com/ozontech/seq-db/pkg/seqproxyapi/v1" search "github.com/ozontech/seq-db/proxy/search" + query "github.com/ozontech/seq-db/query" querytracer "github.com/ozontech/seq-db/querytracer" seq "github.com/ozontech/seq-db/seq" ) @@ -116,11 +117,11 @@ func (mr *MockSearchIngestorMockRecorder) GetAsyncSearchesList(arg0, arg1 interf } // OnePhaseSearch mocks base method. -func (m *MockSearchIngestor) OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, search.AggsIterator, error) { +func (m *MockSearchIngestor) OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, query.RecordProducer, search.AggsIterator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OnePhaseSearch", ctx, sr, tr) ret0, _ := ret[0].(*seq.QPR) - ret1, _ := ret[1].(search.DocsIterator) + ret1, _ := ret[1].(query.RecordProducer) ret2, _ := ret[2].(search.AggsIterator) ret3, _ := ret[3].(error) return ret0, ret1, ret2, ret3 diff --git a/query/exec/merger.go b/query/exec/merger.go index 5aae9b58..b5ab5499 100644 --- a/query/exec/merger.go +++ b/query/exec/merger.go @@ -1,28 +1,207 @@ package exec -import "github.com/ozontech/seq-db/query" +import ( + insaneJSON "github.com/ozontech/insane-json" + + "github.com/ozontech/seq-db/query" +) -// nolint:unused // TODO: type Merger struct { - left query.RecordProducer - right query.RecordProducer + left, right query.RecordProducer + + curLeft, curRight *query.Record - curLeft *query.Record - curRight *query.Record + colIdx int + field string + dataType query.DataType + order Order + less func(any, any) int - colIdx int + done bool } func NewMerger( left query.RecordProducer, right query.RecordProducer, + colIdx int, + field string, + dataType query.DataType, + order Order, ) *Merger { + less := createLessFunc() + return &Merger{ - left: left, - right: right, + left: left, + right: right, + colIdx: colIdx, + field: field, + dataType: dataType, + order: order, + less: less, + curLeft: nil, + curRight: nil, + done: false, } } func (m *Merger) Next() (*query.Record, *query.Metadata) { + if m.done { + return nil, nil + } + + if m.curLeft == nil { + m.curLeft, _ = m.left.Next() + } + if m.curRight == nil { + m.curRight, _ = m.right.Next() + } + + if m.curLeft == nil && m.curRight == nil { + m.done = true + return nil, nil + } + + if m.curLeft == nil { + r := m.curRight + m.curRight, _ = m.right.Next() + return r, nil + } + + if m.curRight == nil { + r := m.curLeft + m.curLeft, _ = m.left.Next() + return r, nil + } + + leftVal := m.extractValue(m.curLeft) + rightVal := m.extractValue(m.curRight) + + cmp := m.less(leftVal, rightVal) + + chooseLeft := cmp <= 0 + if m.order == OrderDesc { + chooseLeft = cmp >= 0 + } + + if chooseLeft { + r := m.curLeft + m.curLeft, _ = m.left.Next() + return r, nil + } + + r := m.curRight + m.curRight, _ = m.right.Next() + return r, nil +} + +func (m *Merger) extractValue(r *query.Record) any { + val := r.Vals[m.colIdx] + decoded := val.Decoded() + + switch m.dataType { + case query.DataTypeDocument: + if m.field == "" { + return decoded + } + return decoded.(*insaneJSON.Root).Dig(m.field).AsString() + case query.DataTypeString: + return decoded.(string) + case query.DataTypeUint32: + return decoded.(uint32) + case query.DataTypeUint64: + return decoded.(uint64) + case query.DataTypeInt32: + return decoded.(int32) + case query.DataTypeInt64: + return decoded.(int64) + case query.DataTypeFloat64: + return decoded.(float64) + default: + return "" + } +} + +func createLessFunc() func(any, any) int { + // TODO: use m.dataType (???) + return func(a, b any) int { + switch v := a.(type) { + case uint32: + if v == b.(uint32) { + return 0 + } + if v < b.(uint32) { + return -1 + } + return 1 + case uint64: + if v == b.(uint64) { + return 0 + } + if v < b.(uint64) { + return -1 + } + return 1 + case int32: + if v == b.(int32) { + return 0 + } + if v < b.(int32) { + return -1 + } + return 1 + case int64: + if v == b.(int64) { + return 0 + } + if v < b.(int64) { + return -1 + } + return 1 + case float64: + if v == b.(float64) { + return 0 + } + if v < b.(float64) { + return -1 + } + return 1 + case string: + if v == b.(string) { + return 0 + } + if v < b.(string) { + return -1 + } + return 1 + } + return 0 + } +} + +func NewNMergedProducers( + producers []query.RecordProducer, + colIdx int, + field string, + dataType query.DataType, + order Order, +) query.RecordProducer { + if len(producers) == 0 { + return &emptyRecordProducer{} + } + + if len(producers) == 1 { + return NewMerger(producers[0], &emptyRecordProducer{}, colIdx, field, dataType, order) + } + + merged := NewMerger(producers[0], producers[1], colIdx, field, dataType, order) + for _, p := range producers[2:] { + merged = NewMerger(merged, p, colIdx, field, dataType, order) + } + return merged +} + +type emptyRecordProducer struct{} + +func (e *emptyRecordProducer) Next() (*query.Record, *query.Metadata) { return nil, nil } diff --git a/query/exec/merger_test.go b/query/exec/merger_test.go new file mode 100644 index 00000000..dc68e84d --- /dev/null +++ b/query/exec/merger_test.go @@ -0,0 +1,513 @@ +package exec + +import ( + "encoding/binary" + "fmt" + "math" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" +) + +func TestMergerAsc(t *testing.T) { + const field = "service" + + leftInput := makeMergerTestRecords([]string{ + "service-01", + "service-03", + "service-05", + }) + rightInput := makeMergerTestRecords([]string{ + "service-02", + "service-04", + "service-06", + }) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 1, + field, + query.DataTypeDocument, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []string{ + "service-01", "service-02", "service-03", + "service-04", "service-05", "service-06", + }, extractFieldValues(outputData, field)) +} + +func TestMergerDesc(t *testing.T) { + const field = "service" + + leftInput := makeMergerTestRecords([]string{ + "service-06", + "service-04", + "service-02", + }) + rightInput := makeMergerTestRecords([]string{ + "service-05", + "service-03", + "service-01", + }) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 1, + field, + query.DataTypeDocument, + OrderDesc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []string{ + "service-06", "service-05", "service-04", + "service-03", "service-02", "service-01", + }, extractFieldValues(outputData, field)) +} + +func TestMergerLeftEmpty(t *testing.T) { + const field = "service" + + leftInput := makeMergerTestRecords([]string{}) + rightInput := makeMergerTestRecords([]string{ + "service-01", + "service-02", + }) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 1, + field, + query.DataTypeDocument, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []string{"service-01", "service-02"}, extractFieldValues(outputData, field)) +} + +func TestMergerRightEmpty(t *testing.T) { + const field = "service" + + leftInput := makeMergerTestRecords([]string{ + "service-01", + "service-02", + }) + rightInput := makeMergerTestRecords([]string{}) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 1, + field, + query.DataTypeDocument, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []string{"service-01", "service-02"}, extractFieldValues(outputData, field)) +} + +func TestMergerBothEmpty(t *testing.T) { + const field = "service" + + leftInput := makeMergerTestRecords([]string{}) + rightInput := makeMergerTestRecords([]string{}) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 1, + field, + query.DataTypeDocument, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Empty(t, outputData) +} + +func TestMergerDuplicates(t *testing.T) { + const field = "service" + + leftInput := makeMergerTestRecords([]string{ + "service-01", + "service-01", + "service-03", + }) + rightInput := makeMergerTestRecords([]string{ + "service-01", + "service-02", + "service-03", + }) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 1, + field, + query.DataTypeDocument, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []string{ + "service-01", "service-01", "service-01", + "service-02", "service-03", "service-03", + }, extractFieldValues(outputData, field)) +} + +func TestMergerUint32(t *testing.T) { + leftInput := makeMergerUint32Records([]uint32{1, 3, 5}) + rightInput := makeMergerUint32Records([]uint32{2, 4, 6}) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeUint32, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []uint32{1, 2, 3, 4, 5, 6}, extractUint32Values(outputData)) +} + +func TestMergerUint64(t *testing.T) { + leftInput := makeMergerUint64Records([]uint64{10, 30, 50}) + rightInput := makeMergerUint64Records([]uint64{20, 40, 60}) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeUint64, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []uint64{10, 20, 30, 40, 50, 60}, extractUint64Values(outputData)) +} + +func TestMergerInt32(t *testing.T) { + leftInput := makeMergerInt32Records([]int32{-5, 0, 5}) + rightInput := makeMergerInt32Records([]int32{-3, 2, 10}) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeInt32, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []int32{-5, -3, 0, 2, 5, 10}, extractInt32Values(outputData)) +} + +func TestMergerInt64(t *testing.T) { + leftInput := makeMergerInt64Records([]int64{100, 0, -100}) + rightInput := makeMergerInt64Records([]int64{200, 50, -50}) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeInt64, + OrderDesc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []int64{200, 100, 50, 0, -50, -100}, extractInt64Values(outputData)) +} + +func TestMergerFloat64(t *testing.T) { + leftInput := makeMergerFloat64Records([]float64{1.5, 3.5, 5.5}) + rightInput := makeMergerFloat64Records([]float64{2.5, 4.5, 6.5}) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeFloat64, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []float64{1.5, 2.5, 3.5, 4.5, 5.5, 6.5}, extractFloat64Values(outputData)) +} + +func TestMergerString(t *testing.T) { + leftInput := makeMergerStringRecords([]string{"apple", "banana", "cherry"}) + rightInput := makeMergerStringRecords([]string{"apricot", "date", "elder"}) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeString, + OrderAsc, + ) + + outputData := collectRecords(merger) + + assert.Equal(t, []string{"apple", "apricot", "banana", "cherry", "date", "elder"}, extractStringValues(outputData)) +} + +func makeMergerTestRecords(values []string) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + doc := fmt.Sprintf(`{"service":%q,"level":3}`, v) + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeUint32, Uint32ToBytes(1)), + query.NewRecordVals(query.DataTypeDocument, []byte(doc)), + }, + }) + } + + return out +} + +func makeMergerUint32Records(values []uint32) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + b := make([]byte, 4) + binary.LittleEndian.PutUint32(b, v) + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeUint32, b), + }, + }) + } + + return out +} + +func makeMergerUint64Records(values []uint64) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, v) + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeUint64, b), + }, + }) + } + + return out +} + +func makeMergerInt32Records(values []int32) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + b := make([]byte, 4) + binary.LittleEndian.PutUint32(b, uint32(v)) + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeInt32, b), + }, + }) + } + + return out +} + +func makeMergerInt64Records(values []int64) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, uint64(v)) + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeInt64, b), + }, + }) + } + + return out +} + +func makeMergerFloat64Records(values []float64) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, math.Float64bits(v)) + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeFloat64, b), + }, + }) + } + + return out +} + +func makeMergerStringRecords(values []string) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeString, []byte(v)), + }, + }) + } + + return out +} + +func extractUint32Values(records []*query.Record) []uint32 { + out := make([]uint32, 0, len(records)) + for _, r := range records { + out = append(out, r.Vals[0].Decoded().(uint32)) + } + return out +} + +func extractUint64Values(records []*query.Record) []uint64 { + out := make([]uint64, 0, len(records)) + for _, r := range records { + out = append(out, r.Vals[0].Decoded().(uint64)) + } + return out +} + +func extractInt32Values(records []*query.Record) []int32 { + out := make([]int32, 0, len(records)) + for _, r := range records { + out = append(out, r.Vals[0].Decoded().(int32)) + } + return out +} + +func extractInt64Values(records []*query.Record) []int64 { + out := make([]int64, 0, len(records)) + for _, r := range records { + out = append(out, r.Vals[0].Decoded().(int64)) + } + return out +} + +func extractFloat64Values(records []*query.Record) []float64 { + out := make([]float64, 0, len(records)) + for _, r := range records { + out = append(out, r.Vals[0].Decoded().(float64)) + } + return out +} + +func extractStringValues(records []*query.Record) []string { + out := make([]string, 0, len(records)) + for _, r := range records { + out = append(out, r.Vals[0].Decoded().(string)) + } + return out +} + +func TestNewNMergedProducersEmpty(t *testing.T) { + const field = "service" + + producers := []query.RecordProducer{} + + merger := NewNMergedProducers(producers, 1, field, query.DataTypeDocument, OrderAsc) + + outputData := collectRecords(merger) + + assert.Empty(t, outputData) +} + +func TestNewNMergedProducersSingle(t *testing.T) { + const field = "service" + + input := makeMergerTestRecords([]string{ + "service-01", + "service-02", + }) + + producers := []query.RecordProducer{ + &testProducer{data: input}, + } + + merger := NewNMergedProducers(producers, 1, field, query.DataTypeDocument, OrderAsc) + + outputData := collectRecords(merger) + + assert.Equal(t, []string{"service-01", "service-02"}, extractFieldValues(outputData, field)) +} + +func TestNewNMergedProducersThree(t *testing.T) { + const field = "service" + + producer1 := makeMergerTestRecords([]string{"service-01", "service-04"}) + producer2 := makeMergerTestRecords([]string{"service-02", "service-05"}) + producer3 := makeMergerTestRecords([]string{"service-03", "service-06"}) + + producers := []query.RecordProducer{ + &testProducer{data: producer1}, + &testProducer{data: producer2}, + &testProducer{data: producer3}, + } + + merger := NewNMergedProducers(producers, 1, field, query.DataTypeDocument, OrderAsc) + + outputData := collectRecords(merger) + + assert.Equal(t, []string{ + "service-01", "service-02", "service-03", + "service-04", "service-05", "service-06", + }, extractFieldValues(outputData, field)) +} + +func TestNewNMergedProducersWithEmpty(t *testing.T) { + const field = "service" + + producer1 := makeMergerTestRecords([]string{"service-03", "service-01"}) + producer2 := makeMergerTestRecords([]string{}) + producer3 := makeMergerTestRecords([]string{"service-02"}) + + producers := []query.RecordProducer{ + &testProducer{data: producer1}, + &testProducer{data: producer2}, + &testProducer{data: producer3}, + } + + merger := NewNMergedProducers(producers, 1, field, query.DataTypeDocument, OrderDesc) + + outputData := collectRecords(merger) + + assert.Equal(t, []string{ + "service-03", "service-02", "service-01", + }, extractFieldValues(outputData, field)) +} diff --git a/query/record.go b/query/record.go index c057b37d..28561030 100644 --- a/query/record.go +++ b/query/record.go @@ -3,6 +3,7 @@ package query import ( "encoding/binary" "fmt" + "math" insaneJSON "github.com/ozontech/insane-json" ) @@ -84,6 +85,12 @@ func (rv *RecordVals) ensureDecoded() { rv.decoded = binary.LittleEndian.Uint32(rv.rawData) case DataTypeUint64: rv.decoded = binary.LittleEndian.Uint64(rv.rawData) + case DataTypeInt32: + rv.decoded = int32(binary.LittleEndian.Uint32(rv.rawData)) + case DataTypeInt64: + rv.decoded = int64(binary.LittleEndian.Uint64(rv.rawData)) + case DataTypeFloat64: + rv.decoded = math.Float64frombits(binary.LittleEndian.Uint64(rv.rawData)) default: panic(fmt.Errorf("unknown data type")) // TODO: error handling } diff --git a/storeapi/grpc_one_phase_search.go b/storeapi/grpc_one_phase_search.go index 65584f34..37fedb02 100644 --- a/storeapi/grpc_one_phase_search.go +++ b/storeapi/grpc_one_phase_search.go @@ -90,20 +90,24 @@ func (g *GrpcV1) doOnePhaseSearchDocs( start := time.Now() + var errCode storeapi.SearchErrorCode // in store mode hot we return error in case request wants data, that we've already rotated - // if g.config.StoreMode == StoreModeHot { - // if g.fracManager.Flags().IsCapacityExceeded() && g.earlierThanOldestFrac(uint64(req.From)) { - // metric.RejectedRequests.WithLabelValues("search", "old_data").Inc() - // return &storeapi.SearchResponse{Code: storeapi.SearchErrorCode_INGESTOR_QUERY_WANTS_OLD_DATA}, nil - // } - // } + if g.config.StoreMode == StoreModeHot { + if g.fracManager.Flags().IsCapacityExceeded() && g.earlierThanOldestFrac(uint64(seq.TimeToMID(req.From.AsTime()))) { + metric.RejectedRequests.WithLabelValues("search", "old_data").Inc() + errCode = storeapi.SearchErrorCode_INGESTOR_QUERY_WANTS_OLD_DATA + } + } tr := querytracer.New(req.Explain, "store/OnePhaseSearchDocs") err := stream.Send(&storeapi.OnePhaseSearchResponse{ ResponseType: &storeapi.OnePhaseSearchResponse_Header{ Header: &storeapi.Header{ - Metadata: &storeapi.Metadata{}, // TODO: fill metadata + Metadata: &storeapi.Metadata{ + // TODO: fill metadata + Code: errCode, + }, Typing: []*storeapi.Typing{ // TODO: conditional typing {Title: "mid", Type: storeapi.DataType_UINT64}, @@ -121,6 +125,11 @@ func (g *GrpcV1) doOnePhaseSearchDocs( return fmt.Errorf("error sending header: %w", err) } + // exit if had errors + if errCode != storeapi.SearchErrorCode_NO_ERROR { + return nil + } + producer, err := g.buildProducer(ctx, req, tr, seqql) curRecord, curMeta := producer.Next() From f1c7ec3f4e6835f8f583793226cbb6ee87ddf0cd Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Wed, 27 May 2026 16:33:11 +0500 Subject: [PATCH 13/14] chore(query engine): merge stores responses with aggs --- proxy/search/one_phase_search.go | 147 +++++++++-------------------- proxyapi/grpc_one_phase_search.go | 137 ++++++++++++++------------- proxyapi/grpc_v1.go | 2 +- proxyapi/mock/grpc_v1.go | 7 +- query/exec/aggregator.go | 150 ++++++++++++++++++++++++++++- query/exec/aggregator_test.go | 151 ++++++++++++++++++++++++++++++ query/exec/merger.go | 62 +++--------- query/exec/sorter.go | 39 ++++---- 8 files changed, 457 insertions(+), 238 deletions(-) create mode 100644 query/exec/aggregator_test.go diff --git a/proxy/search/one_phase_search.go b/proxy/search/one_phase_search.go index db58ec2d..e46952fd 100644 --- a/proxy/search/one_phase_search.go +++ b/proxy/search/one_phase_search.go @@ -29,7 +29,7 @@ func (si *Ingestor) OnePhaseSearch( ctx context.Context, sr *SearchRequest, tr *querytracer.Tracer, -) (*seq.QPR, query.RecordProducer, AggsIterator, error) { +) (*seq.QPR, query.RecordProducer, error) { searchStores := si.config.HotStores if si.config.HotReadStores != nil && len(si.config.HotReadStores.Shards) > 0 { searchStores = si.config.HotReadStores @@ -37,30 +37,30 @@ func (si *Ingestor) OnePhaseSearch( var partialRespErr error - qprs, docs, aggs, err := si.searchStoresOnePhase(ctx, sr, searchStores, tr) + qprs, streams, err := si.searchStoresOnePhase(ctx, sr, searchStores, tr) if err != nil { switch { case errors.Is(err, consts.ErrIngestorQueryWantsOldData): if len(si.config.ReadStores.Shards) == 0 { logger.Error("no cold stores, but hot mode is enabled, bad configuration of stores!") - return nil, nil, nil, err + return nil, nil, err } metric.SearchColdTotal.Inc() - qprs, docs, aggs, err = si.searchStoresOnePhase(ctx, sr, si.config.ReadStores, tr) + qprs, streams, err = si.searchStoresOnePhase(ctx, sr, si.config.ReadStores, tr) if err != nil { metric.SearchColdErrors.Add(1) if errors.Is(err, consts.ErrPartialResponse) { partialRespErr = err // consider partial response from cold stores as a result } else { // errors from both hot and cold stores, return error - return nil, nil, nil, err + return nil, nil, err } } case errors.Is(err, consts.ErrPartialResponse): partialRespErr = err // consider partial response from hot stores as a result default: // unexpected error on all hot replica sets (usually bad query) - return nil, nil, nil, err + return nil, nil, err } } @@ -71,10 +71,17 @@ func (si *Ingestor) OnePhaseSearch( } seq.MergeQPRs(resQpr, qprs, sr.Offset+sr.Size, sr.Interval, sr.Order) - mergedDocsStream := exec.NewNMergedProducers(docs, 0, "", query.DataTypeUint64, execOrderFromSeqOrder(sr.Order)) - limiter := exec.NewLimiter(mergedDocsStream, uint32(sr.Size)) // TODO: offset + var mergedStream query.RecordProducer - return resQpr, limiter, aggs[0], partialRespErr + hasAggs := len(sr.AggQ) > 0 // TODO: check based on stats pipe + if hasAggs { + mergedStream = exec.NewDistributedAggregator(streams, sr.AggQ[0].Func) // TODO: multiple aggs (???) + } else { + mergedDocsStream := exec.NewNMergedProducers(streams, 0, "", query.DataTypeUint64, execOrderFromSeqOrder(sr.Order)) + mergedStream = exec.NewLimiter(mergedDocsStream, uint32(sr.Size)) // TODO: offset + } + + return resQpr, mergedStream, partialRespErr } func (si *Ingestor) searchStoresOnePhase( @@ -82,12 +89,11 @@ func (si *Ingestor) searchStoresOnePhase( sr *SearchRequest, s *stores.Stores, tr *querytracer.Tracer, -) ([]*seq.QPR, []query.RecordProducer, []AggsIterator, error) { +) ([]*seq.QPR, []query.RecordProducer, error) { type ShardResponse struct { - QPR *seq.QPR - Docs query.RecordProducer - Aggs AggsIterator - Err error + QPR *seq.QPR + Stream query.RecordProducer + Err error } wg := sync.WaitGroup{} @@ -99,12 +105,11 @@ func (si *Ingestor) searchStoresOnePhase( defer wg.Done() defer tr.Done() - qpr, docs, aggs, err := si.searchShardOnePhase(ctx, shard, sr, tr) + qpr, stream, err := si.searchShardOnePhase(ctx, shard, sr, tr) respChan <- ShardResponse{ - QPR: qpr, - Docs: docs, - Aggs: aggs, - Err: err, + QPR: qpr, + Stream: stream, + Err: err, } }(shard, searchShardTr) } @@ -115,36 +120,34 @@ func (si *Ingestor) searchStoresOnePhase( }() qprs := make([]*seq.QPR, 0, len(s.Shards)) - docs := make([]query.RecordProducer, 0, len(s.Shards)) - aggs := make([]AggsIterator, 0, len(s.Shards)) + streams := make([]query.RecordProducer, 0, len(s.Shards)) var errs []error for resp := range respChan { if err := resp.Err; err != nil { if errors.Is(err, consts.ErrIngestorQueryWantsOldData) { // At least one hot store doesn't have such old data - return nil, nil, nil, err + return nil, nil, err } if errors.Is(err, consts.ErrTooManyFractionsHit) { - return nil, nil, nil, err + return nil, nil, err } errs = append(errs, err) continue } qprs = append(qprs, resp.QPR) - docs = append(docs, resp.Docs) - aggs = append(aggs, resp.Aggs) + streams = append(streams, resp.Stream) } if err := util.DeduplicateErrors(errs); err != nil { if len(qprs) != 0 { // There are errors, but some Shards returned data, so provide it to user - return qprs, docs, aggs, fmt.Errorf("%w: %s", consts.ErrPartialResponse, err) + return qprs, streams, fmt.Errorf("%w: %s", consts.ErrPartialResponse, err) } - return nil, nil, nil, err + return nil, nil, err } - return qprs, docs, aggs, nil + return qprs, streams, nil } func (si *Ingestor) searchShardOnePhase( @@ -152,7 +155,7 @@ func (si *Ingestor) searchShardOnePhase( hosts []string, request *SearchRequest, tr *querytracer.Tracer, -) (*seq.QPR, query.RecordProducer, AggsIterator, error) { +) (*seq.QPR, query.RecordProducer, error) { var idx []int if si.config.ShuffleReplicas { idx = util.IdxShuffle(len(hosts)) @@ -164,18 +167,18 @@ func (si *Ingestor) searchShardOnePhase( for i := range len(hosts) { host := hosts[idx[i]] tr.Printf("Making search request to %s", host) - qpr, docs, aggs, err := si.searchHostOnePhase(ctx, hosts[i], request, tr) // TODO: + qpr, stream, err := si.searchHostOnePhase(ctx, hosts[i], request, tr) if err != nil { if errors.Is(err, consts.ErrIngestorQueryWantsOldData) { - return nil, nil, nil, err + return nil, nil, err } errs = append(errs, err) continue } - return qpr, docs, aggs, nil + return qpr, stream, nil } - return nil, nil, nil, util.DeduplicateErrors(errs) + return nil, nil, util.DeduplicateErrors(errs) } func (si *Ingestor) searchHostOnePhase( @@ -183,10 +186,10 @@ func (si *Ingestor) searchHostOnePhase( host string, request *SearchRequest, _ *querytracer.Tracer, -) (*seq.QPR, query.RecordProducer, AggsIterator, error) { +) (*seq.QPR, query.RecordProducer, error) { client, has := si.clients[host] if !has { - return nil, nil, nil, fmt.Errorf("can't fetch: no client for host %s", host) + return nil, nil, fmt.Errorf("can't fetch: no client for host %s", host) } fieldsFilter := tryParseFieldsFilter(string(request.Q)) @@ -211,22 +214,22 @@ func (si *Ingestor) searchHostOnePhase( grpc.MaxCallSendMsgSize(256*int(units.MiB)), ) if err != nil { - return nil, nil, nil, fmt.Errorf("can't open stream: %s", err.Error()) + return nil, nil, fmt.Errorf("can't open stream: %s", err.Error()) } msg, err := stream.Recv() if err != nil { - return nil, nil, nil, nil + return nil, nil, err } header := msg.GetHeader() if header == nil { - return nil, nil, nil, fmt.Errorf("can't read header") + return nil, nil, fmt.Errorf("can't read header") } if header.Metadata.Code == storeapi.SearchErrorCode_INGESTOR_QUERY_WANTS_OLD_DATA { - return nil, nil, nil, fmt.Errorf("hot store refuses: %w", consts.ErrIngestorQueryWantsOldData) + return nil, nil, fmt.Errorf("hot store refuses: %w", consts.ErrIngestorQueryWantsOldData) } errs := make([]seq.ErrorSource, 0, len(header.Metadata.Errors)) @@ -239,25 +242,22 @@ func (si *Ingestor) searchHostOnePhase( Errors: errs, } - return qpr, - &OnePhaseSearchDocsIterator{typing: header.Typing, stream: stream}, - &OnePhaseSearchAggsIterator{stream: stream, limit: request.Size}, - nil + return qpr, &OnePhaseSearchStreamIterator{typing: header.Typing, stream: stream}, nil } // TODO: move to executor (???) -type OnePhaseSearchDocsIterator struct { +type OnePhaseSearchStreamIterator struct { typing []*storeapi.Typing stream storeapi.StoreApi_OnePhaseSearchClient curBatch []*storeapi.Record } -func (it *OnePhaseSearchDocsIterator) Next() (*query.Record, *query.Metadata) { +func (it *OnePhaseSearchStreamIterator) Next() (*query.Record, *query.Metadata) { if len(it.curBatch) == 0 { data, err := it.stream.Recv() if errors.Is(err, io.EOF) { - return nil, &query.Metadata{Err: io.EOF} + return nil, nil } if err != nil { return nil, &query.Metadata{Err: err} @@ -275,61 +275,6 @@ func (it *OnePhaseSearchDocsIterator) Next() (*query.Record, *query.Metadata) { return query.NewRecord(recordVals), nil } -type StreamingAgg struct { - Label string - Min float64 - Max float64 - Sum float64 - Total uint64 - NotExists uint64 -} - -type AggsIterator interface { - Next() (StreamingAgg, error) -} - -type OnePhaseSearchAggsIterator struct { - stream storeapi.StoreApi_OnePhaseSearchClient - - curBatch []*storeapi.Record - - fetched int - limit int -} - -func (it *OnePhaseSearchAggsIterator) Next() (StreamingAgg, error) { - if it.fetched >= it.limit { - return StreamingAgg{}, io.EOF - } - - if len(it.curBatch) == 0 { - data, err := it.stream.Recv() - if errors.Is(err, io.EOF) { - return StreamingAgg{}, io.EOF - } - if err != nil { - return StreamingAgg{}, err - } - it.curBatch = data.GetBatch().Records - } - - // TODO: get fields values from columns info - - record := it.curBatch[0] - it.curBatch = it.curBatch[1:] - - it.fetched++ - - return StreamingAgg{ - Label: string(record.RawData[0]), - Min: Float64FromBytes(record.RawData[1]), - Max: Float64FromBytes(record.RawData[2]), - Sum: Float64FromBytes(record.RawData[3]), - Total: binary.LittleEndian.Uint64(record.RawData[4]), - NotExists: binary.LittleEndian.Uint64(record.RawData[5]), - }, nil -} - func Float64FromBytes(in []byte) float64 { return math.Float64frombits(binary.LittleEndian.Uint64(in)) } diff --git a/proxyapi/grpc_one_phase_search.go b/proxyapi/grpc_one_phase_search.go index 83dd1b85..99fc668e 100644 --- a/proxyapi/grpc_one_phase_search.go +++ b/proxyapi/grpc_one_phase_search.go @@ -30,6 +30,9 @@ func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequ return nil, status.Error(codes.InvalidArgument, `"size" must be greater than 0`) } + statsAggs := extractStatsPipesFromQuery(req.Query.Query) + hasAggs := len(statsAggs) > 0 + proxyReq := &seqproxyapi.ComplexSearchRequest{ Query: req.Query, Size: req.Size, @@ -38,7 +41,18 @@ func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequ WithTotal: req.WithTotal, Order: req.Order, } - sResp, docsStream, aggsStream, err := g.doOnePhaseSearch(ctx, proxyReq, true) + + if hasAggs { + proxyReq.Aggs = []*seqproxyapi.AggQuery{ + { + Field: statsAggs[0].Field, + GroupBy: statsAggs[0].GroupBy, + Func: mustConvertStringToAggFunc(statsAggs[0].Func), + }, + } + } + + sResp, stream, err := g.doOnePhaseSearch(ctx, proxyReq, true) if err != nil { return nil, err } @@ -58,54 +72,53 @@ func (g *grpcV1) OnePhaseSearch(ctx context.Context, req *seqproxyapi.SearchRequ } } - statsAggs := extractStatsPipesFromQuery(req.Query.Query) - hasAggs := len(statsAggs) > 0 - if hasAggs { - sResp.qpr.Aggs = convertAggsStreamToAggregationResults(aggsStream) - allAggs := sResp.qpr.Aggregate(aggregationArgsFromStatsAggs(statsAggs)) - resp.Aggs = makeProtoAggregation(allAggs) + if resp.Aggs, err = makeProtoAggsOnePhase(stream); err != nil { + return nil, err + } } else { - resp.Docs = makeProtoDocsOnePhase(docsStream) + if resp.Docs, err = makeProtoDocsOnePhase(stream); err != nil { + return nil, err + } } return resp, nil } -func convertAggsStreamToAggregationResults(aggs search.AggsIterator) []seq.AggregatableSamples { - result := make([]seq.AggregatableSamples, 0) - to := make(map[seq.AggBin]*seq.SamplesContainer) - for agg, err := aggs.Next(); err == nil; agg, err = aggs.Next() { +func makeProtoAggsOnePhase(input query.RecordProducer) ([]*seqproxyapi.Aggregation, error) { + respAggs := []*seqproxyapi.Aggregation{ + {Buckets: make([]*seqproxyapi.Aggregation_Bucket, 0)}, + } - tbin := seq.AggBin{ - MID: consts.DummyMID, - Token: agg.Label, + for { + r, meta := input.Next() + if meta != nil { + if !errors.Is(meta.Err, io.EOF) { + return nil, fmt.Errorf("read aggs stream error: %w", meta.Err) + } + break } - - to[tbin] = &seq.SamplesContainer{ - Min: agg.Min, - Max: agg.Max, - Sum: agg.Sum, - Total: int64(agg.Total), - NotExists: int64(agg.NotExists), + if r == nil { + break } + + respAggs[0].Buckets = append(respAggs[0].Buckets, &seqproxyapi.Aggregation_Bucket{ + Key: r.Vals[0].Decoded().(string), + Value: r.Vals[1].Decoded().(float64), + }) } - result = append(result, seq.AggregatableSamples{ - SamplesByBin: to, - // NotExists: int64(agg.NotExists), - }) - return result + + return respAggs, nil } -func makeProtoDocsOnePhase(input query.RecordProducer) []*seqproxyapi.Document { +func makeProtoDocsOnePhase(input query.RecordProducer) ([]*seqproxyapi.Document, error) { respDocs := make([]*seqproxyapi.Document, 0) for { r, meta := input.Next() if meta != nil { if !errors.Is(meta.Err, io.EOF) { - // TODO: handle error - panic(fmt.Errorf("stream error: %w", meta.Err)) + return nil, fmt.Errorf("read docs stream error: %w", meta.Err) } break } @@ -124,27 +137,27 @@ func makeProtoDocsOnePhase(input query.RecordProducer) []*seqproxyapi.Document { }) } - return respDocs + return respDocs, nil } func (g *grpcV1) doOnePhaseSearch( ctx context.Context, req *seqproxyapi.ComplexSearchRequest, shouldFetch bool, -) (*proxySearchResponse, query.RecordProducer, search.AggsIterator, error) { +) (*proxySearchResponse, query.RecordProducer, error) { metric.SearchOverall.Add(1) span := trace.FromContext(ctx) defer span.End() if req.Query == nil { - return nil, nil, nil, status.Error(codes.InvalidArgument, "search query must be provided") + return nil, nil, status.Error(codes.InvalidArgument, "search query must be provided") } if req.Query.From == nil || req.Query.To == nil { - return nil, nil, nil, status.Error(codes.InvalidArgument, `search query "from" and "to" fields must be provided`) + return nil, nil, status.Error(codes.InvalidArgument, `search query "from" and "to" fields must be provided`) } if req.Offset != 0 && req.OffsetId != "" { - return nil, nil, nil, status.Error(codes.InvalidArgument, `only one of "offset" and "offset_id" must be provided`) + return nil, nil, status.Error(codes.InvalidArgument, `only one of "offset" and "offset_id" must be provided`) } fromTime := req.Query.From.AsTime() @@ -165,7 +178,7 @@ func (g *grpcV1) doOnePhaseSearch( rlQuery := getSearchQueryFromGRPCReqForRateLimiter(req) if !g.rateLimiter.Account(rlQuery) { - return nil, nil, nil, status.Error(codes.ResourceExhausted, consts.ErrRequestWasRateLimited.Error()) + return nil, nil, status.Error(codes.ResourceExhausted, consts.ErrRequestWasRateLimited.Error()) } proxyReq := &search.SearchRequest{ @@ -181,26 +194,34 @@ func (g *grpcV1) doOnePhaseSearch( Order: req.Order.MustDocsOrder(), } + if len(req.Aggs) > 0 { + aggs, err := convertAggsQuery(req.Aggs) + if err != nil { + return nil, nil, err + } + proxyReq.AggQ = aggs + } + tr := querytracer.New(req.Query.Explain, "proxy/OnePhaseSearch") // TODO: do we really need QPR here (???) - qpr, docsStream, aggsStream, err := g.searchIngestor.OnePhaseSearch(ctx, proxyReq, tr) + qpr, stream, err := g.searchIngestor.OnePhaseSearch(ctx, proxyReq, tr) psr := &proxySearchResponse{ qpr: qpr, } if e, ok := parseProxyError(err); ok { psr.err = e - return psr, nil, nil, nil + return psr, nil, nil } if errors.Is(err, consts.ErrInvalidArgument) { - return nil, nil, nil, status.Error(codes.InvalidArgument, err.Error()) + return nil, nil, status.Error(codes.InvalidArgument, err.Error()) } if st, ok := status.FromError(err); ok { // could not parse a query if st.Code() == codes.InvalidArgument { - return nil, nil, nil, err + return nil, nil, err } } @@ -210,16 +231,16 @@ func (g *grpcV1) doOnePhaseSearch( Code: seqproxyapi.ErrorCode_ERROR_CODE_PARTIAL_RESPONSE, Message: err.Error(), } - return psr, docsStream, aggsStream, nil + return psr, stream, nil } if err = processSearchErrors(qpr, err); err != nil { metric.SearchErrors.Inc() - return nil, nil, nil, err + return nil, nil, err } g.tryMirrorRequest(req) - return psr, docsStream, aggsStream, nil + return psr, stream, nil } func extractStatsPipesFromQuery(q string) []parser.StatsAgg { @@ -243,36 +264,24 @@ func extractStatsPipesFromQuery(q string) []parser.StatsAgg { return result } -func aggregationArgsFromStatsAggs(aggs []parser.StatsAgg) []seq.AggregateArgs { - args := make([]seq.AggregateArgs, len(aggs)) - for i, agg := range aggs { - args[i] = seq.AggregateArgs{ - Func: mustConvertStringToAggFunc(agg.Func), - Quantiles: agg.Quantiles, - SkipWithoutTimestamp: agg.Interval != "", - } - } - return args -} - -func mustConvertStringToAggFunc(funcName string) seq.AggFunc { +func mustConvertStringToAggFunc(funcName string) seqproxyapi.AggFunc { switch funcName { case "count": - return seq.AggFuncCount + return seqproxyapi.AggFunc_AGG_FUNC_COUNT case "sum": - return seq.AggFuncSum + return seqproxyapi.AggFunc_AGG_FUNC_SUM case "min": - return seq.AggFuncMin + return seqproxyapi.AggFunc_AGG_FUNC_MIN case "max": - return seq.AggFuncMax + return seqproxyapi.AggFunc_AGG_FUNC_MAX case "avg": - return seq.AggFuncAvg + return seqproxyapi.AggFunc_AGG_FUNC_AVG case "quantile": - return seq.AggFuncQuantile + return seqproxyapi.AggFunc_AGG_FUNC_QUANTILE case "unique": - return seq.AggFuncUnique + return seqproxyapi.AggFunc_AGG_FUNC_UNIQUE case "unique_count": - return seq.AggFuncUniqueCount + return seqproxyapi.AggFunc_AGG_FUNC_UNIQUE_COUNT default: panic(fmt.Errorf("unknown aggregation function: %s", funcName)) } diff --git a/proxyapi/grpc_v1.go b/proxyapi/grpc_v1.go index ebf79d00..31ed2d83 100644 --- a/proxyapi/grpc_v1.go +++ b/proxyapi/grpc_v1.go @@ -39,7 +39,7 @@ type SearchIngestor interface { CancelAsyncSearch(ctx context.Context, id string) error DeleteAsyncSearch(ctx context.Context, id string) error GetAsyncSearchesList(context.Context, search.GetAsyncSearchesListRequest) ([]*search.AsyncSearchesListItem, error) - OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, query.RecordProducer, search.AggsIterator, error) + OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, query.RecordProducer, error) } type MappingProvider interface { diff --git a/proxyapi/mock/grpc_v1.go b/proxyapi/mock/grpc_v1.go index 16a663d5..9ba38f8d 100644 --- a/proxyapi/mock/grpc_v1.go +++ b/proxyapi/mock/grpc_v1.go @@ -117,14 +117,13 @@ func (mr *MockSearchIngestorMockRecorder) GetAsyncSearchesList(arg0, arg1 interf } // OnePhaseSearch mocks base method. -func (m *MockSearchIngestor) OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, query.RecordProducer, search.AggsIterator, error) { +func (m *MockSearchIngestor) OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, query.RecordProducer, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OnePhaseSearch", ctx, sr, tr) ret0, _ := ret[0].(*seq.QPR) ret1, _ := ret[1].(query.RecordProducer) - ret2, _ := ret[2].(search.AggsIterator) - ret3, _ := ret[3].(error) - return ret0, ret1, ret2, ret3 + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // OnePhaseSearch indicates an expected call of OnePhaseSearch. diff --git a/query/exec/aggregator.go b/query/exec/aggregator.go index e03f2b6c..96e93406 100644 --- a/query/exec/aggregator.go +++ b/query/exec/aggregator.go @@ -1,5 +1,151 @@ package exec -type Aggregator struct { - // TODO: aggregate +import ( + "cmp" + "encoding/binary" + "fmt" + "math" + "slices" + + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/seq" +) + +type AggSamples struct { + Min float64 + Max float64 + Sum float64 + Total uint64 +} + +type DistributedAggregator struct { + state ExecutorState + inputs []query.RecordProducer + + aggFunc seq.AggFunc + + buckets map[string]AggSamples + sortingBuf []*query.Record + + curIdx int +} + +func NewDistributedAggregator( + inputs []query.RecordProducer, + aggFunc seq.AggFunc, +) *DistributedAggregator { + return &DistributedAggregator{ + inputs: inputs, + aggFunc: aggFunc, + buckets: make(map[string]AggSamples), + sortingBuf: make([]*query.Record, 0), + } +} + +func (a *DistributedAggregator) Next() (*query.Record, *query.Metadata) { + if a.state == ExecutorStateReadingInput { + // TODO: read from all inputs simultaneously (???) + for _, input := range a.inputs { + for { + r, meta := input.Next() + if meta != nil { + return nil, meta + } + if r == nil { + break + } + + key := r.Vals[0].Decoded().(string) + s := a.buckets[key] + + if s.Total == 0 { + s.Min = r.Vals[1].Decoded().(float64) + s.Max = r.Vals[2].Decoded().(float64) + } else { + s.Min = min(s.Min, r.Vals[1].Decoded().(float64)) + s.Max = max(s.Max, r.Vals[2].Decoded().(float64)) + } + + s.Sum += r.Vals[3].Decoded().(float64) + s.Total += r.Vals[4].Decoded().(uint64) + + a.buckets[key] = s + } + } + + a.state = ExecutorStateProcessingData + } + + if a.state == ExecutorStateProcessingData { + for token, bucket := range a.buckets { + var value float64 + + // TODO: support all aggregate functions + switch a.aggFunc { + case seq.AggFuncCount, seq.AggFuncUnique: + value = float64(bucket.Total) + case seq.AggFuncSum: + value = bucket.Sum + case seq.AggFuncMin: + value = bucket.Min + case seq.AggFuncMax: + value = bucket.Max + case seq.AggFuncAvg: + if bucket.Total != 0 { + value = bucket.Sum / float64(bucket.Total) + } + default: + panic(fmt.Errorf("unimplemented aggregation func")) + } + + a.sortingBuf = append(a.sortingBuf, query.NewRecord([]*query.RecordVals{ + query.NewRecordVals(query.DataTypeString, []byte(token)), + query.NewRecordVals(query.DataTypeFloat64, float64ToBytes(value)), + })) + } + + sortBuckets(a.aggFunc, a.sortingBuf) + a.state = ExecutorStateProducingOutput + } + + if a.curIdx >= len(a.sortingBuf) { + a.state = ExecutorStateDone + return nil, nil + } + + r := a.sortingBuf[a.curIdx] + a.curIdx++ + + return r, nil +} + +func sortBuckets(aggFunc seq.AggFunc, buckets []*query.Record) { + sortByValueDescNameAsc := func(left, right *query.Record) int { + return cmp.Or( + cmp.Compare(right.Vals[1].Decoded().(float64), left.Vals[1].Decoded().(float64)), + cmp.Compare(left.Vals[0].Decoded().(string), right.Vals[0].Decoded().(string)), + ) + } + + sortByValueNameAsc := func(left, right *query.Record) int { + return cmp.Or( + cmp.Compare(left.Vals[1].Decoded().(float64), right.Vals[1].Decoded().(float64)), + cmp.Compare(left.Vals[0].Decoded().(string), right.Vals[0].Decoded().(string)), + ) + } + + sortFunc := sortByValueDescNameAsc + + if aggFunc == seq.AggFuncMin { + // Sort the MIN aggregation result in ascending order. + sortFunc = sortByValueNameAsc + } + + slices.SortFunc(buckets, sortFunc) +} + +func float64ToBytes(val float64) []byte { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, math.Float64bits(val)) + return b } diff --git a/query/exec/aggregator_test.go b/query/exec/aggregator_test.go new file mode 100644 index 00000000..edc092c5 --- /dev/null +++ b/query/exec/aggregator_test.go @@ -0,0 +1,151 @@ +package exec + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/seq" +) + +func TestDistributedAggregator_Count(t *testing.T) { + records1 := []*query.Record{ + newAggRecord("key1", 10.0, 10.0, 10.0, 1), + newAggRecord("key2", 20.0, 20.0, 20.0, 1), + } + + records2 := []*query.Record{ + newAggRecord("key1", 30.0, 30.0, 30.0, 1), + newAggRecord("key2", 40.0, 40.0, 40.0, 1), + } + + input1 := testProducer{data: records1} + input2 := testProducer{data: records2} + agg := NewDistributedAggregator([]query.RecordProducer{&input1, &input2}, seq.AggFuncCount) + + results := collectRecords(agg) + + assert.Len(t, results, 2) + assert.Equal(t, "key1", results[0].Vals[0].Decoded().(string)) + assert.Equal(t, float64(2), results[0].Vals[1].Decoded().(float64)) + assert.Equal(t, "key2", results[1].Vals[0].Decoded().(string)) + assert.Equal(t, float64(2), results[1].Vals[1].Decoded().(float64)) +} + +func TestDistributedAggregator_Sum(t *testing.T) { + records1 := []*query.Record{ + newAggRecord("key1", 10.0, 10.0, 10.0, 1), + newAggRecord("key2", 30.0, 30.0, 30.0, 1), + } + + records2 := []*query.Record{ + newAggRecord("key1", 20.0, 20.0, 20.0, 1), + newAggRecord("key2", 40.0, 40.0, 40.0, 1), + } + + input1 := testProducer{data: records1} + input2 := testProducer{data: records2} + agg := NewDistributedAggregator([]query.RecordProducer{&input1, &input2}, seq.AggFuncSum) + + results := collectRecords(agg) + + assert.Len(t, results, 2) + assert.Equal(t, "key2", results[0].Vals[0].Decoded().(string)) + assert.Equal(t, float64(70.0), results[0].Vals[1].Decoded().(float64)) + assert.Equal(t, "key1", results[1].Vals[0].Decoded().(string)) + assert.Equal(t, float64(30.0), results[1].Vals[1].Decoded().(float64)) +} + +func TestDistributedAggregator_Min(t *testing.T) { + records1 := []*query.Record{ + newAggRecord("key1", 30.0, 30.0, 30.0, 1), + newAggRecord("key2", 20.0, 20.0, 20.0, 1), + } + + records2 := []*query.Record{ + newAggRecord("key1", 10.0, 10.0, 10.0, 1), + newAggRecord("key2", 40.0, 40.0, 40.0, 1), + } + + input1 := testProducer{data: records1} + input2 := testProducer{data: records2} + agg := NewDistributedAggregator([]query.RecordProducer{&input1, &input2}, seq.AggFuncMin) + + results := collectRecords(agg) + + assert.Len(t, results, 2) + assert.Equal(t, "key1", results[0].Vals[0].Decoded().(string)) + assert.Equal(t, float64(10.0), results[0].Vals[1].Decoded().(float64)) + assert.Equal(t, "key2", results[1].Vals[0].Decoded().(string)) + assert.Equal(t, float64(20.0), results[1].Vals[1].Decoded().(float64)) +} + +func TestDistributedAggregator_Max(t *testing.T) { + records1 := []*query.Record{ + newAggRecord("key1", 10.0, 10.0, 10.0, 1), + newAggRecord("key2", 30.0, 30.0, 30.0, 1), + } + + records2 := []*query.Record{ + newAggRecord("key1", 50.0, 50.0, 50.0, 1), + newAggRecord("key2", 20.0, 20.0, 20.0, 1), + } + + input1 := testProducer{data: records1} + input2 := testProducer{data: records2} + agg := NewDistributedAggregator([]query.RecordProducer{&input1, &input2}, seq.AggFuncMax) + + results := collectRecords(agg) + + assert.Len(t, results, 2) + assert.Equal(t, "key1", results[0].Vals[0].Decoded().(string)) + assert.Equal(t, float64(50.0), results[0].Vals[1].Decoded().(float64)) + assert.Equal(t, "key2", results[1].Vals[0].Decoded().(string)) + assert.Equal(t, float64(30.0), results[1].Vals[1].Decoded().(float64)) +} + +func TestDistributedAggregator_Avg(t *testing.T) { + records1 := []*query.Record{ + newAggRecord("key1", 10.0, 10.0, 10.0, 1), + newAggRecord("key2", 20.0, 20.0, 20.0, 1), + } + + records2 := []*query.Record{ + newAggRecord("key1", 30.0, 30.0, 30.0, 1), + newAggRecord("key2", 40.0, 40.0, 40.0, 1), + } + + input1 := testProducer{data: records1} + input2 := testProducer{data: records2} + agg := NewDistributedAggregator([]query.RecordProducer{&input1, &input2}, seq.AggFuncAvg) + + results := collectRecords(agg) + + assert.Len(t, results, 2) + assert.Equal(t, "key2", results[0].Vals[0].Decoded().(string)) + assert.Equal(t, float64(30.0), results[0].Vals[1].Decoded().(float64)) + assert.Equal(t, "key1", results[1].Vals[0].Decoded().(string)) + assert.Equal(t, float64(20.0), results[1].Vals[1].Decoded().(float64)) +} + +func TestDistributedAggregator_EmptyInput(t *testing.T) { + var records []*query.Record + + input := testProducer{data: records} + agg := NewDistributedAggregator([]query.RecordProducer{&input}, seq.AggFuncCount) + + results := collectRecords(agg) + + assert.Len(t, results, 0) +} + +func newAggRecord(key string, minVal, maxVal, sum float64, total uint64) *query.Record { + return query.NewRecord([]*query.RecordVals{ + query.NewRecordVals(query.DataTypeString, []byte(key)), + query.NewRecordVals(query.DataTypeFloat64, float64ToBytes(minVal)), + query.NewRecordVals(query.DataTypeFloat64, float64ToBytes(maxVal)), + query.NewRecordVals(query.DataTypeFloat64, float64ToBytes(sum)), + query.NewRecordVals(query.DataTypeUint64, Uint64ToBytes(uint64(total))), + }) +} diff --git a/query/exec/merger.go b/query/exec/merger.go index b5ab5499..e132a727 100644 --- a/query/exec/merger.go +++ b/query/exec/merger.go @@ -1,6 +1,8 @@ package exec import ( + "cmp" + insaneJSON "github.com/ozontech/insane-json" "github.com/ozontech/seq-db/query" @@ -76,11 +78,10 @@ func (m *Merger) Next() (*query.Record, *query.Metadata) { leftVal := m.extractValue(m.curLeft) rightVal := m.extractValue(m.curRight) - cmp := m.less(leftVal, rightVal) - - chooseLeft := cmp <= 0 + compared := m.less(leftVal, rightVal) + chooseLeft := compared <= 0 if m.order == OrderDesc { - chooseLeft = cmp >= 0 + chooseLeft = compared >= 0 } if chooseLeft { @@ -122,59 +123,24 @@ func (m *Merger) extractValue(r *query.Record) any { } func createLessFunc() func(any, any) int { - // TODO: use m.dataType (???) + // TODO: make use of m.dataType (???) return func(a, b any) int { switch v := a.(type) { case uint32: - if v == b.(uint32) { - return 0 - } - if v < b.(uint32) { - return -1 - } - return 1 + return cmp.Compare(v, b.(uint32)) case uint64: - if v == b.(uint64) { - return 0 - } - if v < b.(uint64) { - return -1 - } - return 1 + return cmp.Compare(v, b.(uint64)) case int32: - if v == b.(int32) { - return 0 - } - if v < b.(int32) { - return -1 - } - return 1 + return cmp.Compare(v, b.(int32)) case int64: - if v == b.(int64) { - return 0 - } - if v < b.(int64) { - return -1 - } - return 1 + return cmp.Compare(v, b.(int64)) case float64: - if v == b.(float64) { - return 0 - } - if v < b.(float64) { - return -1 - } - return 1 + return cmp.Compare(v, b.(float64)) case string: - if v == b.(string) { - return 0 - } - if v < b.(string) { - return -1 - } - return 1 + return cmp.Compare(v, b.(string)) + default: + return 0 // TODO: ??? } - return 0 } } diff --git a/query/exec/sorter.go b/query/exec/sorter.go index 6ca41c88..9dbd6480 100644 --- a/query/exec/sorter.go +++ b/query/exec/sorter.go @@ -16,11 +16,11 @@ const ( OrderDesc ) -// TODO: ??? type ExecutorState byte const ( ExecutorStateReadingInput ExecutorState = iota + ExecutorStateProcessingData ExecutorStateProducingOutput ExecutorStateDone ) @@ -68,29 +68,32 @@ func (s *DocSorter) Next() (*query.Record, *query.Metadata) { return nil, meta } if r == nil { - s.state = ExecutorStateProducingOutput + s.state = ExecutorStateProcessingData break } s.sortingBuf = append(s.sortingBuf, r) } - slices.SortFunc(s.sortingBuf, func(a, b *query.Record) int { - if a == nil || b == nil { - return 0 // TODO: ??? - } - - aVal := a.Vals[s.colIdx].Decoded().(*insaneJSON.Root).Dig(s.field).AsString() - bVal := b.Vals[s.colIdx].Decoded().(*insaneJSON.Root).Dig(s.field).AsString() - - if aVal == bVal { - return 0 - } - if s.less(aVal, bVal) { - return -1 - } - return 1 - }) + if s.state == ExecutorStateProcessingData { + slices.SortFunc(s.sortingBuf, func(a, b *query.Record) int { + if a == nil || b == nil { + return 0 // TODO: ??? + } + + aVal := a.Vals[s.colIdx].Decoded().(*insaneJSON.Root).Dig(s.field).AsString() + bVal := b.Vals[s.colIdx].Decoded().(*insaneJSON.Root).Dig(s.field).AsString() + + if aVal == bVal { + return 0 + } + if s.less(aVal, bVal) { + return -1 + } + return 1 + }) + s.state = ExecutorStateProducingOutput + } if s.curIdx >= len(s.sortingBuf) { s.state = ExecutorStateDone From 67e6e8acc426e1be81a151e7b67ddbfc20f5c6dc Mon Sep 17 00:00:00 2001 From: Daniil Forshev Date: Tue, 2 Jun 2026 19:12:46 +0500 Subject: [PATCH 14/14] chore(query engine): move agg to data source on store --- proxy/search/one_phase_search.go | 92 +++++++------- proxyapi/grpc_one_phase_search.go | 10 +- proxyapi/grpc_v1.go | 2 +- proxyapi/mock/grpc_v1.go | 9 +- query/exec/data_source.go | 141 +++++++++++++++++++-- query/exec/data_source_test.go | 8 +- storeapi/grpc_fetch.go | 31 ++--- storeapi/grpc_one_phase_search.go | 201 ++++++++---------------------- 8 files changed, 253 insertions(+), 241 deletions(-) diff --git a/proxy/search/one_phase_search.go b/proxy/search/one_phase_search.go index e46952fd..19bcee45 100644 --- a/proxy/search/one_phase_search.go +++ b/proxy/search/one_phase_search.go @@ -29,7 +29,7 @@ func (si *Ingestor) OnePhaseSearch( ctx context.Context, sr *SearchRequest, tr *querytracer.Tracer, -) (*seq.QPR, query.RecordProducer, error) { +) (query.RecordProducer, error) { searchStores := si.config.HotStores if si.config.HotReadStores != nil && len(si.config.HotReadStores.Shards) > 0 { searchStores = si.config.HotReadStores @@ -37,40 +37,33 @@ func (si *Ingestor) OnePhaseSearch( var partialRespErr error - qprs, streams, err := si.searchStoresOnePhase(ctx, sr, searchStores, tr) + streams, err := si.searchStoresOnePhase(ctx, sr, searchStores, tr) if err != nil { switch { case errors.Is(err, consts.ErrIngestorQueryWantsOldData): if len(si.config.ReadStores.Shards) == 0 { logger.Error("no cold stores, but hot mode is enabled, bad configuration of stores!") - return nil, nil, err + return nil, err } metric.SearchColdTotal.Inc() - qprs, streams, err = si.searchStoresOnePhase(ctx, sr, si.config.ReadStores, tr) + streams, err = si.searchStoresOnePhase(ctx, sr, si.config.ReadStores, tr) if err != nil { metric.SearchColdErrors.Add(1) if errors.Is(err, consts.ErrPartialResponse) { partialRespErr = err // consider partial response from cold stores as a result } else { // errors from both hot and cold stores, return error - return nil, nil, err + return nil, err } } case errors.Is(err, consts.ErrPartialResponse): partialRespErr = err // consider partial response from hot stores as a result default: // unexpected error on all hot replica sets (usually bad query) - return nil, nil, err + return nil, err } } - // TODO: do we really need QPR (???) - resQpr := &seq.QPR{ - Histogram: make(map[seq.MID]uint64), - Aggs: make([]seq.AggregatableSamples, len(sr.AggQ)), - } - seq.MergeQPRs(resQpr, qprs, sr.Offset+sr.Size, sr.Interval, sr.Order) - var mergedStream query.RecordProducer hasAggs := len(sr.AggQ) > 0 // TODO: check based on stats pipe @@ -81,7 +74,7 @@ func (si *Ingestor) OnePhaseSearch( mergedStream = exec.NewLimiter(mergedDocsStream, uint32(sr.Size)) // TODO: offset } - return resQpr, mergedStream, partialRespErr + return mergedStream, partialRespErr } func (si *Ingestor) searchStoresOnePhase( @@ -89,9 +82,8 @@ func (si *Ingestor) searchStoresOnePhase( sr *SearchRequest, s *stores.Stores, tr *querytracer.Tracer, -) ([]*seq.QPR, []query.RecordProducer, error) { +) ([]query.RecordProducer, error) { type ShardResponse struct { - QPR *seq.QPR Stream query.RecordProducer Err error } @@ -105,9 +97,8 @@ func (si *Ingestor) searchStoresOnePhase( defer wg.Done() defer tr.Done() - qpr, stream, err := si.searchShardOnePhase(ctx, shard, sr, tr) + stream, err := si.searchShardOnePhase(ctx, shard, sr, tr) respChan <- ShardResponse{ - QPR: qpr, Stream: stream, Err: err, } @@ -119,35 +110,32 @@ func (si *Ingestor) searchStoresOnePhase( close(respChan) }() - qprs := make([]*seq.QPR, 0, len(s.Shards)) streams := make([]query.RecordProducer, 0, len(s.Shards)) var errs []error for resp := range respChan { if err := resp.Err; err != nil { if errors.Is(err, consts.ErrIngestorQueryWantsOldData) { // At least one hot store doesn't have such old data - return nil, nil, err + return nil, err } if errors.Is(err, consts.ErrTooManyFractionsHit) { - return nil, nil, err + return nil, err } errs = append(errs, err) continue } - - qprs = append(qprs, resp.QPR) streams = append(streams, resp.Stream) } if err := util.DeduplicateErrors(errs); err != nil { - if len(qprs) != 0 { + if len(streams) != 0 { // There are errors, but some Shards returned data, so provide it to user - return qprs, streams, fmt.Errorf("%w: %s", consts.ErrPartialResponse, err) + return streams, fmt.Errorf("%w: %s", consts.ErrPartialResponse, err) } - return nil, nil, err + return nil, err } - return qprs, streams, nil + return streams, nil } func (si *Ingestor) searchShardOnePhase( @@ -155,7 +143,7 @@ func (si *Ingestor) searchShardOnePhase( hosts []string, request *SearchRequest, tr *querytracer.Tracer, -) (*seq.QPR, query.RecordProducer, error) { +) (query.RecordProducer, error) { var idx []int if si.config.ShuffleReplicas { idx = util.IdxShuffle(len(hosts)) @@ -167,18 +155,18 @@ func (si *Ingestor) searchShardOnePhase( for i := range len(hosts) { host := hosts[idx[i]] tr.Printf("Making search request to %s", host) - qpr, stream, err := si.searchHostOnePhase(ctx, hosts[i], request, tr) + stream, err := si.searchHostOnePhase(ctx, hosts[i], request, tr) if err != nil { if errors.Is(err, consts.ErrIngestorQueryWantsOldData) { - return nil, nil, err + return nil, err } errs = append(errs, err) continue } - return qpr, stream, nil + return stream, nil } - return nil, nil, util.DeduplicateErrors(errs) + return nil, util.DeduplicateErrors(errs) } func (si *Ingestor) searchHostOnePhase( @@ -186,10 +174,10 @@ func (si *Ingestor) searchHostOnePhase( host string, request *SearchRequest, _ *querytracer.Tracer, -) (*seq.QPR, query.RecordProducer, error) { +) (query.RecordProducer, error) { client, has := si.clients[host] if !has { - return nil, nil, fmt.Errorf("can't fetch: no client for host %s", host) + return nil, fmt.Errorf("can't fetch: no client for host %s", host) } fieldsFilter := tryParseFieldsFilter(string(request.Q)) @@ -214,35 +202,39 @@ func (si *Ingestor) searchHostOnePhase( grpc.MaxCallSendMsgSize(256*int(units.MiB)), ) if err != nil { - return nil, nil, fmt.Errorf("can't open stream: %s", err.Error()) + return nil, fmt.Errorf("can't open stream: %s", err.Error()) } msg, err := stream.Recv() if err != nil { - return nil, nil, err + return nil, err } header := msg.GetHeader() if header == nil { - return nil, nil, fmt.Errorf("can't read header") - } - - if header.Metadata.Code == storeapi.SearchErrorCode_INGESTOR_QUERY_WANTS_OLD_DATA { - return nil, nil, fmt.Errorf("hot store refuses: %w", consts.ErrIngestorQueryWantsOldData) - } - - errs := make([]seq.ErrorSource, 0, len(header.Metadata.Errors)) - for _, err := range header.Metadata.Errors { - errs = append(errs, seq.ErrorSource{ErrStr: err}) + return nil, fmt.Errorf("can't read header") } - qpr := &seq.QPR{ - Total: header.Metadata.Total, - Errors: errs, + // TODO: handle header.Metadata.Errors (do we really need it?) + switch header.Metadata.Code { + case storeapi.SearchErrorCode_INGESTOR_QUERY_WANTS_OLD_DATA: + return nil, fmt.Errorf("hot store refuses: %w", consts.ErrIngestorQueryWantsOldData) + case storeapi.SearchErrorCode_TOO_MANY_FIELD_TOKENS: + return nil, fmt.Errorf("store forbids aggregation request: %w", consts.ErrTooManyFieldTokens) + case storeapi.SearchErrorCode_TOO_MANY_FIELD_VALUES: + return nil, fmt.Errorf("store forbids aggregation request: %w", consts.ErrTooManyFieldValues) + case storeapi.SearchErrorCode_TOO_MANY_GROUP_TOKENS: + return nil, fmt.Errorf("store forbids aggregation request: %w", consts.ErrTooManyGroupTokens) + case storeapi.SearchErrorCode_TOO_MANY_FRACTION_TOKENS: + return nil, fmt.Errorf("store forbids aggregation request: %w", consts.ErrTooManyFractionTokens) + case storeapi.SearchErrorCode_MEMORY_LIMIT_EXCEEDED: + return nil, fmt.Errorf("store forbids search request: %w", consts.ErrMemoryLimitExceeded) + case storeapi.SearchErrorCode_TOO_MANY_FRACTIONS_HIT: + return nil, fmt.Errorf("store forbids request: %w", consts.ErrTooManyFractionsHit) } - return qpr, &OnePhaseSearchStreamIterator{typing: header.Typing, stream: stream}, nil + return &OnePhaseSearchStreamIterator{typing: header.Typing, stream: stream}, nil } // TODO: move to executor (???) diff --git a/proxyapi/grpc_one_phase_search.go b/proxyapi/grpc_one_phase_search.go index 99fc668e..d716855a 100644 --- a/proxyapi/grpc_one_phase_search.go +++ b/proxyapi/grpc_one_phase_search.go @@ -203,10 +203,10 @@ func (g *grpcV1) doOnePhaseSearch( } tr := querytracer.New(req.Query.Explain, "proxy/OnePhaseSearch") - // TODO: do we really need QPR here (???) - qpr, stream, err := g.searchIngestor.OnePhaseSearch(ctx, proxyReq, tr) + stream, err := g.searchIngestor.OnePhaseSearch(ctx, proxyReq, tr) + psr := &proxySearchResponse{ - qpr: qpr, + qpr: &seq.QPR{}, // TODO: do we really need QPR here (???) } if e, ok := parseProxyError(err); ok { @@ -219,7 +219,7 @@ func (g *grpcV1) doOnePhaseSearch( } if st, ok := status.FromError(err); ok { - // could not parse a query + // could not parse the query if st.Code() == codes.InvalidArgument { return nil, nil, err } @@ -233,7 +233,7 @@ func (g *grpcV1) doOnePhaseSearch( } return psr, stream, nil } - if err = processSearchErrors(qpr, err); err != nil { + if err = processSearchErrors(psr.qpr, err); err != nil { metric.SearchErrors.Inc() return nil, nil, err } diff --git a/proxyapi/grpc_v1.go b/proxyapi/grpc_v1.go index 31ed2d83..d04ac109 100644 --- a/proxyapi/grpc_v1.go +++ b/proxyapi/grpc_v1.go @@ -39,7 +39,7 @@ type SearchIngestor interface { CancelAsyncSearch(ctx context.Context, id string) error DeleteAsyncSearch(ctx context.Context, id string) error GetAsyncSearchesList(context.Context, search.GetAsyncSearchesListRequest) ([]*search.AsyncSearchesListItem, error) - OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, query.RecordProducer, error) + OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (query.RecordProducer, error) } type MappingProvider interface { diff --git a/proxyapi/mock/grpc_v1.go b/proxyapi/mock/grpc_v1.go index 9ba38f8d..2b50a6d0 100644 --- a/proxyapi/mock/grpc_v1.go +++ b/proxyapi/mock/grpc_v1.go @@ -117,13 +117,12 @@ func (mr *MockSearchIngestorMockRecorder) GetAsyncSearchesList(arg0, arg1 interf } // OnePhaseSearch mocks base method. -func (m *MockSearchIngestor) OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, query.RecordProducer, error) { +func (m *MockSearchIngestor) OnePhaseSearch(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (query.RecordProducer, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OnePhaseSearch", ctx, sr, tr) - ret0, _ := ret[0].(*seq.QPR) - ret1, _ := ret[1].(query.RecordProducer) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 + ret0, _ := ret[0].(query.RecordProducer) + ret1, _ := ret[1].(error) + return ret0, ret1 } // OnePhaseSearch indicates an expected call of OnePhaseSearch. diff --git a/query/exec/data_source.go b/query/exec/data_source.go index 1d51362b..68acdbef 100644 --- a/query/exec/data_source.go +++ b/query/exec/data_source.go @@ -3,10 +3,15 @@ package exec import ( "context" "encoding/binary" + "errors" + "math" + + "google.golang.org/protobuf/types/known/timestamppb" "github.com/ozontech/seq-db/frac" "github.com/ozontech/seq-db/frac/processor" "github.com/ozontech/seq-db/fracmanager" + "github.com/ozontech/seq-db/pkg/storeapi" "github.com/ozontech/seq-db/query" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" @@ -64,10 +69,20 @@ func (s *FractionDataSource) scan() error { if err != nil { return err } + + if len(qpr.Errors) > 0 { + var resErr error + for _, e := range qpr.Errors { + resErr = errors.Join(errors.New(e.ErrStr)) // TODO: ??? + } + return resErr + } + if len(qpr.IDs) == 0 { return nil } - docs, err := s.frac.Fetch(s.Ctx(), qpr.IDs.IDs()) + + docs, err := s.frac.Fetch(s.Ctx(), qpr.IDs.IDs(), false) if err != nil { return err } @@ -83,14 +98,17 @@ type SearcherDataSource struct { tr *querytracer.Tracer searchParams processor.SearchParams // TODO: ??? + isAgg bool fracManager *fracmanager.FracManager searcher *fracmanager.Searcher fetcher *fracmanager.Fetcher - qpr *seq.QPR - docs [][]byte - curDocIdx int + qpr *seq.QPR + docs [][]byte + aggs []*storeapi.SearchResponse_Agg // TODO: internal struct + + curIdx int } func NewSearcherDataSource( @@ -108,24 +126,57 @@ func NewSearcherDataSource( fracManager: fracManager, searcher: searcher, fetcher: fetcher, + isAgg: len(searchParams.AggQ) > 0, } } func (s *SearcherDataSource) Next() (*query.Record, *query.Metadata) { + // TODO: get rid of hardcode (???) + if s.isAgg { + return s.nextAgg() + } else { + return s.nextDoc() + } +} + +func (s *SearcherDataSource) nextDoc() (*query.Record, *query.Metadata) { if len(s.docs) == 0 { if err := s.scan(); err != nil { return nil, &query.Metadata{Err: err} } } - if s.curDocIdx >= len(s.docs) { + if s.curIdx >= len(s.docs) { return nil, nil } - docRecord := makeDocumentRecord(s.qpr.IDs[s.curDocIdx].ID, s.docs[s.curDocIdx]) - s.curDocIdx++ + record := makeDocumentRecord(s.qpr.IDs[s.curIdx].ID, s.docs[s.curIdx]) - return docRecord, nil + s.curIdx++ + + return record, nil +} + +func (s *SearcherDataSource) nextAgg() (*query.Record, *query.Metadata) { + if len(s.aggs) == 0 { + if err := s.scan(); err != nil { + return nil, &query.Metadata{Err: err} + } + } + + if s.aggs[0] == nil { + return nil, nil + } + + if s.curIdx >= len(s.aggs[0].Timeseries) { + return nil, nil + } + + record := makeAggRecord(s.aggs[0].Timeseries[s.curIdx]) + + s.curIdx++ + + return record, nil } func (s *SearcherDataSource) Ctx() context.Context { @@ -141,21 +192,70 @@ func (s *SearcherDataSource) scan() error { return err } + if len(qpr.Errors) > 0 { + var resErr error + for _, e := range qpr.Errors { + resErr = errors.Join(errors.New(e.ErrStr)) // TODO: ??? + } + return resErr + } + + s.qpr = qpr + s.aggs = buildAggs(qpr) + if len(qpr.IDs) == 0 { return nil } - docs, err := s.fetcher.FetchDocs(s.Ctx(), s.fracManager.Fractions(), qpr.IDs) + docs, err := s.fetcher.FetchDocs(s.Ctx(), s.fracManager.Fractions(), qpr.IDs, false) if err != nil { return err } - - s.qpr = qpr s.docs = docs return nil } +func buildAggs(qpr *seq.QPR) []*storeapi.SearchResponse_Agg { + aggsBuf := make([]storeapi.SearchResponse_Agg, len(qpr.Aggs)) + aggs := make([]*storeapi.SearchResponse_Agg, len(qpr.Aggs)) + + for i, fromAgg := range qpr.Aggs { + curAgg := &aggsBuf[i] + + from := fromAgg.SamplesByBin + to := make(map[string]*storeapi.SearchResponse_Histogram, len(from)) + + for bin, hist := range from { + pbhist := &storeapi.SearchResponse_Histogram{ + Min: hist.Min, + Max: hist.Max, + Sum: hist.Sum, + Total: hist.Total, + Samples: hist.Samples, + NotExists: hist.NotExists, + } + + curAgg.Timeseries = append(curAgg.Timeseries, + &storeapi.SearchResponse_Bin{ + Label: bin.Token, + Ts: timestamppb.New(bin.MID.Time()), + Hist: pbhist, + }, + ) + + to[bin.Token] = pbhist + } + + curAgg.NotExists = fromAgg.NotExists + curAgg.AggHistogram = to + + aggs[i] = curAgg + } + + return aggs +} + func makeDocumentRecord(id seq.ID, payload []byte) *query.Record { return &query.Record{ Vals: []*query.RecordVals{ @@ -166,8 +266,27 @@ func makeDocumentRecord(id seq.ID, payload []byte) *query.Record { } } +func makeAggRecord(bin *storeapi.SearchResponse_Bin) *query.Record { + return &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeBytes, []byte(bin.Label)), + query.NewRecordVals(query.DataTypeFloat64, Float64ToBytes(bin.Hist.Min)), + query.NewRecordVals(query.DataTypeFloat64, Float64ToBytes(bin.Hist.Max)), + query.NewRecordVals(query.DataTypeFloat64, Float64ToBytes(bin.Hist.Sum)), + query.NewRecordVals(query.DataTypeUint64, Uint64ToBytes(uint64(bin.Hist.Total))), + query.NewRecordVals(query.DataTypeUint64, Uint64ToBytes(uint64(bin.Hist.NotExists))), + }, + } +} + func Uint64ToBytes(val uint64) []byte { b := make([]byte, 8) binary.LittleEndian.PutUint64(b, val) return b } + +func Float64ToBytes(val float64) []byte { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, math.Float64bits(val)) + return b +} diff --git a/query/exec/data_source_test.go b/query/exec/data_source_test.go index 3348ea82..9cbf6d43 100644 --- a/query/exec/data_source_test.go +++ b/query/exec/data_source_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + "github.com/RoaringBitmap/roaring/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -125,7 +126,10 @@ func setupFraction(t *testing.T, mapping seq.Mapping, bulks ...[]string) frac.Fr type testSkipMaskProvider struct{} -func (testSkipMaskProvider) GetIDsIteratorByFrac(fracName string, minLID, maxLID uint32, reverse bool) (node.Node, bool, error) { - return node.NewStatic([]uint32{}, false), false, nil +func (testSkipMaskProvider) GetIDsIteratorByFrac(fracName string, minLID, maxLID uint32, reverse bool) (node.Node, bool, func() error, error) { + return node.NewStatic([]uint32{}, false), false, func() error { return nil }, nil +} +func (testSkipMaskProvider) GetIDsBitmapByFrac(fracName string, minLID, maxLID uint32) (*roaring.Bitmap, error) { + return nil, nil } func (testSkipMaskProvider) RemoveFrac(_ string) {} diff --git a/storeapi/grpc_fetch.go b/storeapi/grpc_fetch.go index 090fa479..178178f7 100644 --- a/storeapi/grpc_fetch.go +++ b/storeapi/grpc_fetch.go @@ -31,17 +31,7 @@ func (g *GrpcV1) Fetch(req *storeapi.FetchRequest, stream storeapi.StoreApi_Fetc span.AddAttributes(trace.BoolAttribute("explain", req.Explain)) } - ids, err := extractIDs(req) - if err != nil { - span.SetStatus(trace.Status{Code: 1, Message: err.Error()}) - logger.Error("fetch error", zap.Error(err)) - return fmt.Errorf("ids extract errors: %s", err.Error()) - } - - send := func(block []byte) error { - return stream.Send(&storeapi.BinaryData{Data: block}) - } - err = g.doFetch(ctx, ids, req.FieldsFilter, req.Explain, send) + err := g.doFetch(ctx, req, stream) if err != nil { span.SetStatus(trace.Status{Code: 1, Message: err.Error()}) logger.Error("fetch error", zap.Error(err)) @@ -49,13 +39,7 @@ func (g *GrpcV1) Fetch(req *storeapi.FetchRequest, stream storeapi.StoreApi_Fetc return err } -func (g *GrpcV1) doFetch( - ctx context.Context, - ids seq.IDSources, - fieldsFilter *storeapi.FieldsFilter, - explain bool, - send func(block []byte) error, -) error { +func (g *GrpcV1) doFetch(ctx context.Context, req *storeapi.FetchRequest, stream storeapi.StoreApi_FetchServer) error { metric.FetchInFlightQueriesTotal.Inc() defer metric.FetchInFlightQueriesTotal.Dec() @@ -64,6 +48,11 @@ func (g *GrpcV1) doFetch( start := time.Now() + ids, err := extractIDs(req) + if err != nil { + return fmt.Errorf("ids extract errors: %s", err.Error()) + } + notFound := 0 docsFetched := 0 bytesFetched := int64(0) @@ -76,7 +65,7 @@ func (g *GrpcV1) doFetch( buf []byte ) - dp := acquireDocFieldsFilter(fieldsFilter) + dp := acquireDocFieldsFilter(req.FieldsFilter) defer releaseDocFieldsFilter(dp) docsStream := newDocsStream(ctx, ids, g.fetchData.docFetcher, g.fracManager.Fractions(), req.NoSkipMasks) @@ -104,7 +93,7 @@ func (g *GrpcV1) doFetch( block.SetExt1(uint64(id.ID.MID)) block.SetExt2(uint64(id.ID.RID)) - if err := send(block); err != nil { + if err := stream.Send(&storeapi.BinaryData{Data: block}); err != nil { if util.IsCancelled(ctx) { logger.Info("fetch request is canceled", zap.Int("requested", len(ids)), @@ -135,7 +124,7 @@ func (g *GrpcV1) doFetch( ) } - if explain { + if req.Explain { logger.Info("fetch result", zap.Int("requested", len(ids)), zap.Int("fetched", docsFetched), diff --git a/storeapi/grpc_one_phase_search.go b/storeapi/grpc_one_phase_search.go index 37fedb02..1f4782ba 100644 --- a/storeapi/grpc_one_phase_search.go +++ b/storeapi/grpc_one_phase_search.go @@ -2,9 +2,7 @@ package storeapi import ( "context" - "encoding/binary" "fmt" - "math" "time" "go.opencensus.io/trace" @@ -53,26 +51,6 @@ func (g *GrpcV1) doOnePhaseSearch( ctx context.Context, req *storeapi.OnePhaseSearchRequest, stream storeapi.StoreApi_OnePhaseSearchServer, -) error { - seqql, err := parser.ParseSeqQL(req.Query, g.mappingProvider.GetMapping()) - if err != nil { - return fmt.Errorf("parse query error: %w", err) - } - - statsAggs := extractStatsPipesFromSeqQL(seqql) - hasAggs := len(statsAggs) > 0 - if hasAggs { - return g.doOnePhaseSearchWithAggs(ctx, req, stream, statsAggs) - } - - return g.doOnePhaseSearchDocs(ctx, req, stream, seqql) -} - -func (g *GrpcV1) doOnePhaseSearchDocs( - ctx context.Context, - req *storeapi.OnePhaseSearchRequest, - stream storeapi.StoreApi_OnePhaseSearchServer, - seqql parser.SeqQLQuery, ) error { metric.SearchInFlightQueriesTotal.Inc() defer metric.SearchInFlightQueriesTotal.Dec() @@ -101,19 +79,38 @@ func (g *GrpcV1) doOnePhaseSearchDocs( tr := querytracer.New(req.Explain, "store/OnePhaseSearchDocs") - err := stream.Send(&storeapi.OnePhaseSearchResponse{ + seqql, err := parser.ParseSeqQL(req.Query, g.mappingProvider.GetMapping()) + if err != nil { + return fmt.Errorf("parse query error: %w", err) + } + + statsAggs := extractStatsPipesFromSeqQL(seqql) + + // TODO: conditional typing + typing := []*storeapi.Typing{ + {Title: "mid", Type: storeapi.DataType_UINT64}, + {Title: "rid", Type: storeapi.DataType_UINT64}, + {Title: "data", Type: storeapi.DataType_RAW_DOCUMENT}, + } + if len(statsAggs) > 0 { + typing = []*storeapi.Typing{ + {Title: "token", Type: storeapi.DataType_STRING}, + {Title: "min", Type: storeapi.DataType_FLOAT64}, + {Title: "max", Type: storeapi.DataType_FLOAT64}, + {Title: "sum", Type: storeapi.DataType_FLOAT64}, + {Title: "total", Type: storeapi.DataType_UINT64}, + {Title: "not_exists", Type: storeapi.DataType_UINT64}, + } + } + + err = stream.Send(&storeapi.OnePhaseSearchResponse{ ResponseType: &storeapi.OnePhaseSearchResponse_Header{ Header: &storeapi.Header{ Metadata: &storeapi.Metadata{ // TODO: fill metadata Code: errCode, }, - Typing: []*storeapi.Typing{ - // TODO: conditional typing - {Title: "mid", Type: storeapi.DataType_UINT64}, - {Title: "rid", Type: storeapi.DataType_UINT64}, - {Title: "data", Type: storeapi.DataType_RAW_DOCUMENT}, - }, + Typing: typing, }, }, }) @@ -130,7 +127,10 @@ func (g *GrpcV1) doOnePhaseSearchDocs( return nil } - producer, err := g.buildProducer(ctx, req, tr, seqql) + producer, err := g.buildProducer(ctx, req, tr, seqql, statsAggs) + if err != nil { + return fmt.Errorf("can't biuld record producer: %w", err) + } curRecord, curMeta := producer.Next() for { @@ -141,19 +141,15 @@ func (g *GrpcV1) doOnePhaseSearchDocs( break } + rawData := make([][]byte, len(curRecord.Vals)) + for i, d := range curRecord.Vals { + rawData[i] = d.RawData() + } + err = stream.Send(&storeapi.OnePhaseSearchResponse{ ResponseType: &storeapi.OnePhaseSearchResponse_Batch{ Batch: &storeapi.RecordsBatch{ - // TODO: batch - Records: []*storeapi.Record{ - { - RawData: [][]byte{ - curRecord.Vals[0].RawData(), - curRecord.Vals[1].RawData(), - curRecord.Vals[2].RawData(), - }, - }, - }, + Records: []*storeapi.Record{{RawData: rawData}}, // TODO: batch }, }, }) @@ -178,6 +174,7 @@ func (g *GrpcV1) buildProducer( req *storeapi.OnePhaseSearchRequest, tr *querytracer.Tracer, seqql parser.SeqQLQuery, + statsAggs []parser.StatsAgg, ) (query.RecordProducer, error) { searchParams := processor.SearchParams{ AST: seqql.Root, @@ -188,11 +185,29 @@ func (g *GrpcV1) buildProducer( Order: req.Order.MustDocsOrder(), } + if len(statsAggs) > 0 { + // TODO: rewrite aggs parsing and validation + aggs, err := convertStatsAggsToStoreApiAgg(statsAggs) + if err != nil { + return nil, fmt.Errorf("failed to convert stats aggs: %w", err) + } + aggQ, err := aggQueriesFromProto(aggs) + if err != nil { + return nil, fmt.Errorf("failed to convert stats aggs: %w", err) + } + searchParams.AggQ = aggQ + } + var producer query.RecordProducer dataSource := exec.NewSearcherDataSource(ctx, tr, searchParams, g.fracManager, g.searchData.searcher, g.fetchData.docFetcher) producer = dataSource + if len(statsAggs) > 0 { + // TODO: combine aggs with another executors + return producer, nil + } + for _, pipe := range seqql.Pipes { switch p := pipe.(type) { case *parser.PipeFilter: @@ -217,112 +232,6 @@ func (g *GrpcV1) buildProducer( return producer, nil } -// TODO: bytes pool (???), varint (???) -func Uint64ToBytes(val uint64) []byte { - b := make([]byte, 8) - binary.LittleEndian.PutUint64(b, val) - return b -} - -func Float64ToBytes(val float64) []byte { - b := make([]byte, 8) - binary.LittleEndian.PutUint64(b, math.Float64bits(val)) - return b -} - -func (g *GrpcV1) doOnePhaseSearchWithAggs( - ctx context.Context, - req *storeapi.OnePhaseSearchRequest, - stream storeapi.StoreApi_OnePhaseSearchServer, - statsAggs []parser.StatsAgg, -) error { - tr := querytracer.New(req.Explain, "store/OnePhaseSearchWithAggs") - - aggQ, err := convertStatsAggsToStoreApiAgg(statsAggs) - if err != nil { - return fmt.Errorf("failed to convert stats aggs: %w", err) - } - - data, err := g.doSearch(ctx, &storeapi.SearchRequest{ - Query: req.Query, - From: int64(seq.TimeToMID(req.From.AsTime())), - To: int64(seq.TimeToMID(req.To.AsTime())), - Size: req.Size, - Offset: req.Offset, - Explain: req.Explain, - WithTotal: req.WithTotal, - Order: req.Order, - OffsetId: req.OffsetId, - Aggs: aggQ, - }, tr) - if err != nil { - return fmt.Errorf("search error: %w", err) - } - tr.Done() - - err = stream.Send(&storeapi.OnePhaseSearchResponse{ - ResponseType: &storeapi.OnePhaseSearchResponse_Header{ - Header: &storeapi.Header{ - Metadata: &storeapi.Metadata{ - Total: data.Total, - Code: data.Code, - Errors: data.Errors, - Explain: data.Explain, - }, - Typing: []*storeapi.Typing{ - // TODO: conditional typing - {Title: "token", Type: storeapi.DataType_STRING}, - {Title: "min", Type: storeapi.DataType_FLOAT64}, - {Title: "max", Type: storeapi.DataType_FLOAT64}, - {Title: "sum", Type: storeapi.DataType_FLOAT64}, - {Title: "total", Type: storeapi.DataType_UINT64}, - {Title: "not_exists", Type: storeapi.DataType_UINT64}, - }, - }, - }, - }) - if err != nil { - if util.IsCancelled(ctx) { - logger.Info("one phase search request is canceled") - return nil - } - return fmt.Errorf("error sending aggs: %w", err) - } - - for _, agg := range data.Aggs { - for _, bin := range agg.Timeseries { - err := stream.Send(&storeapi.OnePhaseSearchResponse{ - ResponseType: &storeapi.OnePhaseSearchResponse_Batch{ - Batch: &storeapi.RecordsBatch{ - // TODO: batch - Records: []*storeapi.Record{ - { - RawData: [][]byte{ - []byte(bin.Label), - Float64ToBytes(bin.Hist.Min), - Float64ToBytes(bin.Hist.Max), - Float64ToBytes(bin.Hist.Sum), - Uint64ToBytes(uint64(bin.Hist.Total)), - Uint64ToBytes(uint64(bin.Hist.NotExists)), - }, - }, - }, - }, - }, - }) - if err != nil { - if util.IsCancelled(ctx) { - logger.Info("one phase search request is canceled") - return nil - } - return fmt.Errorf("error sending aggs: %w", err) - } - } - } - - return nil -} - func extractStatsPipesFromSeqQL(seqql parser.SeqQLQuery) []parser.StatsAgg { var result []parser.StatsAgg for _, pipe := range seqql.Pipes {