diff --git a/api/storeapi/store_api.proto b/api/storeapi/store_api.proto index d3b2e2b42..d388442b9 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 StreamSearch(stream StreamSearchRequest) returns (stream StreamSearchResponse) {} } message BulkRequest { @@ -265,3 +267,83 @@ message StatusRequest {} message StatusResponse { google.protobuf.Timestamp oldest_time = 1; } + +message StreamSearchRequest { + oneof RequestType { + StreamSearchQuery query = 1; + StreamControl control = 2; + } +} + +message StreamSearchQuery { + string query = 1; // Search query. + google.protobuf.Timestamp from = 2; // Lower bound for search (inclusive). + google.protobuf.Timestamp to = 3; // Upper bound for search (inclusive). + bool explain = 4; // Should request be explained (tracing will be provided with the result). + string offset_id = 5; // ID offset for pagination. + bool with_total = 6; // Should total number of documents be returned in response. +} + +message StreamControl { + ControlAction action = 1; +} + +enum ControlAction { + CONTROL_ACTION_UNSPECIFIED = 0; + FINALIZE = 1; // Indicates correct stream termination, will get Summary after + CANCEL = 2; // Some client error, termination stream immediately, no need for Summary +} + +message StreamSearchResponse { + oneof ResponseType { + ResponseHeader header = 1; + ResponseData data = 2; + ResponseSummary summary = 3; + } +} + +message ResponseHeader { + repeated Typing typing = 1; +} + +message Typing { + string title = 1; + DataType type = 2; +} + +enum DataType { + BYTES = 0; + SEQ_ID = 1; + RAW_DOCUMENT = 2; + STRING = 3; + UINT32 = 4; + UINT64 = 5; + INT32 = 6; + INT64 = 7; + FLOAT64 = 8; + // TODO: later we will need array data types, such as: + // StringArray, Uin64Array, Float64Array etc. +} + +message ResponseData { + RecordsBatch batch = 1; +} + +message RecordsBatch { + repeated Record records = 1; +} + +message Record { + repeated bytes raw_data = 1; +} + +message ResponseSummary { + uint64 total = 1; + Error error = 2; + optional ExplainEntry explain = 3; +} + +message Error { + SearchErrorCode code = 1; + string message = 2; +} diff --git a/parser/seqql.go b/parser/seqql.go index 3c5c8db34..027962d2c 100644 --- a/parser/seqql.go +++ b/parser/seqql.go @@ -29,12 +29,13 @@ func (q *SeqQLQuery) SeqQLString() string { // callers reject them via SeqQLQuery.ValidatePipes. var streamOnlyPipes = map[string]struct{}{ "stats": {}, + "filter": {}, "sort": {}, "limit": {}, "offset": {}, } -// ValidateStreamPipes returns an error if the query contains any stream-only pipe (stats, +// ValidateStreamPipes returns an error if the query contains any stream-only pipe (stats, filter, // sort, limit, offset). It is used by methods that do not support stream-only pipes // to reject them after parsing. ParseSeqQL itself does not perform this check. func (q *SeqQLQuery) ValidateStreamPipes() error { diff --git a/parser/seqql_pipes.go b/parser/seqql_pipes.go index f3b8bbf08..fbc5b02be 100644 --- a/parser/seqql_pipes.go +++ b/parser/seqql_pipes.go @@ -12,27 +12,29 @@ type Pipe interface { } // pipeOrder defines the allowed order of pipes in a SeqQL query: -// stats | fields | sort | limit | offset. Any pipe may be omitted, but the +// stats | filter | fields | sort | limit | offset. Any pipe may be omitted, but the // present ones must appear in this exact sequence. The value is the position of // the pipe in that sequence. var pipeOrder = map[string]int{ "stats": 0, - "fields": 1, - "sort": 2, - "limit": 3, - "offset": 4, + "filter": 1, + "fields": 2, + "sort": 3, + "limit": 4, + "offset": 5, } var pipeNameFromOrder = map[int]string{ 0: "stats", - 1: "fields", - 2: "sort", - 3: "limit", - 4: "offset", + 1: "filter", + 2: "fields", + 3: "sort", + 4: "limit", + 5: "offset", } // parsePipes parses the pipe stage of a SeqQL query. The pipes must appear in -// the fixed order stats | fields | sort | limit | offset; pipes may be omitted, +// the fixed order stats | filter | fields | sort | limit | offset; pipes may be omitted, // but none may appear out of order. func parsePipes(lex *lexer) ([]Pipe, error) { seen := make(map[string]struct{}) @@ -55,6 +57,13 @@ func parsePipes(lex *lexer) ([]Pipe, error) { return nil, fmt.Errorf("parsing 'fields' pipe: %s", err) } pipes = append(pipes, p) + case lex.IsKeyword("filter"): + name = "filter" + p, err := parsePipeFilter(lex) + if err != nil { + return nil, fmt.Errorf("parsing 'filter' pipe: %s", err) + } + pipes = append(pipes, p) case lex.IsKeyword("stats"): name = "stats" p, err := parsePipeStats(lex) @@ -101,6 +110,62 @@ func parsePipes(lex *lexer) ([]Pipe, error) { return pipes, nil } +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 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 PipeFields struct { Fields []string Except bool @@ -457,7 +522,7 @@ var reservedKeywords = uniqueTokens([]string{ "|", // Pipe specific keywords. - "fields", "except", "limit", "offset", "sort", "stats", "by", "interval", "unique_count", "asc", "desc", + "fields", "except", "filter", "limit", "offset", "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 004a23a32..92ff7c7c2 100644 --- a/parser/seqql_pipes_test.go +++ b/parser/seqql_pipes_test.go @@ -39,6 +39,31 @@ func TestParsePipeFieldsExcept(t *testing.T) { test(`* | fields except k8s_namespace`, `* | fields except k8s_namespace`) } +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 TestParsePipeStats(t *testing.T) { test := func(q, expected string) { t.Helper() @@ -171,6 +196,7 @@ func TestParseSeqQLRejectsStreamPipes(t *testing.T) { test(`service:my_service | sort asc`) test(`service:my_service | limit 10`) test(`service:my_service | offset 10`) + test(`service:my_service | filter field:value`) } func TestValidatePipesAllowsFields(t *testing.T) { @@ -189,13 +215,14 @@ func TestParsePipeOrder(t *testing.T) { } test( - "service:my_service | stats count by (service) | fields message | sort asc | limit 10 | offset 5", - "service:my_service | stats count by (service) | fields message | sort asc | limit 10 | offset 5", + "service:my_service | stats count by (service) | filter field:value | fields message | sort asc | limit 10 | offset 5", + "service:my_service | stats count by (service) | filter field:value | fields message | sort asc | limit 10 | offset 5", ) test("service:my_service | stats count by (service) | limit 10", "service:my_service | stats count by (service) | limit 10") test("service:my_service | fields message | offset 5", "service:my_service | fields message | offset 5") test("service:my_service | sort asc | limit 10", "service:my_service | sort asc | limit 10") test("service:my_service | fields message | sort asc", "service:my_service | fields message | sort asc") + test("service:my_service | filter field:value | limit 10", "service:my_service | filter field:value | limit 10") } func TestParsePipeOrderErrors(t *testing.T) { @@ -211,4 +238,5 @@ func TestParsePipeOrderErrors(t *testing.T) { test(`service:my_service | offset 5 | limit 10`) test(`service:my_service | offset 5 | sort asc | limit 10`) test(`service:my_service | offset 5 | limit 10 | sort asc | fields message | stats count by (service)`) + test(`service:my_service | fields message | filter field:value`) } diff --git a/pkg/seqproxyapi/v1/marshaler.go b/pkg/seqproxyapi/v1/marshaler.go index 8258aff2f..b670a134a 100644 --- a/pkg/seqproxyapi/v1/marshaler.go +++ b/pkg/seqproxyapi/v1/marshaler.go @@ -2,16 +2,17 @@ package seqproxyapi import ( "bytes" - "encoding/binary" "encoding/json" "math" "strconv" "time" - "github.com/ozontech/seq-db/seq" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/ozontech/seq-db/query/encoding" + "github.com/ozontech/seq-db/seq" ) var ( @@ -295,7 +296,7 @@ func (r *Record) MarshalJSON() ([]byte, error) { // cells[1] is a little-endian uint64 storing the document MID (nanoseconds). var ts time.Time if len(cells[1]) == 8 { - ts = seq.MID(binary.LittleEndian.Uint64(cells[1])).Time() + ts = seq.MID(encoding.Uint64FromBytes(cells[1])).Time() } return json.Marshal([]any{ string(cells[0]), // id @@ -306,7 +307,7 @@ func (r *Record) MarshalJSON() ([]byte, error) { // cells[1] is a little-endian float64 storing the aggregation value. var value float64 if len(cells[1]) == 8 { - value = math.Float64frombits(binary.LittleEndian.Uint64(cells[1])) + value = encoding.Float64FromBytes(cells[1]) } val := json.RawMessage(strconv.FormatFloat(value, 'f', -1, 64)) if math.IsNaN(value) || math.IsInf(value, 0) { @@ -316,7 +317,7 @@ func (r *Record) MarshalJSON() ([]byte, error) { // A zero MID (no timestamp) is rendered as an empty string. formattedTime := "" if len(cells[2]) == 8 { - if ns := binary.LittleEndian.Uint64(cells[2]); ns != 0 { + if ns := encoding.Uint64FromBytes(cells[2]); ns != 0 { formattedTime = time.Unix(0, int64(ns)).UTC().Format(time.RFC3339Nano) } } diff --git a/pkg/seqproxyapi/v1/marshaler_test.go b/pkg/seqproxyapi/v1/marshaler_test.go index d5652ab9c..790a74815 100644 --- a/pkg/seqproxyapi/v1/marshaler_test.go +++ b/pkg/seqproxyapi/v1/marshaler_test.go @@ -1,12 +1,12 @@ package seqproxyapi import ( - "encoding/binary" "encoding/json" "math" "testing" "time" + "github.com/ozontech/seq-db/query/encoding" "github.com/stretchr/testify/require" "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/timestamppb" @@ -152,12 +152,9 @@ func TestRecordMarshalJSON(t *testing.T) { t.Run("documents", func(t *testing.T) { ns := time.Date(2025, 7, 8, 10, 19, 8, 742000000, time.UTC).UnixNano() - timeBuf := make([]byte, 8) - binary.LittleEndian.PutUint64(timeBuf, uint64(ns)) - rec := &Record{RawData: [][]byte{ []byte("46e48be997010000-e70163d0fa7582e4"), - timeBuf, + encoding.Uint64ToBytes(uint64(ns)), []byte(`{"message":"some_message","level":3}`), }} @@ -170,16 +167,11 @@ func TestRecordMarshalJSON(t *testing.T) { }) t.Run("aggregation buckets", func(t *testing.T) { - valueBuf := make([]byte, 8) - binary.LittleEndian.PutUint64(valueBuf, math.Float64bits(42.5)) tsNs := time.Date(2025, 7, 8, 10, 19, 8, 742000000, time.UTC).UnixNano() - tsBuf := make([]byte, 8) - binary.LittleEndian.PutUint64(tsBuf, uint64(tsNs)) - rec := &Record{RawData: [][]byte{ []byte("service-a"), - valueBuf, - tsBuf, + encoding.Float64ToBytes(42.5), + encoding.Uint64ToBytes(uint64(tsNs)), }} raw, err := json.Marshal(rec) @@ -188,14 +180,10 @@ func TestRecordMarshalJSON(t *testing.T) { }) t.Run("aggregation bucket with NaN", func(t *testing.T) { - valueBuf := make([]byte, 8) - binary.LittleEndian.PutUint64(valueBuf, math.Float64bits(math.NaN())) - tsBuf := make([]byte, 8) - rec := &Record{RawData: [][]byte{ []byte("service-a"), - valueBuf, - tsBuf, + encoding.Float64ToBytes(math.NaN()), + make([]byte, 8), }} raw, err := json.Marshal(rec) diff --git a/pkg/storeapi/store_api.pb.go b/pkg/storeapi/store_api.pb.go index d2e2942b1..83679ae92 100644 --- a/pkg/storeapi/store_api.pb.go +++ b/pkg/storeapi/store_api.pb.go @@ -250,6 +250,122 @@ func (AsyncSearchStatus) EnumDescriptor() ([]byte, []int) { return file_storeapi_store_api_proto_rawDescGZIP(), []int{3} } +type ControlAction int32 + +const ( + ControlAction_CONTROL_ACTION_UNSPECIFIED ControlAction = 0 + ControlAction_FINALIZE ControlAction = 1 // Indicates correct stream termination, will get Summary after + ControlAction_CANCEL ControlAction = 2 // Some client error, termination stream immediately, no need for Summary +) + +// Enum value maps for ControlAction. +var ( + ControlAction_name = map[int32]string{ + 0: "CONTROL_ACTION_UNSPECIFIED", + 1: "FINALIZE", + 2: "CANCEL", + } + ControlAction_value = map[string]int32{ + "CONTROL_ACTION_UNSPECIFIED": 0, + "FINALIZE": 1, + "CANCEL": 2, + } +) + +func (x ControlAction) Enum() *ControlAction { + p := new(ControlAction) + *p = x + return p +} + +func (x ControlAction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ControlAction) Descriptor() protoreflect.EnumDescriptor { + return file_storeapi_store_api_proto_enumTypes[4].Descriptor() +} + +func (ControlAction) Type() protoreflect.EnumType { + return &file_storeapi_store_api_proto_enumTypes[4] +} + +func (x ControlAction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ControlAction.Descriptor instead. +func (ControlAction) EnumDescriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{4} +} + +type DataType int32 + +const ( + DataType_BYTES DataType = 0 + DataType_SEQ_ID DataType = 1 + DataType_RAW_DOCUMENT DataType = 2 + DataType_STRING DataType = 3 + DataType_UINT32 DataType = 4 + DataType_UINT64 DataType = 5 + DataType_INT32 DataType = 6 + DataType_INT64 DataType = 7 + DataType_FLOAT64 DataType = 8 +) + +// Enum value maps for DataType. +var ( + DataType_name = map[int32]string{ + 0: "BYTES", + 1: "SEQ_ID", + 2: "RAW_DOCUMENT", + 3: "STRING", + 4: "UINT32", + 5: "UINT64", + 6: "INT32", + 7: "INT64", + 8: "FLOAT64", + } + DataType_value = map[string]int32{ + "BYTES": 0, + "SEQ_ID": 1, + "RAW_DOCUMENT": 2, + "STRING": 3, + "UINT32": 4, + "UINT64": 5, + "INT32": 6, + "INT64": 7, + "FLOAT64": 8, + } +) + +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[5].Descriptor() +} + +func (DataType) Type() protoreflect.EnumType { + return &file_storeapi_store_api_proto_enumTypes[5] +} + +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{5} +} + type BulkRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` @@ -1758,28 +1874,31 @@ func (x *StatusResponse) GetOldestTime() *timestamppb.Timestamp { return nil } -type SearchResponse_Id struct { - state protoimpl.MessageState `protogen:"open.v1"` - Mid uint64 `protobuf:"varint,1,opt,name=mid,proto3" json:"mid,omitempty"` - Rid uint64 `protobuf:"varint,2,opt,name=rid,proto3" json:"rid,omitempty"` +type StreamSearchRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to RequestType: + // + // *StreamSearchRequest_Query + // *StreamSearchRequest_Control + RequestType isStreamSearchRequest_RequestType `protobuf_oneof:"RequestType"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *SearchResponse_Id) Reset() { - *x = SearchResponse_Id{} +func (x *StreamSearchRequest) Reset() { + *x = StreamSearchRequest{} mi := &file_storeapi_store_api_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *SearchResponse_Id) String() string { +func (x *StreamSearchRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SearchResponse_Id) ProtoMessage() {} +func (*StreamSearchRequest) ProtoMessage() {} -func (x *SearchResponse_Id) ProtoReflect() protoreflect.Message { +func (x *StreamSearchRequest) ProtoReflect() protoreflect.Message { mi := &file_storeapi_store_api_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1791,105 +1910,79 @@ func (x *SearchResponse_Id) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SearchResponse_Id.ProtoReflect.Descriptor instead. -func (*SearchResponse_Id) Descriptor() ([]byte, []int) { - return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 0} +// Deprecated: Use StreamSearchRequest.ProtoReflect.Descriptor instead. +func (*StreamSearchRequest) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{21} } -func (x *SearchResponse_Id) GetMid() uint64 { +func (x *StreamSearchRequest) GetRequestType() isStreamSearchRequest_RequestType { if x != nil { - return x.Mid + return x.RequestType } - return 0 + return nil } -func (x *SearchResponse_Id) GetRid() uint64 { +func (x *StreamSearchRequest) GetQuery() *StreamSearchQuery { if x != nil { - return x.Rid + if x, ok := x.RequestType.(*StreamSearchRequest_Query); ok { + return x.Query + } } - return 0 -} - -type SearchResponse_IdWithHint struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id *SearchResponse_Id `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Hint string `protobuf:"bytes,3,opt,name=hint,proto3" json:"hint,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SearchResponse_IdWithHint) Reset() { - *x = SearchResponse_IdWithHint{} - mi := &file_storeapi_store_api_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SearchResponse_IdWithHint) String() string { - return protoimpl.X.MessageStringOf(x) + return nil } -func (*SearchResponse_IdWithHint) ProtoMessage() {} - -func (x *SearchResponse_IdWithHint) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[22] +func (x *StreamSearchRequest) GetControl() *StreamControl { if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) + if x, ok := x.RequestType.(*StreamSearchRequest_Control); ok { + return x.Control } - return ms } - return mi.MessageOf(x) + return nil } -// Deprecated: Use SearchResponse_IdWithHint.ProtoReflect.Descriptor instead. -func (*SearchResponse_IdWithHint) Descriptor() ([]byte, []int) { - return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 1} +type isStreamSearchRequest_RequestType interface { + isStreamSearchRequest_RequestType() } -func (x *SearchResponse_IdWithHint) GetId() *SearchResponse_Id { - if x != nil { - return x.Id - } - return nil +type StreamSearchRequest_Query struct { + Query *StreamSearchQuery `protobuf:"bytes,1,opt,name=query,proto3,oneof"` } -func (x *SearchResponse_IdWithHint) GetHint() string { - if x != nil { - return x.Hint - } - return "" +type StreamSearchRequest_Control struct { + Control *StreamControl `protobuf:"bytes,2,opt,name=control,proto3,oneof"` } -type SearchResponse_Histogram struct { +func (*StreamSearchRequest_Query) isStreamSearchRequest_RequestType() {} + +func (*StreamSearchRequest_Control) isStreamSearchRequest_RequestType() {} + +type StreamSearchQuery struct { state protoimpl.MessageState `protogen:"open.v1"` - Min float64 `protobuf:"fixed64,1,opt,name=min,proto3" json:"min,omitempty"` - Max float64 `protobuf:"fixed64,2,opt,name=max,proto3" json:"max,omitempty"` - Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` - Total int64 `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"` - NotExists int64 `protobuf:"varint,5,opt,name=not_exists,json=notExists,proto3" json:"not_exists,omitempty"` - Samples []float64 `protobuf:"fixed64,6,rep,packed,name=samples,proto3" json:"samples,omitempty"` - Values []uint32 `protobuf:"varint,7,rep,packed,name=values,proto3" json:"values,omitempty"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` // Search query. + From *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` // Lower bound for search (inclusive). + To *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` // Upper bound for search (inclusive). + Explain bool `protobuf:"varint,4,opt,name=explain,proto3" json:"explain,omitempty"` // Should request be explained (tracing will be provided with the result). + OffsetId string `protobuf:"bytes,5,opt,name=offset_id,json=offsetId,proto3" json:"offset_id,omitempty"` // ID offset for pagination. + WithTotal bool `protobuf:"varint,6,opt,name=with_total,json=withTotal,proto3" json:"with_total,omitempty"` // Should total number of documents be returned in response. unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *SearchResponse_Histogram) Reset() { - *x = SearchResponse_Histogram{} - mi := &file_storeapi_store_api_proto_msgTypes[23] +func (x *StreamSearchQuery) Reset() { + *x = StreamSearchQuery{} + mi := &file_storeapi_store_api_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *SearchResponse_Histogram) String() string { +func (x *StreamSearchQuery) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SearchResponse_Histogram) ProtoMessage() {} +func (*StreamSearchQuery) ProtoMessage() {} -func (x *SearchResponse_Histogram) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[23] +func (x *StreamSearchQuery) 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 { @@ -1900,84 +1993,75 @@ func (x *SearchResponse_Histogram) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SearchResponse_Histogram.ProtoReflect.Descriptor instead. -func (*SearchResponse_Histogram) Descriptor() ([]byte, []int) { - return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 2} -} - -func (x *SearchResponse_Histogram) GetMin() float64 { - if x != nil { - return x.Min - } - return 0 +// Deprecated: Use StreamSearchQuery.ProtoReflect.Descriptor instead. +func (*StreamSearchQuery) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{22} } -func (x *SearchResponse_Histogram) GetMax() float64 { +func (x *StreamSearchQuery) GetQuery() string { if x != nil { - return x.Max + return x.Query } - return 0 + return "" } -func (x *SearchResponse_Histogram) GetSum() float64 { +func (x *StreamSearchQuery) GetFrom() *timestamppb.Timestamp { if x != nil { - return x.Sum + return x.From } - return 0 + return nil } -func (x *SearchResponse_Histogram) GetTotal() int64 { +func (x *StreamSearchQuery) GetTo() *timestamppb.Timestamp { if x != nil { - return x.Total + return x.To } - return 0 + return nil } -func (x *SearchResponse_Histogram) GetNotExists() int64 { +func (x *StreamSearchQuery) GetExplain() bool { if x != nil { - return x.NotExists + return x.Explain } - return 0 + return false } -func (x *SearchResponse_Histogram) GetSamples() []float64 { +func (x *StreamSearchQuery) GetOffsetId() string { if x != nil { - return x.Samples + return x.OffsetId } - return nil + return "" } -func (x *SearchResponse_Histogram) GetValues() []uint32 { +func (x *StreamSearchQuery) GetWithTotal() bool { if x != nil { - return x.Values + return x.WithTotal } - return nil + return false } -type SearchResponse_Bin struct { - state protoimpl.MessageState `protogen:"open.v1"` - Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` - Ts *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=ts,proto3" json:"ts,omitempty"` - Hist *SearchResponse_Histogram `protobuf:"bytes,3,opt,name=hist,proto3" json:"hist,omitempty"` +type StreamControl struct { + state protoimpl.MessageState `protogen:"open.v1"` + Action ControlAction `protobuf:"varint,1,opt,name=action,proto3,enum=api.ControlAction" json:"action,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *SearchResponse_Bin) Reset() { - *x = SearchResponse_Bin{} - mi := &file_storeapi_store_api_proto_msgTypes[24] +func (x *StreamControl) Reset() { + *x = StreamControl{} + mi := &file_storeapi_store_api_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *SearchResponse_Bin) String() string { +func (x *StreamControl) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SearchResponse_Bin) ProtoMessage() {} +func (*StreamControl) ProtoMessage() {} -func (x *SearchResponse_Bin) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[24] +func (x *StreamControl) 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 { @@ -1988,67 +2072,45 @@ func (x *SearchResponse_Bin) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SearchResponse_Bin.ProtoReflect.Descriptor instead. -func (*SearchResponse_Bin) Descriptor() ([]byte, []int) { - return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 3} -} - -func (x *SearchResponse_Bin) GetLabel() string { - if x != nil { - return x.Label - } - return "" -} - -func (x *SearchResponse_Bin) GetTs() *timestamppb.Timestamp { - if x != nil { - return x.Ts - } - return nil +// Deprecated: Use StreamControl.ProtoReflect.Descriptor instead. +func (*StreamControl) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{23} } -func (x *SearchResponse_Bin) GetHist() *SearchResponse_Histogram { +func (x *StreamControl) GetAction() ControlAction { if x != nil { - return x.Hist + return x.Action } - return nil + return ControlAction_CONTROL_ACTION_UNSPECIFIED } -type SearchResponse_Agg struct { +type StreamSearchResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - // Deprecated: Marked as deprecated in storeapi/store_api.proto. - Agg map[string]uint64 `protobuf:"bytes,1,rep,name=agg,proto3" json:"agg,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - AggHistogram map[string]*SearchResponse_Histogram `protobuf:"bytes,2,rep,name=agg_histogram,json=aggHistogram,proto3" json:"agg_histogram,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - NotExists int64 `protobuf:"varint,3,opt,name=not_exists,json=notExists,proto3" json:"not_exists,omitempty"` - // Timeseries will be presented as: - // [ - // - // { (foo, ts1) -> (val) }, - // { (bar, ts1) -> (val) }, - // { (foo, ts2) -> (val) } + // Types that are valid to be assigned to ResponseType: // - // ] - Timeseries []*SearchResponse_Bin `protobuf:"bytes,4,rep,name=timeseries,proto3" json:"timeseries,omitempty"` - ValuesPool []string `protobuf:"bytes,5,rep,name=values_pool,json=valuesPool,proto3" json:"values_pool,omitempty"` + // *StreamSearchResponse_Header + // *StreamSearchResponse_Data + // *StreamSearchResponse_Summary + ResponseType isStreamSearchResponse_ResponseType `protobuf_oneof:"ResponseType"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *SearchResponse_Agg) Reset() { - *x = SearchResponse_Agg{} - mi := &file_storeapi_store_api_proto_msgTypes[25] +func (x *StreamSearchResponse) Reset() { + *x = StreamSearchResponse{} + mi := &file_storeapi_store_api_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *SearchResponse_Agg) String() string { +func (x *StreamSearchResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SearchResponse_Agg) ProtoMessage() {} +func (*StreamSearchResponse) ProtoMessage() {} -func (x *SearchResponse_Agg) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[25] +func (x *StreamSearchResponse) 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 { @@ -2059,48 +2121,750 @@ func (x *SearchResponse_Agg) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SearchResponse_Agg.ProtoReflect.Descriptor instead. -func (*SearchResponse_Agg) Descriptor() ([]byte, []int) { - return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 4} +// Deprecated: Use StreamSearchResponse.ProtoReflect.Descriptor instead. +func (*StreamSearchResponse) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{24} } -// Deprecated: Marked as deprecated in storeapi/store_api.proto. -func (x *SearchResponse_Agg) GetAgg() map[string]uint64 { +func (x *StreamSearchResponse) GetResponseType() isStreamSearchResponse_ResponseType { if x != nil { - return x.Agg + return x.ResponseType } return nil } -func (x *SearchResponse_Agg) GetAggHistogram() map[string]*SearchResponse_Histogram { +func (x *StreamSearchResponse) GetHeader() *ResponseHeader { if x != nil { - return x.AggHistogram + if x, ok := x.ResponseType.(*StreamSearchResponse_Header); ok { + return x.Header + } } return nil } -func (x *SearchResponse_Agg) GetNotExists() int64 { +func (x *StreamSearchResponse) GetData() *ResponseData { if x != nil { - return x.NotExists + if x, ok := x.ResponseType.(*StreamSearchResponse_Data); ok { + return x.Data + } } - return 0 + return nil } -func (x *SearchResponse_Agg) GetTimeseries() []*SearchResponse_Bin { +func (x *StreamSearchResponse) GetSummary() *ResponseSummary { if x != nil { - return x.Timeseries + if x, ok := x.ResponseType.(*StreamSearchResponse_Summary); ok { + return x.Summary + } } return nil } -func (x *SearchResponse_Agg) GetValuesPool() []string { - if x != nil { - return x.ValuesPool - } - return nil +type isStreamSearchResponse_ResponseType interface { + isStreamSearchResponse_ResponseType() } -type FetchRequest_FieldsFilter struct { +type StreamSearchResponse_Header struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"` +} + +type StreamSearchResponse_Data struct { + Data *ResponseData `protobuf:"bytes,2,opt,name=data,proto3,oneof"` +} + +type StreamSearchResponse_Summary struct { + Summary *ResponseSummary `protobuf:"bytes,3,opt,name=summary,proto3,oneof"` +} + +func (*StreamSearchResponse_Header) isStreamSearchResponse_ResponseType() {} + +func (*StreamSearchResponse_Data) isStreamSearchResponse_ResponseType() {} + +func (*StreamSearchResponse_Summary) isStreamSearchResponse_ResponseType() {} + +type ResponseHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + Typing []*Typing `protobuf:"bytes,1,rep,name=typing,proto3" json:"typing,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResponseHeader) Reset() { + *x = ResponseHeader{} + mi := &file_storeapi_store_api_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResponseHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseHeader) ProtoMessage() {} + +func (x *ResponseHeader) 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 ResponseHeader.ProtoReflect.Descriptor instead. +func (*ResponseHeader) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{25} +} + +func (x *ResponseHeader) GetTyping() []*Typing { + if x != nil { + return x.Typing + } + return nil +} + +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 { + 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 ResponseData struct { + state protoimpl.MessageState `protogen:"open.v1"` + Batch *RecordsBatch `protobuf:"bytes,1,opt,name=batch,proto3" json:"batch,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResponseData) Reset() { + *x = ResponseData{} + mi := &file_storeapi_store_api_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResponseData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseData) ProtoMessage() {} + +func (x *ResponseData) 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 ResponseData.ProtoReflect.Descriptor instead. +func (*ResponseData) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{27} +} + +func (x *ResponseData) GetBatch() *RecordsBatch { + if x != nil { + return x.Batch + } + return nil +} + +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[28] + 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[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 RecordsBatch.ProtoReflect.Descriptor instead. +func (*RecordsBatch) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{28} +} + +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[29] + 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[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 Record.ProtoReflect.Descriptor instead. +func (*Record) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{29} +} + +func (x *Record) GetRawData() [][]byte { + if x != nil { + return x.RawData + } + return nil +} + +type ResponseSummary struct { + state protoimpl.MessageState `protogen:"open.v1"` + Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Explain *ExplainEntry `protobuf:"bytes,3,opt,name=explain,proto3,oneof" json:"explain,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResponseSummary) Reset() { + *x = ResponseSummary{} + mi := &file_storeapi_store_api_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResponseSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseSummary) ProtoMessage() {} + +func (x *ResponseSummary) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[30] + 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 ResponseSummary.ProtoReflect.Descriptor instead. +func (*ResponseSummary) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{30} +} + +func (x *ResponseSummary) GetTotal() uint64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *ResponseSummary) GetError() *Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *ResponseSummary) GetExplain() *ExplainEntry { + if x != nil { + return x.Explain + } + return nil +} + +type Error struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code SearchErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=api.SearchErrorCode" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Error) Reset() { + *x = Error{} + mi := &file_storeapi_store_api_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Error) ProtoMessage() {} + +func (x *Error) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[31] + 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 Error.ProtoReflect.Descriptor instead. +func (*Error) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{31} +} + +func (x *Error) GetCode() SearchErrorCode { + if x != nil { + return x.Code + } + return SearchErrorCode_NO_ERROR +} + +func (x *Error) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type SearchResponse_Id struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mid uint64 `protobuf:"varint,1,opt,name=mid,proto3" json:"mid,omitempty"` + Rid uint64 `protobuf:"varint,2,opt,name=rid,proto3" json:"rid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchResponse_Id) Reset() { + *x = SearchResponse_Id{} + mi := &file_storeapi_store_api_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchResponse_Id) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchResponse_Id) ProtoMessage() {} + +func (x *SearchResponse_Id) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[32] + 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 SearchResponse_Id.ProtoReflect.Descriptor instead. +func (*SearchResponse_Id) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *SearchResponse_Id) GetMid() uint64 { + if x != nil { + return x.Mid + } + return 0 +} + +func (x *SearchResponse_Id) GetRid() uint64 { + if x != nil { + return x.Rid + } + return 0 +} + +type SearchResponse_IdWithHint struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id *SearchResponse_Id `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Hint string `protobuf:"bytes,3,opt,name=hint,proto3" json:"hint,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchResponse_IdWithHint) Reset() { + *x = SearchResponse_IdWithHint{} + mi := &file_storeapi_store_api_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchResponse_IdWithHint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchResponse_IdWithHint) ProtoMessage() {} + +func (x *SearchResponse_IdWithHint) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[33] + 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 SearchResponse_IdWithHint.ProtoReflect.Descriptor instead. +func (*SearchResponse_IdWithHint) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 1} +} + +func (x *SearchResponse_IdWithHint) GetId() *SearchResponse_Id { + if x != nil { + return x.Id + } + return nil +} + +func (x *SearchResponse_IdWithHint) GetHint() string { + if x != nil { + return x.Hint + } + return "" +} + +type SearchResponse_Histogram struct { + state protoimpl.MessageState `protogen:"open.v1"` + Min float64 `protobuf:"fixed64,1,opt,name=min,proto3" json:"min,omitempty"` + Max float64 `protobuf:"fixed64,2,opt,name=max,proto3" json:"max,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` + Total int64 `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"` + NotExists int64 `protobuf:"varint,5,opt,name=not_exists,json=notExists,proto3" json:"not_exists,omitempty"` + Samples []float64 `protobuf:"fixed64,6,rep,packed,name=samples,proto3" json:"samples,omitempty"` + Values []uint32 `protobuf:"varint,7,rep,packed,name=values,proto3" json:"values,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchResponse_Histogram) Reset() { + *x = SearchResponse_Histogram{} + mi := &file_storeapi_store_api_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchResponse_Histogram) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchResponse_Histogram) ProtoMessage() {} + +func (x *SearchResponse_Histogram) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[34] + 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 SearchResponse_Histogram.ProtoReflect.Descriptor instead. +func (*SearchResponse_Histogram) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 2} +} + +func (x *SearchResponse_Histogram) GetMin() float64 { + if x != nil { + return x.Min + } + return 0 +} + +func (x *SearchResponse_Histogram) GetMax() float64 { + if x != nil { + return x.Max + } + return 0 +} + +func (x *SearchResponse_Histogram) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +func (x *SearchResponse_Histogram) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *SearchResponse_Histogram) GetNotExists() int64 { + if x != nil { + return x.NotExists + } + return 0 +} + +func (x *SearchResponse_Histogram) GetSamples() []float64 { + if x != nil { + return x.Samples + } + return nil +} + +func (x *SearchResponse_Histogram) GetValues() []uint32 { + if x != nil { + return x.Values + } + return nil +} + +type SearchResponse_Bin struct { + state protoimpl.MessageState `protogen:"open.v1"` + Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` + Ts *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=ts,proto3" json:"ts,omitempty"` + Hist *SearchResponse_Histogram `protobuf:"bytes,3,opt,name=hist,proto3" json:"hist,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchResponse_Bin) Reset() { + *x = SearchResponse_Bin{} + mi := &file_storeapi_store_api_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchResponse_Bin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchResponse_Bin) ProtoMessage() {} + +func (x *SearchResponse_Bin) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[35] + 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 SearchResponse_Bin.ProtoReflect.Descriptor instead. +func (*SearchResponse_Bin) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 3} +} + +func (x *SearchResponse_Bin) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *SearchResponse_Bin) GetTs() *timestamppb.Timestamp { + if x != nil { + return x.Ts + } + return nil +} + +func (x *SearchResponse_Bin) GetHist() *SearchResponse_Histogram { + if x != nil { + return x.Hist + } + return nil +} + +type SearchResponse_Agg struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Deprecated: Marked as deprecated in storeapi/store_api.proto. + Agg map[string]uint64 `protobuf:"bytes,1,rep,name=agg,proto3" json:"agg,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + AggHistogram map[string]*SearchResponse_Histogram `protobuf:"bytes,2,rep,name=agg_histogram,json=aggHistogram,proto3" json:"agg_histogram,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + NotExists int64 `protobuf:"varint,3,opt,name=not_exists,json=notExists,proto3" json:"not_exists,omitempty"` + // Timeseries will be presented as: + // [ + // + // { (foo, ts1) -> (val) }, + // { (bar, ts1) -> (val) }, + // { (foo, ts2) -> (val) } + // + // ] + Timeseries []*SearchResponse_Bin `protobuf:"bytes,4,rep,name=timeseries,proto3" json:"timeseries,omitempty"` + ValuesPool []string `protobuf:"bytes,5,rep,name=values_pool,json=valuesPool,proto3" json:"values_pool,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchResponse_Agg) Reset() { + *x = SearchResponse_Agg{} + mi := &file_storeapi_store_api_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchResponse_Agg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchResponse_Agg) ProtoMessage() {} + +func (x *SearchResponse_Agg) ProtoReflect() protoreflect.Message { + mi := &file_storeapi_store_api_proto_msgTypes[36] + 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 SearchResponse_Agg.ProtoReflect.Descriptor instead. +func (*SearchResponse_Agg) Descriptor() ([]byte, []int) { + return file_storeapi_store_api_proto_rawDescGZIP(), []int{4, 4} +} + +// Deprecated: Marked as deprecated in storeapi/store_api.proto. +func (x *SearchResponse_Agg) GetAgg() map[string]uint64 { + if x != nil { + return x.Agg + } + return nil +} + +func (x *SearchResponse_Agg) GetAggHistogram() map[string]*SearchResponse_Histogram { + if x != nil { + return x.AggHistogram + } + return nil +} + +func (x *SearchResponse_Agg) GetNotExists() int64 { + if x != nil { + return x.NotExists + } + return 0 +} + +func (x *SearchResponse_Agg) GetTimeseries() []*SearchResponse_Bin { + if x != nil { + return x.Timeseries + } + return nil +} + +func (x *SearchResponse_Agg) GetValuesPool() []string { + if x != nil { + return x.ValuesPool + } + 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. @@ -2111,7 +2875,7 @@ type FetchRequest_FieldsFilter struct { func (x *FetchRequest_FieldsFilter) Reset() { *x = FetchRequest_FieldsFilter{} - mi := &file_storeapi_store_api_proto_msgTypes[29] + mi := &file_storeapi_store_api_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2123,7 +2887,7 @@ func (x *FetchRequest_FieldsFilter) String() string { func (*FetchRequest_FieldsFilter) ProtoMessage() {} func (x *FetchRequest_FieldsFilter) ProtoReflect() protoreflect.Message { - mi := &file_storeapi_store_api_proto_msgTypes[29] + mi := &file_storeapi_store_api_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2465,90 +3229,175 @@ var file_storeapi_store_api_proto_rawDesc = string([]byte{ 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, + 0x52, 0x0a, 0x6f, 0x6c, 0x64, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x84, 0x01, 0x0a, + 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x42, 0x0d, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x22, 0xdb, 0x01, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, + 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, 0x18, 0x0a, 0x07, 0x65, + 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, + 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x77, 0x69, 0x74, 0x68, 0x54, 0x6f, 0x74, 0x61, + 0x6c, 0x22, 0x3b, 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x12, 0x2a, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb0, + 0x01, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x30, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x22, 0x35, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 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, 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, 0x37, 0x0a, 0x0c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x05, 0x62, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x05, 0x62, + 0x61, 0x74, 0x63, 0x68, 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, + 0x22, 0x87, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x20, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x07, + 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x03, 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, 0x4b, 0x0a, 0x05, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x12, 0x28, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 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, 0x18, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 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, 0x2a, 0x49, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4e, 0x54, 0x52, + 0x4f, 0x4c, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x49, 0x4e, 0x41, 0x4c, + 0x49, 0x5a, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x10, + 0x02, 0x2a, 0x7a, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, + 0x05, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x51, 0x5f, + 0x49, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x41, 0x57, 0x5f, 0x44, 0x4f, 0x43, 0x55, + 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, + 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x04, 0x12, 0x0a, + 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, + 0x54, 0x33, 0x32, 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x07, + 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x08, 0x32, 0xe7, 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, 0x49, 0x0a, 0x0c, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x28, 0x01, 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 ( @@ -2563,113 +3412,143 @@ 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, 30) +var file_storeapi_store_api_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_storeapi_store_api_proto_msgTypes = make([]protoimpl.MessageInfo, 41) 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 - (*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 + (ControlAction)(0), // 4: api.ControlAction + (DataType)(0), // 5: api.DataType + (*BulkRequest)(nil), // 6: api.BulkRequest + (*BinaryData)(nil), // 7: api.BinaryData + (*AggQuery)(nil), // 8: api.AggQuery + (*SearchRequest)(nil), // 9: api.SearchRequest + (*SearchResponse)(nil), // 10: api.SearchResponse + (*ExplainEntry)(nil), // 11: api.ExplainEntry + (*StartAsyncSearchRequest)(nil), // 12: api.StartAsyncSearchRequest + (*StartAsyncSearchResponse)(nil), // 13: api.StartAsyncSearchResponse + (*FetchAsyncSearchResultRequest)(nil), // 14: api.FetchAsyncSearchResultRequest + (*FetchAsyncSearchResultResponse)(nil), // 15: api.FetchAsyncSearchResultResponse + (*CancelAsyncSearchRequest)(nil), // 16: api.CancelAsyncSearchRequest + (*CancelAsyncSearchResponse)(nil), // 17: api.CancelAsyncSearchResponse + (*DeleteAsyncSearchRequest)(nil), // 18: api.DeleteAsyncSearchRequest + (*DeleteAsyncSearchResponse)(nil), // 19: api.DeleteAsyncSearchResponse + (*GetAsyncSearchesListRequest)(nil), // 20: api.GetAsyncSearchesListRequest + (*GetAsyncSearchesListResponse)(nil), // 21: api.GetAsyncSearchesListResponse + (*AsyncSearchesListItem)(nil), // 22: api.AsyncSearchesListItem + (*IdWithHint)(nil), // 23: api.IdWithHint + (*FetchRequest)(nil), // 24: api.FetchRequest + (*StatusRequest)(nil), // 25: api.StatusRequest + (*StatusResponse)(nil), // 26: api.StatusResponse + (*StreamSearchRequest)(nil), // 27: api.StreamSearchRequest + (*StreamSearchQuery)(nil), // 28: api.StreamSearchQuery + (*StreamControl)(nil), // 29: api.StreamControl + (*StreamSearchResponse)(nil), // 30: api.StreamSearchResponse + (*ResponseHeader)(nil), // 31: api.ResponseHeader + (*Typing)(nil), // 32: api.Typing + (*ResponseData)(nil), // 33: api.ResponseData + (*RecordsBatch)(nil), // 34: api.RecordsBatch + (*Record)(nil), // 35: api.Record + (*ResponseSummary)(nil), // 36: api.ResponseSummary + (*Error)(nil), // 37: api.Error + (*SearchResponse_Id)(nil), // 38: api.SearchResponse.Id + (*SearchResponse_IdWithHint)(nil), // 39: api.SearchResponse.IdWithHint + (*SearchResponse_Histogram)(nil), // 40: api.SearchResponse.Histogram + (*SearchResponse_Bin)(nil), // 41: api.SearchResponse.Bin + (*SearchResponse_Agg)(nil), // 42: api.SearchResponse.Agg + nil, // 43: api.SearchResponse.HistogramEntry + nil, // 44: api.SearchResponse.Agg.AggEntry + nil, // 45: api.SearchResponse.Agg.AggHistogramEntry + (*FetchRequest_FieldsFilter)(nil), // 46: api.FetchRequest.FieldsFilter + (*durationpb.Duration)(nil), // 47: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 48: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 49: 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 + 8, // 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 + 39, // 3: api.SearchResponse.id_sources:type_name -> api.SearchResponse.IdWithHint + 43, // 4: api.SearchResponse.histogram:type_name -> api.SearchResponse.HistogramEntry + 42, // 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 - 9, // 9: api.ExplainEntry.children:type_name -> api.ExplainEntry - 34, // 10: api.StartAsyncSearchRequest.retention:type_name -> google.protobuf.Duration - 6, // 11: api.StartAsyncSearchRequest.aggs:type_name -> api.AggQuery + 11, // 7: api.SearchResponse.explain:type_name -> api.ExplainEntry + 47, // 8: api.ExplainEntry.duration:type_name -> google.protobuf.Duration + 11, // 9: api.ExplainEntry.children:type_name -> api.ExplainEntry + 47, // 10: api.StartAsyncSearchRequest.retention:type_name -> google.protobuf.Duration + 8, // 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 - 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 + 10, // 14: api.FetchAsyncSearchResultResponse.response:type_name -> api.SearchResponse + 48, // 15: api.FetchAsyncSearchResultResponse.started_at:type_name -> google.protobuf.Timestamp + 48, // 16: api.FetchAsyncSearchResultResponse.expires_at:type_name -> google.protobuf.Timestamp + 48, // 17: api.FetchAsyncSearchResultResponse.canceled_at:type_name -> google.protobuf.Timestamp + 8, // 18: api.FetchAsyncSearchResultResponse.aggs:type_name -> api.AggQuery + 48, // 19: api.FetchAsyncSearchResultResponse.from:type_name -> google.protobuf.Timestamp + 48, // 20: api.FetchAsyncSearchResultResponse.to:type_name -> google.protobuf.Timestamp + 47, // 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 + 22, // 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 - 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 - 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 + 48, // 25: api.AsyncSearchesListItem.started_at:type_name -> google.protobuf.Timestamp + 48, // 26: api.AsyncSearchesListItem.expires_at:type_name -> google.protobuf.Timestamp + 48, // 27: api.AsyncSearchesListItem.canceled_at:type_name -> google.protobuf.Timestamp + 8, // 28: api.AsyncSearchesListItem.aggs:type_name -> api.AggQuery + 48, // 29: api.AsyncSearchesListItem.from:type_name -> google.protobuf.Timestamp + 48, // 30: api.AsyncSearchesListItem.to:type_name -> google.protobuf.Timestamp + 47, // 31: api.AsyncSearchesListItem.retention:type_name -> google.protobuf.Duration + 23, // 32: api.FetchRequest.ids_with_hints:type_name -> api.IdWithHint + 46, // 33: api.FetchRequest.fields_filter:type_name -> api.FetchRequest.FieldsFilter + 48, // 34: api.StatusResponse.oldest_time:type_name -> google.protobuf.Timestamp + 28, // 35: api.StreamSearchRequest.query:type_name -> api.StreamSearchQuery + 29, // 36: api.StreamSearchRequest.control:type_name -> api.StreamControl + 48, // 37: api.StreamSearchQuery.from:type_name -> google.protobuf.Timestamp + 48, // 38: api.StreamSearchQuery.to:type_name -> google.protobuf.Timestamp + 4, // 39: api.StreamControl.action:type_name -> api.ControlAction + 31, // 40: api.StreamSearchResponse.header:type_name -> api.ResponseHeader + 33, // 41: api.StreamSearchResponse.data:type_name -> api.ResponseData + 36, // 42: api.StreamSearchResponse.summary:type_name -> api.ResponseSummary + 32, // 43: api.ResponseHeader.typing:type_name -> api.Typing + 5, // 44: api.Typing.type:type_name -> api.DataType + 34, // 45: api.ResponseData.batch:type_name -> api.RecordsBatch + 35, // 46: api.RecordsBatch.records:type_name -> api.Record + 37, // 47: api.ResponseSummary.error:type_name -> api.Error + 11, // 48: api.ResponseSummary.explain:type_name -> api.ExplainEntry + 2, // 49: api.Error.code:type_name -> api.SearchErrorCode + 38, // 50: api.SearchResponse.IdWithHint.id:type_name -> api.SearchResponse.Id + 48, // 51: api.SearchResponse.Bin.ts:type_name -> google.protobuf.Timestamp + 40, // 52: api.SearchResponse.Bin.hist:type_name -> api.SearchResponse.Histogram + 44, // 53: api.SearchResponse.Agg.agg:type_name -> api.SearchResponse.Agg.AggEntry + 45, // 54: api.SearchResponse.Agg.agg_histogram:type_name -> api.SearchResponse.Agg.AggHistogramEntry + 41, // 55: api.SearchResponse.Agg.timeseries:type_name -> api.SearchResponse.Bin + 40, // 56: api.SearchResponse.Agg.AggHistogramEntry.value:type_name -> api.SearchResponse.Histogram + 6, // 57: api.StoreApi.Bulk:input_type -> api.BulkRequest + 9, // 58: api.StoreApi.Search:input_type -> api.SearchRequest + 12, // 59: api.StoreApi.StartAsyncSearch:input_type -> api.StartAsyncSearchRequest + 14, // 60: api.StoreApi.FetchAsyncSearchResult:input_type -> api.FetchAsyncSearchResultRequest + 16, // 61: api.StoreApi.CancelAsyncSearch:input_type -> api.CancelAsyncSearchRequest + 18, // 62: api.StoreApi.DeleteAsyncSearch:input_type -> api.DeleteAsyncSearchRequest + 20, // 63: api.StoreApi.GetAsyncSearchesList:input_type -> api.GetAsyncSearchesListRequest + 24, // 64: api.StoreApi.Fetch:input_type -> api.FetchRequest + 25, // 65: api.StoreApi.Status:input_type -> api.StatusRequest + 27, // 66: api.StoreApi.StreamSearch:input_type -> api.StreamSearchRequest + 49, // 67: api.StoreApi.Bulk:output_type -> google.protobuf.Empty + 10, // 68: api.StoreApi.Search:output_type -> api.SearchResponse + 13, // 69: api.StoreApi.StartAsyncSearch:output_type -> api.StartAsyncSearchResponse + 15, // 70: api.StoreApi.FetchAsyncSearchResult:output_type -> api.FetchAsyncSearchResultResponse + 17, // 71: api.StoreApi.CancelAsyncSearch:output_type -> api.CancelAsyncSearchResponse + 19, // 72: api.StoreApi.DeleteAsyncSearch:output_type -> api.DeleteAsyncSearchResponse + 21, // 73: api.StoreApi.GetAsyncSearchesList:output_type -> api.GetAsyncSearchesListResponse + 7, // 74: api.StoreApi.Fetch:output_type -> api.BinaryData + 26, // 75: api.StoreApi.Status:output_type -> api.StatusResponse + 30, // 76: api.StoreApi.StreamSearch:output_type -> api.StreamSearchResponse + 67, // [67:77] is the sub-list for method output_type + 57, // [57:67] is the sub-list for method input_type + 57, // [57:57] is the sub-list for extension type_name + 57, // [57:57] is the sub-list for extension extendee + 0, // [0:57] is the sub-list for field type_name } func init() { file_storeapi_store_api_proto_init() } @@ -2681,13 +3560,23 @@ 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[21].OneofWrappers = []any{ + (*StreamSearchRequest_Query)(nil), + (*StreamSearchRequest_Control)(nil), + } + file_storeapi_store_api_proto_msgTypes[24].OneofWrappers = []any{ + (*StreamSearchResponse_Header)(nil), + (*StreamSearchResponse_Data)(nil), + (*StreamSearchResponse_Summary)(nil), + } + file_storeapi_store_api_proto_msgTypes[30].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, + NumEnums: 6, + NumMessages: 41, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/storeapi/store_api.pb.gw.go b/pkg/storeapi/store_api.pb.gw.go index 385ec9931..d6acba674 100644 --- a/pkg/storeapi/store_api.pb.gw.go +++ b/pkg/storeapi/store_api.pb.gw.go @@ -247,6 +247,53 @@ func local_request_StoreApi_Status_0(ctx context.Context, marshaler runtime.Mars return msg, metadata, err } +func request_StoreApi_StreamSearch_0(ctx context.Context, marshaler runtime.Marshaler, client StoreApiClient, req *http.Request, pathParams map[string]string) (StoreApi_StreamSearchClient, runtime.ServerMetadata, chan error, error) { + var metadata runtime.ServerMetadata + errChan := make(chan error, 1) + stream, err := client.StreamSearch(ctx) + if err != nil { + grpclog.Errorf("Failed to start streaming: %v", err) + close(errChan) + return nil, metadata, errChan, err + } + dec := marshaler.NewDecoder(req.Body) + handleSend := func() error { + var protoReq StreamSearchRequest + err := dec.Decode(&protoReq) + if errors.Is(err, io.EOF) { + return err + } + if err != nil { + grpclog.Errorf("Failed to decode request: %v", err) + return status.Errorf(codes.InvalidArgument, "Failed to decode request: %v", err) + } + if err := stream.Send(&protoReq); err != nil { + grpclog.Errorf("Failed to send request: %v", err) + return err + } + return nil + } + go func() { + defer close(errChan) + for { + if err := handleSend(); err != nil { + errChan <- err + break + } + } + if err := stream.CloseSend(); err != nil { + grpclog.Errorf("Failed to terminate client stream: %v", err) + } + }() + header, err := stream.Header() + if err != nil { + grpclog.Errorf("Failed to get header from client: %v", err) + return nil, metadata, errChan, err + } + metadata.HeaderMD = header + return stream, metadata, errChan, 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 +468,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_StreamSearch_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 +667,31 @@ 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_StreamSearch_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/StreamSearch", runtime.WithHTTPPathPattern("/api.StoreApi/StreamSearch")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + resp, md, reqErrChan, err := request_StoreApi_StreamSearch_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + go func() { + for err := range reqErrChan { + if err != nil && !errors.Is(err, io.EOF) { + runtime.HTTPStreamError(annotatedContext, mux, outboundMarshaler, w, req, err) + } + } + }() + forward_StoreApi_StreamSearch_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + }) return nil } @@ -626,6 +705,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_StreamSearch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api.StoreApi", "StreamSearch"}, "")) ) var ( @@ -638,4 +718,5 @@ var ( forward_StoreApi_GetAsyncSearchesList_0 = runtime.ForwardResponseMessage forward_StoreApi_Fetch_0 = runtime.ForwardResponseStream forward_StoreApi_Status_0 = runtime.ForwardResponseMessage + forward_StoreApi_StreamSearch_0 = runtime.ForwardResponseStream ) diff --git a/pkg/storeapi/store_api_vtproto.pb.go b/pkg/storeapi/store_api_vtproto.pb.go index fe3d5dc18..6c0295eb8 100644 --- a/pkg/storeapi/store_api_vtproto.pb.go +++ b/pkg/storeapi/store_api_vtproto.pb.go @@ -706,6 +706,275 @@ func (m *StatusResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *StreamSearchRequest) CloneVT() *StreamSearchRequest { + if m == nil { + return (*StreamSearchRequest)(nil) + } + r := new(StreamSearchRequest) + if m.RequestType != nil { + r.RequestType = m.RequestType.(interface { + CloneVT() isStreamSearchRequest_RequestType + }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StreamSearchRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StreamSearchRequest_Query) CloneVT() isStreamSearchRequest_RequestType { + if m == nil { + return (*StreamSearchRequest_Query)(nil) + } + r := new(StreamSearchRequest_Query) + r.Query = m.Query.CloneVT() + return r +} + +func (m *StreamSearchRequest_Control) CloneVT() isStreamSearchRequest_RequestType { + if m == nil { + return (*StreamSearchRequest_Control)(nil) + } + r := new(StreamSearchRequest_Control) + r.Control = m.Control.CloneVT() + return r +} + +func (m *StreamSearchQuery) CloneVT() *StreamSearchQuery { + if m == nil { + return (*StreamSearchQuery)(nil) + } + r := new(StreamSearchQuery) + r.Query = m.Query + r.From = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.From).CloneVT()) + r.To = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.To).CloneVT()) + r.Explain = m.Explain + r.OffsetId = m.OffsetId + r.WithTotal = m.WithTotal + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StreamSearchQuery) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StreamControl) CloneVT() *StreamControl { + if m == nil { + return (*StreamControl)(nil) + } + r := new(StreamControl) + r.Action = m.Action + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StreamControl) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StreamSearchResponse) CloneVT() *StreamSearchResponse { + if m == nil { + return (*StreamSearchResponse)(nil) + } + r := new(StreamSearchResponse) + if m.ResponseType != nil { + r.ResponseType = m.ResponseType.(interface { + CloneVT() isStreamSearchResponse_ResponseType + }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StreamSearchResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StreamSearchResponse_Header) CloneVT() isStreamSearchResponse_ResponseType { + if m == nil { + return (*StreamSearchResponse_Header)(nil) + } + r := new(StreamSearchResponse_Header) + r.Header = m.Header.CloneVT() + return r +} + +func (m *StreamSearchResponse_Data) CloneVT() isStreamSearchResponse_ResponseType { + if m == nil { + return (*StreamSearchResponse_Data)(nil) + } + r := new(StreamSearchResponse_Data) + r.Data = m.Data.CloneVT() + return r +} + +func (m *StreamSearchResponse_Summary) CloneVT() isStreamSearchResponse_ResponseType { + if m == nil { + return (*StreamSearchResponse_Summary)(nil) + } + r := new(StreamSearchResponse_Summary) + r.Summary = m.Summary.CloneVT() + return r +} + +func (m *ResponseHeader) CloneVT() *ResponseHeader { + if m == nil { + return (*ResponseHeader)(nil) + } + r := new(ResponseHeader) + if rhs := m.Typing; rhs != nil { + tmpContainer := make([]*Typing, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Typing = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ResponseHeader) 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 *ResponseData) CloneVT() *ResponseData { + if m == nil { + return (*ResponseData)(nil) + } + r := new(ResponseData) + r.Batch = m.Batch.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ResponseData) 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() +} + +func (m *ResponseSummary) CloneVT() *ResponseSummary { + if m == nil { + return (*ResponseSummary)(nil) + } + r := new(ResponseSummary) + r.Total = m.Total + r.Error = m.Error.CloneVT() + r.Explain = m.Explain.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ResponseSummary) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Error) CloneVT() *Error { + if m == nil { + return (*Error)(nil) + } + r := new(Error) + r.Code = m.Code + r.Message = m.Message + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Error) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (this *BulkRequest) EqualVT(that *BulkRequest) bool { if this == that { return true @@ -1703,797 +1972,898 @@ func (this *StatusResponse) EqualMessageVT(thatMsg proto.Message) bool { } 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. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// StoreApiClient is the client API for StoreApi service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type StoreApiClient interface { - Bulk(ctx context.Context, in *BulkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) - StartAsyncSearch(ctx context.Context, in *StartAsyncSearchRequest, opts ...grpc.CallOption) (*StartAsyncSearchResponse, error) - FetchAsyncSearchResult(ctx context.Context, in *FetchAsyncSearchResultRequest, opts ...grpc.CallOption) (*FetchAsyncSearchResultResponse, error) - CancelAsyncSearch(ctx context.Context, in *CancelAsyncSearchRequest, opts ...grpc.CallOption) (*CancelAsyncSearchResponse, error) - DeleteAsyncSearch(ctx context.Context, in *DeleteAsyncSearchRequest, opts ...grpc.CallOption) (*DeleteAsyncSearchResponse, error) - 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) -} - -type storeApiClient struct { - cc grpc.ClientConnInterface -} - -func NewStoreApiClient(cc grpc.ClientConnInterface) StoreApiClient { - return &storeApiClient{cc} -} - -func (c *storeApiClient) Bulk(ctx context.Context, in *BulkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/api.StoreApi/Bulk", in, out, opts...) - if err != nil { - return nil, err +func (this *StreamSearchRequest) EqualVT(that *StreamSearchRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false } - return out, nil + if this.RequestType == nil && that.RequestType != nil { + return false + } else if this.RequestType != nil { + if that.RequestType == nil { + return false + } + if !this.RequestType.(interface { + EqualVT(isStreamSearchRequest_RequestType) bool + }).EqualVT(that.RequestType) { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) } -func (c *storeApiClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { - out := new(SearchResponse) - err := c.cc.Invoke(ctx, "/api.StoreApi/Search", in, out, opts...) - if err != nil { - return nil, err +func (this *StreamSearchRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StreamSearchRequest) + if !ok { + return false } - return out, nil + return this.EqualVT(that) } - -func (c *storeApiClient) StartAsyncSearch(ctx context.Context, in *StartAsyncSearchRequest, opts ...grpc.CallOption) (*StartAsyncSearchResponse, error) { - out := new(StartAsyncSearchResponse) - err := c.cc.Invoke(ctx, "/api.StoreApi/StartAsyncSearch", in, out, opts...) - if err != nil { - return nil, err +func (this *StreamSearchRequest_Query) EqualVT(thatIface isStreamSearchRequest_RequestType) bool { + that, ok := thatIface.(*StreamSearchRequest_Query) + if !ok { + return false } - return out, nil + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Query, that.Query; p != q { + if p == nil { + p = &StreamSearchQuery{} + } + if q == nil { + q = &StreamSearchQuery{} + } + if !p.EqualVT(q) { + return false + } + } + return true } -func (c *storeApiClient) FetchAsyncSearchResult(ctx context.Context, in *FetchAsyncSearchResultRequest, opts ...grpc.CallOption) (*FetchAsyncSearchResultResponse, error) { - out := new(FetchAsyncSearchResultResponse) - err := c.cc.Invoke(ctx, "/api.StoreApi/FetchAsyncSearchResult", in, out, opts...) - if err != nil { - return nil, err +func (this *StreamSearchRequest_Control) EqualVT(thatIface isStreamSearchRequest_RequestType) bool { + that, ok := thatIface.(*StreamSearchRequest_Control) + if !ok { + return false } - return out, nil -} - -func (c *storeApiClient) CancelAsyncSearch(ctx context.Context, in *CancelAsyncSearchRequest, opts ...grpc.CallOption) (*CancelAsyncSearchResponse, error) { - out := new(CancelAsyncSearchResponse) - err := c.cc.Invoke(ctx, "/api.StoreApi/CancelAsyncSearch", in, out, opts...) - if err != nil { - return nil, err + if this == that { + return true } - return out, nil -} - -func (c *storeApiClient) DeleteAsyncSearch(ctx context.Context, in *DeleteAsyncSearchRequest, opts ...grpc.CallOption) (*DeleteAsyncSearchResponse, error) { - out := new(DeleteAsyncSearchResponse) - err := c.cc.Invoke(ctx, "/api.StoreApi/DeleteAsyncSearch", in, out, opts...) - if err != nil { - return nil, err + if this == nil && that != nil || this != nil && that == nil { + return false } - return out, nil -} - -func (c *storeApiClient) GetAsyncSearchesList(ctx context.Context, in *GetAsyncSearchesListRequest, opts ...grpc.CallOption) (*GetAsyncSearchesListResponse, error) { - out := new(GetAsyncSearchesListResponse) - err := c.cc.Invoke(ctx, "/api.StoreApi/GetAsyncSearchesList", in, out, opts...) - if err != nil { - return nil, err + if p, q := this.Control, that.Control; p != q { + if p == nil { + p = &StreamControl{} + } + if q == nil { + q = &StreamControl{} + } + if !p.EqualVT(q) { + return false + } } - return out, nil + return true } -func (c *storeApiClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (StoreApi_FetchClient, error) { - stream, err := c.cc.NewStream(ctx, &StoreApi_ServiceDesc.Streams[0], "/api.StoreApi/Fetch", opts...) - if err != nil { - return nil, err +func (this *StreamSearchQuery) EqualVT(that *StreamSearchQuery) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false } - x := &storeApiFetchClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err + if this.Query != that.Query { + return false } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err + if !(*timestamppb1.Timestamp)(this.From).EqualVT((*timestamppb1.Timestamp)(that.From)) { + return false } - return x, nil -} - -type StoreApi_FetchClient interface { - Recv() (*BinaryData, error) - grpc.ClientStream -} - -type storeApiFetchClient struct { - grpc.ClientStream -} - -func (x *storeApiFetchClient) Recv() (*BinaryData, error) { - m := new(BinaryData) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err + if !(*timestamppb1.Timestamp)(this.To).EqualVT((*timestamppb1.Timestamp)(that.To)) { + return false } - return m, nil -} - -func (c *storeApiClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - out := new(StatusResponse) - err := c.cc.Invoke(ctx, "/api.StoreApi/Status", in, out, opts...) - if err != nil { - return nil, err + if this.Explain != that.Explain { + return false } - return out, nil + if this.OffsetId != that.OffsetId { + return false + } + if this.WithTotal != that.WithTotal { + return false + } + return string(this.unknownFields) == string(that.unknownFields) } -// StoreApiServer is the server API for StoreApi service. -// All implementations must embed UnimplementedStoreApiServer -// for forward compatibility -type StoreApiServer interface { - Bulk(context.Context, *BulkRequest) (*emptypb.Empty, error) - Search(context.Context, *SearchRequest) (*SearchResponse, error) - StartAsyncSearch(context.Context, *StartAsyncSearchRequest) (*StartAsyncSearchResponse, error) - FetchAsyncSearchResult(context.Context, *FetchAsyncSearchResultRequest) (*FetchAsyncSearchResultResponse, error) - CancelAsyncSearch(context.Context, *CancelAsyncSearchRequest) (*CancelAsyncSearchResponse, error) - DeleteAsyncSearch(context.Context, *DeleteAsyncSearchRequest) (*DeleteAsyncSearchResponse, error) - GetAsyncSearchesList(context.Context, *GetAsyncSearchesListRequest) (*GetAsyncSearchesListResponse, error) - Fetch(*FetchRequest, StoreApi_FetchServer) error - Status(context.Context, *StatusRequest) (*StatusResponse, error) - mustEmbedUnimplementedStoreApiServer() +func (this *StreamSearchQuery) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StreamSearchQuery) + if !ok { + return false + } + return this.EqualVT(that) } - -// UnimplementedStoreApiServer must be embedded to have forward compatible implementations. -type UnimplementedStoreApiServer struct { +func (this *StreamControl) EqualVT(that *StreamControl) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Action != that.Action { + return false + } + return string(this.unknownFields) == string(that.unknownFields) } -func (UnimplementedStoreApiServer) Bulk(context.Context, *BulkRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Bulk not implemented") -} -func (UnimplementedStoreApiServer) Search(context.Context, *SearchRequest) (*SearchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Search not implemented") -} -func (UnimplementedStoreApiServer) StartAsyncSearch(context.Context, *StartAsyncSearchRequest) (*StartAsyncSearchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StartAsyncSearch not implemented") -} -func (UnimplementedStoreApiServer) FetchAsyncSearchResult(context.Context, *FetchAsyncSearchResultRequest) (*FetchAsyncSearchResultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FetchAsyncSearchResult not implemented") -} -func (UnimplementedStoreApiServer) CancelAsyncSearch(context.Context, *CancelAsyncSearchRequest) (*CancelAsyncSearchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CancelAsyncSearch not implemented") -} -func (UnimplementedStoreApiServer) DeleteAsyncSearch(context.Context, *DeleteAsyncSearchRequest) (*DeleteAsyncSearchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteAsyncSearch not implemented") -} -func (UnimplementedStoreApiServer) GetAsyncSearchesList(context.Context, *GetAsyncSearchesListRequest) (*GetAsyncSearchesListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAsyncSearchesList not implemented") -} -func (UnimplementedStoreApiServer) Fetch(*FetchRequest, StoreApi_FetchServer) error { - return status.Errorf(codes.Unimplemented, "method Fetch not implemented") -} -func (UnimplementedStoreApiServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +func (this *StreamControl) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StreamControl) + if !ok { + return false + } + return this.EqualVT(that) } -func (UnimplementedStoreApiServer) mustEmbedUnimplementedStoreApiServer() {} - -// UnsafeStoreApiServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to StoreApiServer will -// result in compilation errors. -type UnsafeStoreApiServer interface { - mustEmbedUnimplementedStoreApiServer() +func (this *StreamSearchResponse) EqualVT(that *StreamSearchResponse) 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(isStreamSearchResponse_ResponseType) bool + }).EqualVT(that.ResponseType) { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) } -func RegisterStoreApiServer(s grpc.ServiceRegistrar, srv StoreApiServer) { - s.RegisterService(&StoreApi_ServiceDesc, srv) +func (this *StreamSearchResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StreamSearchResponse) + if !ok { + return false + } + return this.EqualVT(that) } - -func _StoreApi_Bulk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BulkRequest) - if err := dec(in); err != nil { - return nil, err +func (this *StreamSearchResponse_Header) EqualVT(thatIface isStreamSearchResponse_ResponseType) bool { + that, ok := thatIface.(*StreamSearchResponse_Header) + if !ok { + return false } - if interceptor == nil { - return srv.(StoreApiServer).Bulk(ctx, in) + if this == that { + return true } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.StoreApi/Bulk", + if this == nil && that != nil || this != nil && that == nil { + return false } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreApiServer).Bulk(ctx, req.(*BulkRequest)) + if p, q := this.Header, that.Header; p != q { + if p == nil { + p = &ResponseHeader{} + } + if q == nil { + q = &ResponseHeader{} + } + if !p.EqualVT(q) { + return false + } } - return interceptor(ctx, in, info, handler) + return true } -func _StoreApi_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SearchRequest) - if err := dec(in); err != nil { - return nil, err +func (this *StreamSearchResponse_Data) EqualVT(thatIface isStreamSearchResponse_ResponseType) bool { + that, ok := thatIface.(*StreamSearchResponse_Data) + if !ok { + return false } - if interceptor == nil { - return srv.(StoreApiServer).Search(ctx, in) + if this == that { + return true } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.StoreApi/Search", + if this == nil && that != nil || this != nil && that == nil { + return false } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreApiServer).Search(ctx, req.(*SearchRequest)) + if p, q := this.Data, that.Data; p != q { + if p == nil { + p = &ResponseData{} + } + if q == nil { + q = &ResponseData{} + } + if !p.EqualVT(q) { + return false + } } - return interceptor(ctx, in, info, handler) + return true } -func _StoreApi_StartAsyncSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartAsyncSearchRequest) - if err := dec(in); err != nil { - return nil, err +func (this *StreamSearchResponse_Summary) EqualVT(thatIface isStreamSearchResponse_ResponseType) bool { + that, ok := thatIface.(*StreamSearchResponse_Summary) + if !ok { + return false } - if interceptor == nil { - return srv.(StoreApiServer).StartAsyncSearch(ctx, in) + if this == that { + return true } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.StoreApi/StartAsyncSearch", + if this == nil && that != nil || this != nil && that == nil { + return false } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreApiServer).StartAsyncSearch(ctx, req.(*StartAsyncSearchRequest)) + if p, q := this.Summary, that.Summary; p != q { + if p == nil { + p = &ResponseSummary{} + } + if q == nil { + q = &ResponseSummary{} + } + if !p.EqualVT(q) { + return false + } } - return interceptor(ctx, in, info, handler) + return true } -func _StoreApi_FetchAsyncSearchResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FetchAsyncSearchResultRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreApiServer).FetchAsyncSearchResult(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.StoreApi/FetchAsyncSearchResult", +func (this *ResponseHeader) EqualVT(that *ResponseHeader) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreApiServer).FetchAsyncSearchResult(ctx, req.(*FetchAsyncSearchResultRequest)) + if len(this.Typing) != len(that.Typing) { + return false } - return interceptor(ctx, in, info, handler) + 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 _StoreApi_CancelAsyncSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CancelAsyncSearchRequest) - if err := dec(in); err != nil { - return nil, err +func (this *ResponseHeader) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ResponseHeader) + if !ok { + return false } - if interceptor == nil { - return srv.(StoreApiServer).CancelAsyncSearch(ctx, in) + return this.EqualVT(that) +} +func (this *Typing) EqualVT(that *Typing) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.StoreApi/CancelAsyncSearch", + if this.Title != that.Title { + return false } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreApiServer).CancelAsyncSearch(ctx, req.(*CancelAsyncSearchRequest)) + if this.Type != that.Type { + return false } - return interceptor(ctx, in, info, handler) + return string(this.unknownFields) == string(that.unknownFields) } -func _StoreApi_DeleteAsyncSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAsyncSearchRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreApiServer).DeleteAsyncSearch(ctx, in) +func (this *Typing) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Typing) + if !ok { + return false } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.StoreApi/DeleteAsyncSearch", + return this.EqualVT(that) +} +func (this *ResponseData) EqualVT(that *ResponseData) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreApiServer).DeleteAsyncSearch(ctx, req.(*DeleteAsyncSearchRequest)) + if !this.Batch.EqualVT(that.Batch) { + return false } - return interceptor(ctx, in, info, handler) + return string(this.unknownFields) == string(that.unknownFields) } -func _StoreApi_GetAsyncSearchesList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAsyncSearchesListRequest) - if err := dec(in); err != nil { - return nil, err +func (this *ResponseData) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ResponseData) + if !ok { + return false } - if interceptor == nil { - return srv.(StoreApiServer).GetAsyncSearchesList(ctx, in) + return this.EqualVT(that) +} +func (this *RecordsBatch) EqualVT(that *RecordsBatch) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.StoreApi/GetAsyncSearchesList", + if len(this.Records) != len(that.Records) { + return false } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreApiServer).GetAsyncSearchesList(ctx, req.(*GetAsyncSearchesListRequest)) + 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 interceptor(ctx, in, info, handler) + return string(this.unknownFields) == string(that.unknownFields) } -func _StoreApi_Fetch_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(FetchRequest) - if err := stream.RecvMsg(m); err != nil { - return err +func (this *RecordsBatch) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RecordsBatch) + if !ok { + return false } - return srv.(StoreApiServer).Fetch(m, &storeApiFetchServer{stream}) + return this.EqualVT(that) } - -type StoreApi_FetchServer interface { - Send(*BinaryData) error - grpc.ServerStream +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) } -type storeApiFetchServer struct { - grpc.ServerStream +func (this *Record) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Record) + if !ok { + return false + } + return this.EqualVT(that) } - -func (x *storeApiFetchServer) Send(m *BinaryData) error { - return x.ServerStream.SendMsg(m) +func (this *ResponseSummary) EqualVT(that *ResponseSummary) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Total != that.Total { + return false + } + if !this.Error.EqualVT(that.Error) { + return false + } + if !this.Explain.EqualVT(that.Explain) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) } -func _StoreApi_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatusRequest) - if err := dec(in); err != nil { - return nil, err +func (this *ResponseSummary) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ResponseSummary) + if !ok { + return false } - if interceptor == nil { - return srv.(StoreApiServer).Status(ctx, in) + return this.EqualVT(that) +} +func (this *Error) EqualVT(that *Error) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.StoreApi/Status", + if this.Code != that.Code { + return false } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreApiServer).Status(ctx, req.(*StatusRequest)) + if this.Message != that.Message { + return false } - return interceptor(ctx, in, info, handler) + return string(this.unknownFields) == string(that.unknownFields) } -// 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) -var StoreApi_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "api.StoreApi", - HandlerType: (*StoreApiServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Bulk", - Handler: _StoreApi_Bulk_Handler, - }, - { - MethodName: "Search", - Handler: _StoreApi_Search_Handler, - }, - { - MethodName: "StartAsyncSearch", - Handler: _StoreApi_StartAsyncSearch_Handler, - }, - { - MethodName: "FetchAsyncSearchResult", - Handler: _StoreApi_FetchAsyncSearchResult_Handler, - }, - { - MethodName: "CancelAsyncSearch", - Handler: _StoreApi_CancelAsyncSearch_Handler, - }, - { - MethodName: "DeleteAsyncSearch", - Handler: _StoreApi_DeleteAsyncSearch_Handler, - }, - { - MethodName: "GetAsyncSearchesList", - Handler: _StoreApi_GetAsyncSearchesList_Handler, - }, - { - MethodName: "Status", - Handler: _StoreApi_Status_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Fetch", - Handler: _StoreApi_Fetch_Handler, - ServerStreams: true, - }, - }, - Metadata: "storeapi/store_api.proto", +func (this *Error) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Error) + if !ok { + return false + } + return this.EqualVT(that) } -func (m *BulkRequest) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// StoreApiClient is the client API for StoreApi service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StoreApiClient interface { + Bulk(ctx context.Context, in *BulkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) + StartAsyncSearch(ctx context.Context, in *StartAsyncSearchRequest, opts ...grpc.CallOption) (*StartAsyncSearchResponse, error) + FetchAsyncSearchResult(ctx context.Context, in *FetchAsyncSearchResultRequest, opts ...grpc.CallOption) (*FetchAsyncSearchResultResponse, error) + CancelAsyncSearch(ctx context.Context, in *CancelAsyncSearchRequest, opts ...grpc.CallOption) (*CancelAsyncSearchResponse, error) + DeleteAsyncSearch(ctx context.Context, in *DeleteAsyncSearchRequest, opts ...grpc.CallOption) (*DeleteAsyncSearchResponse, error) + 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) + StreamSearch(ctx context.Context, opts ...grpc.CallOption) (StoreApi_StreamSearchClient, error) +} + +type storeApiClient struct { + cc grpc.ClientConnInterface +} + +func NewStoreApiClient(cc grpc.ClientConnInterface) StoreApiClient { + return &storeApiClient{cc} +} + +func (c *storeApiClient) Bulk(ctx context.Context, in *BulkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.StoreApi/Bulk", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *BulkRequest) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *BulkRequest) 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 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 +func (c *storeApiClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { + out := new(SearchResponse) + err := c.cc.Invoke(ctx, "/api.StoreApi/Search", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *BinaryData) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) +func (c *storeApiClient) StartAsyncSearch(ctx context.Context, in *StartAsyncSearchRequest, opts ...grpc.CallOption) (*StartAsyncSearchResponse, error) { + out := new(StartAsyncSearchResponse) + err := c.cc.Invoke(ctx, "/api.StoreApi/StartAsyncSearch", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *BinaryData) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) +func (c *storeApiClient) FetchAsyncSearchResult(ctx context.Context, in *FetchAsyncSearchResultRequest, opts ...grpc.CallOption) (*FetchAsyncSearchResultResponse, error) { + out := new(FetchAsyncSearchResultResponse) + err := c.cc.Invoke(ctx, "/api.StoreApi/FetchAsyncSearchResult", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *BinaryData) 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 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 +func (c *storeApiClient) CancelAsyncSearch(ctx context.Context, in *CancelAsyncSearchRequest, opts ...grpc.CallOption) (*CancelAsyncSearchResponse, error) { + out := new(CancelAsyncSearchResponse) + err := c.cc.Invoke(ctx, "/api.StoreApi/CancelAsyncSearch", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *AggQuery) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) +func (c *storeApiClient) DeleteAsyncSearch(ctx context.Context, in *DeleteAsyncSearchRequest, opts ...grpc.CallOption) (*DeleteAsyncSearchResponse, error) { + out := new(DeleteAsyncSearchResponse) + err := c.cc.Invoke(ctx, "/api.StoreApi/DeleteAsyncSearch", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *AggQuery) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) +func (c *storeApiClient) GetAsyncSearchesList(ctx context.Context, in *GetAsyncSearchesListRequest, opts ...grpc.CallOption) (*GetAsyncSearchesListResponse, error) { + out := new(GetAsyncSearchesListResponse) + err := c.cc.Invoke(ctx, "/api.StoreApi/GetAsyncSearchesList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *AggQuery) 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.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 +func (c *storeApiClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (StoreApi_FetchClient, error) { + stream, err := c.cc.NewStream(ctx, &StoreApi_ServiceDesc.Streams[0], "/api.StoreApi/Fetch", opts...) + if err != nil { + return nil, err } - if m.Func != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Func)) - i-- - dAtA[i] = 0x20 + x := &storeApiFetchClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err } - 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 err := x.ClientStream.CloseSend(); err != nil { + return nil, err } - 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 x, nil +} + +type StoreApi_FetchClient interface { + Recv() (*BinaryData, error) + grpc.ClientStream +} + +type storeApiFetchClient struct { + grpc.ClientStream +} + +func (x *storeApiFetchClient) Recv() (*BinaryData, error) { + m := new(BinaryData) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err } - return len(dAtA) - i, nil + return m, nil } -func (m *SearchRequest) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil +func (c *storeApiClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + out := new(StatusResponse) + err := c.cc.Invoke(ctx, "/api.StoreApi/Status", in, out, opts...) + if err != nil { + return nil, err } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + return out, nil +} + +func (c *storeApiClient) StreamSearch(ctx context.Context, opts ...grpc.CallOption) (StoreApi_StreamSearchClient, error) { + stream, err := c.cc.NewStream(ctx, &StoreApi_ServiceDesc.Streams[1], "/api.StoreApi/StreamSearch", opts...) if err != nil { return nil, err } - return dAtA[:n], nil + x := &storeApiStreamSearchClient{stream} + return x, nil } -func (m *SearchRequest) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) +type StoreApi_StreamSearchClient interface { + Send(*StreamSearchRequest) error + Recv() (*StreamSearchResponse, error) + grpc.ClientStream } -func (m *SearchRequest) 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.Downsample != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Downsample)) - i-- - dAtA[i] = 0x78 - } - 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].MarshalToSizedBufferVT(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) - copy(dAtA[i:], m.AggregationFilter) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AggregationFilter))) - i-- - dAtA[i] = 0x5a +type storeApiStreamSearchClient struct { + grpc.ClientStream +} + +func (x *storeApiStreamSearchClient) Send(m *StreamSearchRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *storeApiStreamSearchClient) Recv() (*StreamSearchResponse, error) { + m := new(StreamSearchResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err } - if m.WithTotal { - i-- - if m.WithTotal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if m.Explain { - i-- - if m.Explain { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 + return m, nil +} + +// StoreApiServer is the server API for StoreApi service. +// All implementations must embed UnimplementedStoreApiServer +// for forward compatibility +type StoreApiServer interface { + Bulk(context.Context, *BulkRequest) (*emptypb.Empty, error) + Search(context.Context, *SearchRequest) (*SearchResponse, error) + StartAsyncSearch(context.Context, *StartAsyncSearchRequest) (*StartAsyncSearchResponse, error) + FetchAsyncSearchResult(context.Context, *FetchAsyncSearchResultRequest) (*FetchAsyncSearchResultResponse, error) + CancelAsyncSearch(context.Context, *CancelAsyncSearchRequest) (*CancelAsyncSearchResponse, error) + DeleteAsyncSearch(context.Context, *DeleteAsyncSearchRequest) (*DeleteAsyncSearchResponse, error) + GetAsyncSearchesList(context.Context, *GetAsyncSearchesListRequest) (*GetAsyncSearchesListResponse, error) + Fetch(*FetchRequest, StoreApi_FetchServer) error + Status(context.Context, *StatusRequest) (*StatusResponse, error) + StreamSearch(StoreApi_StreamSearchServer) error + mustEmbedUnimplementedStoreApiServer() +} + +// UnimplementedStoreApiServer must be embedded to have forward compatible implementations. +type UnimplementedStoreApiServer struct { +} + +func (UnimplementedStoreApiServer) Bulk(context.Context, *BulkRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Bulk not implemented") +} +func (UnimplementedStoreApiServer) Search(context.Context, *SearchRequest) (*SearchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Search not implemented") +} +func (UnimplementedStoreApiServer) StartAsyncSearch(context.Context, *StartAsyncSearchRequest) (*StartAsyncSearchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartAsyncSearch not implemented") +} +func (UnimplementedStoreApiServer) FetchAsyncSearchResult(context.Context, *FetchAsyncSearchResultRequest) (*FetchAsyncSearchResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchAsyncSearchResult not implemented") +} +func (UnimplementedStoreApiServer) CancelAsyncSearch(context.Context, *CancelAsyncSearchRequest) (*CancelAsyncSearchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelAsyncSearch not implemented") +} +func (UnimplementedStoreApiServer) DeleteAsyncSearch(context.Context, *DeleteAsyncSearchRequest) (*DeleteAsyncSearchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAsyncSearch not implemented") +} +func (UnimplementedStoreApiServer) GetAsyncSearchesList(context.Context, *GetAsyncSearchesListRequest) (*GetAsyncSearchesListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAsyncSearchesList not implemented") +} +func (UnimplementedStoreApiServer) Fetch(*FetchRequest, StoreApi_FetchServer) error { + return status.Errorf(codes.Unimplemented, "method Fetch not implemented") +} +func (UnimplementedStoreApiServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} +func (UnimplementedStoreApiServer) StreamSearch(StoreApi_StreamSearchServer) error { + return status.Errorf(codes.Unimplemented, "method StreamSearch not implemented") +} +func (UnimplementedStoreApiServer) mustEmbedUnimplementedStoreApiServer() {} + +// UnsafeStoreApiServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StoreApiServer will +// result in compilation errors. +type UnsafeStoreApiServer interface { + mustEmbedUnimplementedStoreApiServer() +} + +func RegisterStoreApiServer(s grpc.ServiceRegistrar, srv StoreApiServer) { + s.RegisterService(&StoreApi_ServiceDesc, srv) +} + +func _StoreApi_Bulk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BulkRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.Aggregation) > 0 { - i -= len(m.Aggregation) - copy(dAtA[i:], m.Aggregation) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Aggregation))) - i-- - dAtA[i] = 0x3a + if interceptor == nil { + return srv.(StoreApiServer).Bulk(ctx, in) } - if m.Interval != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) - i-- - dAtA[i] = 0x30 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.StoreApi/Bulk", } - if m.Offset != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Offset)) - i-- - dAtA[i] = 0x28 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreApiServer).Bulk(ctx, req.(*BulkRequest)) } - if m.Size != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) - i-- - dAtA[i] = 0x20 + return interceptor(ctx, in, info, handler) +} + +func _StoreApi_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchRequest) + if err := dec(in); err != nil { + return nil, err } - if m.To != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) - i-- - dAtA[i] = 0x18 + if interceptor == nil { + return srv.(StoreApiServer).Search(ctx, in) } - if m.From != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) - i-- - dAtA[i] = 0x10 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.StoreApi/Search", } - 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 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreApiServer).Search(ctx, req.(*SearchRequest)) } - return len(dAtA) - i, nil + return interceptor(ctx, in, info, handler) } -func (m *SearchResponse_Id) 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 { +func _StoreApi_StartAsyncSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartAsyncSearchRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *SearchResponse_Id) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *SearchResponse_Id) 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 interceptor == nil { + return srv.(StoreApiServer).StartAsyncSearch(ctx, in) } - if m.Rid != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Rid)) - i-- - dAtA[i] = 0x10 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.StoreApi/StartAsyncSearch", } - if m.Mid != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Mid)) - i-- - dAtA[i] = 0x8 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreApiServer).StartAsyncSearch(ctx, req.(*StartAsyncSearchRequest)) } - return len(dAtA) - i, nil + return interceptor(ctx, in, info, handler) } -func (m *SearchResponse_IdWithHint) 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 { +func _StoreApi_FetchAsyncSearchResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchAsyncSearchResultRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *SearchResponse_IdWithHint) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) + if interceptor == nil { + return srv.(StoreApiServer).FetchAsyncSearchResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.StoreApi/FetchAsyncSearchResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreApiServer).FetchAsyncSearchResult(ctx, req.(*FetchAsyncSearchResultRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *SearchResponse_IdWithHint) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil +func _StoreApi_CancelAsyncSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelAsyncSearchRequest) + if err := dec(in); err != nil { + return nil, err } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) + if interceptor == nil { + return srv.(StoreApiServer).CancelAsyncSearch(ctx, in) } - if len(m.Hint) > 0 { - i -= len(m.Hint) - copy(dAtA[i:], m.Hint) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hint))) - i-- - dAtA[i] = 0x1a + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.StoreApi/CancelAsyncSearch", } - if m.Id != nil { - size, err := m.Id.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreApiServer).CancelAsyncSearch(ctx, req.(*CancelAsyncSearchRequest)) } - return len(dAtA) - i, nil + return interceptor(ctx, in, info, handler) } -func (m *SearchResponse_Histogram) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil +func _StoreApi_DeleteAsyncSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAsyncSearchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreApiServer).DeleteAsyncSearch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.StoreApi/DeleteAsyncSearch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreApiServer).DeleteAsyncSearch(ctx, req.(*DeleteAsyncSearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StoreApi_GetAsyncSearchesList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAsyncSearchesListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreApiServer).GetAsyncSearchesList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.StoreApi/GetAsyncSearchesList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreApiServer).GetAsyncSearchesList(ctx, req.(*GetAsyncSearchesListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StoreApi_Fetch_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(FetchRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(StoreApiServer).Fetch(m, &storeApiFetchServer{stream}) +} + +type StoreApi_FetchServer interface { + Send(*BinaryData) error + grpc.ServerStream +} + +type storeApiFetchServer struct { + grpc.ServerStream +} + +func (x *storeApiFetchServer) Send(m *BinaryData) error { + return x.ServerStream.SendMsg(m) +} + +func _StoreApi_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreApiServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.StoreApi/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreApiServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StoreApi_StreamSearch_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(StoreApiServer).StreamSearch(&storeApiStreamSearchServer{stream}) +} + +type StoreApi_StreamSearchServer interface { + Send(*StreamSearchResponse) error + Recv() (*StreamSearchRequest, error) + grpc.ServerStream +} + +type storeApiStreamSearchServer struct { + grpc.ServerStream +} + +func (x *storeApiStreamSearchServer) Send(m *StreamSearchResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *storeApiStreamSearchServer) Recv() (*StreamSearchRequest, error) { + m := new(StreamSearchRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// 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) +var StoreApi_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.StoreApi", + HandlerType: (*StoreApiServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Bulk", + Handler: _StoreApi_Bulk_Handler, + }, + { + MethodName: "Search", + Handler: _StoreApi_Search_Handler, + }, + { + MethodName: "StartAsyncSearch", + Handler: _StoreApi_StartAsyncSearch_Handler, + }, + { + MethodName: "FetchAsyncSearchResult", + Handler: _StoreApi_FetchAsyncSearchResult_Handler, + }, + { + MethodName: "CancelAsyncSearch", + Handler: _StoreApi_CancelAsyncSearch_Handler, + }, + { + MethodName: "DeleteAsyncSearch", + Handler: _StoreApi_DeleteAsyncSearch_Handler, + }, + { + MethodName: "GetAsyncSearchesList", + Handler: _StoreApi_GetAsyncSearchesList_Handler, + }, + { + MethodName: "Status", + Handler: _StoreApi_Status_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Fetch", + Handler: _StoreApi_Fetch_Handler, + ServerStreams: true, + }, + { + StreamName: "StreamSearch", + Handler: _StoreApi_StreamSearch_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "storeapi/store_api.proto", +} + +func (m *BulkRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil } size := m.SizeVT() dAtA = make([]byte, size) @@ -2504,12 +2874,12 @@ func (m *SearchResponse_Histogram) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SearchResponse_Histogram) MarshalToVT(dAtA []byte) (int, error) { +func (m *BulkRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse_Histogram) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *BulkRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -2521,68 +2891,29 @@ func (m *SearchResponse_Histogram) MarshalToSizedBufferVT(dAtA []byte) (int, err i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Values) > 0 { - var pksize2 int - for _, num := range m.Values { - pksize2 += protohelpers.SizeOfVarint(uint64(num)) - } - i -= pksize2 - j1 := i - for _, num := range m.Values { - for num >= 1<<7 { - dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA[j1] = uint8(num) - j1++ - } - i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) - i-- - dAtA[i] = 0x3a - } - if len(m.Samples) > 0 { - for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { - f3 := math.Float64bits(float64(m.Samples[iNdEx])) - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(f3)) - } - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Samples)*8)) - i-- - dAtA[i] = 0x32 - } - if m.NotExists != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NotExists)) - i-- - dAtA[i] = 0x28 - } - if m.Total != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x20 - } - if m.Sum != 0 { - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Sum)))) + 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] = 0x19 + dAtA[i] = 0x1a } - if m.Max != 0 { - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Max)))) + 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] = 0x11 + dAtA[i] = 0x12 } - if m.Min != 0 { - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Min)))) + if m.Count != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Count)) i-- - dAtA[i] = 0x9 + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *SearchResponse_Bin) MarshalVT() (dAtA []byte, err error) { +func (m *BinaryData) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -2595,12 +2926,12 @@ func (m *SearchResponse_Bin) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SearchResponse_Bin) MarshalToVT(dAtA []byte) (int, error) { +func (m *BinaryData) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse_Bin) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *BinaryData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -2612,37 +2943,17 @@ func (m *SearchResponse_Bin) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Hist != nil { - size, err := m.Hist.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } - if m.Ts != nil { - size, err := (*timestamppb1.Timestamp)(m.Ts).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - if len(m.Label) > 0 { - i -= len(m.Label) - copy(dAtA[i:], m.Label) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Label))) + 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 *SearchResponse_Agg) MarshalVT() (dAtA []byte, err error) { +func (m *AggQuery) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -2655,12 +2966,12 @@ func (m *SearchResponse_Agg) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SearchResponse_Agg) MarshalToVT(dAtA []byte) (int, error) { +func (m *AggQuery) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse_Agg) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *AggQuery) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -2672,75 +2983,44 @@ func (m *SearchResponse_Agg) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.ValuesPool) > 0 { - for iNdEx := len(m.ValuesPool) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ValuesPool[iNdEx]) - copy(dAtA[i:], m.ValuesPool[iNdEx]) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ValuesPool[iNdEx]))) - i-- - dAtA[i] = 0x2a - } + if m.Interval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) + i-- + dAtA[i] = 0x30 } - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Timeseries[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 + 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.NotExists != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NotExists)) + if m.Func != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Func)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x20 } - if len(m.AggHistogram) > 0 { - for k := range m.AggHistogram { - v := m.AggHistogram[k] - baseI := i - size, err := v.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } + 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.Agg) > 0 { - for k := range m.Agg { - v := m.Agg[k] - baseI := i - i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) - i-- - dAtA[i] = 0x10 - i -= len(k) - copy(dAtA[i:], k) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } + 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 *SearchResponse) MarshalVT() (dAtA []byte, err error) { +func (m *SearchRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -2753,12 +3033,12 @@ func (m *SearchResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SearchResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *SearchRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *SearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -2770,34 +3050,22 @@ func (m *SearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 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 -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + if m.Downsample != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Downsample)) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x78 } - if m.Code != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) + 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] = 0x38 - } - 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] = 0x32 - } + dAtA[i] = 0x72 } - if m.Total != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) + if m.Order != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x68 } if len(m.Aggs) > 0 { for iNdEx := len(m.Aggs) - 1; iNdEx >= 0; iNdEx-- { @@ -2808,47 +3076,79 @@ func (m *SearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x62 } } - if len(m.Histogram) > 0 { - for k := range m.Histogram { - v := m.Histogram[k] - baseI := i - i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) - i-- - dAtA[i] = 0x10 - i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) - i-- - dAtA[i] = 0x8 - i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a + if len(m.AggregationFilter) > 0 { + i -= len(m.AggregationFilter) + copy(dAtA[i:], m.AggregationFilter) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AggregationFilter))) + i-- + dAtA[i] = 0x5a + } + if m.WithTotal { + i-- + if m.WithTotal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x50 } - if len(m.IdSources) > 0 { - for iNdEx := len(m.IdSources) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.IdSources[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.Explain { + i-- + if m.Explain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x40 } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) + if len(m.Aggregation) > 0 { + i -= len(m.Aggregation) + copy(dAtA[i:], m.Aggregation) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Aggregation))) + i-- + dAtA[i] = 0x3a + } + if m.Interval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) + 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 *ExplainEntry) MarshalVT() (dAtA []byte, err error) { +func (m *SearchResponse_Id) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -2861,12 +3161,12 @@ func (m *ExplainEntry) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExplainEntry) MarshalToVT(dAtA []byte) (int, error) { +func (m *SearchResponse_Id) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ExplainEntry) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *SearchResponse_Id) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -2878,39 +3178,20 @@ func (m *ExplainEntry) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Children) > 0 { - for iNdEx := len(m.Children) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Children[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } - } - if m.Duration != nil { - size, err := (*durationpb1.Duration)(m.Duration).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + if m.Rid != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Rid)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Message))) + if m.Mid != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Mid)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *StartAsyncSearchRequest) MarshalVT() (dAtA []byte, err error) { +func (m *SearchResponse_IdWithHint) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -2923,12 +3204,12 @@ func (m *StartAsyncSearchRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StartAsyncSearchRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *SearchResponse_IdWithHint) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *StartAsyncSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *SearchResponse_IdWithHint) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -2940,76 +3221,27 @@ func (m *StartAsyncSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, erro i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Size != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) - i-- - dAtA[i] = 0x48 - } - if m.WithDocs { - i-- - if m.WithDocs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.HistogramInterval != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) - i-- - dAtA[i] = 0x38 - } - if len(m.Aggs) > 0 { - for iNdEx := len(m.Aggs) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Aggs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x32 - } - } - if m.To != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) - i-- - dAtA[i] = 0x28 - } - if m.From != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) - i-- - dAtA[i] = 0x20 - } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Query))) + if len(m.Hint) > 0 { + i -= len(m.Hint) + copy(dAtA[i:], m.Hint) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hint))) i-- dAtA[i] = 0x1a } - if m.Retention != nil { - size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVT(dAtA[:i]) + if m.Id != nil { + size, err := m.Id.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x12 - } - if len(m.SearchId) > 0 { - i -= len(m.SearchId) - copy(dAtA[i:], m.SearchId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *StartAsyncSearchResponse) MarshalVT() (dAtA []byte, err error) { +func (m *SearchResponse_Histogram) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3022,12 +3254,12 @@ func (m *StartAsyncSearchResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StartAsyncSearchResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *SearchResponse_Histogram) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *StartAsyncSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *SearchResponse_Histogram) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3039,10 +3271,68 @@ func (m *StartAsyncSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, err i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Values) > 0 { + var pksize2 int + for _, num := range m.Values { + pksize2 += protohelpers.SizeOfVarint(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num := range m.Values { + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0x3a + } + if len(m.Samples) > 0 { + for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { + f3 := math.Float64bits(float64(m.Samples[iNdEx])) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(f3)) + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Samples)*8)) + i-- + dAtA[i] = 0x32 + } + if m.NotExists != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NotExists)) + i-- + dAtA[i] = 0x28 + } + if m.Total != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x20 + } + if m.Sum != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Sum)))) + i-- + dAtA[i] = 0x19 + } + if m.Max != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Max)))) + i-- + dAtA[i] = 0x11 + } + if m.Min != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Min)))) + i-- + dAtA[i] = 0x9 + } return len(dAtA) - i, nil } -func (m *FetchAsyncSearchResultRequest) MarshalVT() (dAtA []byte, err error) { +func (m *SearchResponse_Bin) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3055,12 +3345,12 @@ func (m *FetchAsyncSearchResultRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FetchAsyncSearchResultRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *SearchResponse_Bin) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *FetchAsyncSearchResultRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *SearchResponse_Bin) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3072,32 +3362,37 @@ func (m *FetchAsyncSearchResultRequest) MarshalToSizedBufferVT(dAtA []byte) (int i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Order != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) - i-- - dAtA[i] = 0x20 - } - if m.Offset != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Offset)) + if m.Hist != nil { + size, err := m.Hist.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.Size != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + if m.Ts != nil { + size, err := (*timestamppb1.Timestamp)(m.Ts).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.SearchId) > 0 { - i -= len(m.SearchId) - copy(dAtA[i:], m.SearchId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Label))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *FetchAsyncSearchResultResponse) MarshalVT() (dAtA []byte, err error) { +func (m *SearchResponse_Agg) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3110,12 +3405,12 @@ func (m *FetchAsyncSearchResultResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FetchAsyncSearchResultResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *SearchResponse_Agg) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *FetchAsyncSearchResultResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *SearchResponse_Agg) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3127,141 +3422,75 @@ func (m *FetchAsyncSearchResultResponse) MarshalToSizedBufferVT(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Size != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - } - if m.WithDocs { - i-- - if m.WithDocs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x78 - } - if m.Retention != nil { - size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x72 - } - 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] = 0x6a - } - if m.From != nil { - size, err := (*timestamppb1.Timestamp)(m.From).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err + if len(m.ValuesPool) > 0 { + for iNdEx := len(m.ValuesPool) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ValuesPool[iNdEx]) + copy(dAtA[i:], m.ValuesPool[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ValuesPool[iNdEx]))) + i-- + dAtA[i] = 0x2a } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x62 - } - 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] = 0x5a - } - if m.HistogramInterval != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) - i-- - dAtA[i] = 0x50 } - if len(m.Aggs) > 0 { - for iNdEx := len(m.Aggs) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Aggs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if len(m.Timeseries) > 0 { + for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Timeseries[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x22 } } - if m.DiskUsage != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DiskUsage)) - i-- - dAtA[i] = 0x40 - } - if m.FracsQueue != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsQueue)) - i-- - dAtA[i] = 0x38 - } - if m.FracsDone != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsDone)) + if m.NotExists != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NotExists)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x18 } - if m.CanceledAt != nil { - size, err := (*timestamppb1.Timestamp)(m.CanceledAt).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x2a - } - if m.ExpiresAt != nil { - size, err := (*timestamppb1.Timestamp)(m.ExpiresAt).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } - if m.StartedAt != nil { - size, err := (*timestamppb1.Timestamp)(m.StartedAt).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err + if len(m.AggHistogram) > 0 { + for k := range m.AggHistogram { + v := m.AggHistogram[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a } - if m.Response != nil { - size, err := m.Response.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Agg) > 0 { + for k := range m.Agg { + v := m.Agg[k] + baseI := i + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - if m.Status != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *CancelAsyncSearchRequest) MarshalVT() (dAtA []byte, err error) { +func (m *SearchResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3274,12 +3503,12 @@ func (m *CancelAsyncSearchRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CancelAsyncSearchRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *SearchResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *CancelAsyncSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *SearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3291,90 +3520,85 @@ func (m *CancelAsyncSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, err i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.SearchId) > 0 { - i -= len(m.SearchId) - copy(dAtA[i:], m.SearchId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + if m.Explain != nil { + size, err := m.Explain.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 *CancelAsyncSearchResponse) 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 + dAtA[i] = 0x42 } - return dAtA[:n], nil -} - -func (m *CancelAsyncSearchResponse) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *CancelAsyncSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil + if m.Code != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x38 } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) + 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] = 0x32 + } } - return len(dAtA) - i, nil -} - -func (m *DeleteAsyncSearchRequest) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil + if m.Total != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x28 } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err + if len(m.Aggs) > 0 { + for iNdEx := len(m.Aggs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Aggs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } } - return dAtA[:n], nil -} - -func (m *DeleteAsyncSearchRequest) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *DeleteAsyncSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil + if len(m.Histogram) > 0 { + for k := range m.Histogram { + v := m.Histogram[k] + baseI := i + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) + if len(m.IdSources) > 0 { + for iNdEx := len(m.IdSources) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.IdSources[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } } - if len(m.SearchId) > 0 { - i -= len(m.SearchId) - copy(dAtA[i:], m.SearchId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + 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 *DeleteAsyncSearchResponse) MarshalVT() (dAtA []byte, err error) { +func (m *ExplainEntry) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3387,12 +3611,12 @@ func (m *DeleteAsyncSearchResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DeleteAsyncSearchResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *ExplainEntry) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *DeleteAsyncSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ExplainEntry) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3404,10 +3628,39 @@ func (m *DeleteAsyncSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, er i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Children) > 0 { + for iNdEx := len(m.Children) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Children[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if m.Duration != nil { + size, err := (*durationpb1.Duration)(m.Duration).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *GetAsyncSearchesListRequest) MarshalVT() (dAtA []byte, err error) { +func (m *StartAsyncSearchRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3420,12 +3673,12 @@ func (m *GetAsyncSearchesListRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetAsyncSearchesListRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *StartAsyncSearchRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *GetAsyncSearchesListRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *StartAsyncSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3437,24 +3690,76 @@ func (m *GetAsyncSearchesListRequest) MarshalToSizedBufferVT(dAtA []byte) (int, i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Ids) > 0 { - for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Ids[iNdEx]) - copy(dAtA[i:], m.Ids[iNdEx]) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ids[iNdEx]))) + if m.Size != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x48 + } + if m.WithDocs { + i-- + if m.WithDocs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.HistogramInterval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) + i-- + dAtA[i] = 0x38 + } + if len(m.Aggs) > 0 { + for iNdEx := len(m.Aggs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Aggs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x32 } } - if m.Status != nil { - i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Status)) + if m.To != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) i-- - dAtA[i] = 0x8 + dAtA[i] = 0x28 + } + if m.From != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) + i-- + dAtA[i] = 0x20 + } + 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] = 0x1a + } + if m.Retention != nil { + size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.SearchId) > 0 { + i -= len(m.SearchId) + copy(dAtA[i:], m.SearchId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *GetAsyncSearchesListResponse) MarshalVT() (dAtA []byte, err error) { +func (m *StartAsyncSearchResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3467,12 +3772,12 @@ func (m *GetAsyncSearchesListResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetAsyncSearchesListResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *StartAsyncSearchResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *GetAsyncSearchesListResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *StartAsyncSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3484,22 +3789,10 @@ func (m *GetAsyncSearchesListResponse) MarshalToSizedBufferVT(dAtA []byte) (int, i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Searches) > 0 { - for iNdEx := len(m.Searches) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Searches[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 *AsyncSearchesListItem) MarshalVT() (dAtA []byte, err error) { +func (m *FetchAsyncSearchResultRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3512,12 +3805,12 @@ func (m *AsyncSearchesListItem) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AsyncSearchesListItem) MarshalToVT(dAtA []byte) (int, error) { +func (m *FetchAsyncSearchResultRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *AsyncSearchesListItem) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *FetchAsyncSearchResultRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3529,14 +3822,60 @@ func (m *AsyncSearchesListItem) MarshalToSizedBufferVT(dAtA []byte) (int, error) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Error))) + if m.Order != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) i-- - dAtA[i] = 0x1 + dAtA[i] = 0x20 + } + if m.Offset != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Offset)) i-- - dAtA[i] = 0x8a + dAtA[i] = 0x18 + } + if m.Size != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x10 + } + if len(m.SearchId) > 0 { + i -= len(m.SearchId) + copy(dAtA[i:], m.SearchId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FetchAsyncSearchResultResponse) 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 *FetchAsyncSearchResultResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *FetchAsyncSearchResultResponse) 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.Size != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) @@ -3654,10 +3993,53 @@ func (m *AsyncSearchesListItem) MarshalToSizedBufferVT(dAtA []byte) (int, error) i-- dAtA[i] = 0x1a } + if m.Response != nil { + size, err := m.Response.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } if m.Status != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CancelAsyncSearchRequest) 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 *CancelAsyncSearchRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CancelAsyncSearchRequest) 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 len(m.SearchId) > 0 { i -= len(m.SearchId) @@ -3669,7 +4051,7 @@ func (m *AsyncSearchesListItem) MarshalToSizedBufferVT(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *IdWithHint) MarshalVT() (dAtA []byte, err error) { +func (m *CancelAsyncSearchResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3682,12 +4064,12 @@ func (m *IdWithHint) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IdWithHint) MarshalToVT(dAtA []byte) (int, error) { +func (m *CancelAsyncSearchResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *IdWithHint) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *CancelAsyncSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3699,24 +4081,10 @@ func (m *IdWithHint) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Hint) > 0 { - i -= len(m.Hint) - copy(dAtA[i:], m.Hint) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hint))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *FetchRequest_FieldsFilter) MarshalVT() (dAtA []byte, err error) { +func (m *DeleteAsyncSearchRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3729,12 +4097,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 *DeleteAsyncSearchRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *FetchRequest_FieldsFilter) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *DeleteAsyncSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3746,29 +4114,17 @@ func (m *FetchRequest_FieldsFilter) MarshalToSizedBufferVT(dAtA []byte) (int, er i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.AllowList { - i-- - if m.AllowList { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + if len(m.SearchId) > 0 { + i -= len(m.SearchId) + copy(dAtA[i:], m.SearchId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) i-- - dAtA[i] = 0x10 - } - if len(m.Fields) > 0 { - for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Fields[iNdEx]) - copy(dAtA[i:], m.Fields[iNdEx]) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Fields[iNdEx]))) - i-- - dAtA[i] = 0xa - } + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *FetchRequest) MarshalVT() (dAtA []byte, err error) { +func (m *DeleteAsyncSearchResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3781,12 +4137,12 @@ func (m *FetchRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FetchRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *DeleteAsyncSearchResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *FetchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *DeleteAsyncSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3798,61 +4154,10 @@ func (m *FetchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.NoSkipMasks { - i-- - if m.NoSkipMasks { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - 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] = 0x2a - } - if len(m.IdsWithHints) > 0 { - for iNdEx := len(m.IdsWithHints) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.IdsWithHints[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } - } - if m.Explain { - i-- - if m.Explain { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Ids) > 0 { - for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Ids[iNdEx]) - copy(dAtA[i:], m.Ids[iNdEx]) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ids[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } -func (m *StatusRequest) MarshalVT() (dAtA []byte, err error) { +func (m *GetAsyncSearchesListRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3865,12 +4170,12 @@ func (m *StatusRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StatusRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *GetAsyncSearchesListRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *StatusRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *GetAsyncSearchesListRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3882,10 +4187,24 @@ func (m *StatusRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Ids) > 0 { + for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ids[iNdEx]) + copy(dAtA[i:], m.Ids[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ids[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Status != nil { + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Status)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } -func (m *StatusResponse) MarshalVT() (dAtA []byte, err error) { +func (m *GetAsyncSearchesListResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3898,12 +4217,12 @@ func (m *StatusResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StatusResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *GetAsyncSearchesListResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *StatusResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *GetAsyncSearchesListResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3915,38 +4234,40 @@ func (m *StatusResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.OldestTime != nil { - size, err := (*timestamppb1.Timestamp)(m.OldestTime).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Searches) > 0 { + for iNdEx := len(m.Searches) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Searches[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *BulkRequest) MarshalVTStrict() (dAtA []byte, err error) { +func (m *AsyncSearchesListItem) 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 *AsyncSearchesListItem) 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 *AsyncSearchesListItem) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3958,47 +4279,165 @@ 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 len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.Size != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.WithDocs { + i-- + if m.WithDocs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if m.Retention != nil { + size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x72 + } + 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] = 0x6a + } + 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] = 0x62 + } + 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] = 0x5a + } + if m.HistogramInterval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) + i-- + dAtA[i] = 0x50 + } + if len(m.Aggs) > 0 { + for iNdEx := len(m.Aggs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Aggs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + } + } + if m.DiskUsage != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DiskUsage)) + i-- + dAtA[i] = 0x40 + } + if m.FracsQueue != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsQueue)) + i-- + dAtA[i] = 0x38 + } + if m.FracsDone != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsDone)) + i-- + dAtA[i] = 0x30 + } + if m.CanceledAt != nil { + size, err := (*timestamppb1.Timestamp)(m.CanceledAt).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.ExpiresAt != nil { + size, err := (*timestamppb1.Timestamp)(m.ExpiresAt).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.StartedAt != nil { + size, err := (*timestamppb1.Timestamp)(m.StartedAt).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) 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.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if m.Count != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Count)) + if len(m.SearchId) > 0 { + i -= len(m.SearchId) + copy(dAtA[i:], m.SearchId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *BinaryData) MarshalVTStrict() (dAtA []byte, err error) { +func (m *IdWithHint) 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 *IdWithHint) 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 *IdWithHint) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4010,35 +4449,42 @@ 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 len(m.Hint) > 0 { + i -= len(m.Hint) + copy(dAtA[i:], m.Hint) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hint))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *AggQuery) MarshalVTStrict() (dAtA []byte, err error) { +func (m *FetchRequest_FieldsFilter) 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 *FetchRequest_FieldsFilter) 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 *FetchRequest_FieldsFilter) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4050,62 +4496,47 @@ 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.AllowList { 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)) + if m.AllowList { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - 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 + dAtA[i] = 0x10 } - 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 + if len(m.Fields) > 0 { + for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Fields[iNdEx]) + copy(dAtA[i:], m.Fields[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Fields[iNdEx]))) + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } -func (m *SearchRequest) MarshalVTStrict() (dAtA []byte, err error) { +func (m *FetchRequest) 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 *SearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *FetchRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *FetchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4117,51 +4548,37 @@ func (m *SearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Downsample != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Downsample)) + if m.NoSkipMasks { i-- - dAtA[i] = 0x78 - } - if len(m.OffsetId) > 0 { - i -= len(m.OffsetId) - copy(dAtA[i:], m.OffsetId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OffsetId))) + if m.NoSkipMasks { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } i-- - dAtA[i] = 0x72 + dAtA[i] = 0x30 } - if m.Order != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) + 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] = 0x68 + dAtA[i] = 0x2a } - if len(m.Aggs) > 0 { - for iNdEx := len(m.Aggs) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Aggs[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if len(m.IdsWithHints) > 0 { + for iNdEx := len(m.IdsWithHints) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.IdsWithHints[iNdEx].MarshalToSizedBufferVT(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) - copy(dAtA[i:], m.AggregationFilter) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AggregationFilter))) - i-- - dAtA[i] = 0x5a - } - if m.WithTotal { - i-- - if m.WithTotal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x50 } if m.Explain { i-- @@ -4171,69 +4588,39 @@ func (m *SearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x40 - } - if len(m.Aggregation) > 0 { - i -= len(m.Aggregation) - copy(dAtA[i:], m.Aggregation) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Aggregation))) - i-- - dAtA[i] = 0x3a - } - if m.Interval != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) - 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 + if len(m.Ids) > 0 { + for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ids[iNdEx]) + copy(dAtA[i:], m.Ids[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ids[iNdEx]))) + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } -func (m *SearchResponse_Id) MarshalVTStrict() (dAtA []byte, err error) { +func (m *StatusRequest) 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 *SearchResponse_Id) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *StatusRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse_Id) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *StatusRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4245,38 +4632,28 @@ func (m *SearchResponse_Id) MarshalToSizedBufferVTStrict(dAtA []byte) (int, erro i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Rid != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Rid)) - i-- - dAtA[i] = 0x10 - } - if m.Mid != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Mid)) - i-- - dAtA[i] = 0x8 - } return len(dAtA) - i, nil } -func (m *SearchResponse_IdWithHint) MarshalVTStrict() (dAtA []byte, err error) { +func (m *StatusResponse) 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 *SearchResponse_IdWithHint) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *StatusResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse_IdWithHint) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *StatusResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4288,15 +4665,8 @@ func (m *SearchResponse_IdWithHint) MarshalToSizedBufferVTStrict(dAtA []byte) (i i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Hint) > 0 { - i -= len(m.Hint) - copy(dAtA[i:], m.Hint) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hint))) - i-- - dAtA[i] = 0x1a - } - if m.Id != nil { - size, err := m.Id.MarshalToSizedBufferVTStrict(dAtA[:i]) + if m.OldestTime != nil { + size, err := (*timestamppb1.Timestamp)(m.OldestTime).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -4308,25 +4678,25 @@ func (m *SearchResponse_IdWithHint) MarshalToSizedBufferVTStrict(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *SearchResponse_Histogram) MarshalVTStrict() (dAtA []byte, err error) { +func (m *StreamSearchRequest) 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 *SearchResponse_Histogram) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *StreamSearchRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse_Histogram) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *StreamSearchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4338,86 +4708,83 @@ func (m *SearchResponse_Histogram) MarshalToSizedBufferVTStrict(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Values) > 0 { - var pksize2 int - for _, num := range m.Values { - pksize2 += protohelpers.SizeOfVarint(uint64(num)) + if vtmsg, ok := m.RequestType.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } - i -= pksize2 - j1 := i - for _, num := range m.Values { - for num >= 1<<7 { - dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA[j1] = uint8(num) - j1++ + i -= size + } + return len(dAtA) - i, nil +} + +func (m *StreamSearchRequest_Query) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StreamSearchRequest_Query) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Query != nil { + size, err := m.Query.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } - i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x3a + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa } - if len(m.Samples) > 0 { - for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { - f3 := math.Float64bits(float64(m.Samples[iNdEx])) - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(f3)) + return len(dAtA) - i, nil +} +func (m *StreamSearchRequest_Control) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StreamSearchRequest_Control) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Control != nil { + size, err := m.Control.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Samples)*8)) - i-- - dAtA[i] = 0x32 - } - if m.NotExists != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NotExists)) - i-- - dAtA[i] = 0x28 - } - if m.Total != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x20 - } - if m.Sum != 0 { - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Sum)))) - i-- - dAtA[i] = 0x19 - } - if m.Max != 0 { - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Max)))) + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x11 - } - if m.Min != 0 { - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Min)))) + dAtA[i] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) i-- - dAtA[i] = 0x9 + dAtA[i] = 0x12 } return len(dAtA) - i, nil } - -func (m *SearchResponse_Bin) MarshalVTStrict() (dAtA []byte, err error) { +func (m *StreamSearchQuery) 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 *SearchResponse_Bin) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *StreamSearchQuery) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse_Bin) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *StreamSearchQuery) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4429,8 +4796,35 @@ func (m *SearchResponse_Bin) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Hist != nil { - size, err := m.Hist.MarshalToSizedBufferVTStrict(dAtA[:i]) + if m.WithTotal { + i-- + if m.WithTotal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + 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] = 0x2a + } + if m.Explain { + i-- + if m.Explain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.To != nil { + size, err := (*timestamppb1.Timestamp)(m.To).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -4439,8 +4833,8 @@ func (m *SearchResponse_Bin) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i-- dAtA[i] = 0x1a } - if m.Ts != nil { - size, err := (*timestamppb1.Timestamp)(m.Ts).MarshalToSizedBufferVTStrict(dAtA[:i]) + if m.From != nil { + size, err := (*timestamppb1.Timestamp)(m.From).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -4449,35 +4843,35 @@ func (m *SearchResponse_Bin) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i-- dAtA[i] = 0x12 } - if len(m.Label) > 0 { - i -= len(m.Label) - copy(dAtA[i:], m.Label) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Label))) + 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 *SearchResponse_Agg) MarshalVTStrict() (dAtA []byte, err error) { +func (m *StreamControl) 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 *SearchResponse_Agg) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *StreamControl) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse_Agg) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *StreamControl) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4489,93 +4883,33 @@ func (m *SearchResponse_Agg) MarshalToSizedBufferVTStrict(dAtA []byte) (int, err i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.ValuesPool) > 0 { - for iNdEx := len(m.ValuesPool) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ValuesPool[iNdEx]) - copy(dAtA[i:], m.ValuesPool[iNdEx]) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ValuesPool[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Timeseries[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } - } - if m.NotExists != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NotExists)) + if m.Action != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Action)) i-- - dAtA[i] = 0x18 - } - if len(m.AggHistogram) > 0 { - for k := range m.AggHistogram { - v := m.AggHistogram[k] - baseI := i - size, err := v.MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Agg) > 0 { - for k := range m.Agg { - v := m.Agg[k] - baseI := i - i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) - i-- - dAtA[i] = 0x10 - i -= len(k) - copy(dAtA[i:], k) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *SearchResponse) MarshalVTStrict() (dAtA []byte, err error) { +func (m *StreamSearchResponse) 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 *SearchResponse) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *StreamSearchResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *SearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *StreamSearchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4587,103 +4921,106 @@ func (m *SearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Explain != nil { - size, err := m.Explain.MarshalToSizedBufferVTStrict(dAtA[:i]) + 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 - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x42 - } - if m.Code != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x38 } - 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] = 0x32 + return len(dAtA) - i, nil +} + +func (m *StreamSearchResponse_Header) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StreamSearchResponse_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 } - } - if m.Total != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x28 - } - 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] = 0x22 - } - } - if len(m.Histogram) > 0 { - for k := range m.Histogram { - v := m.Histogram[k] - baseI := i - i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) - i-- - dAtA[i] = 0x10 - i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) - i-- - dAtA[i] = 0x8 - i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.IdSources) > 0 { - for iNdEx := len(m.IdSources) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.IdSources[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) + dAtA[i] = 0xa + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } +func (m *StreamSearchResponse_Data) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} -func (m *ExplainEntry) MarshalVTStrict() (dAtA []byte, err error) { +func (m *StreamSearchResponse_Data) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + 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] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *StreamSearchResponse_Summary) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StreamSearchResponse_Summary) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Summary != nil { + size, err := m.Summary.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ResponseHeader) 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 *ExplainEntry) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *ResponseHeader) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ExplainEntry) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *ResponseHeader) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4695,57 +5032,40 @@ func (m *ExplainEntry) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Children) > 0 { - for iNdEx := len(m.Children) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Children[iNdEx].MarshalToSizedBufferVTStrict(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] = 0x1a - } - } - if m.Duration != nil { - size, err := (*durationpb1.Duration)(m.Duration).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err + dAtA[i] = 0xa } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *StartAsyncSearchRequest) 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 *StartAsyncSearchRequest) 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 *StartAsyncSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *Typing) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4757,94 +5077,83 @@ func (m *StartAsyncSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Size != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) - i-- - dAtA[i] = 0x48 - } - if m.WithDocs { + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) i-- - if m.WithDocs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 + dAtA[i] = 0x10 } - if m.HistogramInterval != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) + 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] = 0x38 + dAtA[i] = 0xa } - 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] = 0x32 - } + return len(dAtA) - i, nil +} + +func (m *ResponseData) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil } - if m.To != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) - i-- - dAtA[i] = 0x28 + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err } - if m.From != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) - i-- - dAtA[i] = 0x20 + return dAtA[:n], nil +} + +func (m *ResponseData) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ResponseData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil } - 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] = 0x1a + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - if m.Retention != nil { - size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVTStrict(dAtA[:i]) + if m.Batch != nil { + size, err := m.Batch.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x12 - } - if len(m.SearchId) > 0 { - i -= len(m.SearchId) - copy(dAtA[i:], m.SearchId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *StartAsyncSearchResponse) 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 *StartAsyncSearchResponse) 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 *StartAsyncSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *RecordsBatch) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4856,28 +5165,40 @@ func (m *StartAsyncSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (in 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].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 *FetchAsyncSearchResultRequest) 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 *FetchAsyncSearchResultRequest) 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 *FetchAsyncSearchResultRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *Record) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4889,50 +5210,37 @@ func (m *FetchAsyncSearchResultRequest) MarshalToSizedBufferVTStrict(dAtA []byte i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Order != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) - i-- - dAtA[i] = 0x20 - } - if m.Offset != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Offset)) - i-- - dAtA[i] = 0x18 - } - if m.Size != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) - i-- - dAtA[i] = 0x10 - } - if len(m.SearchId) > 0 { - i -= len(m.SearchId) - copy(dAtA[i:], m.SearchId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) - i-- - dAtA[i] = 0xa + 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 *FetchAsyncSearchResultResponse) MarshalVTStrict() (dAtA []byte, err error) { +func (m *ResponseSummary) 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 *FetchAsyncSearchResultResponse) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *ResponseSummary) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *FetchAsyncSearchResultResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *ResponseSummary) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -4944,159 +5252,53 @@ func (m *FetchAsyncSearchResultResponse) MarshalToSizedBufferVTStrict(dAtA []byt i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Size != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - } - if m.WithDocs { - i-- - if m.WithDocs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x78 - } - if m.Retention != nil { - size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVTStrict(dAtA[:i]) + if m.Explain != nil { + size, err := m.Explain.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x72 + dAtA[i] = 0x1a } - if m.To != nil { - size, err := (*timestamppb1.Timestamp)(m.To).MarshalToSizedBufferVTStrict(dAtA[:i]) + if m.Error != nil { + size, err := m.Error.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x6a + dAtA[i] = 0x12 } - 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)) + if m.Total != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x8 } - 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] = 0x5a + return len(dAtA) - i, nil +} + +func (m *Error) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil } - if m.HistogramInterval != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) - i-- - dAtA[i] = 0x50 - } - 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] = 0x4a - } - } - if m.DiskUsage != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DiskUsage)) - i-- - dAtA[i] = 0x40 - } - if m.FracsQueue != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsQueue)) - i-- - dAtA[i] = 0x38 - } - if m.FracsDone != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsDone)) - i-- - dAtA[i] = 0x30 - } - if m.CanceledAt != nil { - size, err := (*timestamppb1.Timestamp)(m.CanceledAt).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x2a - } - if m.ExpiresAt != nil { - size, err := (*timestamppb1.Timestamp)(m.ExpiresAt).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } - if m.StartedAt != nil { - size, err := (*timestamppb1.Timestamp)(m.StartedAt).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } - if m.Response != nil { - size, err := m.Response.MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - if m.Status != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CancelAsyncSearchRequest) 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 + 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 *CancelAsyncSearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *Error) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *CancelAsyncSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *Error) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5108,17 +5310,22 @@ func (m *CancelAsyncSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.SearchId) > 0 { - i -= len(m.SearchId) - copy(dAtA[i:], m.SearchId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Message))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + if m.Code != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *CancelAsyncSearchResponse) MarshalVTStrict() (dAtA []byte, err error) { +func (m *BulkRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5131,12 +5338,12 @@ func (m *CancelAsyncSearchResponse) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CancelAsyncSearchResponse) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *BulkRequest) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *CancelAsyncSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *BulkRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5148,10 +5355,29 @@ func (m *CancelAsyncSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (i 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 *DeleteAsyncSearchRequest) MarshalVTStrict() (dAtA []byte, err error) { +func (m *BinaryData) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5164,12 +5390,12 @@ func (m *DeleteAsyncSearchRequest) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DeleteAsyncSearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *BinaryData) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *DeleteAsyncSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *BinaryData) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5181,17 +5407,17 @@ func (m *DeleteAsyncSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.SearchId) > 0 { - i -= len(m.SearchId) - copy(dAtA[i:], m.SearchId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + 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 *DeleteAsyncSearchResponse) MarshalVTStrict() (dAtA []byte, err error) { +func (m *AggQuery) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5204,12 +5430,12 @@ func (m *DeleteAsyncSearchResponse) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DeleteAsyncSearchResponse) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *AggQuery) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *DeleteAsyncSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *AggQuery) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5221,57 +5447,44 @@ func (m *DeleteAsyncSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (i i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - return len(dAtA) - i, nil -} - -func (m *GetAsyncSearchesListRequest) 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 + if m.Interval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) + i-- + dAtA[i] = 0x30 } - return dAtA[:n], nil -} - -func (m *GetAsyncSearchesListRequest) MarshalToVTStrict(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) -} - -func (m *GetAsyncSearchesListRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { - if m == nil { - return 0, nil + 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 } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) + if m.Func != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Func)) + i-- + dAtA[i] = 0x20 } - if len(m.Ids) > 0 { - for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Ids[iNdEx]) - copy(dAtA[i:], m.Ids[iNdEx]) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ids[iNdEx]))) - i-- - dAtA[i] = 0x12 - } + 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 m.Status != nil { - i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Status)) + 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] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *GetAsyncSearchesListResponse) MarshalVTStrict() (dAtA []byte, err error) { +func (m *SearchRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5284,12 +5497,12 @@ func (m *GetAsyncSearchesListResponse) MarshalVTStrict() (dAtA []byte, err error return dAtA[:n], nil } -func (m *GetAsyncSearchesListResponse) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *SearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *GetAsyncSearchesListResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *SearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5301,192 +5514,105 @@ func (m *GetAsyncSearchesListResponse) MarshalToSizedBufferVTStrict(dAtA []byte) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Searches) > 0 { - for iNdEx := len(m.Searches) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Searches[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if m.Downsample != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Downsample)) + i-- + dAtA[i] = 0x78 + } + 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] = 0xa + dAtA[i] = 0x62 } } - return len(dAtA) - i, nil -} - -func (m *AsyncSearchesListItem) 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 *AsyncSearchesListItem) MarshalToVTStrict(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) -} - -func (m *AsyncSearchesListItem) 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.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - if m.Size != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) - i-- - dAtA[i] = 0x1 + if len(m.AggregationFilter) > 0 { + i -= len(m.AggregationFilter) + copy(dAtA[i:], m.AggregationFilter) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AggregationFilter))) i-- - dAtA[i] = 0x80 + dAtA[i] = 0x5a } - if m.WithDocs { + if m.WithTotal { i-- - if m.WithDocs { + if m.WithTotal { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x78 - } - if m.Retention != nil { - size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x72 - } - 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] = 0x6a - } - 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] = 0x62 - } - 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] = 0x5a - } - if m.HistogramInterval != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) - i-- dAtA[i] = 0x50 } - 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] = 0x4a + if m.Explain { + i-- + if m.Explain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - } - if m.DiskUsage != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DiskUsage)) i-- dAtA[i] = 0x40 } - if m.FracsQueue != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsQueue)) + if len(m.Aggregation) > 0 { + i -= len(m.Aggregation) + copy(dAtA[i:], m.Aggregation) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Aggregation))) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x3a } - if m.FracsDone != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsDone)) + if m.Interval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Interval)) i-- dAtA[i] = 0x30 } - if m.CanceledAt != nil { - size, err := (*timestamppb1.Timestamp)(m.CanceledAt).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + if m.Offset != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Offset)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x28 } - if m.ExpiresAt != nil { - size, err := (*timestamppb1.Timestamp)(m.ExpiresAt).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + if m.Size != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x20 } - if m.StartedAt != nil { - size, err := (*timestamppb1.Timestamp)(m.StartedAt).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + if m.To != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x18 } - if m.Status != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + if m.From != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) i-- dAtA[i] = 0x10 } - if len(m.SearchId) > 0 { - i -= len(m.SearchId) - copy(dAtA[i:], m.SearchId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + 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 *IdWithHint) MarshalVTStrict() (dAtA []byte, err error) { +func (m *SearchResponse_Id) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5499,12 +5625,12 @@ func (m *IdWithHint) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IdWithHint) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *SearchResponse_Id) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *IdWithHint) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *SearchResponse_Id) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5516,24 +5642,20 @@ func (m *IdWithHint) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Hint) > 0 { - i -= len(m.Hint) - copy(dAtA[i:], m.Hint) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hint))) + if m.Rid != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Rid)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) + if m.Mid != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Mid)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *FetchRequest_FieldsFilter) MarshalVTStrict() (dAtA []byte, err error) { +func (m *SearchResponse_IdWithHint) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5546,12 +5668,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 *SearchResponse_IdWithHint) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *FetchRequest_FieldsFilter) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *SearchResponse_IdWithHint) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5563,29 +5685,27 @@ func (m *FetchRequest_FieldsFilter) MarshalToSizedBufferVTStrict(dAtA []byte) (i i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.AllowList { - i-- - if m.AllowList { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + if len(m.Hint) > 0 { + i -= len(m.Hint) + copy(dAtA[i:], m.Hint) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hint))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x1a } - if len(m.Fields) > 0 { - for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Fields[iNdEx]) - copy(dAtA[i:], m.Fields[iNdEx]) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Fields[iNdEx]))) - i-- - dAtA[i] = 0xa + if m.Id != nil { + size, err := m.Id.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 *FetchRequest) MarshalVTStrict() (dAtA []byte, err error) { +func (m *SearchResponse_Histogram) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5598,12 +5718,12 @@ func (m *FetchRequest) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FetchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *SearchResponse_Histogram) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *FetchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *SearchResponse_Histogram) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5615,61 +5735,68 @@ func (m *FetchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.NoSkipMasks { - i-- - if m.NoSkipMasks { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.Values) > 0 { + var pksize2 int + for _, num := range m.Values { + pksize2 += protohelpers.SizeOfVarint(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num := range m.Values { + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ } + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x3a } - if m.FieldsFilter != nil { - size, err := m.FieldsFilter.MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Samples) > 0 { + for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { + f3 := math.Float64bits(float64(m.Samples[iNdEx])) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(f3)) } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Samples)*8)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 } - if len(m.IdsWithHints) > 0 { - for iNdEx := len(m.IdsWithHints) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.IdsWithHints[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } + if m.NotExists != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NotExists)) + i-- + dAtA[i] = 0x28 } - if m.Explain { + if m.Total != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) i-- - if m.Explain { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + dAtA[i] = 0x20 + } + if m.Sum != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Sum)))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x19 } - if len(m.Ids) > 0 { - for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Ids[iNdEx]) - copy(dAtA[i:], m.Ids[iNdEx]) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ids[iNdEx]))) - i-- - dAtA[i] = 0xa - } + if m.Max != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Max)))) + i-- + dAtA[i] = 0x11 + } + if m.Min != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Min)))) + i-- + dAtA[i] = 0x9 } return len(dAtA) - i, nil } -func (m *StatusRequest) MarshalVTStrict() (dAtA []byte, err error) { +func (m *SearchResponse_Bin) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5682,12 +5809,12 @@ func (m *StatusRequest) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StatusRequest) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *SearchResponse_Bin) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *StatusRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *SearchResponse_Bin) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5699,10 +5826,37 @@ func (m *StatusRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.Hist != nil { + size, err := m.Hist.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Ts != nil { + size, err := (*timestamppb1.Timestamp)(m.Ts).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *StatusResponse) MarshalVTStrict() (dAtA []byte, err error) { +func (m *SearchResponse_Agg) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -5715,12 +5869,12 @@ func (m *StatusResponse) MarshalVTStrict() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StatusResponse) MarshalToVTStrict(dAtA []byte) (int, error) { +func (m *SearchResponse_Agg) MarshalToVTStrict(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *StatusResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { +func (m *SearchResponse_Agg) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -5732,746 +5886,5231 @@ func (m *StatusResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.OldestTime != nil { - size, err := (*timestamppb1.Timestamp)(m.OldestTime).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err + if len(m.ValuesPool) > 0 { + for iNdEx := len(m.ValuesPool) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ValuesPool[iNdEx]) + copy(dAtA[i:], m.ValuesPool[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ValuesPool[iNdEx]))) + i-- + dAtA[i] = 0x2a } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa } - return len(dAtA) - i, nil -} - -func (m *BulkRequest) SizeVT() (n int) { - if m == nil { - return 0 + if len(m.Timeseries) > 0 { + for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Timeseries[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } } - var l int - _ = l - if m.Count != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Count)) + if m.NotExists != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NotExists)) + i-- + dAtA[i] = 0x18 } - l = len(m.Docs) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if len(m.AggHistogram) > 0 { + for k := range m.AggHistogram { + v := m.AggHistogram[k] + baseI := i + size, err := v.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } } - l = len(m.Metas) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if len(m.Agg) > 0 { + for k := range m.Agg { + v := m.Agg[k] + baseI := i + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } } - n += len(m.unknownFields) - return n + return len(dAtA) - i, nil } -func (m *BinaryData) SizeVT() (n int) { +func (m *SearchResponse) 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 *SearchResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *SearchResponse) 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.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] = 0x42 } - if m.Func != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Func)) + if m.Code != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x38 } - if len(m.Quantiles) > 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(len(m.Quantiles)*8)) + len(m.Quantiles)*8 + 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] = 0x32 + } } - 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 m.Total != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x28 } if len(m.Aggs) > 0 { - for _, e := range m.Aggs { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + 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] = 0x22 } } - if m.Order != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Order)) + if len(m.Histogram) > 0 { + for k := range m.Histogram { + v := m.Histogram[k] + baseI := i + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i = protohelpers.EncodeVarint(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } } - l = len(m.OffsetId) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if len(m.IdSources) > 0 { + for iNdEx := len(m.IdSources) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.IdSources[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.Downsample != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Downsample)) + 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 } - n += len(m.unknownFields) - return n + return len(dAtA) - i, nil } -func (m *SearchResponse_Id) SizeVT() (n int) { +func (m *ExplainEntry) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 - } - var l int - _ = l - if m.Mid != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Mid)) + return nil, nil } - if m.Rid != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Rid)) + 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 *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 *ExplainEntry) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *SearchResponse_Histogram) SizeVT() (n int) { +func (m *ExplainEntry) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - if m.Min != 0 { - n += 9 - } - if m.Max != 0 { - n += 9 - } - if m.Sum != 0 { - n += 9 - } - if m.Total != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Total)) - } - if m.NotExists != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.NotExists)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - if len(m.Samples) > 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(len(m.Samples)*8)) + len(m.Samples)*8 + if len(m.Children) > 0 { + for iNdEx := len(m.Children) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Children[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } } - if len(m.Values) > 0 { - l = 0 - for _, e := range m.Values { - l += protohelpers.SizeOfVarint(uint64(e)) + if m.Duration != nil { + size, err := (*durationpb1.Duration)(m.Duration).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err } - n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } - n += len(m.unknownFields) - return n + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *SearchResponse_Bin) SizeVT() (n int) { +func (m *StartAsyncSearchRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Label) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.Ts != nil { - l = (*timestamppb1.Timestamp)(m.Ts).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return nil, nil } - if m.Hist != nil { - l = m.Hist.SizeVT() - 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 *SearchResponse_Agg) SizeVT() (n int) { +func (m *StartAsyncSearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StartAsyncSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - if len(m.Agg) > 0 { - for k, v := range m.Agg { - _ = k - _ = v - mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + protohelpers.SizeOfVarint(uint64(v)) - n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) - } - } - if len(m.AggHistogram) > 0 { - for k, v := range m.AggHistogram { - _ = k - _ = v - l = 0 - if v != nil { - l = v.SizeVT() - } - l += 1 + protohelpers.SizeOfVarint(uint64(l)) - mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l - n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) - } + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - if m.NotExists != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.NotExists)) + if m.Size != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x48 } - if len(m.Timeseries) > 0 { - for _, e := range m.Timeseries { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - } - if len(m.ValuesPool) > 0 { - for _, s := range m.ValuesPool { - l = len(s) - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.WithDocs { + i-- + if m.WithDocs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x40 } - n += len(m.unknownFields) - return n -} - -func (m *SearchResponse) 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)) + if m.HistogramInterval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) + i-- + dAtA[i] = 0x38 } - if len(m.IdSources) > 0 { - for _, e := range m.IdSources { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + 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] = 0x32 } } - if len(m.Histogram) > 0 { - for k, v := range m.Histogram { - _ = k - _ = v - mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) - n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) - } + if m.To != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.To)) + i-- + dAtA[i] = 0x28 } - if len(m.Aggs) > 0 { - for _, e := range m.Aggs { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } + if m.From != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.From)) + i-- + dAtA[i] = 0x20 } - if m.Total != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Total)) + 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] = 0x1a } - if len(m.Errors) > 0 { - for _, s := range m.Errors { - l = len(s) - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.Retention != nil { + size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } - if m.Code != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Code)) + if len(m.SearchId) > 0 { + i -= len(m.SearchId) + copy(dAtA[i:], m.SearchId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + i-- + dAtA[i] = 0xa } - if m.Explain != nil { - l = m.Explain.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *StartAsyncSearchResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil } - n += len(m.unknownFields) - return n + 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 *ExplainEntry) SizeVT() (n int) { +func (m *StartAsyncSearchResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StartAsyncSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Message) - 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.Duration != nil { - l = (*durationpb1.Duration)(m.Duration).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *FetchAsyncSearchResultRequest) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil } - if len(m.Children) > 0 { - for _, e := range m.Children { - l = e.SizeVT() - 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 *StartAsyncSearchRequest) SizeVT() (n int) { +func (m *FetchAsyncSearchResultRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *FetchAsyncSearchResultRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.SearchId) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.Retention != nil { - l = (*durationpb1.Duration)(m.Retention).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(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 len(m.Aggs) > 0 { - for _, e := range m.Aggs { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - if m.HistogramInterval != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.HistogramInterval)) + if m.Order != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Order)) + i-- + dAtA[i] = 0x20 } - if m.WithDocs { - n += 2 + if m.Offset != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Offset)) + i-- + dAtA[i] = 0x18 } if m.Size != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x10 } - n += len(m.unknownFields) - return n + if len(m.SearchId) > 0 { + i -= len(m.SearchId) + copy(dAtA[i:], m.SearchId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *StartAsyncSearchResponse) SizeVT() (n int) { +func (m *FetchAsyncSearchResultResponse) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - n += len(m.unknownFields) - return n + 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 *FetchAsyncSearchResultRequest) SizeVT() (n int) { +func (m *FetchAsyncSearchResultResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *FetchAsyncSearchResultResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.SearchId) - 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.Size != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 } - if m.Offset != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Offset)) - } - if m.Order != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Order)) + if m.WithDocs { + i-- + if m.WithDocs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 } - n += len(m.unknownFields) - return n -} - -func (m *FetchAsyncSearchResultResponse) SizeVT() (n int) { - if m == nil { - return 0 + if m.Retention != nil { + size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x72 } - var l int - _ = l - if m.Status != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + 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] = 0x6a } - if m.Response != nil { - l = m.Response.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + 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] = 0x62 } - if m.StartedAt != nil { - l = (*timestamppb1.Timestamp)(m.StartedAt).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + 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] = 0x5a } - if m.ExpiresAt != nil { - l = (*timestamppb1.Timestamp)(m.ExpiresAt).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.HistogramInterval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) + i-- + dAtA[i] = 0x50 } - if m.CanceledAt != nil { - l = (*timestamppb1.Timestamp)(m.CanceledAt).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + 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] = 0x4a + } } - if m.FracsDone != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.FracsDone)) + if m.DiskUsage != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DiskUsage)) + i-- + dAtA[i] = 0x40 } if m.FracsQueue != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.FracsQueue)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsQueue)) + i-- + dAtA[i] = 0x38 } - if m.DiskUsage != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.DiskUsage)) + if m.FracsDone != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsDone)) + i-- + dAtA[i] = 0x30 } - if len(m.Aggs) > 0 { - for _, e := range m.Aggs { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.CanceledAt != nil { + size, err := (*timestamppb1.Timestamp)(m.CanceledAt).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a } - if m.HistogramInterval != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.HistogramInterval)) - } - l = len(m.Query) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.From != nil { - l = (*timestamppb1.Timestamp)(m.From).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.To != nil { - l = (*timestamppb1.Timestamp)(m.To).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.ExpiresAt != nil { + size, err := (*timestamppb1.Timestamp)(m.ExpiresAt).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 } - if m.Retention != nil { - l = (*durationpb1.Duration)(m.Retention).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.StartedAt != nil { + size, err := (*timestamppb1.Timestamp)(m.StartedAt).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a } - if m.WithDocs { - n += 2 + if m.Response != nil { + size, err := m.Response.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } - if m.Size != 0 { - n += 2 + protohelpers.SizeOfVarint(uint64(m.Size)) + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 } - n += len(m.unknownFields) - return n + return len(dAtA) - i, nil } -func (m *CancelAsyncSearchRequest) SizeVT() (n int) { +func (m *CancelAsyncSearchRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - l = len(m.SearchId) - 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 *CancelAsyncSearchResponse) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += len(m.unknownFields) - return n +func (m *CancelAsyncSearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) } -func (m *DeleteAsyncSearchRequest) SizeVT() (n int) { +func (m *CancelAsyncSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.SearchId) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - n += len(m.unknownFields) - return n + if len(m.SearchId) > 0 { + i -= len(m.SearchId) + copy(dAtA[i:], m.SearchId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *DeleteAsyncSearchResponse) SizeVT() (n int) { +func (m *CancelAsyncSearchResponse) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - n += len(m.unknownFields) - return n + 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 *GetAsyncSearchesListRequest) SizeVT() (n int) { +func (m *CancelAsyncSearchResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *CancelAsyncSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - if m.Status != nil { - n += 1 + protohelpers.SizeOfVarint(uint64(*m.Status)) - } - if len(m.Ids) > 0 { - for _, s := range m.Ids { - l = len(s) - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - n += len(m.unknownFields) - return n + return len(dAtA) - i, nil } -func (m *GetAsyncSearchesListResponse) SizeVT() (n int) { +func (m *DeleteAsyncSearchRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - if len(m.Searches) > 0 { - for _, e := range m.Searches { - l = e.SizeVT() - 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 *AsyncSearchesListItem) SizeVT() (n int) { +func (m *DeleteAsyncSearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *DeleteAsyncSearchRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.SearchId) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.Status != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) - } - if m.StartedAt != nil { - l = (*timestamppb1.Timestamp)(m.StartedAt).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.ExpiresAt != nil { - l = (*timestamppb1.Timestamp)(m.ExpiresAt).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.CanceledAt != nil { - l = (*timestamppb1.Timestamp)(m.CanceledAt).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.FracsDone != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.FracsDone)) - } - if m.FracsQueue != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.FracsQueue)) - } - if m.DiskUsage != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.DiskUsage)) - } - if len(m.Aggs) > 0 { - for _, e := range m.Aggs { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - } - if m.HistogramInterval != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.HistogramInterval)) - } - l = len(m.Query) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.From != nil { - l = (*timestamppb1.Timestamp)(m.From).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.To != nil { - l = (*timestamppb1.Timestamp)(m.To).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.Retention != nil { - l = (*durationpb1.Duration)(m.Retention).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - if m.WithDocs { - n += 2 + if len(m.SearchId) > 0 { + i -= len(m.SearchId) + copy(dAtA[i:], m.SearchId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + i-- + dAtA[i] = 0xa } - if m.Size != 0 { - n += 2 + protohelpers.SizeOfVarint(uint64(m.Size)) + return len(dAtA) - i, nil +} + +func (m *DeleteAsyncSearchResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil } - l = len(m.Error) - if l > 0 { - n += 2 + 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 *IdWithHint) SizeVT() (n int) { +func (m *DeleteAsyncSearchResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *DeleteAsyncSearchResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - l = len(m.Hint) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - n += len(m.unknownFields) - return n + return len(dAtA) - i, nil } -func (m *FetchRequest_FieldsFilter) SizeVT() (n int) { +func (m *GetAsyncSearchesListRequest) MarshalVTStrict() (dAtA []byte, err error) { if m == nil { - return 0 - } - var l int - _ = l - if len(m.Fields) > 0 { - for _, s := range m.Fields { - l = len(s) - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } + return nil, nil } - if m.AllowList { - n += 2 + 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 *FetchRequest) SizeVT() (n int) { +func (m *GetAsyncSearchesListRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *GetAsyncSearchesListRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + 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.Ids) > 0 { - for _, s := range m.Ids { - l = len(s) - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ids[iNdEx]) + copy(dAtA[i:], m.Ids[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ids[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - if m.Explain { - n += 2 - } - if len(m.IdsWithHints) > 0 { - for _, e := range m.IdsWithHints { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } + if m.Status != nil { + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Status)) + i-- + dAtA[i] = 0x8 } - if m.FieldsFilter != nil { - l = m.FieldsFilter.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *GetAsyncSearchesListResponse) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil } - if m.NoSkipMasks { - n += 2 + 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 *StatusRequest) SizeVT() (n int) { +func (m *GetAsyncSearchesListResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *GetAsyncSearchesListResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - n += len(m.unknownFields) - return n + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Searches) > 0 { + for iNdEx := len(m.Searches) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Searches[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 *StatusResponse) SizeVT() (n int) { +func (m *AsyncSearchesListItem) 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 *AsyncSearchesListItem) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *AsyncSearchesListItem) 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.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.Size != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.WithDocs { + i-- + if m.WithDocs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if m.Retention != nil { + size, err := (*durationpb1.Duration)(m.Retention).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x72 + } + 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] = 0x6a + } + 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] = 0x62 + } + 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] = 0x5a + } + if m.HistogramInterval != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HistogramInterval)) + i-- + dAtA[i] = 0x50 + } + 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] = 0x4a + } + } + if m.DiskUsage != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DiskUsage)) + i-- + dAtA[i] = 0x40 + } + if m.FracsQueue != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsQueue)) + i-- + dAtA[i] = 0x38 + } + if m.FracsDone != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FracsDone)) + i-- + dAtA[i] = 0x30 + } + if m.CanceledAt != nil { + size, err := (*timestamppb1.Timestamp)(m.CanceledAt).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.ExpiresAt != nil { + size, err := (*timestamppb1.Timestamp)(m.ExpiresAt).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.StartedAt != nil { + size, err := (*timestamppb1.Timestamp)(m.StartedAt).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if len(m.SearchId) > 0 { + i -= len(m.SearchId) + copy(dAtA[i:], m.SearchId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IdWithHint) 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 *IdWithHint) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *IdWithHint) 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.Hint) > 0 { + i -= len(m.Hint) + copy(dAtA[i:], m.Hint) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hint))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FetchRequest_FieldsFilter) 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 *FetchRequest_FieldsFilter) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *FetchRequest_FieldsFilter) 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.AllowList { + i-- + if m.AllowList { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Fields) > 0 { + for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Fields[iNdEx]) + copy(dAtA[i:], m.Fields[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Fields[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *FetchRequest) 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 *FetchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *FetchRequest) 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.NoSkipMasks { + i-- + if m.NoSkipMasks { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + 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] = 0x2a + } + if len(m.IdsWithHints) > 0 { + for iNdEx := len(m.IdsWithHints) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.IdsWithHints[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + } + if m.Explain { + i-- + if m.Explain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.Ids) > 0 { + for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ids[iNdEx]) + copy(dAtA[i:], m.Ids[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ids[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StatusRequest) 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 *StatusRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StatusRequest) 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) + } + return len(dAtA) - i, nil +} + +func (m *StatusResponse) 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 *StatusResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StatusResponse) 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.OldestTime != nil { + size, err := (*timestamppb1.Timestamp)(m.OldestTime).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 *StreamSearchRequest) 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 *StreamSearchRequest) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamSearchRequest) 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 msg, ok := m.RequestType.(*StreamSearchRequest_Control); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.RequestType.(*StreamSearchRequest_Query); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *StreamSearchRequest_Query) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamSearchRequest_Query) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Query != nil { + size, err := m.Query.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 + } + return len(dAtA) - i, nil +} +func (m *StreamSearchRequest_Control) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamSearchRequest_Control) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Control != nil { + size, err := m.Control.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 + } + return len(dAtA) - i, nil +} +func (m *StreamSearchQuery) 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 *StreamSearchQuery) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamSearchQuery) 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.WithTotal { + i-- + if m.WithTotal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + 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] = 0x2a + } + if m.Explain { + i-- + if m.Explain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + 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] = 0x1a + } + 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] = 0x12 + } + 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 *StreamControl) 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 *StreamControl) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamControl) 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.Action != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StreamSearchResponse) 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 *StreamSearchResponse) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamSearchResponse) 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 msg, ok := m.ResponseType.(*StreamSearchResponse_Summary); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.ResponseType.(*StreamSearchResponse_Data); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if msg, ok := m.ResponseType.(*StreamSearchResponse_Header); ok { + size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *StreamSearchResponse_Header) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamSearchResponse_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 + } + return len(dAtA) - i, nil +} +func (m *StreamSearchResponse_Data) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamSearchResponse_Data) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + 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] = 0x12 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *StreamSearchResponse_Summary) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *StreamSearchResponse_Summary) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Summary != nil { + size, err := m.Summary.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ResponseHeader) 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 *ResponseHeader) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ResponseHeader) 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.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] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Typing) 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 *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.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 + } + 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 + } + return len(dAtA) - i, nil +} + +func (m *ResponseData) 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 *ResponseData) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ResponseData) 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.Batch != nil { + size, err := m.Batch.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 *RecordsBatch) 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 *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, 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.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 *ResponseSummary) 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 *ResponseSummary) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *ResponseSummary) 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] = 0x1a + } + if m.Error != nil { + size, err := m.Error.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Total != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Error) 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 *Error) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Error) 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.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x12 + } + if m.Code != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 + } + 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)) + } + 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)) + } + if m.Downsample != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Downsample)) + } + 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 + } + if m.Sum != 0 { + n += 9 + } + if m.Total != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Total)) + } + if m.NotExists != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.NotExists)) + } + if len(m.Samples) > 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.Samples)*8)) + len(m.Samples)*8 + } + if len(m.Values) > 0 { + l = 0 + for _, e := range m.Values { + l += protohelpers.SizeOfVarint(uint64(e)) + } + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l + } + n += len(m.unknownFields) + return n +} + +func (m *SearchResponse_Bin) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Label) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Ts != nil { + l = (*timestamppb1.Timestamp)(m.Ts).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Hist != nil { + l = m.Hist.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SearchResponse_Agg) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Agg) > 0 { + for k, v := range m.Agg { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if len(m.AggHistogram) > 0 { + for k, v := range m.AggHistogram { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if m.NotExists != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.NotExists)) + } + if len(m.Timeseries) > 0 { + for _, e := range m.Timeseries { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.ValuesPool) > 0 { + for _, s := range m.ValuesPool { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *SearchResponse) 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)) + } + if len(m.IdSources) > 0 { + for _, e := range m.IdSources { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Histogram) > 0 { + for k, v := range m.Histogram { + _ = k + _ = v + mapEntrySize := 1 + protohelpers.SizeOfVarint(uint64(k)) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if len(m.Aggs) > 0 { + for _, e := range m.Aggs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(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 *ExplainEntry) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Duration != nil { + l = (*durationpb1.Duration)(m.Duration).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Children) > 0 { + for _, e := range m.Children { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *StartAsyncSearchRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SearchId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Retention != nil { + l = (*durationpb1.Duration)(m.Retention).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(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 len(m.Aggs) > 0 { + for _, e := range m.Aggs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.HistogramInterval != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.HistogramInterval)) + } + if m.WithDocs { + n += 2 + } + if m.Size != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Size)) + } + n += len(m.unknownFields) + return n +} + +func (m *StartAsyncSearchResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *FetchAsyncSearchResultRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SearchId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Size != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Size)) + } + if m.Offset != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Offset)) + } + if m.Order != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Order)) + } + n += len(m.unknownFields) + return n +} + +func (m *FetchAsyncSearchResultResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + if m.Response != nil { + l = m.Response.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.StartedAt != nil { + l = (*timestamppb1.Timestamp)(m.StartedAt).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ExpiresAt != nil { + l = (*timestamppb1.Timestamp)(m.ExpiresAt).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.CanceledAt != nil { + l = (*timestamppb1.Timestamp)(m.CanceledAt).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FracsDone != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FracsDone)) + } + if m.FracsQueue != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FracsQueue)) + } + if m.DiskUsage != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.DiskUsage)) + } + if len(m.Aggs) > 0 { + for _, e := range m.Aggs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.HistogramInterval != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.HistogramInterval)) + } + l = len(m.Query) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.From != nil { + l = (*timestamppb1.Timestamp)(m.From).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.To != nil { + l = (*timestamppb1.Timestamp)(m.To).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Retention != nil { + l = (*durationpb1.Duration)(m.Retention).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.WithDocs { + n += 2 + } + if m.Size != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.Size)) + } + n += len(m.unknownFields) + return n +} + +func (m *CancelAsyncSearchRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SearchId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *CancelAsyncSearchResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *DeleteAsyncSearchRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SearchId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *DeleteAsyncSearchResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *GetAsyncSearchesListRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + n += 1 + protohelpers.SizeOfVarint(uint64(*m.Status)) + } + if len(m.Ids) > 0 { + for _, s := range m.Ids { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *GetAsyncSearchesListResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Searches) > 0 { + for _, e := range m.Searches { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *AsyncSearchesListItem) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SearchId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + if m.StartedAt != nil { + l = (*timestamppb1.Timestamp)(m.StartedAt).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ExpiresAt != nil { + l = (*timestamppb1.Timestamp)(m.ExpiresAt).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.CanceledAt != nil { + l = (*timestamppb1.Timestamp)(m.CanceledAt).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FracsDone != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FracsDone)) + } + if m.FracsQueue != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FracsQueue)) + } + if m.DiskUsage != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.DiskUsage)) + } + if len(m.Aggs) > 0 { + for _, e := range m.Aggs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.HistogramInterval != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.HistogramInterval)) + } + l = len(m.Query) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.From != nil { + l = (*timestamppb1.Timestamp)(m.From).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.To != nil { + l = (*timestamppb1.Timestamp)(m.To).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Retention != nil { + l = (*durationpb1.Duration)(m.Retention).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.WithDocs { + n += 2 + } + if m.Size != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.Size)) + } + l = len(m.Error) + if l > 0 { + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *IdWithHint) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + 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 *FetchRequest_FieldsFilter) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Fields) > 0 { + for _, s := range m.Fields { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.AllowList { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *FetchRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Ids) > 0 { + for _, s := range m.Ids { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Explain { + n += 2 + } + if len(m.IdsWithHints) > 0 { + for _, e := range m.IdsWithHints { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.FieldsFilter != nil { + l = m.FieldsFilter.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.NoSkipMasks { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *StatusRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *StatusResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OldestTime != nil { + l = (*timestamppb1.Timestamp)(m.OldestTime).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *StreamSearchRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.RequestType.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *StreamSearchRequest_Query) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Query != nil { + l = m.Query.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 3 + } + return n +} +func (m *StreamSearchRequest_Control) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Control != nil { + l = m.Control.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 3 + } + return n +} +func (m *StreamSearchQuery) 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 != nil { + l = (*timestamppb1.Timestamp)(m.From).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.To != nil { + l = (*timestamppb1.Timestamp)(m.To).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Explain { + n += 2 + } + l = len(m.OffsetId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.WithTotal { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *StreamControl) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Action != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Action)) + } + n += len(m.unknownFields) + return n +} + +func (m *StreamSearchResponse) 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 *StreamSearchResponse_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 *StreamSearchResponse_Data) 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)) + } else { + n += 3 + } + return n +} +func (m *StreamSearchResponse_Summary) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Summary != nil { + l = m.Summary.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 3 + } + return n +} +func (m *ResponseHeader) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = 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 *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 *ResponseData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Batch != nil { + l = m.Batch.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + 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 *ResponseSummary) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Total)) + } + if m.Error != nil { + l = m.Error.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Explain != nil { + l = m.Explain.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Error) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Code)) + } + l = len(m.Message) + if l > 0 { + 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 + 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: BulkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BulkRequest: 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) + } + 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 + } + 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.AggregationFilter = string(dAtA[iNdEx:postIndex]) + 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].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) + } + 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 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 + } + m.OffsetId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Downsample", wireType) + } + m.Downsample = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Downsample |= uint32(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_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) + } + 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) 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: + 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.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 { + 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.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 != 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) + } + 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 |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + } + 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 + } + } + 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:]) + 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) 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_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) + } + 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.Label = string(dAtA[iNdEx:postIndex]) + 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 { + 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.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 Hist", 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.Hist == nil { + m.Hist = &SearchResponse_Histogram{} + } + if err := m.Hist.UnmarshalVT(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 *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 Agg", 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.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 + } + } + 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 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.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 + } + 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 { + 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 + } + } + m.AggHistogram[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + } + 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 + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", 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.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 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValuesPool", 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.ValuesPool = append(m.ValuesPool, 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) 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: 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 = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + 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) + } + 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.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 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 + } + } + 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:]) + 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 *ExplainEntry) 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: 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 + } + 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.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", 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.Duration == nil { + m.Duration = &durationpb.Duration{} + } + 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 Children", 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.Children = append(m.Children, &ExplainEntry{}) + if err := m.Children[len(m.Children)-1].UnmarshalVT(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 + } } - var l int - _ = l - if m.OldestTime != nil { - l = (*timestamppb1.Timestamp)(m.OldestTime).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + + if iNdEx > l { + return io.ErrUnexpectedEOF } - n += len(m.unknownFields) - return n + return nil } - -func (m *BulkRequest) UnmarshalVT(dAtA []byte) error { +func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6494,17 +11133,17 @@ func (m *BulkRequest) UnmarshalVT(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: StartAsyncSearchRequest: 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: StartAsyncSearchRequest: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } - m.Count = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6514,16 +11153,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 } } + 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 Docs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6533,31 +11185,33 @@ 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{} + 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 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6567,82 +11221,120 @@ 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.Query = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + 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 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 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 } - 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 *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 + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } - if iNdEx >= l { - return io.ErrUnexpectedEOF + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + 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: 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) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) } - var byteLen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6652,26 +11344,82 @@ func (m *BinaryData) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return protohelpers.ErrInvalidLength + m.WithDocs = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } - postIndex := iNdEx + byteLen - if postIndex < 0 { + 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.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex + } + 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:]) @@ -6694,7 +11442,7 @@ func (m *BinaryData) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *AggQuery) UnmarshalVT(dAtA []byte) error { +func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6717,15 +11465,15 @@ 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: FetchAsyncSearchResultRequest: 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: 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 Field", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6753,13 +11501,13 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Field = string(dAtA[iNdEx:postIndex]) + m.SearchId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupBy", wireType) + case 2: + if wireType != 0 { + 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 @@ -6769,29 +11517,16 @@ func (m *AggQuery) 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.GroupBy = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - m.Func = 0 + m.Offset = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6801,70 +11536,16 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Func |= AggFunc(b&0x7F) << shift + m.Offset |= int32(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: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) } - m.Interval = 0 + m.Order = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6874,7 +11555,7 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Interval |= int64(b&0x7F) << shift + m.Order |= Order(b&0x7F) << shift if b < 0x80 { break } @@ -6901,7 +11582,7 @@ func (m *AggQuery) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { +func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6924,17 +11605,36 @@ func (m *SearchRequest) UnmarshalVT(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: FetchAsyncSearchResultResponse: 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: 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 Query", 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 @@ -6944,29 +11644,33 @@ 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.Query = 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: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) } - m.From = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -6976,16 +11680,33 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.From |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + if msglen < 0 { + return protohelpers.ErrInvalidLength } - m.To = 0 + 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).UnmarshalVT(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 @@ -6995,16 +11716,69 @@ func (m *SearchRequest) 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.ExpiresAt == nil { + m.ExpiresAt = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.ExpiresAt).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) + } + 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 } } - case 4: + 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).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) } - m.Size = 0 + m.FracsDone = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7014,16 +11788,16 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Size |= int64(b&0x7F) << shift + m.FracsDone |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 5: + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) } - m.Offset = 0 + m.FracsQueue = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7033,16 +11807,16 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Offset |= int64(b&0x7F) << shift + m.FracsQueue |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 6: + case 8: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) } - m.Interval = 0 + m.DiskUsage = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7052,16 +11826,16 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Interval |= int64(b&0x7F) << shift + m.DiskUsage |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 7: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggregation", 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 @@ -7071,49 +11845,31 @@ 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.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.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Explain = bool(v != 0) + iNdEx = postIndex case 10: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) } - var v int + m.HistogramInterval = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7123,15 +11879,14 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.HistogramInterval |= int64(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) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7159,11 +11914,11 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AggregationFilter = string(dAtA[iNdEx:postIndex]) + m.Query = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7190,16 +11945,18 @@ 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 { + 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 != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - m.Order = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7209,16 +11966,33 @@ func (m *SearchRequest) 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 + } + 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 OffsetId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7228,29 +12002,33 @@ 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]) + 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 Downsample", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) } - m.Downsample = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7260,7 +12038,27 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Downsample |= uint32(b&0x7F) << shift + 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 } @@ -7287,7 +12085,7 @@ func (m *SearchRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchResponse_Id) UnmarshalVT(dAtA []byte) error { +func (m *CancelAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7310,17 +12108,17 @@ func (m *SearchResponse_Id) UnmarshalVT(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: CancelAsyncSearchRequest: 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: CancelAsyncSearchRequest: 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 SearchId", wireType) } - m.Mid = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7330,30 +12128,24 @@ func (m *SearchResponse_Id) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Mid |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Rid", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength } - 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 - } + 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:]) @@ -7376,7 +12168,58 @@ func (m *SearchResponse_Id) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchResponse_IdWithHint) UnmarshalVT(dAtA []byte) error { +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 { @@ -7399,51 +12242,15 @@ func (m *SearchResponse_IdWithHint) UnmarshalVT(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: DeleteAsyncSearchRequest: 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: 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 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) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7471,7 +12278,7 @@ func (m *SearchResponse_IdWithHint) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Hint = string(dAtA[iNdEx:postIndex]) + m.SearchId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -7495,7 +12302,7 @@ func (m *SearchResponse_IdWithHint) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchResponse_Histogram) UnmarshalVT(dAtA []byte) error { +func (m *DeleteAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7515,216 +12322,15 @@ func (m *SearchResponse_Histogram) UnmarshalVT(dAtA []byte) error { 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 != 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) - } - 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 |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) - } - 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 - } - } - 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) - } + 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:]) @@ -7747,7 +12353,7 @@ func (m *SearchResponse_Histogram) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { +func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7770,17 +12376,17 @@ 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: GetAsyncSearchesListRequest: 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: GetAsyncSearchesListRequest: 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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var stringLen uint64 + var v AsyncSearchStatus for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7790,29 +12396,17 @@ func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= AsyncSearchStatus(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.Label = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.Status = &v 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 Ids", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7822,31 +12416,78 @@ func (m *SearchResponse_Bin) 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.Ts == nil { - m.Ts = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.Ts).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 3: + 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 *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 + } + 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: 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 Hist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7873,10 +12514,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.Searches = append(m.Searches, &AsyncSearchesListItem{}) + if err := m.Searches[len(m.Searches)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7902,7 +12541,7 @@ func (m *SearchResponse_Bin) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { +func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7925,15 +12564,66 @@ 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: AsyncSearchesListItem: 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: 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 Agg", wireType) + 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 + 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 { @@ -7960,93 +12650,16 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Agg == nil { - m.Agg = make(map[string]uint64) + if m.StartedAt == nil { + m.StartedAt = ×tamppb.Timestamp{} } - 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 - } + if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Agg[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 ExpiresAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8073,111 +12686,54 @@ 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.ExpiresAt == nil { + m.ExpiresAt = ×tamppb.Timestamp{} } - 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 := (*timestamppb1.Timestamp)(m.ExpiresAt).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) + } + var msglen 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 - } - 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++ + 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.CanceledAt == nil { + m.CanceledAt = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) } - m.NotExists = 0 + m.FracsDone = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8187,16 +12743,16 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NotExists |= int64(b&0x7F) << shift + m.FracsDone |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) } - var msglen int + m.FracsQueue = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8206,31 +12762,35 @@ func (m *SearchResponse_Agg) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.FracsQueue |= 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 + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) } - m.Timeseries = append(m.Timeseries, &SearchResponse_Bin{}) - if err := m.Timeseries[len(m.Timeseries)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + 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 + } } - iNdEx = postIndex - case 5: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValuesPool", 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 @@ -8240,80 +12800,50 @@ func (m *SearchResponse_Agg) 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.ValuesPool = append(m.ValuesPool, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(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 *SearchResponse) 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 + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + 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: 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: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8323,29 +12853,27 @@ 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.Query = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdSources", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8372,14 +12900,16 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { 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 { + 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: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Histogram", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8406,79 +12936,16 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Histogram == nil { - m.Histogram = make(map[uint64]uint64) + if m.To == nil { + m.To = ×tamppb.Timestamp{} } - 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 - } + if err := (*timestamppb1.Timestamp)(m.To).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Histogram[mapkey] = mapvalue iNdEx = postIndex - case 4: + 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 { @@ -8505,35 +12972,18 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { 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 { + 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 5: + case 15: 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 WithDocs", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8543,29 +12993,17 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= 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 - } - m.Errors = append(m.Errors, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: + m.WithDocs = bool(v != 0) + case 16: 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 @@ -8575,16 +13013,16 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= SearchErrorCode(b&0x7F) << shift + m.Size |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 8: + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", 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 @@ -8594,27 +13032,23 @@ func (m *SearchResponse) 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.Explain == nil { - m.Explain = &ExplainEntry{} - } - if err := m.Explain.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -8638,7 +13072,7 @@ func (m *SearchResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ExplainEntry) UnmarshalVT(dAtA []byte) error { +func (m *IdWithHint) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8661,15 +13095,15 @@ 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: IdWithHint: 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: 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 Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8697,49 +13131,13 @@ func (m *ExplainEntry) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Message = string(dAtA[iNdEx:postIndex]) + m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", 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.Duration == nil { - m.Duration = &durationpb.Duration{} - } - 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 Children", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8749,25 +13147,23 @@ func (m *ExplainEntry) 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.Children = append(m.Children, &ExplainEntry{}) - if err := m.Children[len(m.Children)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Hint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -8791,7 +13187,7 @@ func (m *ExplainEntry) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { +func (m *FetchRequest_FieldsFilter) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8814,15 +13210,15 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StartAsyncSearchRequest: wiretype end group for non-group") + return fmt.Errorf("proto: FetchRequest_FieldsFilter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StartAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FetchRequest_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 SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8850,13 +13246,13 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SearchId = string(dAtA[iNdEx:postIndex]) + m.Fields = append(m.Fields, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowList", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8866,31 +13262,66 @@ func (m *StartAsyncSearchRequest) 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.AllowList = 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.Retention == nil { - m.Retention = &durationpb.Duration{} + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FetchRequest) 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 := (*durationpb1.Duration)(m.Retention).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 3: + 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 { @@ -8918,32 +13349,13 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Query = string(dAtA[iNdEx:postIndex]) + m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) 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 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.From |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } - m.To = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -8953,14 +13365,15 @@ 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: + m.Explain = bool(v != 0) + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IdsWithHints", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8987,16 +13400,16 @@ func (m *StartAsyncSearchRequest) 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 { + 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 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FieldsFilter", wireType) } - m.HistogramInterval = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9006,14 +13419,31 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.HistogramInterval |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 8: + 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 = &FetchRequest_FieldsFilter{} + } + if err := m.FieldsFilter.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 { @@ -9030,26 +13460,58 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { break } } - m.WithDocs = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + m.NoSkipMasks = bool(v != 0) + 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 |= 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 *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 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:]) @@ -9072,7 +13534,7 @@ func (m *StartAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *StartAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { +func (m *StatusResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9095,12 +13557,48 @@ 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: StatusResponse: 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: 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 OldestTime", 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.OldestTime == nil { + m.OldestTime = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -9123,7 +13621,7 @@ func (m *StartAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { +func (m *StreamSearchRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9146,17 +13644,17 @@ 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: StreamSearchRequest: 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: StreamSearchRequest: 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 Query", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9166,29 +13664,38 @@ func (m *FetchAsyncSearchResultRequest) 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.SearchId = string(dAtA[iNdEx:postIndex]) + if oneof, ok := m.RequestType.(*StreamSearchRequest_Query); ok { + if err := oneof.Query.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &StreamSearchQuery{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.RequestType = &StreamSearchRequest_Query{Query: v} + } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Control", wireType) } - m.Size = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9198,49 +13705,33 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Size |= int32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + if msglen < 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 |= int32(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + if postIndex > l { + return io.ErrUnexpectedEOF } - m.Order = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if oneof, ok := m.RequestType.(*StreamSearchRequest_Control); ok { + if err := oneof.Control.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } - b := dAtA[iNdEx] - iNdEx++ - m.Order |= Order(b&0x7F) << shift - if b < 0x80 { - break + } else { + v := &StreamControl{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.RequestType = &StreamSearchRequest_Control{Control: v} } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -9263,7 +13754,7 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { +func (m *StreamSearchQuery) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9286,17 +13777,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: StreamSearchQuery: 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: StreamSearchQuery: 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 Query", wireType) } - m.Status = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9306,14 +13797,27 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= AsyncSearchStatus(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.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex 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 From", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9340,16 +13844,16 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Response == nil { - m.Response = &SearchResponse{} + if m.From == nil { + m.From = ×tamppb.Timestamp{} } - if err := m.Response.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: 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 { @@ -9376,18 +13880,38 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(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).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + 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 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 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", 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 @@ -9397,33 +13921,29 @@ 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.ExpiresAt == nil { - m.ExpiresAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.OffsetId = string(dAtA[iNdEx:postIndex]) 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 WithTotal", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9433,33 +13953,68 @@ func (m *FetchAsyncSearchResultResponse) 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.WithTotal = 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 *StreamControl) 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: + 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: StreamControl: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamControl: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) } - m.FracsDone = 0 + m.Action = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9469,16 +14024,67 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.FracsDone |= uint64(b&0x7F) << shift + m.Action |= ControlAction(b&0x7F) << shift if b < 0x80 { break } } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", 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 *StreamSearchResponse) 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: StreamSearchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamSearchResponse: 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) } - m.FracsQueue = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9488,33 +14094,36 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.FracsQueue |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + if msglen < 0 { + return protohelpers.ErrInvalidLength } - m.DiskUsage = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.ResponseType.(*StreamSearchResponse_Header); ok { + if err := oneof.Header.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } - b := dAtA[iNdEx] - iNdEx++ - m.DiskUsage |= uint64(b&0x7F) << shift - if b < 0x80 { - break + } else { + v := &ResponseHeader{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.ResponseType = &StreamSearchResponse_Header{Header: v} } - case 9: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9541,16 +14150,23 @@ func (m *FetchAsyncSearchResultResponse) 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 + if oneof, ok := m.ResponseType.(*StreamSearchResponse_Data); ok { + if err := oneof.Data.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &ResponseData{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &StreamSearchResponse_Data{Data: v} } iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) } - m.HistogramInterval = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9560,16 +14176,89 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.HistogramInterval |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 11: + 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.(*StreamSearchResponse_Summary); ok { + if err := oneof.Summary.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &ResponseSummary{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &StreamSearchResponse_Summary{Summary: v} + } + 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 *ResponseHeader) 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: ResponseHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseHeader: 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 Typing", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9579,29 +14268,82 @@ func (m *FetchAsyncSearchResultResponse) 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]) + m.Typing = append(m.Typing, &Typing{}) + if err := m.Typing[len(m.Typing)-1].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 *Typing) 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: Typing: wiretype end group for non-group") + } + if fieldNum <= 0 { + 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 From", 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 @@ -9611,33 +14353,29 @@ 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.From == nil { - m.From = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.From).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + case 2: + 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 @@ -9647,31 +14385,65 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(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 + 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 *ResponseData) 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.To).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 14: + 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: ResponseData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseData: 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 Batch", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9698,52 +14470,13 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Retention == nil { - m.Retention = &durationpb.Duration{} + if m.Batch == nil { + m.Batch = &RecordsBatch{} } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Batch.UnmarshalVT(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 - } - } default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -9766,7 +14499,7 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *CancelAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { +func (m *RecordsBatch) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9789,17 +14522,17 @@ func (m *CancelAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CancelAsyncSearchRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RecordsBatch: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CancelAsyncSearchRequest: 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 SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9809,23 +14542,25 @@ func (m *CancelAsyncSearchRequest) 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.SearchId = string(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 @@ -9849,7 +14584,7 @@ func (m *CancelAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *CancelAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { +func (m *Record) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9872,12 +14607,44 @@ func (m *CancelAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CancelAsyncSearchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: Record: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CancelAsyncSearchResponse: 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 RawData", 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.RawData = append(m.RawData, make([]byte, postIndex-iNdEx)) + copy(m.RawData[len(m.RawData)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -9900,7 +14667,7 @@ func (m *CancelAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *DeleteAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { +func (m *ResponseSummary) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9923,17 +14690,36 @@ func (m *DeleteAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteAsyncSearchRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ResponseSummary: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResponseSummary: 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 SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -9943,23 +14729,63 @@ func (m *DeleteAsyncSearchRequest) 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.SearchId = string(dAtA[iNdEx:postIndex]) + if m.Error == nil { + m.Error = &Error{} + } + if err := m.Error.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + 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 + } + } + 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 @@ -9983,7 +14809,7 @@ func (m *DeleteAsyncSearchRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *DeleteAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { +func (m *Error) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10006,12 +14832,63 @@ func (m *DeleteAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteAsyncSearchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: Error: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Error: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + 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 2: + 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 + } + 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.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -10034,7 +14911,7 @@ func (m *DeleteAsyncSearchResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { +func (m *BulkRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10053,21 +14930,40 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { if b < 0x80 { break } - } - 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) + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BulkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BulkRequest: 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) } - var v AsyncSearchStatus + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10077,17 +14973,28 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= AsyncSearchStatus(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.Status = &v - case 2: + 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 != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10097,23 +15004,22 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVT(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 } - m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) + m.Metas = dAtA[iNdEx:postIndex] iNdEx = postIndex default: iNdEx = preIndex @@ -10137,7 +15043,7 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *GetAsyncSearchesListResponse) UnmarshalVT(dAtA []byte) error { +func (m *BinaryData) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10160,17 +15066,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: BinaryData: 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: 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 Searches", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10180,25 +15086,22 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVT(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 } - m.Searches = append(m.Searches, &AsyncSearchesListItem{}) - if err := m.Searches[len(m.Searches)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Data = dAtA[iNdEx:postIndex] iNdEx = postIndex default: iNdEx = preIndex @@ -10222,7 +15125,7 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { +func (m *AggQuery) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10245,15 +15148,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: AggQuery: 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: 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 SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10281,13 +15184,53 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SearchId = string(dAtA[iNdEx:postIndex]) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Field = stringValue iNdEx = postIndex - case 2: + 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 + } + 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 Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) } - m.Status = 0 + m.Func = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10297,16 +15240,140 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= AsyncSearchStatus(b&0x7F) << shift + m.Func |= AggFunc(b&0x7F) << shift if b < 0x80 { break } } - case 3: + 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) 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: 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 StartedAt", 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 @@ -10316,33 +15383,33 @@ func (m *AsyncSearchesListItem) 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.StartedAt == nil { - m.StartedAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.StartedAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + m.Query = stringValue iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) + 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 @@ -10352,33 +15419,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.ExpiresAt == nil { - m.ExpiresAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.ExpiresAt).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 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 @@ -10388,33 +15438,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.CanceledAt == nil { - m.CanceledAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsDone", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) } - m.FracsDone = 0 + m.Size = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10424,16 +15457,16 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.FracsDone |= uint64(b&0x7F) << shift + m.Size |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 7: + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - m.FracsQueue = 0 + m.Offset = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10443,16 +15476,16 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.FracsQueue |= uint64(b&0x7F) << shift + m.Offset |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 8: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) } - m.DiskUsage = 0 + m.Interval = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10462,16 +15495,16 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DiskUsage |= uint64(b&0x7F) << shift + m.Interval |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 9: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aggregation", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10481,31 +15514,53 @@ func (m *AsyncSearchesListItem) 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.Aggs = append(m.Aggs, &AggQuery{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + 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 HistogramInterval", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) } - m.HistogramInterval = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10515,14 +15570,15 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.HistogramInterval |= int64(b&0x7F) << shift + 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 Query", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggregationFilter", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10550,11 +15606,15 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Query = string(dAtA[iNdEx:postIndex]) + 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 From", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10581,18 +15641,16 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { 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 { + 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 != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + 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 @@ -10602,33 +15660,16 @@ func (m *AsyncSearchesListItem) 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.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) + 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 @@ -10638,33 +15679,33 @@ func (m *AsyncSearchesListItem) 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.Retention == nil { - m.Retention = &durationpb.Duration{} - } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVT(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 15: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Downsample", wireType) } - var v int + m.Downsample = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10674,17 +15715,67 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Downsample |= uint32(b&0x7F) << shift if b < 0x80 { break } } - m.WithDocs = bool(v != 0) - case 16: + 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 Size", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mid", wireType) } - m.Size = 0 + m.Mid = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10694,16 +15785,16 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Size |= int64(b&0x7F) << shift + m.Mid |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Rid", wireType) } - var stringLen uint64 + m.Rid = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10713,24 +15804,11 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Rid |= 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.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -10753,7 +15831,7 @@ func (m *AsyncSearchesListItem) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *IdWithHint) UnmarshalVT(dAtA []byte) error { +func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10776,17 +15854,17 @@ func (m *IdWithHint) UnmarshalVT(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: SearchResponse_IdWithHint: 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: 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 stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10796,25 +15874,29 @@ 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.Id = string(dAtA[iNdEx:postIndex]) + if m.Id == nil { + m.Id = &SearchResponse_Id{} + } + if err := m.Id.UnmarshalVTUnsafe(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 Hint", wireType) } @@ -10844,7 +15926,11 @@ func (m *IdWithHint) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Hint = string(dAtA[iNdEx:postIndex]) + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } + m.Hint = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -10868,7 +15954,7 @@ func (m *IdWithHint) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *FetchRequest_FieldsFilter) UnmarshalVT(dAtA []byte) error { +func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10891,17 +15977,50 @@ 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: SearchResponse_Histogram: 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: SearchResponse_Histogram: 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) + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) } - var stringLen uint64 + 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) + } + m.Total = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10911,29 +16030,16 @@ func (m *FetchRequest_FieldsFilter) 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.Fields = append(m.Fields, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) } - var v int + m.NotExists = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -10943,12 +16049,141 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.NotExists |= int64(b&0x7F) << shift if b < 0x80 { break } } - m.AllowList = bool(v != 0) + 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:]) @@ -10971,7 +16206,7 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *FetchRequest) UnmarshalVT(dAtA []byte) error { +func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10994,15 +16229,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: SearchResponse_Bin: 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: 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 Ids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11030,31 +16265,15 @@ func (m *FetchRequest) UnmarshalVT(dAtA []byte) error { 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 - } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Explain = bool(v != 0) - case 4: + m.Label = stringValue + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdsWithHints", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11081,14 +16300,16 @@ func (m *FetchRequest) UnmarshalVT(dAtA []byte) error { 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 { + if m.Ts == nil { + m.Ts = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.Ts).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 FieldsFilter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hist", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11115,84 +16336,13 @@ func (m *FetchRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.FieldsFilter == nil { - m.FieldsFilter = &FetchRequest_FieldsFilter{} + if m.Hist == nil { + m.Hist = &SearchResponse_Histogram{} } - if err := m.FieldsFilter.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Hist.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 - } - 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:]) - 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 *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 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:]) @@ -11215,7 +16365,7 @@ func (m *StatusRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *StatusResponse) UnmarshalVT(dAtA []byte) error { +func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11238,15 +16388,15 @@ func (m *StatusResponse) UnmarshalVT(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: SearchResponse_Agg: 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: 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 OldestTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Agg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11273,69 +16423,99 @@ func (m *StatusResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.OldestTime == nil { - m.OldestTime = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVT(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 *BulkRequest) 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.Agg == nil { + m.Agg = make(map[string]uint64) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + 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 + } + 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 + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BulkRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BulkRequest: 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.Agg[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AggHistogram", wireType) } - m.Count = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11345,16 +16525,130 @@ func (m *BulkRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Count |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Docs", wireType) + if msglen < 0 { + return protohelpers.ErrInvalidLength } - var byteLen int + 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 + } + 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 + } + 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 + } + } + m.AggHistogram[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + } + m.NotExists = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11364,28 +16658,16 @@ func (m *BulkRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.NotExists |= int64(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: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11395,79 +16677,31 @@ func (m *BulkRequest) 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.Metas = dAtA[iNdEx:postIndex] - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if 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 } - 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) 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: + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValuesPool", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11477,22 +16711,27 @@ func (m *BinaryData) 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.ValuesPool = append(m.ValuesPool, stringValue) iNdEx = postIndex default: iNdEx = preIndex @@ -11516,7 +16755,7 @@ func (m *BinaryData) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *AggQuery) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11539,17 +16778,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: SearchResponse: 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: 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 Data", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11559,33 +16798,28 @@ 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.Field = stringValue + m.Data = dAtA[iNdEx:postIndex] iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupBy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IdSources", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11595,33 +16829,31 @@ func (m *AggQuery) 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.IdSources = append(m.IdSources, &SearchResponse_IdWithHint{}) + if err := m.IdSources[len(m.IdSources)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.GroupBy = stringValue iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Histogram", wireType) } - m.Func = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11631,23 +16863,29 @@ func (m *AggQuery) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Func |= AggFunc(b&0x7F) << shift + msglen |= int(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 + 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 @@ -11657,150 +16895,64 @@ func (m *AggQuery) 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 - } - 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 + 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 + } } - 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) 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: 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 - } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + } 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.Query = stringValue + m.Histogram[mapkey] = mapvalue iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } - m.From = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11810,54 +16962,31 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.From |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + if msglen < 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 - } + 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) + if postIndex > l { + return io.ErrUnexpectedEOF } - 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.Aggs = append(m.Aggs, &SearchResponse_Agg{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } + iNdEx = postIndex case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) } - m.Offset = 0 + m.Total = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11867,33 +16996,14 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Offset |= int64(b&0x7F) << shift + m.Total |= uint64(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) + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11925,13 +17035,13 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Aggregation = stringValue + m.Errors = append(m.Errors, stringValue) iNdEx = postIndex - case 8: + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - var v int + m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11941,17 +17051,16 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Code |= SearchErrorCode(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) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -11961,15 +17070,82 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.WithTotal = bool(v != 0) - case 11: + 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 + 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 *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 AggregationFilter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -12001,11 +17177,11 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.AggregationFilter = stringValue + m.Message = stringValue iNdEx = postIndex - case 12: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12032,71 +17208,18 @@ func (m *SearchRequest) 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.Duration == nil { + m.Duration = &durationpb.Duration{} + } + if err := (*durationpb1.Duration)(m.Duration).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 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Order |= Order(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: + case 3: 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 - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Downsample", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Children", wireType) } - m.Downsample = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12106,11 +17229,26 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Downsample |= uint32(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.Children = append(m.Children, &ExplainEntry{}) + if err := m.Children[len(m.Children)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -12133,7 +17271,7 @@ func (m *SearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12156,36 +17294,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: StartAsyncSearchRequest: 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: StartAsyncSearchRequest: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } - m.Rid = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12195,65 +17314,31 @@ func (m *SearchResponse_Id) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Rid |= uint64(b&0x7F) << shift + stringLen |= 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 { + intStringLen := int(stringLen) + if intStringLen < 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 + postIndex := iNdEx + intStringLen + 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 + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - } - 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: + m.SearchId = stringValue + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12280,16 +17365,16 @@ func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Id == nil { - m.Id = &SearchResponse_Id{} + if m.Retention == nil { + m.Retention = &durationpb.Duration{} } - if err := m.Id.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + 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 Hint", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -12321,97 +17406,85 @@ func (m *SearchResponse_IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Hint = stringValue + m.Query = 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 + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + 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 + } } - 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 + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + 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 + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } - } - 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 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 + } } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF + if msglen < 0 { + return protohelpers.ErrInvalidLength } - 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) + postIndex := iNdEx + msglen + 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.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 + m.Aggs = append(m.Aggs, &AggQuery{}) + if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Sum = float64(math.Float64frombits(v)) - case 4: + iNdEx = postIndex + 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 @@ -12421,16 +17494,16 @@ func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Total |= int64(b&0x7F) << shift + m.HistogramInterval |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 5: + case 8: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) } - m.NotExists = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12440,140 +17513,30 @@ func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NotExists |= int64(b&0x7F) << shift + v |= 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 - 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) + m.WithDocs = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", 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 + m.Size = 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++ - } - } - 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) + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int64(b&0x7F) << shift + if b < 0x80 { + break } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) } default: iNdEx = preIndex @@ -12597,7 +17560,7 @@ func (m *SearchResponse_Histogram) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *StartAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12620,15 +17583,66 @@ func (m *SearchResponse_Bin) UnmarshalVTUnsafe(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: StartAsyncSearchResponse: 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: 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 Label", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -12660,13 +17674,13 @@ func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Label = stringValue + m.SearchId = stringValue iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) + 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 @@ -12676,33 +17690,35 @@ func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Size |= 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.Ts == nil { - m.Ts = ×tamppb.Timestamp{} - } - 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 Hist", wireType) + 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 + } } - var msglen int + 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 @@ -12712,28 +17728,11 @@ func (m *SearchResponse_Bin) UnmarshalVTUnsafe(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.Hist == nil { - m.Hist = &SearchResponse_Histogram{} - } - if err := m.Hist.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -12756,7 +17755,7 @@ func (m *SearchResponse_Bin) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12779,17 +17778,17 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(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: FetchAsyncSearchResultResponse: 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: FetchAsyncSearchResultResponse: 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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var msglen int + m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -12799,112 +17798,14 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Status |= 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.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 - } - 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 - } - } - m.Agg[mapkey] = mapvalue - 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 Response", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12931,115 +17832,18 @@ 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) + if m.Response == nil { + m.Response = &SearchResponse{} } - 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 - } - } - 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 err := m.Response.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.AggHistogram[mapkey] = mapvalue iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NotExists", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) } - m.NotExists = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13049,14 +17853,31 @@ func (m *SearchResponse_Agg) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NotExists |= 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.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 Timeseries", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13083,16 +17904,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.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 ValuesPool", 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 @@ -13102,84 +17925,52 @@ 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) + if m.CanceledAt == nil { + m.CanceledAt = ×tamppb.Timestamp{} } - m.ValuesPool = append(m.ValuesPool, stringValue) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { + if err := (*timestamppb1.Timestamp)(m.CanceledAt).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 *SearchResponse) 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 + 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: 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) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FracsQueue", wireType) } - var byteLen int + m.FracsQueue = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13189,26 +17980,33 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.FracsQueue |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) } - if postIndex > 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 + } } - m.Data = dAtA[iNdEx:postIndex] - iNdEx = postIndex - case 2: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdSources", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13235,16 +18033,35 @@ 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 { + 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 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 @@ -13254,94 +18071,31 @@ 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 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 - } + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Histogram[mapkey] = mapvalue + m.Query = stringValue iNdEx = postIndex - case 4: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13368,16 +18122,18 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Aggs = append(m.Aggs, &SearchResponse_Agg{}) - if err := m.Aggs[len(m.Aggs)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + 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 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } - m.Total = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13387,16 +18143,33 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Total |= uint64(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 Errors", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13406,33 +18179,33 @@ func (m *SearchResponse) 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.Retention == nil { + m.Retention = &durationpb.Duration{} + } + if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Errors = append(m.Errors, stringValue) iNdEx = postIndex - case 7: + case 15: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) } - m.Code = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -13442,16 +18215,17 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= SearchErrorCode(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", 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 @@ -13461,28 +18235,11 @@ func (m *SearchResponse) UnmarshalVTUnsafe(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.Explain == nil { - m.Explain = &ExplainEntry{} - } - if err := m.Explain.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -13505,7 +18262,7 @@ func (m *SearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *ExplainEntry) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *CancelAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13528,15 +18285,15 @@ 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: CancelAsyncSearchRequest: 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: 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 Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -13568,77 +18325,7 @@ func (m *ExplainEntry) UnmarshalVTUnsafe(dAtA []byte) error { 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 Duration", 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.Duration == nil { - m.Duration = &durationpb.Duration{} - } - if err := (*durationpb1.Duration)(m.Duration).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Children", 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.Children = append(m.Children, &ExplainEntry{}) - if err := m.Children[len(m.Children)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.SearchId = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -13662,7 +18349,7 @@ func (m *ExplainEntry) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *CancelAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13685,87 +18372,66 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StartAsyncSearchRequest: wiretype end group for non-group") + return fmt.Errorf("proto: CancelAsyncSearchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StartAsyncSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CancelAsyncSearchResponse: 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 + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protohelpers.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > 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 != 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 + 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 postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - if m.Retention == nil { - m.Retention = &durationpb.Duration{} - } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 3: + } + 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 Query", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -13797,138 +18463,59 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Query = stringValue + m.SearchId = 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 - } - 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 - } - } - case 6: - 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 + 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].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - 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 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.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 } - m.WithDocs = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - 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 - } + 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:]) @@ -13951,7 +18538,7 @@ func (m *StartAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *StartAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *GetAsyncSearchesListRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13961,25 +18548,81 @@ func (m *StartAsyncSearchResponse) 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: 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 + } + 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 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 } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - } - 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 { + m.Ids = append(m.Ids, stringValue) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -14002,7 +18645,7 @@ func (m *StartAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *FetchAsyncSearchResultRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *GetAsyncSearchesListResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14025,17 +18668,17 @@ 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: GetAsyncSearchesListResponse: 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: 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 SearchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14045,85 +18688,26 @@ func (m *FetchAsyncSearchResultRequest) 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.Searches = append(m.Searches, &AsyncSearchesListItem{}) + if err := m.Searches[len(m.Searches)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - 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:]) @@ -14146,7 +18730,7 @@ func (m *FetchAsyncSearchResultRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14169,17 +18753,17 @@ 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: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SearchId", wireType) } - m.Status = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14189,16 +18773,33 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= AsyncSearchStatus(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 case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var msglen int + m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -14208,28 +18809,11 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Status |= 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.Response == nil { - m.Response = &SearchResponse{} - } - if err := m.Response.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) @@ -14631,6 +19215,42 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { 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:]) @@ -14653,7 +19273,7 @@ func (m *FetchAsyncSearchResultResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *CancelAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14663,28 +19283,64 @@ func (m *CancelAsyncSearchRequest) 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: 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 + } + 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 } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - } - 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: + m.Id = stringValue + iNdEx = postIndex + 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 Hint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -14716,7 +19372,7 @@ func (m *CancelAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.SearchId = stringValue + m.Hint = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -14740,7 +19396,7 @@ func (m *CancelAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *CancelAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *FetchRequest_FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14763,12 +19419,68 @@ func (m *CancelAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CancelAsyncSearchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: FetchRequest_FieldsFilter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CancelAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FetchRequest_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) + } + 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.Fields = append(m.Fields, stringValue) + 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:]) @@ -14791,7 +19503,7 @@ func (m *CancelAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *DeleteAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14814,15 +19526,15 @@ func (m *DeleteAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteAsyncSearchRequest: wiretype end group for non-group") + return fmt.Errorf("proto: FetchRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteAsyncSearchRequest: 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 { @@ -14854,8 +19566,118 @@ func (m *DeleteAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.SearchId = stringValue + 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) + } + 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].UnmarshalVTUnsafe(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) + } + 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.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 + } + 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:]) @@ -14878,7 +19700,7 @@ func (m *DeleteAsyncSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *DeleteAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *StatusRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14901,10 +19723,10 @@ func (m *DeleteAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteAsyncSearchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteAsyncSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -14929,7 +19751,7 @@ func (m *DeleteAsyncSearchResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *GetAsyncSearchesListRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *StatusResponse) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14952,37 +19774,17 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVTUnsafe(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: StatusResponse: 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: StatusResponse: 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 Ids", 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 @@ -14992,27 +19794,27 @@ func (m *GetAsyncSearchesListRequest) 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.OldestTime == nil { + m.OldestTime = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Ids = append(m.Ids, stringValue) iNdEx = postIndex default: iNdEx = preIndex @@ -15036,7 +19838,7 @@ func (m *GetAsyncSearchesListRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *GetAsyncSearchesListResponse) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *StreamSearchRequest) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15059,15 +19861,15 @@ 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: StreamSearchRequest: 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: StreamSearchRequest: 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 Query", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15094,9 +19896,57 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVTUnsafe(dAtA []byte) error { 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 + if oneof, ok := m.RequestType.(*StreamSearchRequest_Query); ok { + if err := oneof.Query.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &StreamSearchQuery{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.RequestType = &StreamSearchRequest_Query{Query: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Control", 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 oneof, ok := m.RequestType.(*StreamSearchRequest_Control); ok { + if err := oneof.Control.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &StreamControl{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.RequestType = &StreamSearchRequest_Control{Control: v} } iNdEx = postIndex default: @@ -15121,7 +19971,7 @@ func (m *GetAsyncSearchesListResponse) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *StreamSearchQuery) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15144,15 +19994,15 @@ 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: StreamSearchQuery: 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: StreamSearchQuery: 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 Query", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -15184,66 +20034,11 @@ 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) - } - 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) + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15270,16 +20065,16 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ExpiresAt == nil { - m.ExpiresAt = ×tamppb.Timestamp{} + if m.From == nil { + m.From = ×tamppb.Timestamp{} } - if err := (*timestamppb1.Timestamp)(m.ExpiresAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.From).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 CanceledAt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15306,56 +20101,18 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.CanceledAt == nil { - m.CanceledAt = ×tamppb.Timestamp{} + if m.To == nil { + m.To = ×tamppb.Timestamp{} } - if err := (*timestamppb1.Timestamp)(m.CanceledAt).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + if err := (*timestamppb1.Timestamp)(m.To).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: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskUsage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } - m.DiskUsage = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15365,16 +20122,17 @@ 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.Explain = bool(v != 0) + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aggs", 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 @@ -15384,31 +20142,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.OffsetId = stringValue iNdEx = postIndex - case 10: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramInterval", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithTotal", wireType) } - m.HistogramInterval = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15418,16 +20178,68 @@ 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: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + m.WithTotal = 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 *StreamControl) 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: StreamControl: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamControl: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) } - var stringLen uint64 + m.Action = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15437,31 +20249,65 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Action |= ControlAction(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protohelpers.ErrInvalidLength + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protohelpers.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - var stringValue string - if intStringLen > 0 { - stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StreamSearchResponse) 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 } - m.Query = stringValue - iNdEx = postIndex - case 12: + 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: StreamSearchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15488,16 +20334,21 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { 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 + if oneof, ok := m.ResponseType.(*StreamSearchResponse_Header); ok { + if err := oneof.Header.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &ResponseHeader{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &StreamSearchResponse_Header{Header: v} } iNdEx = postIndex - case 13: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15524,16 +20375,21 @@ 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 { - return err + if oneof, ok := m.ResponseType.(*StreamSearchResponse_Data); ok { + if err := oneof.Data.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &ResponseData{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &StreamSearchResponse_Data{Data: v} } iNdEx = postIndex - case 14: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retention", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15560,57 +20416,74 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Retention == nil { - m.Retention = &durationpb.Duration{} + if oneof, ok := m.ResponseType.(*StreamSearchResponse_Summary); ok { + if err := oneof.Summary.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &ResponseSummary{} + if err := v.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ResponseType = &StreamSearchResponse_Summary{Summary: v} } - if err := (*durationpb1.Duration)(m.Retention).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithDocs", wireType) + if (skippy < 0) || (iNdEx+skippy) < 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 - } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - m.WithDocs = bool(v != 0) - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponseHeader) 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 } - 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 - } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - case 17: + 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: ResponseHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Typing", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15620,27 +20493,25 @@ 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.Typing = append(m.Typing, &Typing{}) + if err := m.Typing[len(m.Typing)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Error = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -15664,7 +20535,7 @@ func (m *AsyncSearchesListItem) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Typing) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15687,15 +20558,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: Typing: 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: 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 Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -15727,13 +20598,83 @@ func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { if intStringLen > 0 { stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } - m.Id = stringValue + m.Title = stringValue iNdEx = postIndex case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= DataType(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 *ResponseData) 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: ResponseData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hint", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Batch", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15743,27 +20684,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) + if m.Batch == nil { + m.Batch = &RecordsBatch{} + } + if err := m.Batch.UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Hint = stringValue iNdEx = postIndex default: iNdEx = preIndex @@ -15787,7 +20728,7 @@ func (m *IdWithHint) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *FetchRequest_FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *RecordsBatch) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15810,17 +20751,17 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVTUnsafe(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: RecordsBatch: 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: 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 Fields", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -15830,48 +20771,26 @@ func (m *FetchRequest_FieldsFilter) 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.Records = append(m.Records, &Record{}) + if err := m.Records[len(m.Records)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Fields = append(m.Fields, stringValue) 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:]) @@ -15894,7 +20813,7 @@ func (m *FetchRequest_FieldsFilter) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Record) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15917,17 +20836,17 @@ 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: Record: 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: 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 Ids", 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 @@ -15937,33 +20856,79 @@ func (m *FetchRequest) 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.Ids = append(m.Ids, stringValue) + m.RawData = append(m.RawData, dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + 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 *ResponseSummary) 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: ResponseSummary: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseSummary: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", 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 @@ -15973,15 +20938,14 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Total |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.Explain = bool(v != 0) - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdsWithHints", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -16008,14 +20972,16 @@ 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 { + if m.Error == nil { + m.Error = &Error{} + } + if err := m.Error.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 FieldsFilter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -16042,33 +21008,13 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.FieldsFilter == nil { - m.FieldsFilter = &FetchRequest_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 - 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:]) @@ -16091,7 +21037,7 @@ func (m *FetchRequest) UnmarshalVTUnsafe(dAtA []byte) error { } return nil } -func (m *StatusRequest) UnmarshalVTUnsafe(dAtA []byte) error { +func (m *Error) UnmarshalVTUnsafe(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16114,68 +21060,36 @@ 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: Error: 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: Error: 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 *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 + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + 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 + } } - } - 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: + 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 Message", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -16185,27 +21099,27 @@ func (m *StatusResponse) 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.OldestTime == nil { - m.OldestTime = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.OldestTime).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringValue string + if intStringLen > 0 { + stringValue = unsafe.String(&dAtA[iNdEx], intStringLen) } + m.Message = stringValue iNdEx = postIndex default: iNdEx = preIndex diff --git a/proxy/search/mock/store_api_client_mock.go b/proxy/search/mock/store_api_client_mock.go index 3f593d18c..cfb22f6f0 100644 --- a/proxy/search/mock/store_api_client_mock.go +++ b/proxy/search/mock/store_api_client_mock.go @@ -216,3 +216,23 @@ func (mr *MockStoreApiClientMockRecorder) Status(arg0, arg1 interface{}, arg2 .. varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Status", reflect.TypeOf((*MockStoreApiClient)(nil).Status), varargs...) } + +// StreamSearch mocks base method. +func (m *MockStoreApiClient) StreamSearch(arg0 context.Context, arg1 ...grpc.CallOption) (storeapi.StoreApi_StreamSearchClient, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0} + for _, a := range arg1 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StreamSearch", varargs...) + ret0, _ := ret[0].(storeapi.StoreApi_StreamSearchClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StreamSearch indicates an expected call of StreamSearch. +func (mr *MockStoreApiClientMockRecorder) StreamSearch(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0}, arg1...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamSearch", reflect.TypeOf((*MockStoreApiClient)(nil).StreamSearch), varargs...) +} diff --git a/proxy/search/stream_search.go b/proxy/search/stream_search.go new file mode 100644 index 000000000..fe60ab930 --- /dev/null +++ b/proxy/search/stream_search.go @@ -0,0 +1,447 @@ +package search + +import ( + "context" + "errors" + "fmt" + "io" + "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" +) + +type StreamSearchRequest struct { + Query string + From seq.MID + To seq.MID + Explain bool + OffsetId string + WithTotal bool + Agg *AggQuery + Order seq.DocsOrder + Size int + Offset int +} + +func (si *Ingestor) StreamSearch( + ctx context.Context, + sr *StreamSearchRequest, + tr *querytracer.Tracer, +) (query.RecordProducer, ControlBroadcaster, error) { + searchStores := si.config.HotStores + if si.config.HotReadStores != nil && len(si.config.HotReadStores.Shards) > 0 { + searchStores = si.config.HotReadStores + } + + var partialRespErr error + + streams, err := si.streamSearchStores(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 + } + metric.SearchColdTotal.Inc() + streams, err = si.streamSearchStores(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 + } + } + 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 + } + } + + broadcaster := newControlBroadcaster(streams) + producers := make([]query.RecordProducer, 0, len(streams)) + for _, s := range streams { + producers = append(producers, s) + } + + var mergedStream query.RecordProducer + if sr.Agg != nil { + mergedStream = exec.NewDistributedAggregator(producers, sr.Agg.Func) + } else { + const seqIdColIdx = 0 + mergedDocsStream := exec.NewNMergedProducers(producers, seqIdColIdx, "", query.DataTypeSeqID, sr.Order) + mergedStream = exec.NewLimiter(mergedDocsStream, uint32(sr.Size), uint32(sr.Offset)) + } + + return mergedStream, broadcaster, partialRespErr +} + +func (si *Ingestor) streamSearchStores( + ctx context.Context, + sr *StreamSearchRequest, + s *stores.Stores, + tr *querytracer.Tracer, +) ([]*StreamSearchIterator, error) { + type ShardResponse struct { + Stream *StreamSearchIterator + 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/streamSearchShard") + go func(shard []string, tr *querytracer.Tracer) { + defer wg.Done() + + stream, err := si.streamSearchShard(ctx, shard, sr, tr) + respChan <- ShardResponse{ + Stream: stream, + Err: err, + } + }(shard, searchShardTr) + } + + go func() { + wg.Wait() + close(respChan) + }() + + // earlyErr is set when a fail-fast error (old data / too many fractions hit) is observed. + // In this case we must collect and close all the streams before returning. + var earlyErr error + + streams := make([]*StreamSearchIterator, 0, len(s.Shards)) + var errs []error + for resp := range respChan { + if err := resp.Err; err != nil { + if errors.Is(err, consts.ErrIngestorQueryWantsOldData) || errors.Is(err, consts.ErrTooManyFractionsHit) { + if earlyErr == nil { + earlyErr = err + } + if resp.Stream != nil { + _ = resp.Stream.Close() + } + continue + } + errs = append(errs, err) + continue + } + streams = append(streams, resp.Stream) + } + + if earlyErr != nil { + closeStreams(streams) + return nil, earlyErr + } + + if err := util.DeduplicateErrors(errs); err != nil { + if len(streams) != 0 { + // There are errors, but some Shards returned data, so provide it to user + return streams, fmt.Errorf("%w: %s", consts.ErrPartialResponse, err) + } + return nil, err + } + + return streams, nil +} + +func (si *Ingestor) streamSearchShard( + ctx context.Context, + hosts []string, + request *StreamSearchRequest, + tr *querytracer.Tracer, +) (*StreamSearchIterator, 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) + stream, err := si.streamSearchHost(ctx, host, request, tr) + if err != nil { + if errors.Is(err, consts.ErrIngestorQueryWantsOldData) { + return nil, err + } + errs = append(errs, err) + continue + } + return stream, nil + } + + return nil, util.DeduplicateErrors(errs) +} + +func (si *Ingestor) streamSearchHost( + ctx context.Context, + host string, + request *StreamSearchRequest, + tr *querytracer.Tracer, +) (*StreamSearchIterator, error) { + client, has := si.clients[host] + if !has { + return nil, fmt.Errorf("can't fetch: no client for host %s", host) + } + + req := &storeapi.StreamSearchRequest{ + RequestType: &storeapi.StreamSearchRequest_Query{ + Query: &storeapi.StreamSearchQuery{ + Query: request.Query, + From: timestamppb.New(request.From.Time()), + To: timestamppb.New(request.To.Time()), + Explain: request.Explain, + OffsetId: request.OffsetId, + WithTotal: request.WithTotal, + }, + }, + } + + stream, err := client.StreamSearch(ctx, + grpc.MaxCallRecvMsgSize(256*int(units.MiB)), + grpc.MaxCallSendMsgSize(256*int(units.MiB)), + ) + if err != nil { + return nil, fmt.Errorf("can't open stream: %s", err.Error()) + } + + err = stream.Send(req) + if err != nil { + return nil, fmt.Errorf("can't send stream request: %s", err.Error()) + } + + msg, err := stream.Recv() + if err != nil { + return nil, err + } + + switch v := msg.ResponseType.(type) { + case *storeapi.StreamSearchResponse_Header: + return NewStreamSearchIterator(tr, v.Header, stream) + case *storeapi.StreamSearchResponse_Summary: + // The store refused the request before sending any data. + if s := v.Summary; s != nil && s.Error != nil { + return nil, storeCodeToError(s.Error.Code) + } + return nil, fmt.Errorf("can't read header: store sent summary without data") + default: + return nil, fmt.Errorf("can't read header") + } +} + +func closeStreams(streams []*StreamSearchIterator) { + for _, s := range streams { + _ = s.Close() + } +} + +// NewStreamSearchIterator reads one message ahead after the header so that a +// summary-with-error sent immediately after the header (before any data) is +// detected on the open-stream phase and can trigger fail-fast in the +// ingestor. The prefetched message is buffered in the iterator. +func NewStreamSearchIterator( + tr *querytracer.Tracer, + header *storeapi.ResponseHeader, + stream storeapi.StoreApi_StreamSearchClient, +) (*StreamSearchIterator, error) { + it := &StreamSearchIterator{tr: tr, typing: header.Typing, stream: stream} + + msg, err := stream.Recv() + if errors.Is(err, io.EOF) { + // No data and no summary: an empty result, not an error. + return it, nil + } + if err != nil { + return nil, err + } + if err := it.push(msg); err != nil { + return nil, err + } + return it, nil +} + +type StreamSearchIterator struct { + tr *querytracer.Tracer + + typing []*storeapi.Typing + stream storeapi.StoreApi_StreamSearchClient + + curBatch []*storeapi.Record + + total uint64 + err error + done bool +} + +func (it *StreamSearchIterator) Next() *query.Record { + if it.done { + return nil + } + + if len(it.curBatch) == 0 { + data, err := it.stream.Recv() + if errors.Is(err, io.EOF) { + it.done = true + return nil + } + if err != nil { + it.err = err + it.done = true + return nil + } + if err := it.push(data); err != nil { + it.err = err + it.done = true + return nil + } + if it.done { + return nil + } + } + + record := it.curBatch[0] + it.curBatch = it.curBatch[1:] + + 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) +} + +// push handles a single message received from the store stream. +func (it *StreamSearchIterator) push(msg *storeapi.StreamSearchResponse) error { + switch v := msg.ResponseType.(type) { + case *storeapi.StreamSearchResponse_Header: + // header should be sent only once + return errors.New("unexpected header message") + case *storeapi.StreamSearchResponse_Data: + it.curBatch = v.Data.GetBatch().GetRecords() + case *storeapi.StreamSearchResponse_Summary: + it.total = v.Summary.Total + if v.Summary.Explain != nil { + it.tr.AddChildWithSpan(explainEntryToTracerSpan(v.Summary.Explain)) + } + if v.Summary.Error != nil { + it.err = storeCodeToError(v.Summary.Error.Code) + } + it.done = true + } + return nil +} + +// SendControl forwards a control action to the store. It is safe to call concurrently with Recv/Next. +// Errors (e.g. the store already closed the stream) are best-effort: the caller proceeds regardless. +func (it *StreamSearchIterator) SendControl(action storeapi.ControlAction) error { + return it.stream.Send(&storeapi.StreamSearchRequest{ + RequestType: &storeapi.StreamSearchRequest_Control{ + Control: &storeapi.StreamControl{Action: action}, + }, + }) +} + +// Close releases the store stream when the iterator is discarded without being finalized. +// It is best-effort and safe to call on an already-closed stream; it must not be called concurrently with Next/Finalize. +func (it *StreamSearchIterator) Close() error { + _ = it.SendControl(storeapi.ControlAction_CANCEL) + return it.stream.CloseSend() +} + +func (it *StreamSearchIterator) Finalize() *query.Summary { + // If the stream was finalized before the data was exhausted, the store's summary may still be in flight. + // Drain the remaining messages so the store-reported summary is not lost. + if !it.done { + it.drain() + } + it.tr.Done() + return &query.Summary{Total: it.total, Err: it.err} +} + +// drain reads the store stream until the summary message (or EOF/error) is +// received, capturing the store-reported total and error. +// It must be called only after the producer has stopped calling Next concurrently. +func (it *StreamSearchIterator) drain() { + for !it.done { + msg, err := it.stream.Recv() + if errors.Is(err, io.EOF) { + it.done = true + return + } + if err != nil { + it.err = err + it.done = true + return + } + if err := it.push(msg); err != nil { + it.err = err + it.done = true + return + } + } +} + +// ControlBroadcaster fans a control action out to every store stream backing a search. +type ControlBroadcaster interface { + SendControl(storeapi.ControlAction) +} + +type controlBroadcaster struct { + streams []*StreamSearchIterator +} + +func newControlBroadcaster(streams []*StreamSearchIterator) ControlBroadcaster { + return &controlBroadcaster{streams: streams} +} + +func (b *controlBroadcaster) SendControl(action storeapi.ControlAction) { + for _, s := range b.streams { + // Best-effort: a store that already terminated the stream returns an + // error here, which we intentionally ignore. + _ = s.SendControl(action) + } +} + +func storeCodeToError(code storeapi.SearchErrorCode) error { + switch code { + case storeapi.SearchErrorCode_NO_ERROR: + return nil + case storeapi.SearchErrorCode_INGESTOR_QUERY_WANTS_OLD_DATA: + return fmt.Errorf("hot store refuses: %w", consts.ErrIngestorQueryWantsOldData) + case storeapi.SearchErrorCode_TOO_MANY_FIELD_TOKENS: + return fmt.Errorf("store forbids aggregation request: %w", consts.ErrTooManyFieldTokens) + case storeapi.SearchErrorCode_TOO_MANY_FIELD_VALUES: + return fmt.Errorf("store forbids aggregation request: %w", consts.ErrTooManyFieldValues) + case storeapi.SearchErrorCode_TOO_MANY_GROUP_TOKENS: + return fmt.Errorf("store forbids aggregation request: %w", consts.ErrTooManyGroupTokens) + case storeapi.SearchErrorCode_TOO_MANY_FRACTION_TOKENS: + return fmt.Errorf("store forbids aggregation request: %w", consts.ErrTooManyFractionTokens) + case storeapi.SearchErrorCode_MEMORY_LIMIT_EXCEEDED: + return fmt.Errorf("store forbids search request: %w", consts.ErrMemoryLimitExceeded) + case storeapi.SearchErrorCode_TOO_MANY_FRACTIONS_HIT: + return fmt.Errorf("store forbids request: %w", consts.ErrTooManyFractionsHit) + default: + return fmt.Errorf("unknown store error code: %s", code.String()) + } +} diff --git a/proxyapi/grpc_stream_search.go b/proxyapi/grpc_stream_search.go index 325a797c0..1501eac83 100644 --- a/proxyapi/grpc_stream_search.go +++ b/proxyapi/grpc_stream_search.go @@ -2,25 +2,29 @@ package proxyapi import ( "context" - "encoding/binary" "errors" "fmt" "io" - "math" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "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/pkg/storeapi" "github.com/ozontech/seq-db/proxy/search" + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/query/encoding" "github.com/ozontech/seq-db/querytracer" "github.com/ozontech/seq-db/seq" + "github.com/ozontech/seq-db/util" ) // streamSearchBatchSize limits the number of records sent in a single // StreamSearchResponse data message. -const streamSearchBatchSize = 50 +const streamSearchBatchSize = 100 // controlOutcome describes how the data streaming phase ended. type controlOutcome int @@ -38,7 +42,7 @@ func (g *grpcV1) StreamSearch(stream seqproxyapi.SeqProxyApi_StreamSearchServer) // The first message must carry the search query. req, err := stream.Recv() if err == io.EOF { - return nil // Client closed the stream gracefully. + return nil } if err != nil { return err @@ -48,27 +52,34 @@ func (g *grpcV1) StreamSearch(stream seqproxyapi.SeqProxyApi_StreamSearchServer) return status.Error(codes.InvalidArgument, "first message must be a search query") } - proxyReq, err := buildProxyReq(q) + searchReq, err := buildSearchReq(q) if err != nil { return status.Error(codes.InvalidArgument, fmt.Sprintf("error parsing query: %s", err.Error())) } - if proxyReq.Size <= 0 && len(proxyReq.Aggs) == 0 { - return status.Error(codes.InvalidArgument, `one of "limit" or "stats" must be provided`) - } - if len(proxyReq.Aggs) > 1 { - return status.Error(codes.InvalidArgument, `must be only one aggregation`) + + if searchReq.Agg != nil && (searchReq.Agg.Func == seq.AggFuncQuantile || searchReq.Agg.Func == seq.AggFuncUniqueCount) { + // TODO: support all agg funcs + return status.Error(codes.InvalidArgument, `unsupported aggregate function`) } tr := querytracer.New(q.Explain, "proxy/StreamSearch") - sResp, err := g.doSearch(ctx, proxyReq, true, false, tr) + + var partialErr error + storesStream, broadcaster, err := g.searchIngestor.StreamSearch(ctx, searchReq, tr) if err != nil { - return err - } - if sResp.err != nil && sResp.err.Code == seqproxyapi.ErrorCode_ERROR_CODE_PARTIAL_RESPONSE && shouldFailPartialResponse(ctx) { - return status.Error(codes.Internal, "partial response: not all shards returned results") - } - if sResp.err != nil && !shouldHaveResponse(sResp.err.Code) { - return errors.New(sResp.err.Message) + // The stores were not opened or failed to open, cancel any that may have started before propagating the error. + if broadcaster != nil { + broadcaster.SendControl(storeapi.ControlAction_CANCEL) + } + if errors.Is(err, consts.ErrPartialResponse) { + if shouldFailPartialResponse(ctx) { + return status.Error(codes.Internal, "partial response: not all shards returned results") + } + partialErr = err + metric.SearchPartial.Inc() + } else { + return status.Error(codes.Internal, err.Error()) + } } // Read control messages from the client concurrently with sending data. @@ -80,8 +91,7 @@ func (g *grpcV1) StreamSearch(stream seqproxyapi.SeqProxyApi_StreamSearchServer) for { msg, err := stream.Recv() if err != nil { - // io.EOF or any read error means the client is done. Signal it - // and stop reading. + // io.EOF or any read error means the client is done. Signal it and stop reading select { case recvErrCh <- err: case <-ctx.Done(): @@ -99,40 +109,84 @@ func (g *grpcV1) StreamSearch(stream seqproxyapi.SeqProxyApi_StreamSearchServer) } }() - var outcome controlOutcome - if len(proxyReq.Aggs) > 0 { - outcome, err = g.streamSearchAggs(stream, proxyReq.Aggs, sResp, tr, controlCh, recvErrCh, ctx) + var typing []*seqproxyapi.Typing + var toRecord func(*query.Record) *seqproxyapi.Record + if searchReq.Agg != nil { + typing = aggsTyping() + toRecord = aggToRecord } else { - outcome, err = g.streamSearchDocs(stream, sResp, controlCh, recvErrCh, ctx) + typing = docsTyping() + toRecord = docToRecord } + outcome, err := g.streamSearchRecords(stream, storesStream, typing, toRecord, controlCh, recvErrCh, ctx) if err != nil { + // Streaming failed: cancel the stores so they stop producing. + broadcaster.SendControl(storeapi.ControlAction_CANCEL) return err } // CANCEL: terminate immediately, no summary. if outcome == outcomeCancel { + broadcaster.SendControl(storeapi.ControlAction_CANCEL) return nil } - // FINALIZE or data exhausted without an explicit control action: send the - // summary. - summary := &seqproxyapi.ResponseSummary{Total: sResp.qpr.Total} - if sResp.err != nil { - summary.Error = sResp.err - } else { - summary.Error = &seqproxyapi.Error{Code: seqproxyapi.ErrorCode_ERROR_CODE_NO} + // FINALIZE or data exhausted without an explicit control action: send the summary gathered from the store stream. + broadcaster.SendControl(storeapi.ControlAction_FINALIZE) + summary := storesStream.Finalize() + if summary == nil { + summary = &query.Summary{} + } + if partialErr != nil && summary.Err == nil { + summary.Err = partialErr + } + return g.sendSummary(stream, summary, tr, q.Explain) +} + +func (g *grpcV1) sendSummary( + stream seqproxyapi.SeqProxyApi_StreamSearchServer, + meta *query.Summary, + tr *querytracer.Tracer, + explain bool, +) error { + summary := &seqproxyapi.ResponseSummary{ + Error: &seqproxyapi.Error{Code: seqproxyapi.ErrorCode_ERROR_CODE_NO}, + } + + if meta != nil { + summary.Total = meta.Total + if meta.Err != nil { + summary.Error = &seqproxyapi.Error{ + Code: mapProxyErrorCode(meta.Err), + Message: meta.Err.Error(), + } + } + } + + if explain { + tr.Done() + summary.Explain = tracerSpanToExplainEntry(tr.ToSpan()) } - tr.Done() - summary.Explain = tracerSpanToExplainEntry(tr.ToSpan()) + if err := stream.Send(&seqproxyapi.StreamSearchResponse{ ResponseType: &seqproxyapi.StreamSearchResponse_Summary{Summary: summary}, }); err != nil { return status.Errorf(codes.Internal, "failed to send summary: %v", err) } - return nil } +func mapProxyErrorCode(err error) seqproxyapi.ErrorCode { + switch { + case errors.Is(err, consts.ErrIngestorQueryWantsOldData): + return seqproxyapi.ErrorCode_ERROR_CODE_PARTIAL_RESPONSE + case errors.Is(err, consts.ErrTooManyFractionsHit): + return seqproxyapi.ErrorCode_ERROR_CODE_TOO_MANY_FRACTIONS_HIT + default: + return seqproxyapi.ErrorCode_ERROR_CODE_UNSPECIFIED + } +} + // checkControl peeks at the control/recv channels without blocking. It returns // ok=true when the caller should stop streaming (a control action arrived or // the client disconnected). @@ -142,12 +196,21 @@ func checkControl( ctx context.Context, ) (controlOutcome, bool) { select { - case c := <-controlCh: + case c, ok := <-controlCh: + if !ok { + return outcomeNone, false + } if c.GetAction() == seqproxyapi.ControlAction_CANCEL { return outcomeCancel, true } return outcomeFinalize, true - case <-recvErrCh: + case err, ok := <-recvErrCh: + if !ok { + return outcomeNone, false + } + if errors.Is(err, io.EOF) { + return outcomeNone, false + } return outcomeCancel, true case <-ctx.Done(): return outcomeCancel, true @@ -156,16 +219,16 @@ func checkControl( } } -// streamSearchDocs streams matched documents as batches of records. Each record -// carries three columns: id (SEQ_ID), time (UINT64 nanoseconds) and data (RAW_DOCUMENT). -func (g *grpcV1) streamSearchDocs( +func (g *grpcV1) streamSearchRecords( stream seqproxyapi.SeqProxyApi_StreamSearchServer, - sResp *proxySearchResponse, + storesStream query.RecordProducer, + typing []*seqproxyapi.Typing, + toRecord func(*query.Record) *seqproxyapi.Record, controlCh <-chan *seqproxyapi.StreamControl, recvErrCh <-chan error, ctx context.Context, ) (controlOutcome, error) { - header := &seqproxyapi.ResponseHeader{Typing: docsTyping()} + header := &seqproxyapi.ResponseHeader{Typing: typing} if err := stream.Send(&seqproxyapi.StreamSearchResponse{ ResponseType: &seqproxyapi.StreamSearchResponse_Header{Header: header}, }); err != nil { @@ -173,60 +236,15 @@ func (g *grpcV1) streamSearchDocs( } var batch []*seqproxyapi.Record - for doc, err := sResp.docsStream.Next(); err == nil; doc, err = sResp.docsStream.Next() { - batch = append(batch, docToRecord(doc)) + for doc := storesStream.Next(); doc != nil; doc = storesStream.Next() { + batch = append(batch, toRecord(doc)) if len(batch) >= streamSearchBatchSize { if err := sendRecords(stream, batch); err != nil { return outcomeNone, err } batch = batch[:0] - if outcome, stop := checkControl(controlCh, recvErrCh, ctx); stop { - return outcome, nil - } - } - } - if len(batch) > 0 { - if err := sendRecords(stream, batch); err != nil { - return outcomeNone, err - } - } - return outcomeNone, nil -} - -// streamSearchAggs streams aggregation buckets as batches of records. Each -// record carries two columns: key (STRING) and value (FLOAT64). -func (g *grpcV1) streamSearchAggs( - stream seqproxyapi.SeqProxyApi_StreamSearchServer, - aggs []*seqproxyapi.AggQuery, - sResp *proxySearchResponse, - tr *querytracer.Tracer, - controlCh <-chan *seqproxyapi.StreamControl, - recvErrCh <-chan error, - ctx context.Context, -) (controlOutcome, error) { - header := &seqproxyapi.ResponseHeader{Typing: aggsTyping()} - if err := stream.Send(&seqproxyapi.StreamSearchResponse{ - ResponseType: &seqproxyapi.StreamSearchResponse_Header{Header: header}, - }); err != nil { - return outcomeNone, status.Errorf(codes.Internal, "failed to send header: %v", err) - } - - aggTr := tr.NewChild("aggregate") - allAggregations := sResp.qpr.Aggregate(aggregationArgsFromProto(aggs)) - aggTr.Done() - - var batch []*seqproxyapi.Record - for _, agg := range allAggregations { - for _, item := range agg.Buckets { - batch = append(batch, aggBucketToRecord(item)) - if len(batch) >= streamSearchBatchSize { - if err := sendRecords(stream, batch); err != nil { - return outcomeNone, err - } - batch = batch[:0] - if outcome, stop := checkControl(controlCh, recvErrCh, ctx); stop { - return outcome, nil - } + if curOutcome, stop := checkControl(controlCh, recvErrCh, ctx); stop { + return curOutcome, nil } } } @@ -235,7 +253,7 @@ func (g *grpcV1) streamSearchAggs( return outcomeNone, err } } - return outcomeNone, nil + return outcomeFinalize, nil } func sendRecords(stream seqproxyapi.SeqProxyApi_StreamSearchServer, records []*seqproxyapi.Record) error { @@ -250,26 +268,6 @@ func sendRecords(stream seqproxyapi.SeqProxyApi_StreamSearchServer, records []*s return nil } -func docToRecord(doc search.StreamingDoc) *seqproxyapi.Record { - return &seqproxyapi.Record{ - RawData: [][]byte{ - []byte(doc.ID.String()), - Uint64ToBytes(uint64(doc.ID.MID)), - doc.Data, - }, - } -} - -func aggBucketToRecord(aggBucket seq.AggregationBucket) *seqproxyapi.Record { - return &seqproxyapi.Record{ - RawData: [][]byte{ - []byte(aggBucket.Name), - Uint64ToBytes(math.Float64bits(aggBucket.Value)), - Uint64ToBytes(uint64(aggBucket.MID)), - }, - } -} - // hardcoded schema func docsTyping() []*seqproxyapi.Typing { return []*seqproxyapi.Typing{ @@ -288,80 +286,116 @@ func aggsTyping() []*seqproxyapi.Typing { } } -func buildProxyReq(q *seqproxyapi.StreamSearchQuery) (*seqproxyapi.ComplexSearchRequest, error) { +// converts *query.Record to *seqproxyapi.Record according to hardcoded schemas from both store and proxy +func docToRecord(r *query.Record) *seqproxyapi.Record { + id := r.Vals[0].Decoded().(seq.ID) + + return &seqproxyapi.Record{ + RawData: [][]byte{ + []byte(id.String()), // id + encoding.Uint64ToBytes(uint64(id.MID)), // time + r.Vals[1].RawData(), // data + }, + } +} + +// converts *query.Record to *seqproxyapi.Record according to hardcoded schemas from both store and proxy +func aggToRecord(r *query.Record) *seqproxyapi.Record { + return &seqproxyapi.Record{ + RawData: [][]byte{ + r.Vals[0].RawData(), // key + r.Vals[1].RawData(), // value + r.Vals[2].RawData(), // ts + }, + } +} + +func buildSearchReq(q *seqproxyapi.StreamSearchQuery) (*search.StreamSearchRequest, error) { seqql, err := parser.ParseSeqQL(q.Query, nil) if err != nil { return nil, err } - proxyReq := &seqproxyapi.ComplexSearchRequest{ - Query: &seqproxyapi.SearchQuery{ - Query: q.Query, - From: q.From, - To: q.To, - Explain: q.Explain, - }, + streamSearchReq := &search.StreamSearchRequest{ + Query: q.Query, + From: seq.TimeToMID(q.From.AsTime()), + To: seq.TimeToMID(q.To.AsTime()), + Explain: q.Explain, WithTotal: q.WithTotal, OffsetId: q.OffsetId, } + var ( + hasStatsPipe bool + hasOtherPipes bool + ) + for _, pipe := range seqql.Pipes { switch p := pipe.(type) { case *parser.PipeLimit: - proxyReq.Size = int64(p.Limit) + streamSearchReq.Size = p.Limit + hasOtherPipes = true case *parser.PipeOffset: - proxyReq.Offset = int64(p.Offset) + streamSearchReq.Offset = p.Offset + hasOtherPipes = true case *parser.PipeSort: - order := seqproxyapi.Order_ORDER_DESC + order := seq.DocsOrderDesc if p.Order == "asc" { - order = seqproxyapi.Order_ORDER_ASC + order = seq.DocsOrderAsc } - proxyReq.Order = order + streamSearchReq.Order = order + hasOtherPipes = true + case *parser.PipeFilter, *parser.PipeFields: + hasOtherPipes = true case *parser.PipeStats: agg := p.Agg - proxyReqAgg := &seqproxyapi.AggQuery{ + proxyReqAgg := &search.AggQuery{ Field: agg.Field, GroupBy: agg.GroupBy, Func: mustConvertStringToAggFunc(agg.Func), Quantiles: agg.Quantiles, } if agg.Interval != "" { - proxyReqAgg.Interval = &agg.Interval + interval, err := util.ParseDuration(agg.Interval) + if err != nil { + return nil, fmt.Errorf("failed to parse interval: %w", err) + } + proxyReqAgg.Interval = seq.DurationToMID(interval) } - proxyReq.Aggs = append(proxyReq.Aggs, proxyReqAgg) + streamSearchReq.Agg = proxyReqAgg + hasStatsPipe = true default: continue } } - return proxyReq, nil + // for now we don't allow to combine stats with other pipes + if hasStatsPipe && hasOtherPipes { + return nil, errors.New("must be no other pipes if `stats` is present") + } + + return streamSearchReq, nil } -func mustConvertStringToAggFunc(funcName string) seqproxyapi.AggFunc { +func mustConvertStringToAggFunc(funcName string) seq.AggFunc { switch funcName { case "count": - return seqproxyapi.AggFunc_AGG_FUNC_COUNT + return seq.AggFuncCount case "sum": - return seqproxyapi.AggFunc_AGG_FUNC_SUM + return seq.AggFuncSum case "min": - return seqproxyapi.AggFunc_AGG_FUNC_MIN + return seq.AggFuncMin case "max": - return seqproxyapi.AggFunc_AGG_FUNC_MAX + return seq.AggFuncMax case "avg": - return seqproxyapi.AggFunc_AGG_FUNC_AVG + return seq.AggFuncAvg case "quantile": - return seqproxyapi.AggFunc_AGG_FUNC_QUANTILE + return seq.AggFuncQuantile case "unique": - return seqproxyapi.AggFunc_AGG_FUNC_UNIQUE + return seq.AggFuncUnique case "unique_count": - return seqproxyapi.AggFunc_AGG_FUNC_UNIQUE_COUNT + return seq.AggFuncUniqueCount default: panic(fmt.Errorf("unknown aggregation function: %s", funcName)) } } - -func Uint64ToBytes(val uint64) []byte { - b := make([]byte, 8) - binary.LittleEndian.PutUint64(b, val) - return b -} diff --git a/proxyapi/grpc_v1.go b/proxyapi/grpc_v1.go index cb54064a2..d3c4201e7 100644 --- a/proxyapi/grpc_v1.go +++ b/proxyapi/grpc_v1.go @@ -25,6 +25,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" @@ -32,6 +33,7 @@ import ( type SearchIngestor interface { Search(ctx context.Context, sr *search.SearchRequest, tr *querytracer.Tracer) (*seq.QPR, search.DocsIterator, time.Duration, error) + StreamSearch(ctx context.Context, sr *search.StreamSearchRequest, tr *querytracer.Tracer) (query.RecordProducer, search.ControlBroadcaster, error) Documents(ctx context.Context, r search.FetchRequest) (search.DocsIterator, error) Status(ctx context.Context) *search.IngestorStatus StartAsyncSearch(context.Context, search.AsyncRequest) (search.AsyncResponse, error) diff --git a/proxyapi/mock/grpc_v1.go b/proxyapi/mock/grpc_v1.go index c178291fa..ab6e1aea1 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" ) @@ -161,6 +162,22 @@ func (mr *MockSearchIngestorMockRecorder) Status(ctx interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Status", reflect.TypeOf((*MockSearchIngestor)(nil).Status), ctx) } +// StreamSearch mocks base method. +func (m *MockSearchIngestor) StreamSearch(ctx context.Context, sr *search.StreamSearchRequest, tr *querytracer.Tracer) (query.RecordProducer, search.ControlBroadcaster, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "StreamSearch", ctx, sr, tr) + ret0, _ := ret[0].(query.RecordProducer) + ret1, _ := ret[1].(search.ControlBroadcaster) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// StreamSearch indicates an expected call of StreamSearch. +func (mr *MockSearchIngestorMockRecorder) StreamSearch(ctx, sr, tr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamSearch", reflect.TypeOf((*MockSearchIngestor)(nil).StreamSearch), ctx, sr, tr) +} + // MockMappingProvider is a mock of MappingProvider interface. type MockMappingProvider struct { ctrl *gomock.Controller diff --git a/query/encoding/encoding.go b/query/encoding/encoding.go new file mode 100644 index 000000000..21da3b4cc --- /dev/null +++ b/query/encoding/encoding.go @@ -0,0 +1,79 @@ +package encoding + +import ( + "encoding/binary" + "math" + + "github.com/ozontech/seq-db/seq" + "github.com/ozontech/seq-db/util" +) + +// TODO: use buffer pools (???) + +func StringToBytes(val string) []byte { + return util.StringToByteUnsafe(val) +} + +func StringFromBytes(val []byte) string { + return string(val) +} + +func SeqIDToBytes(id seq.ID) []byte { + b := make([]byte, 16) + binary.LittleEndian.PutUint64(b[:8], uint64(id.MID)) + binary.LittleEndian.PutUint64(b[8:], uint64(id.RID)) + return b +} + +func SeqIDFromBytes(b []byte) seq.ID { + return seq.ID{ + MID: seq.MID(binary.LittleEndian.Uint64(b[:8])), + RID: seq.RID(binary.LittleEndian.Uint64(b[8:])), + } +} + +func Uint64ToBytes(val uint64) []byte { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, val) + return b +} + +func Uint64FromBytes(b []byte) uint64 { + return binary.LittleEndian.Uint64(b) +} + +func Uint32ToBytes(val uint32) []byte { + b := make([]byte, 4) + binary.LittleEndian.PutUint32(b, val) + return b +} + +func Uint32FromBytes(b []byte) uint32 { + return binary.LittleEndian.Uint32(b) +} + +func Int64ToBytes(val int64) []byte { + return Uint64ToBytes(uint64(val)) +} + +func Int64FromBytes(b []byte) int64 { + return int64(binary.LittleEndian.Uint64(b)) +} + +func Int32ToBytes(val int32) []byte { + return Uint32ToBytes(uint32(val)) +} + +func Int32FromBytes(b []byte) int32 { + return int32(binary.LittleEndian.Uint32(b)) +} + +func Float64ToBytes(val float64) []byte { + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, math.Float64bits(val)) + return b +} + +func Float64FromBytes(b []byte) float64 { + return math.Float64frombits(binary.LittleEndian.Uint64(b)) +} diff --git a/query/encoding/encoding_test.go b/query/encoding/encoding_test.go new file mode 100644 index 000000000..fba6b8405 --- /dev/null +++ b/query/encoding/encoding_test.go @@ -0,0 +1,117 @@ +package encoding + +import ( + "math" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/seq" +) + +func TestString(t *testing.T) { + values := []string{ + "", + "hello", + "привет", + "service-a", + "46e48be997010000-e70163d0fa7582e4", + } + for _, v := range values { + assert.Equal(t, v, StringFromBytes(StringToBytes(v))) + } +} + +func TestSeqID(t *testing.T) { + values := []seq.ID{ + {}, + {MID: 1, RID: 0}, + {MID: 0, RID: 1}, + {MID: math.MaxUint64, RID: math.MaxUint64}, + {MID: 0x46e48be997010000, RID: 0xe70163d0fa7582e4}, + } + for _, v := range values { + assert.Equal(t, v, SeqIDFromBytes(SeqIDToBytes(v))) + } +} + +func TestUint64(t *testing.T) { + values := []uint64{ + 0, + 1, + 42, + math.MaxUint32, + math.MaxUint64, + 0x46e48be997010000, + } + for _, v := range values { + assert.Equal(t, v, Uint64FromBytes(Uint64ToBytes(v))) + } +} + +func TestUint32(t *testing.T) { + values := []uint32{ + 0, + 1, + 42, + math.MaxUint16, + math.MaxUint32, + } + for _, v := range values { + assert.Equal(t, v, Uint32FromBytes(Uint32ToBytes(v))) + } +} + +func TestInt64(t *testing.T) { + values := []int64{ + math.MinInt64, + -1, + 0, + 1, + math.MaxInt64, + 0x46e48be997010000, + } + for _, v := range values { + assert.Equal(t, v, Int64FromBytes(Int64ToBytes(v))) + } +} + +func TestInt32(t *testing.T) { + values := []int32{ + math.MinInt32, + -1, + 0, + 1, + math.MaxInt32, + } + for _, v := range values { + assert.Equal(t, v, Int32FromBytes(Int32ToBytes(v))) + } +} + +func TestFloat64(t *testing.T) { + values := []float64{ + 0, + 1, + -1, + 42.5, + math.Pi, + math.MaxFloat64, + math.SmallestNonzeroFloat64, + -math.MaxFloat64, + } + for _, v := range values { + assert.Equal(t, v, Float64FromBytes(Float64ToBytes(v))) + } +} + +// TestEncodedByteLengths verifies that each encoder produces the expected +// fixed-size buffer, since the decoders read that many bytes unguarded. +func TestEncodedByteLengths(t *testing.T) { + assert.Len(t, SeqIDToBytes(seq.ID{MID: 1, RID: 2}), 16, "SeqID") + assert.Len(t, Uint64ToBytes(1), 8, "Uint64") + assert.Len(t, Uint32ToBytes(1), 4, "Uint32") + assert.Len(t, Int64ToBytes(1), 8, "Int64") + assert.Len(t, Int32ToBytes(1), 4, "Int32") + assert.Len(t, Float64ToBytes(1), 8, "Float64") +} diff --git a/query/exec/aggregator.go b/query/exec/aggregator.go new file mode 100644 index 000000000..60f594bd3 --- /dev/null +++ b/query/exec/aggregator.go @@ -0,0 +1,188 @@ +package exec + +import ( + "cmp" + "fmt" + "slices" + + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/query/encoding" + "github.com/ozontech/seq-db/seq" +) + +type ExecutorState byte + +const ( + ExecutorStateReadingInput ExecutorState = iota + ExecutorStateProcessingData + ExecutorStateProducingOutput + ExecutorStateDone +) + +// aggKey identifies a single timeseries bin: the grouping token plus the +// (floored) timestamp. ts is 0 (DummyMID) for non-timeseries aggregations, so +// all samples for the same token collapse into one bucket. +type aggKey struct { + token string + ts uint64 +} + +type AggSamples struct { + Min float64 + Max float64 + Sum float64 + Total uint64 +} + +type DistributedAggregator struct { + state ExecutorState + inputs []query.RecordProducer + + aggFunc seq.AggFunc + + buckets map[aggKey]AggSamples + sortingBuf []*query.Record + + curIdx int + // err holds the first error encountered while reading the inputs. It is + // reported via Finalize. + err error +} + +func NewDistributedAggregator( + inputs []query.RecordProducer, + aggFunc seq.AggFunc, +) *DistributedAggregator { + return &DistributedAggregator{ + inputs: inputs, + aggFunc: aggFunc, + buckets: make(map[aggKey]AggSamples), + sortingBuf: make([]*query.Record, 0), + } +} + +func (a *DistributedAggregator) Next() *query.Record { + if a.state == ExecutorStateReadingInput { + // TODO: read from all inputs simultaneously (???) + for _, input := range a.inputs { + for { + r := input.Next() + if r == nil { + break + } + + key := aggKey{ + token: r.Vals[0].Decoded().(string), + ts: r.Vals[6].Decoded().(uint64), + } + 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 key, 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(key.token)), + query.NewRecordVals(query.DataTypeFloat64, encoding.Float64ToBytes(value)), + query.NewRecordVals(query.DataTypeUint64, encoding.Uint64ToBytes(key.ts)), + })) + } + + sortBuckets(a.aggFunc, a.sortingBuf) + a.state = ExecutorStateProducingOutput + } + + if a.curIdx >= len(a.sortingBuf) { + a.state = ExecutorStateDone + return nil + } + + r := a.sortingBuf[a.curIdx] + a.curIdx++ + + return r +} + +func (a *DistributedAggregator) Finalize() *query.Summary { + var total uint64 + var firstErr error + for _, i := range a.inputs { + s := i.Finalize() + if s == nil { + continue + } + total += s.Total + if firstErr == nil && s.Err != nil { + firstErr = s.Err + } + } + if firstErr == nil { + firstErr = a.err + } + return &query.Summary{Total: total, Err: firstErr} +} + +func sortBuckets(aggFunc seq.AggFunc, buckets []*query.Record) { + // ts (Vals[2]) is the primary key (ASC), matching seq/qpr.go sortBuckets + // where MID comes first. Within the same ts buckets are ordered by value. + sortByTsValueDescNameAsc := func(left, right *query.Record) int { + return cmp.Or( + cmp.Compare(left.Vals[2].Decoded().(uint64), right.Vals[2].Decoded().(uint64)), + cmp.Compare(right.Vals[1].Decoded().(float64), left.Vals[1].Decoded().(float64)), + cmp.Compare(left.Vals[0].Decoded().(string), right.Vals[0].Decoded().(string)), + ) + } + + sortByTsValueNameAsc := func(left, right *query.Record) int { + return cmp.Or( + cmp.Compare(left.Vals[2].Decoded().(uint64), right.Vals[2].Decoded().(uint64)), + 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 := sortByTsValueDescNameAsc + + if aggFunc == seq.AggFuncMin { + // Sort the MIN aggregation result in ascending order. + sortFunc = sortByTsValueNameAsc + } + + slices.SortFunc(buckets, sortFunc) +} diff --git a/query/exec/aggregator_test.go b/query/exec/aggregator_test.go new file mode 100644 index 000000000..fb075ea69 --- /dev/null +++ b/query/exec/aggregator_test.go @@ -0,0 +1,257 @@ +package exec + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/query/encoding" + "github.com/ozontech/seq-db/seq" +) + +func TestDistributedAggregator_Count(t *testing.T) { + records1 := []*query.Record{ + makeAggInputRecord("key1", 10.0, 10.0, 10.0, 1, 0), + makeAggInputRecord("key2", 20.0, 20.0, 20.0, 1, 0), + } + + records2 := []*query.Record{ + makeAggInputRecord("key1", 30.0, 30.0, 30.0, 1, 0), + makeAggInputRecord("key2", 40.0, 40.0, 40.0, 1, 0), + } + + 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{ + makeAggInputRecord("key1", 10.0, 10.0, 10.0, 1, 0), + makeAggInputRecord("key2", 30.0, 30.0, 30.0, 1, 0), + } + + records2 := []*query.Record{ + makeAggInputRecord("key1", 20.0, 20.0, 20.0, 1, 0), + makeAggInputRecord("key2", 40.0, 40.0, 40.0, 1, 0), + } + + 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{ + makeAggInputRecord("key1", 30.0, 30.0, 30.0, 1, 0), + makeAggInputRecord("key2", 20.0, 20.0, 20.0, 1, 0), + } + + records2 := []*query.Record{ + makeAggInputRecord("key1", 10.0, 10.0, 10.0, 1, 0), + makeAggInputRecord("key2", 40.0, 40.0, 40.0, 1, 0), + } + + 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{ + makeAggInputRecord("key1", 10.0, 10.0, 10.0, 1, 0), + makeAggInputRecord("key2", 30.0, 30.0, 30.0, 1, 0), + } + + records2 := []*query.Record{ + makeAggInputRecord("key1", 50.0, 50.0, 50.0, 1, 0), + makeAggInputRecord("key2", 20.0, 20.0, 20.0, 1, 0), + } + + 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{ + makeAggInputRecord("key1", 10.0, 10.0, 10.0, 1, 0), + makeAggInputRecord("key2", 20.0, 20.0, 20.0, 1, 0), + } + + records2 := []*query.Record{ + makeAggInputRecord("key1", 30.0, 30.0, 30.0, 1, 0), + makeAggInputRecord("key2", 40.0, 40.0, 40.0, 1, 0), + } + + 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 TestDistributedAggregatorSumTimeseries(t *testing.T) { + const ts1, ts2 uint64 = 1_000_000_000, 2_000_000_000 + in1 := &testProducer{data: []*query.Record{ + makeAggInputRecord("foo", 2, 2, 2, 1, ts1), + makeAggInputRecord("foo", 3, 3, 3, 1, ts2), + makeAggInputRecord("bar", 5, 5, 5, 1, ts1), + }} + in2 := &testProducer{data: []*query.Record{ + makeAggInputRecord("foo", 4, 4, 4, 1, ts1), // same bin as in1[0] -> merged sum 6 + makeAggInputRecord("baz", 7, 7, 7, 1, ts2), + }} + + a := NewDistributedAggregator([]query.RecordProducer{in1, in2}, seq.AggFuncSum) + got := decodeAggOutputs(t, a) + + // Sorted by ts ASC, then value DESC, then name ASC. + want := []aggOutput{ + {"foo", 6, ts1}, // 2 + 4 + {"bar", 5, ts1}, + {"baz", 7, ts2}, + {"foo", 3, ts2}, + } + assert.Equal(t, want, got) +} + +// TestDistributedAggregatorMinMergeAcrossShards checks that min/max are reduced +// across shards sharing a bin and that Min sorts ascending by value. +func TestDistributedAggregatorMinMergeAcrossShards(t *testing.T) { + const ts uint64 = 0 // no interval: all samples collapse into ts=0 + in1 := &testProducer{data: []*query.Record{ + makeAggInputRecord("a", 5, 50, 0, 1, ts), + makeAggInputRecord("b", 1, 10, 0, 1, ts), + }} + in2 := &testProducer{data: []*query.Record{ + makeAggInputRecord("a", 2, 60, 0, 1, ts), // min(5,2)=2, max(50,60)=60 + makeAggInputRecord("c", 9, 9, 0, 1, ts), + }} + + a := NewDistributedAggregator([]query.RecordProducer{in1, in2}, seq.AggFuncMin) + got := decodeAggOutputs(t, a) + + // Same ts (0); Min sorts by value ASC, then name ASC. + want := []aggOutput{ + {"b", 1, ts}, + {"a", 2, ts}, + {"c", 9, ts}, + } + assert.Equal(t, want, got) +} + +// TestDistributedAggregatorNoIntervalCollapsesByToken verifies that without an +// interval (ts=0 for every input) aggregation merges solely by token. +func TestDistributedAggregatorNoIntervalCollapsesByToken(t *testing.T) { + in1 := &testProducer{data: []*query.Record{ + makeAggInputRecord("foo", 0, 0, 10, 2, 0), + }} + in2 := &testProducer{data: []*query.Record{ + makeAggInputRecord("foo", 0, 0, 5, 3, 0), + }} + + a := NewDistributedAggregator([]query.RecordProducer{in1, in2}, seq.AggFuncCount) + got := decodeAggOutputs(t, a) + + // count = total = 2 + 3 = 5. + want := []aggOutput{ + {"foo", 5, 0}, + } + assert.Equal(t, want, got) +} + +func TestDistributedAggregatorFinalize(t *testing.T) { + in1 := &testProducer{data: nil, total: 40} + in2 := &testProducer{data: nil, total: 60} + a := NewDistributedAggregator([]query.RecordProducer{in1, in2}, seq.AggFuncCount) + for r := a.Next(); r != nil; r = a.Next() { + t.Fatalf("unexpected record: %v", r) + } + summary := a.Finalize() + assert.NotNil(t, summary) + assert.Equal(t, uint64(100), summary.Total) + assert.Nil(t, summary.Err) +} + +func makeAggInputRecord(token string, mn, mx, sum float64, total, ts uint64) *query.Record { + return query.NewRecord([]*query.RecordVals{ + query.NewRecordVals(query.DataTypeString, []byte(token)), + query.NewRecordVals(query.DataTypeFloat64, encoding.Float64ToBytes(mn)), + query.NewRecordVals(query.DataTypeFloat64, encoding.Float64ToBytes(mx)), + query.NewRecordVals(query.DataTypeFloat64, encoding.Float64ToBytes(sum)), + query.NewRecordVals(query.DataTypeUint64, encoding.Uint64ToBytes(total)), + query.NewRecordVals(query.DataTypeUint64, encoding.Uint64ToBytes(0)), // not_exists, unused by aggregator + query.NewRecordVals(query.DataTypeUint64, encoding.Uint64ToBytes(ts)), + }) +} + +// nolint:unused // fields are checked but not directly +type aggOutput struct { + key string + value float64 + ts uint64 +} + +func decodeAggOutputs(t *testing.T, a *DistributedAggregator) []aggOutput { + t.Helper() + out := make([]aggOutput, 0) + for r := a.Next(); r != nil; r = a.Next() { + out = append(out, aggOutput{ + key: r.Vals[0].Decoded().(string), + value: r.Vals[1].Decoded().(float64), + ts: r.Vals[2].Decoded().(uint64), + }) + } + return out +} diff --git a/query/exec/datasource.go b/query/exec/datasource.go new file mode 100644 index 000000000..95347f75b --- /dev/null +++ b/query/exec/datasource.go @@ -0,0 +1,293 @@ +package exec + +import ( + "context" + "errors" + + "google.golang.org/protobuf/types/known/timestamppb" + + "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/query/encoding" + "github.com/ozontech/seq-db/querytracer" + "github.com/ozontech/seq-db/seq" +) + +const searcherBatchLimit = 1000 + +// SearcherDataSource is limitless: for the documents +// path it walks the matched set in fixed-size batches via cursor pagination: +// - repeatedly call Searcher.SearchDocs with a constant per-batch limit and a +// cursor (OffsetId) advanced from the previous batch's last ID; +// - the Fetcher.FetchDocs step is performed on demand — only the current +// document is fetched right before it is returned from Next(). +// +// The aggregation path is a scan-all request (one SearchDocs, no cursor): +// aggregations require a full scan and the proxy-side DistributedAggregator +// merges complete results. +type SearcherDataSource struct { + ctx context.Context + tr *querytracer.Tracer + + searchParams processor.SearchParams + isAgg bool + + fracManager *fracmanager.FracManager + searcher *fracmanager.Searcher + fetcher *fracmanager.Fetcher + + qpr *seq.QPR + aggs []*storeapi.SearchResponse_Agg + aggsScanned bool + + curIdx int + + // total accumulates the final total. + total uint64 + // batchNo counts completed batches; 0 means no batch has been scanned yet. + batchNo int + // done marks the documents path as exhausted (a batch returned no IDs). + done bool + + // fracs are acquired once and held for the producer's lifetime so that + // cursor-pagination batches and per-document fetches share the same set. + fracs fracmanager.List + release func() + + // err holds the first error encountered during scanning/fetching. Reported via Finalize. + err error +} + +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, + isAgg: len(searchParams.AggQ) > 0, + } +} + +func (s *SearcherDataSource) Next() *query.Record { + if s.isAgg { + return s.nextAgg() + } + return s.nextDoc() +} + +func (s *SearcherDataSource) Finalize() *query.Summary { + if s.release != nil { + s.release() + } + return &query.Summary{Total: s.total, Err: s.err} +} + +func (s *SearcherDataSource) nextDoc() *query.Record { + if s.done { + return nil + } + + if s.qpr == nil || s.curIdx >= len(s.qpr.IDs) { + if err := s.scanBatch(); err != nil { + s.err = err + return nil + } + if s.done { + return nil + } + } + + idSrc := s.qpr.IDs[s.curIdx] + s.curIdx++ + + docs, err := s.fetcher.FetchDocs(s.Ctx(), s.fracs, []seq.IDSource{idSrc}, false) + if err != nil { + s.err = err + return nil + } + + return makeDocumentRecord(idSrc.ID, docs[0]) +} + +func (s *SearcherDataSource) nextAgg() *query.Record { + if !s.aggsScanned { + if err := s.scanAgg(); err != nil { + s.err = err + return nil + } + s.aggsScanned = true + } + + if len(s.aggs) == 0 { + return nil + } + + agg := s.aggs[0] + if agg == nil || s.curIdx >= len(agg.Timeseries) { + return nil + } + + record := makeAggRecord(agg.Timeseries[s.curIdx]) + + s.curIdx++ + + return record +} + +func (s *SearcherDataSource) Ctx() context.Context { + if s.ctx == nil { + return context.Background() + } + return s.ctx +} + +// scanBatch runs one SearchDocs iteration of the documents path with cursor +// pagination. The first batch honors searchParams.WithTotal (to capture the +// full total once); subsequent batches drop WithTotal and advance the cursor +// (OffsetId) from the previous batch's last ID, narrowing the time range. +func (s *SearcherDataSource) scanBatch() error { + params := s.searchParams + + if s.fracs == nil { + s.fracs, s.release = s.fracManager.AcquireFractionsInRange(params.From, params.To) + } + + params.Limit = searcherBatchLimit + + if s.batchNo > 0 { + // Advance the cursor and narrow the time range so the fractions filter skips already-served data. + params.WithTotal = false + lastID := s.qpr.IDs[len(s.qpr.IDs)-1].ID + params.OffsetId = lastID + if params.Order == seq.DocsOrderDesc { + params.To = lastID.MID + } else { + params.From = lastID.MID + } + } + + qpr, err := s.searcher.SearchDocs(s.Ctx(), s.fracs, params, s.tr) + if err != nil { + return err + } + if err := qprErrors(qpr); err != nil { + return err + } + + if len(qpr.IDs) == 0 { + s.done = true + return nil + } + + s.qpr = qpr + s.curIdx = 0 + s.batchNo++ + if params.WithTotal { + s.total = qpr.Total + } + return nil +} + +// scanAgg runs the single scan-all SearchDocs for the aggregation path. +func (s *SearcherDataSource) scanAgg() error { + s.fracs, s.release = s.fracManager.AcquireFractionsInRange(s.searchParams.From, s.searchParams.To) + + qpr, err := s.searcher.SearchDocs(s.Ctx(), s.fracs, s.searchParams, s.tr) + if err != nil { + return err + } + if err := qprErrors(qpr); err != nil { + return err + } + + s.qpr = qpr + s.total = qpr.Total + s.aggs = buildAggs(qpr) + return nil +} + +// qprErrors joins all store-level errors reported in the QPR, if any. +func qprErrors(qpr *seq.QPR) error { + if len(qpr.Errors) == 0 { + return nil + } + var resErr error + for _, e := range qpr.Errors { + resErr = errors.Join(errors.New(e.ErrStr)) + } + return resErr +} + +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{ + query.NewRecordVals(query.DataTypeSeqID, encoding.SeqIDToBytes(id)), + query.NewRecordVals(query.DataTypeDocument, payload), + }, + } +} + +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, encoding.Float64ToBytes(bin.Hist.Min)), + query.NewRecordVals(query.DataTypeFloat64, encoding.Float64ToBytes(bin.Hist.Max)), + query.NewRecordVals(query.DataTypeFloat64, encoding.Float64ToBytes(bin.Hist.Sum)), + query.NewRecordVals(query.DataTypeUint64, encoding.Uint64ToBytes(uint64(bin.Hist.Total))), + query.NewRecordVals(query.DataTypeUint64, encoding.Uint64ToBytes(uint64(bin.Hist.NotExists))), + query.NewRecordVals(query.DataTypeUint64, encoding.Uint64ToBytes(uint64(bin.Ts.AsTime().UnixNano()))), + }, + } +} diff --git a/query/exec/filter.go b/query/exec/filter.go new file mode 100644 index 000000000..d7e45faf1 --- /dev/null +++ b/query/exec/filter.go @@ -0,0 +1,158 @@ +package exec + +import ( + "cmp" + + insaneJSON "github.com/ozontech/insane-json" + + "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] + + // withTotal requests the accurate total of records that pass the filter. + // When true, Finalize drains the (possibly partially consumed) input to the + // end and reports the count of passing records as Total. When false, the + // upstream total is forwarded unchanged. + withTotal bool + // passed counts records emitted via Next; Finalize keeps counting while + // draining the remaining input. + passed uint64 + + // roots holds every record whose colIdx val has been decoded (and thus + // Spawn'd an insaneJSON root). They are released back to the library pool in + // Finalize. Record.Release is idempotent, so records that were forwarded + // downstream (and released there too) are safe to release here as well. + roots []*query.Record +} + +func NewFilter[T any]( + input query.RecordProducer, + colIdx int, + expr FilterExpr[T], + withTotal bool, +) *Filter[T] { + return &Filter[T]{ + input: input, + colIdx: colIdx, + expr: expr, + withTotal: withTotal, + } +} + +func (f *Filter[T]) Next() *query.Record { + for { + r := f.input.Next() + if r == nil { + return nil + } + + passes := f.expr.Eval(r.Vals[f.colIdx].Decoded().(T)) + // The decoded root is now cached; keep a reference so Finalize can release it. + f.roots = append(f.roots, r) + if passes { + f.passed++ + return r + } + } +} + +func (f *Filter[T]) Finalize() *query.Summary { + upstream := f.input.Finalize() + if !f.withTotal { + f.releaseRoots() + return upstream + } + + for f.Next() != nil { + } + f.releaseRoots() + + summary := &query.Summary{Total: f.passed} + if upstream != nil { + summary.Err = upstream.Err + } + return summary +} + +func (f *Filter[T]) releaseRoots() { + for _, r := range f.roots { + r.Release() + } +} + +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 +} + +type DocFilter struct { + field string + filter FilterExpr[string] +} + +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 new file mode 100644 index 000000000..2dcdb0987 --- /dev/null +++ b/query/exec/filter_test.go @@ -0,0 +1,135 @@ +package exec + +import ( + "errors" + "testing" + + insaneJSON "github.com/ozontech/insane-json" + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" +) + +var assertErr = errors.New("some error") + +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 TestDocumentFilter(t *testing.T) { + const ( + field = "service" + cond = "service-5" + ) + + filterExpr := NewDocFilter(field, NewEq(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[T], + 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, false) + + outputData := make([]*query.Record, 0) + for r := filter.Next(); r != nil; r = filter.Next() { + outputData = append(outputData, r) + } + + assert.Equal(t, wantData, outputData) +} + +func TestFilterTotalDrainsInput(t *testing.T) { + const cond = 5 + + filterExpr := NewEq[uint32](cond) + + inputData := makeTestInputRecords(10) + input := testProducer{data: inputData, total: uint64(len(inputData))} + + wantCount := 0 + wantData := make([]*query.Record, 0) + for _, r := range inputData { + if r.Vals[0].Decoded().(uint32) == uint32(cond) { + wantCount++ + wantData = append(wantData, r) + } + } + + filter := NewFilter(&input, 0, filterExpr, true) + outputData := make([]*query.Record, 0) + for i := 0; i < len(wantData); i++ { + r := filter.Next() + assert.NotNil(t, r) + outputData = append(outputData, r) + } + assert.Equal(t, wantData, outputData) + + summary := filter.Finalize() + assert.Equal(t, uint64(wantCount), summary.Total) +} + +func TestFilterTotalErrorPropagated(t *testing.T) { + const cond = 5 + + filterExpr := NewEq[uint32](cond) + + inputData := makeTestInputRecords(10) + input := testProducer{ + data: inputData, + total: uint64(len(inputData)), + err: assertErr, + } + + filter := NewFilter(&input, 0, filterExpr, true) + for r := filter.Next(); r != nil; r = filter.Next() { + } + + summary := filter.Finalize() + assert.Equal(t, assertErr, summary.Err) +} diff --git a/query/exec/limiter.go b/query/exec/limiter.go new file mode 100644 index 000000000..af9ffdaec --- /dev/null +++ b/query/exec/limiter.go @@ -0,0 +1,53 @@ +package exec + +import "github.com/ozontech/seq-db/query" + +type Limiter struct { + input query.RecordProducer + + limit uint32 + offset uint32 + + produced uint32 + skipped uint32 +} + +func NewLimiter( + input query.RecordProducer, + limit uint32, + offset uint32, +) *Limiter { + return &Limiter{ + input: input, + limit: limit, + offset: offset, + } +} + +func (l *Limiter) Next() *query.Record { + for l.skipped < l.offset { + r := l.input.Next() + if r == nil { + return nil + } + l.skipped++ + } + + // limit == 0 means no limit + if l.limit != 0 && l.produced >= l.limit { + return nil + } + + r := l.input.Next() + if r == nil { + return nil + } + + l.produced++ + + return r +} + +func (l *Limiter) Finalize() *query.Summary { + return l.input.Finalize() +} diff --git a/query/exec/limiter_test.go b/query/exec/limiter_test.go new file mode 100644 index 000000000..5c529122a --- /dev/null +++ b/query/exec/limiter_test.go @@ -0,0 +1,107 @@ +package exec + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/query/encoding" +) + +func TestLimiterLessThanInputLen(t *testing.T) { + const limit = 5 + testLimiter(t, limit, 0) +} + +func TestLimiterGreaterThanInputLen(t *testing.T) { + const limit = 50 + testLimiter(t, limit, 0) +} + +func TestLimiterOffset(t *testing.T) { + const limit = 10 + const offset = 20 + testLimiter(t, limit, offset) +} + +func testLimiter(t *testing.T, limit, offset int) { + t.Helper() + + inputData := makeTestInputRecords(100) + input := testProducer{data: inputData} + limiter := NewLimiter(&input, uint32(limit), uint32(offset)) + outputData := make([]*query.Record, 0) + for r := limiter.Next(); r != nil; r = limiter.Next() { + outputData = append(outputData, r) + } + + assert.Equal(t, inputData[offset:min(len(inputData), int(limit))+int(offset)], outputData) +} + +func TestLimiterNoLimit(t *testing.T) { + t.Run("no offset", func(t *testing.T) { + inputData := makeTestInputRecords(100) + limiter := NewLimiter(&testProducer{data: inputData}, 0, 0) + + outputData := make([]*query.Record, 0) + for r := limiter.Next(); r != nil; r = limiter.Next() { + outputData = append(outputData, r) + } + assert.Equal(t, inputData, outputData) + }) + + t.Run("with offset", func(t *testing.T) { + const offset = 20 + inputData := makeTestInputRecords(100) + limiter := NewLimiter(&testProducer{data: inputData}, 0, uint32(offset)) + + outputData := make([]*query.Record, 0) + for r := limiter.Next(); r != nil; r = limiter.Next() { + outputData = append(outputData, r) + } + assert.Equal(t, inputData[offset:], outputData) + }) +} + +type testProducer struct { + data []*query.Record + cur int + total uint64 + err error +} + +func (p *testProducer) Next() *query.Record { + if p.cur >= len(p.data) { + return nil + } + + r := p.data[p.cur] + p.cur++ + + return r +} + +func (p *testProducer) Finalize() *query.Summary { + if p.total == 0 && p.err == nil { + return nil + } + return &query.Summary{Total: p.total, Err: p.err} +} + +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, encoding.Uint32ToBytes(uint32(i))), + query.NewRecordVals(query.DataTypeDocument, []byte(doc)), + }, + }) + } + + return out +} diff --git a/query/exec/merger.go b/query/exec/merger.go new file mode 100644 index 000000000..2d5d4bc88 --- /dev/null +++ b/query/exec/merger.go @@ -0,0 +1,281 @@ +package exec + +import ( + "cmp" + + insaneJSON "github.com/ozontech/insane-json" + + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/seq" +) + +type Merger struct { + left, right query.RecordProducer + + curLeft, curRight *query.Record + + colIdx int + field string + dataType query.DataType + order seq.DocsOrder + less func(any, any) int + + // dedup drops records whose sort key repeats the previously emitted one. + // It is enabled only for the seq.ID merge: shards may match the same + // document, and the merged document stream must contain each seq.ID once. + dedup bool + lastVal any + // dups counts records dropped by dedup so Finalize can subtract it from the merged total. + dups uint64 + + // roots holds records whose colIdx val has been decoded (Spawn'd an + // insaneJSON root) while comparing during the merge. They leave the merger + // once chosen, so this is the last owner and Finalize releases them. On the + // documents path the merger compares by SeqID and the vals stay undecoded, + // so roots stays empty; the DataTypeDocument path is handled for + // correctness. + roots []*query.Record + + done bool +} + +func NewMerger( + left query.RecordProducer, + right query.RecordProducer, + colIdx int, + field string, + dataType query.DataType, + order seq.DocsOrder, +) *Merger { + less := createLessFunc() + + return &Merger{ + left: left, + right: right, + colIdx: colIdx, + field: field, + dataType: dataType, + order: order, + less: less, + dedup: dataType == query.DataTypeSeqID, + curLeft: nil, + curRight: nil, + done: false, + } +} + +func (m *Merger) Next() *query.Record { + if m.done { + return nil + } + + for { + r := m.mergeNext() + if r == nil { + return nil + } + if !m.dedup { + return r + } + val := m.extractValue(r) + if m.lastVal != nil && m.less(val, m.lastVal) == 0 { + // Skip duplicate. + m.dups++ + continue + } + m.lastVal = val + return r + } +} + +func (m *Merger) mergeNext() *query.Record { + 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 + } + + if m.curLeft == nil { + r := m.curRight + m.curRight = m.right.Next() + return r + } + + if m.curRight == nil { + r := m.curLeft + m.curLeft = m.left.Next() + return r + } + + leftVal := m.extractValue(m.curLeft) + rightVal := m.extractValue(m.curRight) + + compared := m.less(leftVal, rightVal) + chooseLeft := compared <= 0 + if m.order == seq.DocsOrderDesc { + chooseLeft = compared >= 0 + } + + if chooseLeft { + r := m.curLeft + m.curLeft = m.left.Next() + m.trackRoot(r) + return r + } + + r := m.curRight + m.curRight = m.right.Next() + m.trackRoot(r) + return r +} + +func (m *Merger) Finalize() *query.Summary { + for _, r := range m.roots { + r.Release() + } + // The lookahead cursors may still hold partially consumed records whose + // colIdx val extractValue has decoded. + if m.dataType == query.DataTypeDocument { + if m.curLeft != nil { + m.curLeft.Release() + } + if m.curRight != nil { + m.curRight.Release() + } + } + + left := m.left.Finalize() + right := m.right.Finalize() + summary := combineSummaries(left, right) + if m.dedup && m.dups > 0 && summary.Total >= m.dups { + summary.Total -= m.dups + } + return summary +} + +// trackRoot records a record leaving the merger if its colIdx val may have been +// decoded by extractValue, so Finalize can release the spawned insaneJSON root. +// Non-document types never decode an insaneJSON root, so tracking them is +// unnecessary (but harmless — Record.Release is a no-op for them). +func (m *Merger) trackRoot(r *query.Record) { + if m.dataType == query.DataTypeDocument { + m.roots = append(m.roots, r) + } +} + +// combineSummaries merges the final summaries of two merged branches. The +// totals are summed; an error from either side (if any) takes precedence. +func combineSummaries(left, right *query.Summary) *query.Summary { + var total uint64 + if left != nil { + total += left.Total + } + if right != nil { + total += right.Total + } + summary := &query.Summary{Total: total} + if left != nil && left.Err != nil { + summary.Err = left.Err + } else if right != nil && right.Err != nil { + summary.Err = right.Err + } + return summary +} + +func (m *Merger) extractValue(r *query.Record) any { + val := r.Vals[m.colIdx] + decoded := val.Decoded() + + switch m.dataType { + case query.DataTypeSeqID: + return decoded.(seq.ID) + 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 { + return func(a, b any) int { + switch v := a.(type) { + case seq.ID: + w := b.(seq.ID) + switch { + case seq.Less(v, w): + return -1 + case seq.Less(w, v): + return 1 + default: + return 0 + } + case uint32: + return cmp.Compare(v, b.(uint32)) + case uint64: + return cmp.Compare(v, b.(uint64)) + case int32: + return cmp.Compare(v, b.(int32)) + case int64: + return cmp.Compare(v, b.(int64)) + case float64: + return cmp.Compare(v, b.(float64)) + case string: + return cmp.Compare(v, b.(string)) + default: + return 0 + } + } +} + +func NewNMergedProducers( + producers []query.RecordProducer, + colIdx int, + field string, + dataType query.DataType, + order seq.DocsOrder, +) 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 { + return nil +} + +func (e *emptyRecordProducer) Finalize() *query.Summary { + return nil +} diff --git a/query/exec/merger_test.go b/query/exec/merger_test.go new file mode 100644 index 000000000..ae698c37f --- /dev/null +++ b/query/exec/merger_test.go @@ -0,0 +1,682 @@ +package exec + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + + insaneJSON "github.com/ozontech/insane-json" + + "github.com/ozontech/seq-db/query" + "github.com/ozontech/seq-db/query/encoding" + "github.com/ozontech/seq-db/seq" +) + +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, + seq.DocsOrderAsc, + ) + + 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, + seq.DocsOrderDesc, + ) + + 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, + seq.DocsOrderAsc, + ) + + 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, + seq.DocsOrderAsc, + ) + + 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, + seq.DocsOrderAsc, + ) + + 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, + seq.DocsOrderAsc, + ) + + 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, + seq.DocsOrderAsc, + ) + + 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, + seq.DocsOrderAsc, + ) + + 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, + seq.DocsOrderAsc, + ) + + 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, + seq.DocsOrderDesc, + ) + + 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, + seq.DocsOrderAsc, + ) + + 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, + seq.DocsOrderAsc, + ) + + outputData := collectRecords(merger) + assert.Equal(t, []string{"apple", "apricot", "banana", "cherry", "date", "elder"}, extractStringValues(outputData)) +} + +func TestMergerSeqIDAsc(t *testing.T) { + leftInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 100, RID: 1}, + {MID: 300, RID: 5}, + {MID: 500, RID: 9}, + }) + rightInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 200, RID: 3}, + {MID: 400, RID: 7}, + {MID: 600, RID: 11}, + }) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeSeqID, + seq.DocsOrderAsc, + ) + + outputData := collectRecords(merger) + assert.Equal(t, []seq.ID{ + {MID: 100, RID: 1}, {MID: 200, RID: 3}, {MID: 300, RID: 5}, + {MID: 400, RID: 7}, {MID: 500, RID: 9}, {MID: 600, RID: 11}, + }, extractSeqIDValues(outputData)) +} + +func TestMergerSeqIDDesc(t *testing.T) { + leftInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 600, RID: 11}, + {MID: 400, RID: 7}, + {MID: 200, RID: 3}, + }) + rightInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 500, RID: 9}, + {MID: 300, RID: 5}, + {MID: 100, RID: 1}, + }) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeSeqID, + seq.DocsOrderDesc, + ) + + outputData := collectRecords(merger) + assert.Equal(t, []seq.ID{ + {MID: 600, RID: 11}, {MID: 500, RID: 9}, {MID: 400, RID: 7}, + {MID: 300, RID: 5}, {MID: 200, RID: 3}, {MID: 100, RID: 1}, + }, extractSeqIDValues(outputData)) +} + +func TestMergerSeqIDSameMIDDifferentRID(t *testing.T) { + leftInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 1000, RID: 10}, + {MID: 1000, RID: 30}, + }) + rightInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 1000, RID: 20}, + {MID: 1000, RID: 40}, + }) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeSeqID, + seq.DocsOrderAsc, + ) + + outputData := collectRecords(merger) + assert.Equal(t, []seq.ID{ + {MID: 1000, RID: 10}, {MID: 1000, RID: 20}, + {MID: 1000, RID: 30}, {MID: 1000, RID: 40}, + }, extractSeqIDValues(outputData)) +} + +func TestMergerSeqIDLeftEmpty(t *testing.T) { + leftInput := makeMergerSeqIDRecords([]seq.ID{}) + rightInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 100, RID: 1}, + {MID: 200, RID: 2}, + }) + + merger := NewMerger( + &testProducer{data: leftInput}, + &testProducer{data: rightInput}, + 0, + "", + query.DataTypeSeqID, + seq.DocsOrderAsc, + ) + + outputData := collectRecords(merger) + assert.Equal(t, []seq.ID{ + {MID: 100, RID: 1}, {MID: 200, RID: 2}, + }, extractSeqIDValues(outputData)) +} + +func TestMergerSeqIDDuplicates(t *testing.T) { + leftInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 100, RID: 1}, + {MID: 100, RID: 1}, + {MID: 300, RID: 3}, + }) + rightInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 100, RID: 1}, + {MID: 200, RID: 2}, + {MID: 300, RID: 3}, + }) + + merger := NewMerger( + &testProducer{data: leftInput, total: uint64(len(leftInput))}, + &testProducer{data: rightInput, total: uint64(len(rightInput))}, + 0, + "", + query.DataTypeSeqID, + seq.DocsOrderAsc, + ) + + outputData := collectRecords(merger) + assert.Equal(t, []seq.ID{ + {MID: 100, RID: 1}, {MID: 200, RID: 2}, {MID: 300, RID: 3}, + }, extractSeqIDValues(outputData)) +} + +func TestMergerSeqIDDuplicatesDesc(t *testing.T) { + leftInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 300, RID: 3}, + {MID: 300, RID: 3}, + {MID: 100, RID: 1}, + }) + rightInput := makeMergerSeqIDRecords([]seq.ID{ + {MID: 300, RID: 3}, + {MID: 200, RID: 2}, + {MID: 100, RID: 1}, + }) + + merger := NewMerger( + &testProducer{data: leftInput, total: uint64(len(leftInput))}, + &testProducer{data: rightInput, total: uint64(len(rightInput))}, + 0, + "", + query.DataTypeSeqID, + seq.DocsOrderDesc, + ) + + outputData := collectRecords(merger) + assert.Equal(t, []seq.ID{ + {MID: 300, RID: 3}, {MID: 200, RID: 2}, {MID: 100, RID: 1}, + }, extractSeqIDValues(outputData)) + + summary := merger.Finalize() + assert.Equal(t, uint64(3), summary.Total) +} + +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, encoding.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 { + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeUint32, encoding.Uint32ToBytes(v)), + }, + }) + } + + return out +} + +func makeMergerUint64Records(values []uint64) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeUint64, encoding.Uint64ToBytes(v)), + }, + }) + } + + return out +} + +func makeMergerInt32Records(values []int32) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeInt32, encoding.Int32ToBytes(v)), + }, + }) + } + + return out +} + +func makeMergerInt64Records(values []int64) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeInt64, encoding.Int64ToBytes(v)), + }, + }) + } + + return out +} + +func makeMergerFloat64Records(values []float64) []*query.Record { + out := make([]*query.Record, 0, len(values)) + + for _, v := range values { + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeFloat64, encoding.Float64ToBytes(v)), + }, + }) + } + + 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 makeMergerSeqIDRecords(values []seq.ID) []*query.Record { + out := make([]*query.Record, 0, len(values)) + for _, v := range values { + out = append(out, &query.Record{ + Vals: []*query.RecordVals{ + query.NewRecordVals(query.DataTypeSeqID, encoding.SeqIDToBytes(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 extractSeqIDValues(records []*query.Record) []seq.ID { + out := make([]seq.ID, 0, len(records)) + for _, r := range records { + out = append(out, r.Vals[0].Decoded().(seq.ID)) + } + return out +} + +func TestNewNMergedProducersEmpty(t *testing.T) { + const field = "service" + + producers := []query.RecordProducer{} + + merger := NewNMergedProducers(producers, 1, field, query.DataTypeDocument, seq.DocsOrderAsc) + 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, seq.DocsOrderAsc) + 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, seq.DocsOrderAsc) + 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, seq.DocsOrderDesc) + outputData := collectRecords(merger) + assert.Equal(t, []string{ + "service-03", "service-02", "service-01", + }, extractFieldValues(outputData, field)) +} + +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/query/exec/projector.go b/query/exec/projector.go new file mode 100644 index 000000000..5db2862b8 --- /dev/null +++ b/query/exec/projector.go @@ -0,0 +1,97 @@ +package exec + +import ( + "slices" + + insaneJSON "github.com/ozontech/insane-json" + + "github.com/ozontech/seq-db/query" +) + +type FieldsFilter struct { + Fields []string + AllowList bool +} + +type DocProjector struct { + input query.RecordProducer + colIdx int + filter *FieldsFilter + decoderBuf []byte + + // roots holds the input records whose decoded document root has been + // mutated during projection. The mutated root lives only inside the input + // record (the output record carries freshly encoded raw bytes with + // decoded=nil), so the projector is the last owner and must release these + // roots in Finalize. + roots []*query.Record +} + +func NewDocProjector( + input query.RecordProducer, + colIdx int, + filter *FieldsFilter, +) *DocProjector { + return &DocProjector{ + input: input, + colIdx: colIdx, + filter: filter, + } +} + +func (p *DocProjector) Next() *query.Record { + r := p.input.Next() + if r == nil { + return nil + } + + decoder := r.Vals[p.colIdx].Decoded().(*insaneJSON.Root) + + var newRecord *query.Record + if !p.filter.AllowList { + // It is block list, so remove given fields from document. + for _, field := range p.filter.Fields { + decoder.Dig(field).Suicide() + } + newRecord = p.makeRecordWithNewVals(r, decoder.Encode(p.decoderBuf[:0])) + } else { + // 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() + } + newRecord = p.makeRecordWithNewVals(r, decoder.Encode(p.decoderBuf[:0])) + } + + // The input record holds the mutated root and won't be seen downstream; + // keep it for release in Finalize. + p.roots = append(p.roots, r) + return newRecord +} + +func (p *DocProjector) Finalize() *query.Summary { + for _, r := range p.roots { + r.Release() + } + return p.input.Finalize() +} + +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 000000000..35812fbd1 --- /dev/null +++ b/query/exec/projector_test.go @@ -0,0 +1,52 @@ +package exec + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ozontech/seq-db/query" +) + +func TestDocProjectorFields(t *testing.T) { + testDocProjector( + t, + &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, + &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 *FieldsFilter, wantDocs []string) { + t.Helper() + + inputData := makeTestInputRecords(2) + input := testProducer{data: inputData} + + projector := NewDocProjector(&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/query/producer.go b/query/producer.go new file mode 100644 index 000000000..e699d4859 --- /dev/null +++ b/query/producer.go @@ -0,0 +1,17 @@ +package query + +type RecordProducer interface { + // Next returns the next record, or nil when the stream is exhausted. Errors + // that occur during production are not returned here; they are accumulated + // internally and reported via Finalize. + Next() *Record + // Finalize releases resources held by the producer and returns the final + // summary gathered during the stream. It must be called exactly once after the + // producer is exhausted. + Finalize() *Summary +} + +type Summary struct { + Err error + Total uint64 +} diff --git a/query/record.go b/query/record.go new file mode 100644 index 000000000..ea985ba90 --- /dev/null +++ b/query/record.go @@ -0,0 +1,118 @@ +package query + +import ( + "fmt" + + insaneJSON "github.com/ozontech/insane-json" + + "github.com/ozontech/seq-db/query/encoding" +) + +// 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 + DataTypeSeqID + DataTypeDocument + DataTypeString + DataTypeUint32 + DataTypeUint64 + DataTypeInt32 + DataTypeInt64 + DataTypeFloat64 + // later we will need array data types, such as: + // StringArray, Uin64Array, Float64Array etc. +) + +// 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 + + decoded any +} + +func NewRecordVals(dataType DataType, rawData []byte) *RecordVals { + return &RecordVals{ + Type: dataType, + rawData: rawData, + } +} + +func (rv *RecordVals) RawData() []byte { + return rv.rawData +} + +func (rv *RecordVals) Decoded() any { + if rv.decoded == nil { + rv.ensureDecoded() + } + return rv.decoded +} + +// Release returns the insaneJSON decoder (allocated for DataTypeDocument in +// ensureDecoded) back to the library's internal pool. It is idempotent: after +// the first call rv.decoded is cleared, so repeated calls are a no-op. Calling +// it on a non-document val or a not-yet-decoded val is also a no-op. Safe to +// invoke from every executor that has touched the val — the first caller wins. +func (rv *RecordVals) Release() { + if rv.Type != DataTypeDocument { + return + } + if r, ok := rv.decoded.(*insaneJSON.Root); ok && r != nil { + insaneJSON.Release(r) + rv.decoded = nil + } +} + +func (r *Record) Release() { + for _, v := range r.Vals { + v.Release() + } +} + +func (rv *RecordVals) ensureDecoded() { + switch rv.Type { + case DataTypeBytes: + rv.decoded = rv.rawData + case DataTypeSeqID: + rv.decoded = encoding.SeqIDFromBytes(rv.rawData) + case DataTypeDocument: + root := insaneJSON.Spawn() + err := root.DecodeBytes(rv.rawData) + if err != nil { + panic(fmt.Errorf("error decoding document: %w", err)) + } + if !root.IsObject() { + panic(fmt.Errorf("document is not an object: %s", rv.rawData)) + } + rv.decoded = root + case DataTypeString: + rv.decoded = encoding.StringFromBytes(rv.rawData) + case DataTypeUint32: + rv.decoded = encoding.Uint32FromBytes(rv.rawData) + case DataTypeUint64: + rv.decoded = encoding.Uint64FromBytes(rv.rawData) + case DataTypeInt32: + rv.decoded = encoding.Int32FromBytes(rv.rawData) + case DataTypeInt64: + rv.decoded = encoding.Int64FromBytes(rv.rawData) + case DataTypeFloat64: + rv.decoded = encoding.Float64FromBytes(rv.rawData) + default: + panic("BUG: unknown data type") + } +} diff --git a/storeapi/client.go b/storeapi/client.go index 3da87929d..48441493d 100644 --- a/storeapi/client.go +++ b/storeapi/client.go @@ -4,6 +4,7 @@ import ( "context" "io" "slices" + "sync" "google.golang.org/grpc" "google.golang.org/grpc/metadata" @@ -129,3 +130,143 @@ 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) } + +// streamSearchPipe is the shared channel plumbing connecting the in-memory +// StreamSearch client with the StreamSearch server handler. +// The server handler runs in a goroutine started by inMemoryAPIClient.StreamSearch. +type streamSearchPipe struct { + ctx context.Context + + // reqCh carries StreamSearchRequest messages from client to server. + reqCh chan *storeapi.StreamSearchRequest + // resCh carries StreamSearchResponse messages from server to client. + resCh chan *storeapi.StreamSearchResponse + + // reqClosed is closed when the client will send no more requests, so the + // server's Recv returns io.EOF. Closed at most once. + reqClosed chan struct{} + closeOnce sync.Once + + // serverDone is closed when the server handler returns; serverErr holds its + // result. The client reads them after resCh is closed. + serverDone chan struct{} + serverErr error +} + +func newStreamSearchPipe(ctx context.Context) *streamSearchPipe { + return &streamSearchPipe{ + ctx: ctx, + reqCh: make(chan *storeapi.StreamSearchRequest, 1), + resCh: make(chan *storeapi.StreamSearchResponse, 1), + reqClosed: make(chan struct{}), + serverDone: make(chan struct{}), + } +} + +func (p *streamSearchPipe) closeReq() { + p.closeOnce.Do(func() { close(p.reqClosed) }) +} + +type storeAPIStreamSearchServer struct { + grpc.ServerStream + *streamSearchPipe +} + +func (s storeAPIStreamSearchServer) Send(m *storeapi.StreamSearchResponse) error { + select { + case s.resCh <- m.CloneVT(): + return nil + case <-s.serverDone: + return io.EOF + case <-s.ctx.Done(): + return s.ctx.Err() + } +} + +func (s storeAPIStreamSearchServer) Recv() (*storeapi.StreamSearchRequest, error) { + select { + case m, ok := <-s.reqCh: + if !ok { + return nil, io.EOF + } + return m, nil + case <-s.reqClosed: + return nil, io.EOF + case <-s.ctx.Done(): + return nil, s.ctx.Err() + } +} + +func (s storeAPIStreamSearchServer) Context() context.Context { return s.ctx } + +type storeAPIStreamSearchClient struct { + grpc.ClientStream + *streamSearchPipe +} + +func (c *storeAPIStreamSearchClient) Header() (metadata.MD, error) { + md := make(metadata.MD) + md[consts.StoreProtocolVersionHeader] = []string{config.StoreProtocolVersion2.String()} + return md, nil +} + +func (c *storeAPIStreamSearchClient) Context() context.Context { return c.ctx } + +func (c *storeAPIStreamSearchClient) CloseSend() error { return nil } + +func (c *storeAPIStreamSearchClient) Send(m *storeapi.StreamSearchRequest) error { + select { + case c.reqCh <- m.CloneVT(): + return nil + case <-c.ctx.Done(): + return c.ctx.Err() + } +} + +func (c *storeAPIStreamSearchClient) Recv() (*storeapi.StreamSearchResponse, error) { + // If the server handler has already finished, we need to drain whatever it produced before cancelling the context. + select { + case m, ok := <-c.resCh: + if !ok { + return nil, c.waitServerErr() + } + return m, nil + default: + } + + select { + case m, ok := <-c.resCh: + if !ok { + return nil, c.waitServerErr() + } + return m, nil + case <-c.ctx.Done(): + return nil, c.ctx.Err() + } +} + +func (c *storeAPIStreamSearchClient) waitServerErr() error { + <-c.serverDone + if c.serverErr != nil { + return c.serverErr + } + return io.EOF +} + +func (i inMemoryAPIClient) StreamSearch(ctx context.Context, opts ...grpc.CallOption) (storeapi.StoreApi_StreamSearchClient, error) { + setProtocolVersionHeader(opts...) + pipeCtx, cancel := context.WithCancel(ctx) + p := newStreamSearchPipe(pipeCtx) + + go func() { + defer cancel() + // Closing resCh unblocks the client's Recv with io.EOF (or serverErr). + // closeReq drains the request side so the handler's Recv does not block. + defer p.closeReq() + defer close(p.resCh) + defer close(p.serverDone) + p.serverErr = i.store.GrpcV1().StreamSearch(storeAPIStreamSearchServer{streamSearchPipe: p}) + }() + + return &storeAPIStreamSearchClient{streamSearchPipe: p}, nil +} diff --git a/storeapi/grpc_stream_search.go b/storeapi/grpc_stream_search.go new file mode 100644 index 000000000..abe3558c9 --- /dev/null +++ b/storeapi/grpc_stream_search.go @@ -0,0 +1,471 @@ +package storeapi + +import ( + "context" + "errors" + "fmt" + "io" + "time" + + "go.opencensus.io/trace" + "go.uber.org/zap" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ozontech/seq-db/consts" + "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" + "github.com/ozontech/seq-db/tracing" + "github.com/ozontech/seq-db/util" +) + +// streamSearchBatchSize limits the number of records sent in a single +// StreamSearchResponse data message. +const streamSearchBatchSize = 100 + +type controlOutcome int + +const ( + outcomeNone controlOutcome = iota // data exhausted, no control received yet + outcomeFinalize // client requested a graceful finalization + outcomeCancel // client canceled or disconnected +) + +func (g *GrpcV1) StreamSearch(stream storeapi.StoreApi_StreamSearchServer) error { + ctx, span := tracing.StartSpan(stream.Context(), "store-server/StreamSearch") + defer span.End() + + // The first message must carry the search query. + req, err := stream.Recv() + if err == io.EOF { + return nil + } + if err != nil { + return err + } + q := req.GetQuery() + if q == nil { + return status.Error(codes.InvalidArgument, "first message must be a search query") + } + + if span.IsRecordingEvents() { + span.AddAttributes(trace.StringAttribute("request", q.Query)) + span.AddAttributes(trace.StringAttribute("from", q.From.AsTime().Format(time.RFC3339Nano))) + span.AddAttributes(trace.StringAttribute("to", q.To.AsTime().Format(time.RFC3339Nano))) + span.AddAttributes(trace.StringAttribute("offset_id", q.OffsetId)) + span.AddAttributes(trace.BoolAttribute("explain", q.Explain)) + span.AddAttributes(trace.BoolAttribute("with_total", q.WithTotal)) + } + + err = g.doStreamSearch(ctx, q, stream) + if err != nil { + span.SetStatus(trace.Status{Code: 1, Message: err.Error()}) + logger.Error("stream search error", zap.Error(err)) + } + return err +} + +func (g *GrpcV1) doStreamSearch( + ctx context.Context, + req *storeapi.StreamSearchQuery, + stream storeapi.StoreApi_StreamSearchServer, +) error { + metric.SearchInFlightQueriesTotal.Inc() + defer metric.SearchInFlightQueriesTotal.Dec() + + 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) + } + + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + start := time.Now() + tr := querytracer.New(req.Explain, "store/StreamSearchDocs") + + var errCode error + // 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(seq.TimeToMID(req.From.AsTime()))) { + metric.RejectedRequests.WithLabelValues("search", "old_data").Inc() + errCode = consts.ErrIngestorQueryWantsOldData + } + } + + // exit if had errors + if errCode != nil { + return sendSummary(stream, &query.Summary{Err: errCode}, tr, req.Explain) + } + + seqql, err := parser.ParseSeqQL(req.Query, g.mappingProvider.GetMapping()) + if err != nil { + return fmt.Errorf("parse query error: %w", err) + } + + producer, typing, err := g.buildProducer(ctx, req, tr, seqql) + if err != nil { + return fmt.Errorf("can't build record producer: %w", err) + } + + err = stream.Send(&storeapi.StreamSearchResponse{ + ResponseType: &storeapi.StreamSearchResponse_Header{ + Header: &storeapi.ResponseHeader{ + Typing: typing, + }, + }, + }) + if err != nil { + if util.IsCancelled(ctx) { + logger.Info("stream search request is canceled") + return nil + } + return fmt.Errorf("error sending header: %w", err) + } + + // Read control messages concurrently with sending data. + controlCh := make(chan *storeapi.StreamControl) + recvErrCh := make(chan error, 1) + go func() { + defer close(controlCh) + defer close(recvErrCh) + for { + msg, err := stream.Recv() + if err != nil { + // io.EOF or any read error means the client is done. Signal it and stop reading. + select { + case recvErrCh <- err: + case <-ctx.Done(): + } + return + } + if c := msg.GetControl(); c != nil { + select { + case controlCh <- c: + case <-ctx.Done(): + return + } + } + // Any other message type on the input stream is ignored. + } + }() + + outcome, err := g.streamSearchRecords(ctx, stream, producer, controlCh, recvErrCh) + if err != nil { + return fmt.Errorf("store can't stream records: %w", err) + } + + // CANCEL: terminate immediately, no summary. + if outcome == outcomeCancel { + return nil + } + + metric.SearchDurationSeconds.Observe(time.Since(start).Seconds()) + + summary := producer.Finalize() + if summary == nil { + summary = &query.Summary{} + } + return sendSummary(stream, summary, tr, req.Explain) +} + +func (g *GrpcV1) streamSearchRecords( + ctx context.Context, + stream storeapi.StoreApi_StreamSearchServer, + producer query.RecordProducer, + controlCh <-chan *storeapi.StreamControl, + recvErrCh <-chan error, +) (controlOutcome, error) { + var batch []*storeapi.Record + for curRecord := producer.Next(); curRecord != nil; curRecord = producer.Next() { + rawData := make([][]byte, len(curRecord.Vals)) + for i, d := range curRecord.Vals { + rawData[i] = d.RawData() + } + batch = append(batch, &storeapi.Record{RawData: rawData}) + + if len(batch) >= streamSearchBatchSize { + if err := sendRecords(stream, batch); err != nil { + if util.IsCancelled(ctx) { + logger.Info("stream search request is canceled") + return outcomeCancel, nil + } + return outcomeNone, fmt.Errorf("error sending fetched docs: %w", err) + } + batch = batch[:0] + if curOutcome, stop := checkControl(controlCh, recvErrCh, ctx); stop { + return curOutcome, nil + } + } + } + if len(batch) > 0 { + if err := sendRecords(stream, batch); err != nil { + if util.IsCancelled(ctx) { + logger.Info("stream search request is canceled") + return outcomeCancel, nil + } + return outcomeNone, fmt.Errorf("error sending fetched docs: %w", err) + } + } + return outcomeFinalize, nil +} + +// checkControl peeks at the control/recv channels without blocking. It returns +// ok=true when the caller should stop streaming (a control action arrived or +// the client disconnected). +func checkControl( + controlCh <-chan *storeapi.StreamControl, + recvErrCh <-chan error, + ctx context.Context, +) (controlOutcome, bool) { + select { + case c, ok := <-controlCh: + if !ok { + return outcomeNone, false + } + if c.GetAction() == storeapi.ControlAction_CANCEL { + return outcomeCancel, true + } + return outcomeFinalize, true + case err, ok := <-recvErrCh: + if !ok { + return outcomeNone, false + } + if errors.Is(err, io.EOF) { + return outcomeNone, false + } + return outcomeCancel, true + case <-ctx.Done(): + return outcomeCancel, true + default: + return outcomeNone, false + } +} + +func sendRecords(stream storeapi.StoreApi_StreamSearchServer, records []*storeapi.Record) error { + resp := &storeapi.StreamSearchResponse{ + ResponseType: &storeapi.StreamSearchResponse_Data{ + Data: &storeapi.ResponseData{ + Batch: &storeapi.RecordsBatch{Records: records}, + }, + }, + } + if err := stream.Send(resp); err != nil { + return fmt.Errorf("error sending data: %w", err) + } + return nil +} + +func sendSummary( + stream storeapi.StoreApi_StreamSearchServer, + summary *query.Summary, + tr *querytracer.Tracer, + explain bool, +) error { + respSummary := &storeapi.ResponseSummary{ + Total: summary.Total, + Error: &storeapi.Error{Code: storeapi.SearchErrorCode_NO_ERROR}, + } + + if summary.Err != nil { + errCode, _ := parseStoreError(summary.Err) + respSummary.Error = &storeapi.Error{ + Code: errCode, + Message: summary.Err.Error(), + } + } + + if explain { + tr.Done() + respSummary.Explain = tracerSpanToExplainEntry(tr.ToSpan()) + } + + err := stream.Send(&storeapi.StreamSearchResponse{ + ResponseType: &storeapi.StreamSearchResponse_Summary{Summary: respSummary}, + }) + if err != nil { + return fmt.Errorf("error sending summary: %w", err) + } + return nil +} + +func (g *GrpcV1) buildProducer( + ctx context.Context, + req *storeapi.StreamSearchQuery, + tr *querytracer.Tracer, + seqql parser.SeqQLQuery, +) (query.RecordProducer, []*storeapi.Typing, error) { + // The data source is limitless and walks the matched set via cursor pagination; + // the real request limit is applied by a Limiter executor. + searchParams := processor.SearchParams{ + AST: seqql.Root, + From: seq.MillisToMID(uint64(seq.TimeToMID(req.From.AsTime()))), + To: seq.MillisToMID(uint64(seq.TimeToMID(req.To.AsTime()))), + WithTotal: req.WithTotal, + } + + typing := docsTyping() + var offset int + var limit int + var fieldsFilter *exec.FieldsFilter + var docFilter *exec.DocFilter + + for _, pipe := range seqql.Pipes { + switch p := pipe.(type) { + case *parser.PipeLimit: + limit = p.Limit + case *parser.PipeOffset: + offset = p.Offset + case *parser.PipeSort: + order := seq.DocsOrderAsc + if p.Order == "desc" { + order = seq.DocsOrderDesc + } + searchParams.Order = order + case *parser.PipeStats: + aggQ, err := convertStatsAggToAggQuery(p.Agg) + if err != nil { + return nil, nil, fmt.Errorf("failed to convert stats aggs: %w", err) + } + searchParams.AggQ = []processor.AggQuery{aggQ} + typing = aggsTyping() + case *parser.PipeFilter: + docFilter = exec.NewDocFilter(p.Condition.Field, exec.NewEq(p.Condition.Value)) + case *parser.PipeFields: + fieldsFilter = &exec.FieldsFilter{ + Fields: p.Fields, + AllowList: !p.Except, + } + default: + continue + } + } + + const docDataColIdx = 1 + var producer query.RecordProducer + producer = exec.NewSearcherDataSource(ctx, tr, searchParams, g.fracManager, g.searchData.searcher, g.fetchData.docFetcher) + if len(searchParams.AggQ) > 0 { + return producer, typing, nil + } + if docFilter != nil { + producer = exec.NewFilter(producer, docDataColIdx, docFilter, req.WithTotal) + } + if fieldsFilter != nil { + producer = exec.NewDocProjector(producer, docDataColIdx, fieldsFilter) + } + if limit > 0 { + // set limit=limit+offset and offset=0 to merge stores' results correctly on proxy + producer = exec.NewLimiter(producer, uint32(limit+offset), 0) + } + + return producer, typing, nil +} + +// hardcoded schema +func docsTyping() []*storeapi.Typing { + return []*storeapi.Typing{ + {Title: "id", Type: storeapi.DataType_SEQ_ID}, + {Title: "data", Type: storeapi.DataType_RAW_DOCUMENT}, + } +} + +// hardcoded schema +func aggsTyping() []*storeapi.Typing { + return []*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}, + {Title: "ts", Type: storeapi.DataType_UINT64}, + } +} + +func convertStatsAggToAggQuery(statsAgg parser.StatsAgg) (processor.AggQuery, error) { + aggFunc, err := convertStringToAggFunc(statsAgg.Func) + if err != nil { + return processor.AggQuery{}, err + } + + // 'groupBy' is required for Count and Unique. + if statsAgg.GroupBy == "" && (aggFunc == seq.AggFuncCount || aggFunc == seq.AggFuncUnique) { + return processor.AggQuery{}, fmt.Errorf("%w: groupBy is required for %s func", consts.ErrInvalidAggQuery, aggFunc) + } + + // 'field' is required for stat functions like sum, avg, max and min. + if statsAgg.Field == "" && aggFunc != seq.AggFuncCount && aggFunc != seq.AggFuncUnique { + return processor.AggQuery{}, fmt.Errorf("%w: field is required for %s func", consts.ErrInvalidAggQuery, aggFunc) + } + + // Check 'quantiles' is not empty for Quantile func. + if len(statsAgg.Quantiles) == 0 && aggFunc == seq.AggFuncQuantile { + return processor.AggQuery{}, fmt.Errorf("%w: expect an argument for Quantile func", consts.ErrInvalidAggQuery) + } + + var field *parser.Literal + if statsAgg.Field != "" { + field = &parser.Literal{ + Field: statsAgg.Field, + Terms: searchAll, + } + } + + var groupBy *parser.Literal + if statsAgg.GroupBy != "" { + groupBy = &parser.Literal{ + Field: statsAgg.GroupBy, + Terms: searchAll, + } + } + + procAgg := processor.AggQuery{ + Field: field, + GroupBy: groupBy, + Func: aggFunc, + Quantiles: statsAgg.Quantiles, + } + + if statsAgg.Interval != "" { + interval, err := util.ParseDuration(statsAgg.Interval) + if err != nil { + return processor.AggQuery{}, fmt.Errorf("failed to parse interval: %w", err) + } + procAgg.Interval = int64(seq.MIDToMillis(seq.MID(interval.Nanoseconds()))) + } + + return procAgg, nil +} + +func convertStringToAggFunc(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, fmt.Errorf("unknown aggregation function: %s", funcName) + } +} diff --git a/storeapi/grpc_v1.go b/storeapi/grpc_v1.go index 3471b3f01..730f809ce 100644 --- a/storeapi/grpc_v1.go +++ b/storeapi/grpc_v1.go @@ -157,6 +157,9 @@ func parseStoreError(e error) (storeapi.SearchErrorCode, bool) { metric.RejectedRequests.WithLabelValues("search", "fracs_exceeding").Inc() return storeapi.SearchErrorCode_TOO_MANY_FRACTIONS_HIT, true } + if errors.Is(e, consts.ErrIngestorQueryWantsOldData) { + return storeapi.SearchErrorCode_INGESTOR_QUERY_WANTS_OLD_DATA, true + } return 0, false } diff --git a/tests/integration_tests/integration_test.go b/tests/integration_tests/integration_test.go index a020f11a1..395f8d204 100644 --- a/tests/integration_tests/integration_test.go +++ b/tests/integration_tests/integration_test.go @@ -5,6 +5,7 @@ import ( "bytes" "context" _ "embed" + "encoding/binary" "encoding/json" "fmt" "io" @@ -1957,6 +1958,7 @@ func sendStreamSearchQuery(t *testing.T, stream seqproxyapi.SeqProxyApi_StreamSe From: timestamppb.New(now.Add(-time.Hour)), To: timestamppb.New(now.Add(time.Hour)), WithTotal: true, + Explain: true, }, }, })) @@ -2010,7 +2012,11 @@ func (s *IntegrationTestSuite) TestStreamSearch() { for i := range totalDocs { origDocs[i] = fmt.Sprintf(`{"service":"a", "trace_id":"%d", "ts":%q}`, i, getNextTs()) } - setup.Bulk(t, env.IngestorBulkAddr(), origDocs) + const bulkBatchSize = 1000 + for i := 0; i < totalDocs; i += bulkBatchSize { + end := min(i+bulkBatchSize, totalDocs) + setup.Bulk(t, env.IngestorBulkAddr(), origDocs[i:end]) + } env.WaitIdle() streamQuery := func(limit int) string { @@ -2073,6 +2079,8 @@ func (s *IntegrationTestSuite) TestStreamSearch() { r.True(finalizeSent, "got summary without finalize") r.Greater(gotRecordsCount, 0) r.Less(gotRecordsCount, totalDocs, "finalize should stop the stream before all data is sent") + r.Equal(uint64(totalDocs), v.Summary.GetTotal(), "finalize must not lose the store-reported total") + r.Equal(seqproxyapi.ErrorCode_ERROR_CODE_NO, v.Summary.GetError().GetCode()) return } } @@ -2133,6 +2141,75 @@ func (s *IntegrationTestSuite) TestStreamSearch() { r.Equal(totalDocs, gotBucketsCount, "each distinct `trace_id` value should produce one bucket") }) + t.Run("timeseries aggregation stream", func(t *testing.T) { + // Ingest documents for a distinct service spread across two + // minute-aligned bins so the interval(1m) stats produce separate + // (trace_id, ts) buckets. + base := time.Now().Truncate(time.Minute) + bin0 := base.Add(-2 * time.Minute) + bin1 := base.Add(-time.Minute) + const docsPerBin = 5 + tsDocs := make([]string, 0, 2*docsPerBin) + for i := range docsPerBin { + tsDocs = append( + tsDocs, + fmt.Sprintf(`{"service":"ts", "trace_id":"t0", "ts":%q}`, + bin0.Add(time.Duration(i)*time.Second).Format(time.RFC3339Nano), + ), + ) + } + for i := range docsPerBin { + tsDocs = append( + tsDocs, + fmt.Sprintf(`{"service":"ts", "trace_id":"t0", "ts":%q}`, + bin1.Add(time.Duration(i)*time.Second).Format(time.RFC3339Nano), + ), + ) + } + setup.Bulk(t, env.IngestorBulkAddr(), tsDocs) + env.WaitIdle() + + stream, conn, _, cancel := newStreamSearchClient(t, env) + defer cancel() + defer conn.Close() + + sendStreamSearchQuery(t, stream, `service:ts | stats count by (trace_id) interval(1m)`) + + got := make(map[uint64]float64) // ts -> summed count + var gotBuckets int + for { + resp, err := stream.Recv() + if err != nil { + break + } + switch v := resp.ResponseType.(type) { + case *seqproxyapi.StreamSearchResponse_Data: + for _, rec := range v.Data.GetBatch().GetRecords() { + raw := rec.GetRawData() + // [key:STRING, value:FLOAT64, ts:UINT64] — proxy agg schema. + r.Len(raw, 3) + value := math.Float64frombits(binary.LittleEndian.Uint64(raw[1])) + ts := binary.LittleEndian.Uint64(raw[2]) + got[ts] += value + gotBuckets++ + } + case *seqproxyapi.StreamSearchResponse_Summary: + // Two minute bins, each with 5 documents -> two buckets. + r.Equal(2, gotBuckets, "expected one bucket per minute bin") + r.Len(got, 2, "expected two distinct ts bins") + + wantBins := []time.Time{bin0, bin1} + for _, want := range wantBins { + wantMID := uint64(seq.MID(seq.TimeToMID(want))) + // Floor to the minute boundary the aggregator bins by. + wantBin := wantMID - wantMID%uint64(seq.MID(seq.DurationToMID(time.Minute))) + r.Contains(got, wantBin, "missing bin for %s", want) + r.Equal(float64(docsPerBin), got[wantBin], "bin %s count mismatch", want) + } + } + } + }) + t.Run("missing query is rejected", func(t *testing.T) { stream, conn, _, cancel := newStreamSearchClient(t, env) defer cancel()