diff --git a/Makefile.d/dependencies.mk b/Makefile.d/dependencies.mk index 8dece00fcad..f97d76007ac 100644 --- a/Makefile.d/dependencies.mk +++ b/Makefile.d/dependencies.mk @@ -47,7 +47,8 @@ go/download: .PHONY: go/deps ## install Go package dependencies -go/deps: +go/deps: \ + update/go sed -i "3s/go [0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?/go $(GO_VERSION)/g" $(ROOTDIR)/hack/go.mod.default if $(GO_CLEAN_DEPS); then \ rm -rf $(ROOTDIR)/vendor \ diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index 2a4a50ecb73..38ce7066e24 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -23,6 +23,8 @@ - [Info.IPs](#payload-v1-Info-IPs) - [Info.Index](#payload-v1-Info-Index) - [Info.Index.Count](#payload-v1-Info-Index-Count) + - [Info.Index.Detail](#payload-v1-Info-Index-Detail) + - [Info.Index.Detail.CountsEntry](#payload-v1-Info-Index-Detail-CountsEntry) - [Info.Index.UUID](#payload-v1-Info-Index-UUID) - [Info.Index.UUID.Committed](#payload-v1-Info-Index-UUID-Committed) - [Info.Index.UUID.Uncommitted](#payload-v1-Info-Index-UUID-Uncommitted) @@ -97,6 +99,8 @@ - [Remove.Timestamp.Operator](#payload-v1-Remove-Timestamp-Operator) - [Search.AggregationAlgorithm](#payload-v1-Search-AggregationAlgorithm) +<<<<<<< HEAD + - [v1/agent/core/agent.proto](#v1_agent_core_agent-proto) - [Agent](#core-v1-Agent) - [v1/agent/sidecar/sidecar.proto](#v1_agent_sidecar_sidecar-proto) @@ -111,7 +115,23 @@ - [Index](#manager-index-v1-Index) - [v1/mirror/mirror.proto](#v1_mirror_mirror-proto) - [Mirror](#mirror-v1-Mirror) -- [v1/rpc/errdetails/error_details.proto](#v1_rpc_errdetails_error_details-proto) +- # [v1/rpc/errdetails/error_details.proto](#v1_rpc_errdetails_error_details-proto) +- [apis/proto/v1/vald/filter.proto](#apis_proto_v1_vald_filter-proto) + - [Filter](#vald-v1-Filter) +- [apis/proto/v1/vald/insert.proto](#apis_proto_v1_vald_insert-proto) + - [Insert](#vald-v1-Insert) +- [apis/proto/v1/vald/object.proto](#apis_proto_v1_vald_object-proto) + - [Object](#vald-v1-Object) +- [apis/proto/v1/vald/remove.proto](#apis_proto_v1_vald_remove-proto) + - [Remove](#vald-v1-Remove) +- [apis/proto/v1/vald/search.proto](#apis_proto_v1_vald_search-proto) + - [Search](#vald-v1-Search) +- [apis/proto/v1/vald/upsert.proto](#apis_proto_v1_vald_upsert-proto) + - [Upsert](#vald-v1-Upsert) +- [apis/proto/v1/vald/update.proto](#apis_proto_v1_vald_update-proto) + - [Update](#vald-v1-Update) +- [apis/proto/v1/rpc/error_details.proto](#apis_proto_v1_rpc_error_details-proto) + > > > > > > > refactor/manager-index/small-refactor - [BadRequest](#rpc-v1-BadRequest) - [BadRequest.FieldViolation](#rpc-v1-BadRequest-FieldViolation) - [DebugInfo](#rpc-v1-DebugInfo) @@ -149,8 +169,118 @@

Top

+<<<<<<< HEAD + ## v1/payload/payload.proto +======= + +## apis/proto/v1/agent/core/agent.proto + + + +### Agent + +Represent the agent service. + +| Method Name | Request Type | Response Type | Description | +| ------------------ | -------------------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------- | +| CreateIndex | [.payload.v1.Control.CreateIndexRequest](#payload-v1-Control-CreateIndexRequest) | [.payload.v1.Empty](#payload-v1-Empty) | Represent the creating index RPC. | +| SaveIndex | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Empty](#payload-v1-Empty) | Represent the saving index RPC. | +| CreateAndSaveIndex | [.payload.v1.Control.CreateIndexRequest](#payload-v1-Control-CreateIndexRequest) | [.payload.v1.Empty](#payload-v1-Empty) | Represent the creating and saving index RPC. | +| IndexInfo | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Count](#payload-v1-Info-Index-Count) | Represent the RPC to get the agent index information. | + + + +

Top

+ +## apis/proto/v1/agent/sidecar/sidecar.proto + + + +### Sidecar + +Represent the agent sidecar service. + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ----------- | + + + +

Top

+ +## apis/proto/v1/discoverer/discoverer.proto + + + +### Discoverer + +Represent the discoverer service. + +| Method Name | Request Type | Response Type | Description | +| ----------- | ---------------------------------------------------------------- | ------------------------------------------------ | ---------------------------------------------------- | +| Pods | [.payload.v1.Discoverer.Request](#payload-v1-Discoverer-Request) | [.payload.v1.Info.Pods](#payload-v1-Info-Pods) | Represent the RPC to get the agent pods information. | +| Nodes | [.payload.v1.Discoverer.Request](#payload-v1-Discoverer-Request) | [.payload.v1.Info.Nodes](#payload-v1-Info-Nodes) | Represent the RPC to get the node information. | + + + +

Top

+ +## apis/proto/v1/filter/egress/egress_filter.proto + + + +### Filter + +Represent the egress filter service. + +| Method Name | Request Type | Response Type | Description | +| -------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ----------------------------------------- | +| FilterDistance | [.payload.v1.Object.Distance](#payload-v1-Object-Distance) | [.payload.v1.Object.Distance](#payload-v1-Object-Distance) | Represent the RPC to filter the distance. | +| FilterVector | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | Represent the RPC to filter the vector. | + + + +

Top

+ +## apis/proto/v1/filter/ingress/ingress_filter.proto + + + +### Filter + +Represent the ingress filter service. + +| Method Name | Request Type | Response Type | Description | +| ------------ | ------------------------------------------------------ | ------------------------------------------------------ | ----------------------------------------- | +| GenVector | [.payload.v1.Object.Blob](#payload-v1-Object-Blob) | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | Represent the RPC to generate the vector. | +| FilterVector | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | Represent the RPC to filter the vector. | + + + +

Top

+ +## apis/proto/v1/manager/index/index_manager.proto + + + +### Index + +Represent the index manager service. + +| Method Name | Request Type | Response Type | Description | +| ----------- | -------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------- | +| IndexInfo | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Count](#payload-v1-Info-Index-Count) | Represent the RPC to get the index information. | +| IndexDetail | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Detail](#payload-v1-Info-Index-Detail) | Represent the RPC to get the index information for each agents. | + + + +

Top

+ +## apis/proto/v1/payload/payload.proto + +> > > > > > > refactor/manager-index/small-refactor + ### Control @@ -294,6 +424,27 @@ Represent the index count message. | indexing | [bool](#bool) | | The indexing index count. | | saving | [bool](#bool) | | The saving index count. | + + +### Info.Index.Detail + +Represent the index count for each Agents message. + +| Field | Type | Label | Description | +| ----------- | -------------------------------------------------------------------------- | -------- | ---------------------------------- | +| counts | [Info.Index.Detail.CountsEntry](#payload-v1-Info-Index-Detail-CountsEntry) | repeated | count infos for each agents | +| replica | [uint32](#uint32) | | index replica of vald cluster | +| live_agents | [uint32](#uint32) | | live agent replica of vald cluster | + + + +### Info.Index.Detail.CountsEntry + +| Field | Type | Label | Description | +| ----- | ------------------------------------------------ | ----- | ----------- | +| key | [string](#string) | | | +| value | [Info.Index.Count](#payload-v1-Info-Index-Count) | | | + ### Info.Index.UUID @@ -1194,8 +1345,79 @@ Represent the mirror service.

Top

+<<<<<<< HEAD + ## v1/rpc/errdetails/error_details.proto +======= + +## apis/proto/v1/vald/search.proto + + + +### Search + +Search service provides ways to search indexed vectors. + +| Method Name | Request Type | Response Type | Description | +| ---------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| Search | [.payload.v1.Search.Request](#payload-v1-Search-Request) | [.payload.v1.Search.Response](#payload-v1-Search-Response) | A method to search indexed vectors by a raw vector. | +| SearchByID | [.payload.v1.Search.IDRequest](#payload-v1-Search-IDRequest) | [.payload.v1.Search.Response](#payload-v1-Search-Response) | A method to search indexed vectors by ID. | +| StreamSearch | [.payload.v1.Search.Request](#payload-v1-Search-Request) stream | [.payload.v1.Search.StreamResponse](#payload-v1-Search-StreamResponse) stream | A method to search indexed vectors by multiple vectors. | +| StreamSearchByID | [.payload.v1.Search.IDRequest](#payload-v1-Search-IDRequest) stream | [.payload.v1.Search.StreamResponse](#payload-v1-Search-StreamResponse) stream | A method to search indexed vectors by multiple IDs. | +| MultiSearch | [.payload.v1.Search.MultiRequest](#payload-v1-Search-MultiRequest) | [.payload.v1.Search.Responses](#payload-v1-Search-Responses) | A method to search indexed vectors by multiple vectors in a single request. | +| MultiSearchByID | [.payload.v1.Search.MultiIDRequest](#payload-v1-Search-MultiIDRequest) | [.payload.v1.Search.Responses](#payload-v1-Search-Responses) | A method to search indexed vectors by multiple IDs in a single request. | +| LinearSearch | [.payload.v1.Search.Request](#payload-v1-Search-Request) | [.payload.v1.Search.Response](#payload-v1-Search-Response) | A method to linear search indexed vectors by a raw vector. | +| LinearSearchByID | [.payload.v1.Search.IDRequest](#payload-v1-Search-IDRequest) | [.payload.v1.Search.Response](#payload-v1-Search-Response) | A method to linear search indexed vectors by ID. | +| StreamLinearSearch | [.payload.v1.Search.Request](#payload-v1-Search-Request) stream | [.payload.v1.Search.StreamResponse](#payload-v1-Search-StreamResponse) stream | A method to linear search indexed vectors by multiple vectors. | +| StreamLinearSearchByID | [.payload.v1.Search.IDRequest](#payload-v1-Search-IDRequest) stream | [.payload.v1.Search.StreamResponse](#payload-v1-Search-StreamResponse) stream | A method to linear search indexed vectors by multiple IDs. | +| MultiLinearSearch | [.payload.v1.Search.MultiRequest](#payload-v1-Search-MultiRequest) | [.payload.v1.Search.Responses](#payload-v1-Search-Responses) | A method to linear search indexed vectors by multiple vectors in a single request. | +| MultiLinearSearchByID | [.payload.v1.Search.MultiIDRequest](#payload-v1-Search-MultiIDRequest) | [.payload.v1.Search.Responses](#payload-v1-Search-Responses) | A method to linear search indexed vectors by multiple IDs in a single request. | + + + +

Top

+ +## apis/proto/v1/vald/upsert.proto + + + +### Upsert + +Upsert service provides ways to insert/update vectors. + +| Method Name | Request Type | Response Type | Description | +| ------------ | ------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| Upsert | [.payload.v1.Upsert.Request](#payload-v1-Upsert-Request) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to insert/update a vector. | +| StreamUpsert | [.payload.v1.Upsert.Request](#payload-v1-Upsert-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to insert/update multiple vectors by bidirectional streaming. | +| MultiUpsert | [.payload.v1.Upsert.MultiRequest](#payload-v1-Upsert-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to insert/update multiple vectors in a single request. | + + + +

Top

+ +## apis/proto/v1/vald/update.proto + + + +### Update + +Update service provides ways to update indexed vectors. + +| Method Name | Request Type | Response Type | Description | +| ------------ | ------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| Update | [.payload.v1.Update.Request](#payload-v1-Update-Request) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to update an indexed vector. | +| StreamUpdate | [.payload.v1.Update.Request](#payload-v1-Update-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to update multiple indexed vectors by bidirectional streaming. | +| MultiUpdate | [.payload.v1.Update.MultiRequest](#payload-v1-Update-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to update multiple indexed vectors in a single request. | + + + +

Top

+ +## apis/proto/v1/rpc/error_details.proto + +> > > > > > > refactor/manager-index/small-refactor + ### BadRequest diff --git a/apis/grpc/v1/agent/core/agent.pb.go b/apis/grpc/v1/agent/core/agent.pb.go index 7b70659a66e..40b856f4f61 100644 --- a/apis/grpc/v1/agent/core/agent.pb.go +++ b/apis/grpc/v1/agent/core/agent.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/agent/core/agent.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/agent/core/agent.proto +>>>>>>> refactor/manager-index/small-refactor package core diff --git a/apis/grpc/v1/agent/sidecar/sidecar.pb.go b/apis/grpc/v1/agent/sidecar/sidecar.pb.go index ef77866a958..5c83af94596 100644 --- a/apis/grpc/v1/agent/sidecar/sidecar.pb.go +++ b/apis/grpc/v1/agent/sidecar/sidecar.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/agent/sidecar/sidecar.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/agent/sidecar/sidecar.proto +>>>>>>> refactor/manager-index/small-refactor package sidecar diff --git a/apis/grpc/v1/discoverer/discoverer.pb.go b/apis/grpc/v1/discoverer/discoverer.pb.go index b3bb0fa3766..ac9b96b0e47 100644 --- a/apis/grpc/v1/discoverer/discoverer.pb.go +++ b/apis/grpc/v1/discoverer/discoverer.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/discoverer/discoverer.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/discoverer/discoverer.proto +>>>>>>> refactor/manager-index/small-refactor package discoverer diff --git a/apis/grpc/v1/filter/egress/egress_filter.pb.go b/apis/grpc/v1/filter/egress/egress_filter.pb.go index 979b819852b..0e09cf96574 100644 --- a/apis/grpc/v1/filter/egress/egress_filter.pb.go +++ b/apis/grpc/v1/filter/egress/egress_filter.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/filter/egress/egress_filter.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/filter/egress/egress_filter.proto +>>>>>>> refactor/manager-index/small-refactor package egress diff --git a/apis/grpc/v1/filter/ingress/ingress_filter.pb.go b/apis/grpc/v1/filter/ingress/ingress_filter.pb.go index e6eacd40bbe..1609c3a15ba 100644 --- a/apis/grpc/v1/filter/ingress/ingress_filter.pb.go +++ b/apis/grpc/v1/filter/ingress/ingress_filter.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/filter/ingress/ingress_filter.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/filter/ingress/ingress_filter.proto +>>>>>>> refactor/manager-index/small-refactor package ingress diff --git a/apis/grpc/v1/manager/index/index_manager.pb.go b/apis/grpc/v1/manager/index/index_manager.pb.go index 483c3010cf3..248052b2c23 100644 --- a/apis/grpc/v1/manager/index/index_manager.pb.go +++ b/apis/grpc/v1/manager/index/index_manager.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/manager/index/index_manager.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/manager/index/index_manager.proto +>>>>>>> refactor/manager-index/small-refactor package index @@ -40,6 +46,7 @@ const ( var File_v1_manager_index_index_manager_proto protoreflect.FileDescriptor +<<<<<<< HEAD var file_v1_manager_index_index_manager_proto_rawDesc = []byte{ 0x0a, 0x24, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, @@ -54,6 +61,31 @@ var file_v1_manager_index_index_manager_proto_rawDesc = []byte{ 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x42, 0x6b, 0x0a, 0x23, +======= +var file_apis_proto_v1_manager_index_index_manager_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x10, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x2e, 0x76, 0x31, 0x1a, 0x23, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xb2, 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x51, 0x0a, 0x09, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x11, + 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, + 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, + 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, + 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x56, 0x0a, 0x0b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x12, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x42, 0x6b, 0x0a, 0x23, +>>>>>>> refactor/manager-index/small-refactor 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x10, 0x56, 0x61, 0x6c, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4d, 0x61, @@ -64,15 +96,24 @@ var file_v1_manager_index_index_manager_proto_rawDesc = []byte{ 0x33, } +<<<<<<< HEAD var file_v1_manager_index_index_manager_proto_goTypes = []interface{}{ (*payload.Empty)(nil), // 0: payload.v1.Empty (*payload.Info_Index_Count)(nil), // 1: payload.v1.Info.Index.Count +======= +var file_apis_proto_v1_manager_index_index_manager_proto_goTypes = []interface{}{ + (*payload.Empty)(nil), // 0: payload.v1.Empty + (*payload.Info_Index_Count)(nil), // 1: payload.v1.Info.Index.Count + (*payload.Info_Index_Detail)(nil), // 2: payload.v1.Info.Index.Detail +>>>>>>> refactor/manager-index/small-refactor } var file_v1_manager_index_index_manager_proto_depIdxs = []int32{ 0, // 0: manager.index.v1.Index.IndexInfo:input_type -> payload.v1.Empty - 1, // 1: manager.index.v1.Index.IndexInfo:output_type -> payload.v1.Info.Index.Count - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type + 0, // 1: manager.index.v1.Index.IndexDetail:input_type -> payload.v1.Empty + 1, // 2: manager.index.v1.Index.IndexInfo:output_type -> payload.v1.Info.Index.Count + 2, // 3: manager.index.v1.Index.IndexDetail:output_type -> payload.v1.Info.Index.Detail + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/apis/grpc/v1/manager/index/index_manager_vtproto.pb.go b/apis/grpc/v1/manager/index/index_manager_vtproto.pb.go index b88016d3291..f7545564a55 100644 --- a/apis/grpc/v1/manager/index/index_manager_vtproto.pb.go +++ b/apis/grpc/v1/manager/index/index_manager_vtproto.pb.go @@ -44,6 +44,8 @@ const _ = grpc.SupportPackageIsVersion7 type IndexClient interface { // Represent the RPC to get the index information. IndexInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Count, error) + // Represent the RPC to get the index information for each agents. + IndexDetail(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Detail, error) } type indexClient struct { @@ -63,12 +65,23 @@ func (c *indexClient) IndexInfo(ctx context.Context, in *payload.Empty, opts ... return out, nil } +func (c *indexClient) IndexDetail(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Detail, error) { + out := new(payload.Info_Index_Detail) + err := c.cc.Invoke(ctx, "/manager.index.v1.Index/IndexDetail", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // IndexServer is the server API for Index service. // All implementations must embed UnimplementedIndexServer // for forward compatibility type IndexServer interface { // Represent the RPC to get the index information. IndexInfo(context.Context, *payload.Empty) (*payload.Info_Index_Count, error) + // Represent the RPC to get the index information for each agents. + IndexDetail(context.Context, *payload.Empty) (*payload.Info_Index_Detail, error) mustEmbedUnimplementedIndexServer() } @@ -79,6 +92,9 @@ type UnimplementedIndexServer struct { func (UnimplementedIndexServer) IndexInfo(context.Context, *payload.Empty) (*payload.Info_Index_Count, error) { return nil, status.Errorf(codes.Unimplemented, "method IndexInfo not implemented") } +func (UnimplementedIndexServer) IndexDetail(context.Context, *payload.Empty) (*payload.Info_Index_Detail, error) { + return nil, status.Errorf(codes.Unimplemented, "method IndexDetail not implemented") +} func (UnimplementedIndexServer) mustEmbedUnimplementedIndexServer() {} // UnsafeIndexServer may be embedded to opt out of forward compatibility for this service. @@ -110,6 +126,24 @@ func _Index_IndexInfo_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Index_IndexDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(payload.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IndexServer).IndexDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/manager.index.v1.Index/IndexDetail", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IndexServer).IndexDetail(ctx, req.(*payload.Empty)) + } + return interceptor(ctx, in, info, handler) +} + // Index_ServiceDesc is the grpc.ServiceDesc for Index service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -121,6 +155,10 @@ var Index_ServiceDesc = grpc.ServiceDesc{ MethodName: "IndexInfo", Handler: _Index_IndexInfo_Handler, }, + { + MethodName: "IndexDetail", + Handler: _Index_IndexDetail_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "v1/manager/index/index_manager.proto", diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index c68b9dd9e43..e46cfe8d249 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/payload/payload.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/payload/payload.proto +>>>>>>> refactor/manager-index/small-refactor package payload @@ -4792,6 +4798,73 @@ func (x *Info_Index_Count) GetSaving() bool { return false } +// Represent the index count for each Agents message. +type Info_Index_Detail struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // count infos for each agents + Counts map[string]*Info_Index_Count `protobuf:"bytes,1,rep,name=counts,proto3" json:"counts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // index replica of vald cluster + Replica uint32 `protobuf:"varint,2,opt,name=replica,proto3" json:"replica,omitempty"` + // live agent replica of vald cluster + LiveAgents uint32 `protobuf:"varint,3,opt,name=live_agents,json=liveAgents,proto3" json:"live_agents,omitempty"` +} + +func (x *Info_Index_Detail) Reset() { + *x = Info_Index_Detail{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Info_Index_Detail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Info_Index_Detail) ProtoMessage() {} + +func (x *Info_Index_Detail) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Info_Index_Detail.ProtoReflect.Descriptor instead. +func (*Info_Index_Detail) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{9, 0, 1} +} + +func (x *Info_Index_Detail) GetCounts() map[string]*Info_Index_Count { + if x != nil { + return x.Counts + } + return nil +} + +func (x *Info_Index_Detail) GetReplica() uint32 { + if x != nil { + return x.Replica + } + return 0 +} + +func (x *Info_Index_Detail) GetLiveAgents() uint32 { + if x != nil { + return x.LiveAgents + } + return 0 +} + // Represent the UUID message. type Info_Index_UUID struct { state protoimpl.MessageState @@ -4802,7 +4875,11 @@ type Info_Index_UUID struct { func (x *Info_Index_UUID) Reset() { *x = Info_Index_UUID{} if protoimpl.UnsafeEnabled { +<<<<<<< HEAD mi := &file_v1_payload_payload_proto_msgTypes[81] +======= + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] +>>>>>>> refactor/manager-index/small-refactor ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4815,7 +4892,11 @@ func (x *Info_Index_UUID) String() string { func (*Info_Index_UUID) ProtoMessage() {} func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { +<<<<<<< HEAD mi := &file_v1_payload_payload_proto_msgTypes[81] +======= + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] +>>>>>>> refactor/manager-index/small-refactor if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4828,7 +4909,11 @@ func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { // Deprecated: Use Info_Index_UUID.ProtoReflect.Descriptor instead. func (*Info_Index_UUID) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 1} +======= + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{9, 0, 2} +>>>>>>> refactor/manager-index/small-refactor } // The committed UUID. @@ -4843,7 +4928,11 @@ type Info_Index_UUID_Committed struct { func (x *Info_Index_UUID_Committed) Reset() { *x = Info_Index_UUID_Committed{} if protoimpl.UnsafeEnabled { +<<<<<<< HEAD mi := &file_v1_payload_payload_proto_msgTypes[82] +======= + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] +>>>>>>> refactor/manager-index/small-refactor ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4856,7 +4945,11 @@ func (x *Info_Index_UUID_Committed) String() string { func (*Info_Index_UUID_Committed) ProtoMessage() {} func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { +<<<<<<< HEAD mi := &file_v1_payload_payload_proto_msgTypes[82] +======= + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] +>>>>>>> refactor/manager-index/small-refactor if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4869,7 +4962,11 @@ func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { // Deprecated: Use Info_Index_UUID_Committed.ProtoReflect.Descriptor instead. func (*Info_Index_UUID_Committed) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 1, 0} +======= + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{9, 0, 2, 0} +>>>>>>> refactor/manager-index/small-refactor } func (x *Info_Index_UUID_Committed) GetUuid() string { @@ -4891,7 +4988,11 @@ type Info_Index_UUID_Uncommitted struct { func (x *Info_Index_UUID_Uncommitted) Reset() { *x = Info_Index_UUID_Uncommitted{} if protoimpl.UnsafeEnabled { +<<<<<<< HEAD mi := &file_v1_payload_payload_proto_msgTypes[83] +======= + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] +>>>>>>> refactor/manager-index/small-refactor ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4904,7 +5005,11 @@ func (x *Info_Index_UUID_Uncommitted) String() string { func (*Info_Index_UUID_Uncommitted) ProtoMessage() {} func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { +<<<<<<< HEAD mi := &file_v1_payload_payload_proto_msgTypes[83] +======= + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] +>>>>>>> refactor/manager-index/small-refactor if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4917,7 +5022,11 @@ func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { // Deprecated: Use Info_Index_UUID_Uncommitted.ProtoReflect.Descriptor instead. func (*Info_Index_UUID_Uncommitted) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0, 1, 1} +======= + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{9, 0, 2, 1} +>>>>>>> refactor/manager-index/small-refactor } func (x *Info_Index_UUID_Uncommitted) GetUuid() string { @@ -5128,6 +5237,7 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, +<<<<<<< HEAD 0x61, 0x64, 0x22, 0x6b, 0x0a, 0x14, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x63, 0x75, @@ -5523,6 +5633,129 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0xa2, 0x02, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +======= + 0x61, 0x64, 0x1a, 0x44, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x70, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, 0x73, 0x1a, 0x84, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x08, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, + 0x46, 0x0a, 0x09, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x39, 0x0a, 0x09, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x8b, 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, + 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x78, 0x0a, 0x08, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x56, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x48, 0x00, 0x52, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x45, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x1a, 0x3a, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, + 0x28, 0x00, 0x52, 0x08, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x66, 0x0a, 0x0a, + 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x72, 0x1a, 0x58, 0x0a, 0x07, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xc2, 0x09, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0xac, 0x03, + 0x0a, 0x05, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x75, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x06, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x75, + 0x6e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x61, 0x76, 0x69, 0x6e, 0x67, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x1a, 0xdf, + 0x01, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x41, 0x0a, 0x06, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x72, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x76, 0x65, 0x5f, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6c, 0x69, 0x76, + 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x57, 0x0a, 0x0b, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x4a, 0x0a, 0x04, 0x55, 0x55, 0x49, 0x44, 0x1a, 0x1f, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x1a, 0x21, 0x0a, 0x0b, 0x55, 0x6e, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x1a, 0xef, 0x01, 0x0a, + 0x03, 0x50, 0x6f, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, + 0x42, 0x04, 0x72, 0x02, 0x78, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x26, 0x0a, 0x03, 0x63, 0x70, + 0x75, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x50, 0x55, 0x52, 0x03, 0x63, + 0x70, 0x75, 0x12, 0x2f, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x06, 0x6d, 0x65, 0x6d, + 0x6f, 0x72, 0x79, 0x12, 0x29, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, + 0x6e, 0x66, 0x6f, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x1a, 0xe8, + 0x01, 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, + 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x41, 0x64, 0x64, 0x72, 0x12, 0x26, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x50, 0x55, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x2f, 0x0a, + 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x29, + 0x0a, 0x04, 0x50, 0x6f, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, + 0x6f, 0x64, 0x73, 0x52, 0x04, 0x50, 0x6f, 0x64, 0x73, 0x1a, 0x4b, 0x0a, 0x03, 0x43, 0x50, 0x55, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x4e, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x3a, 0x0a, 0x04, 0x50, 0x6f, 0x64, 0x73, 0x12, 0x32, + 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, + 0x6f, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x04, 0x70, 0x6f, + 0x64, 0x73, 0x1a, 0x3e, 0x0a, 0x05, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x6e, + 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4e, 0x6f, 0x64, + 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x05, 0x6e, 0x6f, 0x64, + 0x65, 0x73, 0x1a, 0x15, 0x0a, 0x03, 0x49, 0x50, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x42, 0x64, 0x0a, 0x1d, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, + 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x42, 0x0b, 0x56, 0x61, 0x6c, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, + 0x64, 0x61, 0x61, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0xa2, 0x02, + 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +>>>>>>> refactor/manager-index/small-refactor } var ( @@ -5537,9 +5770,15 @@ func file_v1_payload_payload_proto_rawDescGZIP() []byte { return file_v1_payload_payload_proto_rawDescData } +<<<<<<< HEAD var file_v1_payload_payload_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 88) var file_v1_payload_payload_proto_goTypes = []interface{}{ +======= +var file_apis_proto_v1_payload_payload_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_apis_proto_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 76) +var file_apis_proto_v1_payload_payload_proto_goTypes = []interface{}{ +>>>>>>> refactor/manager-index/small-refactor (Search_AggregationAlgorithm)(0), // 0: payload.v1.Search.AggregationAlgorithm (Remove_Timestamp_Operator)(0), // 1: payload.v1.Remove.Timestamp.Operator (*Search)(nil), // 2: payload.v1.Search @@ -5548,6 +5787,7 @@ var file_v1_payload_payload_proto_goTypes = []interface{}{ (*Update)(nil), // 5: payload.v1.Update (*Upsert)(nil), // 6: payload.v1.Upsert (*Remove)(nil), // 7: payload.v1.Remove +<<<<<<< HEAD (*Flush)(nil), // 8: payload.v1.Flush (*Object)(nil), // 9: payload.v1.Object (*Control)(nil), // 10: payload.v1.Control @@ -5632,6 +5872,79 @@ var file_v1_payload_payload_proto_goTypes = []interface{}{ (*Mirror_Targets)(nil), // 89: payload.v1.Mirror.Targets (*wrapperspb.FloatValue)(nil), // 90: google.protobuf.FloatValue (*status.Status)(nil), // 91: google.rpc.Status +======= + (*Object)(nil), // 8: payload.v1.Object + (*Control)(nil), // 9: payload.v1.Control + (*Discoverer)(nil), // 10: payload.v1.Discoverer + (*Info)(nil), // 11: payload.v1.Info + (*Empty)(nil), // 12: payload.v1.Empty + (*Search_Request)(nil), // 13: payload.v1.Search.Request + (*Search_MultiRequest)(nil), // 14: payload.v1.Search.MultiRequest + (*Search_IDRequest)(nil), // 15: payload.v1.Search.IDRequest + (*Search_MultiIDRequest)(nil), // 16: payload.v1.Search.MultiIDRequest + (*Search_ObjectRequest)(nil), // 17: payload.v1.Search.ObjectRequest + (*Search_MultiObjectRequest)(nil), // 18: payload.v1.Search.MultiObjectRequest + (*Search_Config)(nil), // 19: payload.v1.Search.Config + (*Search_Response)(nil), // 20: payload.v1.Search.Response + (*Search_Responses)(nil), // 21: payload.v1.Search.Responses + (*Search_StreamResponse)(nil), // 22: payload.v1.Search.StreamResponse + (*Filter_Target)(nil), // 23: payload.v1.Filter.Target + (*Filter_Config)(nil), // 24: payload.v1.Filter.Config + (*Insert_Request)(nil), // 25: payload.v1.Insert.Request + (*Insert_MultiRequest)(nil), // 26: payload.v1.Insert.MultiRequest + (*Insert_ObjectRequest)(nil), // 27: payload.v1.Insert.ObjectRequest + (*Insert_MultiObjectRequest)(nil), // 28: payload.v1.Insert.MultiObjectRequest + (*Insert_Config)(nil), // 29: payload.v1.Insert.Config + (*Update_Request)(nil), // 30: payload.v1.Update.Request + (*Update_MultiRequest)(nil), // 31: payload.v1.Update.MultiRequest + (*Update_ObjectRequest)(nil), // 32: payload.v1.Update.ObjectRequest + (*Update_MultiObjectRequest)(nil), // 33: payload.v1.Update.MultiObjectRequest + (*Update_Config)(nil), // 34: payload.v1.Update.Config + (*Upsert_Request)(nil), // 35: payload.v1.Upsert.Request + (*Upsert_MultiRequest)(nil), // 36: payload.v1.Upsert.MultiRequest + (*Upsert_ObjectRequest)(nil), // 37: payload.v1.Upsert.ObjectRequest + (*Upsert_MultiObjectRequest)(nil), // 38: payload.v1.Upsert.MultiObjectRequest + (*Upsert_Config)(nil), // 39: payload.v1.Upsert.Config + (*Remove_Request)(nil), // 40: payload.v1.Remove.Request + (*Remove_MultiRequest)(nil), // 41: payload.v1.Remove.MultiRequest + (*Remove_TimestampRequest)(nil), // 42: payload.v1.Remove.TimestampRequest + (*Remove_Timestamp)(nil), // 43: payload.v1.Remove.Timestamp + (*Remove_Config)(nil), // 44: payload.v1.Remove.Config + (*Object_VectorRequest)(nil), // 45: payload.v1.Object.VectorRequest + (*Object_Distance)(nil), // 46: payload.v1.Object.Distance + (*Object_StreamDistance)(nil), // 47: payload.v1.Object.StreamDistance + (*Object_ID)(nil), // 48: payload.v1.Object.ID + (*Object_IDs)(nil), // 49: payload.v1.Object.IDs + (*Object_Vector)(nil), // 50: payload.v1.Object.Vector + (*Object_Vectors)(nil), // 51: payload.v1.Object.Vectors + (*Object_StreamVector)(nil), // 52: payload.v1.Object.StreamVector + (*Object_ReshapeVector)(nil), // 53: payload.v1.Object.ReshapeVector + (*Object_Blob)(nil), // 54: payload.v1.Object.Blob + (*Object_StreamBlob)(nil), // 55: payload.v1.Object.StreamBlob + (*Object_Location)(nil), // 56: payload.v1.Object.Location + (*Object_StreamLocation)(nil), // 57: payload.v1.Object.StreamLocation + (*Object_Locations)(nil), // 58: payload.v1.Object.Locations + (*Object_List)(nil), // 59: payload.v1.Object.List + (*Object_List_Request)(nil), // 60: payload.v1.Object.List.Request + (*Object_List_Response)(nil), // 61: payload.v1.Object.List.Response + (*Control_CreateIndexRequest)(nil), // 62: payload.v1.Control.CreateIndexRequest + (*Discoverer_Request)(nil), // 63: payload.v1.Discoverer.Request + (*Info_Index)(nil), // 64: payload.v1.Info.Index + (*Info_Pod)(nil), // 65: payload.v1.Info.Pod + (*Info_Node)(nil), // 66: payload.v1.Info.Node + (*Info_CPU)(nil), // 67: payload.v1.Info.CPU + (*Info_Memory)(nil), // 68: payload.v1.Info.Memory + (*Info_Pods)(nil), // 69: payload.v1.Info.Pods + (*Info_Nodes)(nil), // 70: payload.v1.Info.Nodes + (*Info_IPs)(nil), // 71: payload.v1.Info.IPs + (*Info_Index_Count)(nil), // 72: payload.v1.Info.Index.Count + (*Info_Index_Detail)(nil), // 73: payload.v1.Info.Index.Detail + (*Info_Index_UUID)(nil), // 74: payload.v1.Info.Index.UUID + nil, // 75: payload.v1.Info.Index.Detail.CountsEntry + (*Info_Index_UUID_Committed)(nil), // 76: payload.v1.Info.Index.UUID.Committed + (*Info_Index_UUID_Uncommitted)(nil), // 77: payload.v1.Info.Index.UUID.Uncommitted + (*status.Status)(nil), // 78: google.rpc.Status +>>>>>>> refactor/manager-index/small-refactor } var file_v1_payload_payload_proto_depIdxs = []int32{ 21, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config @@ -5644,6 +5957,7 @@ var file_v1_payload_payload_proto_depIdxs = []int32{ 26, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config 26, // 8: payload.v1.Search.Config.egress_filters:type_name -> payload.v1.Filter.Config 0, // 9: payload.v1.Search.Config.aggregation_algorithm:type_name -> payload.v1.Search.AggregationAlgorithm +<<<<<<< HEAD 90, // 10: payload.v1.Search.Config.ratio:type_name -> google.protobuf.FloatValue 49, // 11: payload.v1.Search.Response.results:type_name -> payload.v1.Object.Distance 22, // 12: payload.v1.Search.Responses.responses:type_name -> payload.v1.Search.Response @@ -5714,6 +6028,71 @@ var file_v1_payload_payload_proto_depIdxs = []int32{ 75, // [75:75] is the sub-list for extension type_name 75, // [75:75] is the sub-list for extension extendee 0, // [0:75] is the sub-list for field type_name +======= + 46, // 10: payload.v1.Search.Response.results:type_name -> payload.v1.Object.Distance + 20, // 11: payload.v1.Search.Responses.responses:type_name -> payload.v1.Search.Response + 20, // 12: payload.v1.Search.StreamResponse.response:type_name -> payload.v1.Search.Response + 78, // 13: payload.v1.Search.StreamResponse.status:type_name -> google.rpc.Status + 23, // 14: payload.v1.Filter.Config.targets:type_name -> payload.v1.Filter.Target + 50, // 15: payload.v1.Insert.Request.vector:type_name -> payload.v1.Object.Vector + 29, // 16: payload.v1.Insert.Request.config:type_name -> payload.v1.Insert.Config + 25, // 17: payload.v1.Insert.MultiRequest.requests:type_name -> payload.v1.Insert.Request + 54, // 18: payload.v1.Insert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 29, // 19: payload.v1.Insert.ObjectRequest.config:type_name -> payload.v1.Insert.Config + 23, // 20: payload.v1.Insert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 27, // 21: payload.v1.Insert.MultiObjectRequest.requests:type_name -> payload.v1.Insert.ObjectRequest + 24, // 22: payload.v1.Insert.Config.filters:type_name -> payload.v1.Filter.Config + 50, // 23: payload.v1.Update.Request.vector:type_name -> payload.v1.Object.Vector + 34, // 24: payload.v1.Update.Request.config:type_name -> payload.v1.Update.Config + 30, // 25: payload.v1.Update.MultiRequest.requests:type_name -> payload.v1.Update.Request + 54, // 26: payload.v1.Update.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 34, // 27: payload.v1.Update.ObjectRequest.config:type_name -> payload.v1.Update.Config + 23, // 28: payload.v1.Update.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 32, // 29: payload.v1.Update.MultiObjectRequest.requests:type_name -> payload.v1.Update.ObjectRequest + 24, // 30: payload.v1.Update.Config.filters:type_name -> payload.v1.Filter.Config + 50, // 31: payload.v1.Upsert.Request.vector:type_name -> payload.v1.Object.Vector + 39, // 32: payload.v1.Upsert.Request.config:type_name -> payload.v1.Upsert.Config + 35, // 33: payload.v1.Upsert.MultiRequest.requests:type_name -> payload.v1.Upsert.Request + 54, // 34: payload.v1.Upsert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 39, // 35: payload.v1.Upsert.ObjectRequest.config:type_name -> payload.v1.Upsert.Config + 23, // 36: payload.v1.Upsert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 37, // 37: payload.v1.Upsert.MultiObjectRequest.requests:type_name -> payload.v1.Upsert.ObjectRequest + 24, // 38: payload.v1.Upsert.Config.filters:type_name -> payload.v1.Filter.Config + 48, // 39: payload.v1.Remove.Request.id:type_name -> payload.v1.Object.ID + 44, // 40: payload.v1.Remove.Request.config:type_name -> payload.v1.Remove.Config + 40, // 41: payload.v1.Remove.MultiRequest.requests:type_name -> payload.v1.Remove.Request + 43, // 42: payload.v1.Remove.TimestampRequest.timestamps:type_name -> payload.v1.Remove.Timestamp + 1, // 43: payload.v1.Remove.Timestamp.operator:type_name -> payload.v1.Remove.Timestamp.Operator + 48, // 44: payload.v1.Object.VectorRequest.id:type_name -> payload.v1.Object.ID + 24, // 45: payload.v1.Object.VectorRequest.filters:type_name -> payload.v1.Filter.Config + 46, // 46: payload.v1.Object.StreamDistance.distance:type_name -> payload.v1.Object.Distance + 78, // 47: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status + 50, // 48: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector + 50, // 49: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector + 78, // 50: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status + 54, // 51: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob + 78, // 52: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status + 56, // 53: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location + 78, // 54: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status + 56, // 55: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location + 50, // 56: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector + 78, // 57: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status + 67, // 58: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU + 68, // 59: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory + 66, // 60: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node + 67, // 61: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU + 68, // 62: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory + 69, // 63: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods + 65, // 64: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod + 66, // 65: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node + 75, // 66: payload.v1.Info.Index.Detail.counts:type_name -> payload.v1.Info.Index.Detail.CountsEntry + 72, // 67: payload.v1.Info.Index.Detail.CountsEntry.value:type_name -> payload.v1.Info.Index.Count + 68, // [68:68] is the sub-list for method output_type + 68, // [68:68] is the sub-list for method input_type + 68, // [68:68] is the sub-list for extension type_name + 68, // [68:68] is the sub-list for extension extendee + 0, // [0:68] is the sub-list for field type_name +>>>>>>> refactor/manager-index/small-refactor } func init() { file_v1_payload_payload_proto_init() } @@ -6694,8 +7073,13 @@ func file_v1_payload_payload_proto_init() { return nil } } +<<<<<<< HEAD file_v1_payload_payload_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Info_Index_UUID); i { +======= + file_apis_proto_v1_payload_payload_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info_Index_Detail); i { +>>>>>>> refactor/manager-index/small-refactor case 0: return &v.state case 1: @@ -6706,7 +7090,23 @@ func file_v1_payload_payload_proto_init() { return nil } } +<<<<<<< HEAD file_v1_payload_payload_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { +======= + file_apis_proto_v1_payload_payload_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info_Index_UUID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apis_proto_v1_payload_payload_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { +>>>>>>> refactor/manager-index/small-refactor switch v := v.(*Info_Index_UUID_Committed); i { case 0: return &v.state @@ -6718,7 +7118,11 @@ func file_v1_payload_payload_proto_init() { return nil } } +<<<<<<< HEAD file_v1_payload_payload_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { +======= + file_apis_proto_v1_payload_payload_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { +>>>>>>> refactor/manager-index/small-refactor switch v := v.(*Info_Index_UUID_Uncommitted); i { case 0: return &v.state @@ -6785,7 +7189,11 @@ func file_v1_payload_payload_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_v1_payload_payload_proto_rawDesc, NumEnums: 2, +<<<<<<< HEAD NumMessages: 88, +======= + NumMessages: 76, +>>>>>>> refactor/manager-index/small-refactor NumExtensions: 0, NumServices: 0, }, diff --git a/apis/grpc/v1/payload/payload_vtproto.pb.go b/apis/grpc/v1/payload/payload_vtproto.pb.go index 53d8e69ecc6..26ff758cfdd 100644 --- a/apis/grpc/v1/payload/payload_vtproto.pb.go +++ b/apis/grpc/v1/payload/payload_vtproto.pb.go @@ -1474,6 +1474,32 @@ func (m *Info_Index_Count) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *Info_Index_Detail) CloneVT() *Info_Index_Detail { + if m == nil { + return (*Info_Index_Detail)(nil) + } + r := &Info_Index_Detail{ + Replica: m.Replica, + LiveAgents: m.LiveAgents, + } + if rhs := m.Counts; rhs != nil { + tmpContainer := make(map[string]*Info_Index_Count, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Counts = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Info_Index_Detail) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *Info_Index_UUID_Committed) CloneVT() *Info_Index_UUID_Committed { if m == nil { return (*Info_Index_UUID_Committed)(nil) @@ -3873,6 +3899,48 @@ func (this *Info_Index_Count) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *Info_Index_Detail) EqualVT(that *Info_Index_Detail) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Counts) != len(that.Counts) { + return false + } + for i, vx := range this.Counts { + vy, ok := that.Counts[i] + if !ok { + return false + } + if p, q := vx, vy; p != q { + if p == nil { + p = &Info_Index_Count{} + } + if q == nil { + q = &Info_Index_Count{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.Replica != that.Replica { + return false + } + if this.LiveAgents != that.LiveAgents { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Info_Index_Detail) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Info_Index_Detail) + if !ok { + return false + } + return this.EqualVT(that) +} func (this *Info_Index_UUID_Committed) EqualVT(that *Info_Index_UUID_Committed) bool { if this == that { return true @@ -7770,6 +7838,71 @@ func (m *Info_Index_Count) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Info_Index_Detail) 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 *Info_Index_Detail) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Info_Index_Detail) 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.LiveAgents != 0 { + i = encodeVarint(dAtA, i, uint64(m.LiveAgents)) + i-- + dAtA[i] = 0x18 + } + if m.Replica != 0 { + i = encodeVarint(dAtA, i, uint64(m.Replica)) + i-- + dAtA[i] = 0x10 + } + if len(m.Counts) > 0 { + for k := range m.Counts { + v := m.Counts[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *Info_Index_UUID_Committed) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -10034,6 +10167,35 @@ func (m *Info_Index_Count) SizeVT() (n int) { return n } +func (m *Info_Index_Detail) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Counts) > 0 { + for k, v := range m.Counts { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + sov(uint64(l)) + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + if m.Replica != 0 { + n += 1 + sov(uint64(m.Replica)) + } + if m.LiveAgents != 0 { + n += 1 + sov(uint64(m.LiveAgents)) + } + n += len(m.unknownFields) + return n +} + func (m *Info_Index_UUID_Committed) SizeVT() (n int) { if m == nil { return 0 @@ -17232,6 +17394,224 @@ func (m *Info_Index_Count) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *Info_Index_Detail) 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 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: Info_Index_Detail: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Info_Index_Detail: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Counts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Counts == nil { + m.Counts = make(map[string]*Info_Index_Count) + } + var mapkey string + var mapvalue *Info_Index_Count + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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 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 ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return 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 ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Info_Index_Count{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Counts[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replica", wireType) + } + m.Replica = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Replica |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LiveAgents", wireType) + } + m.LiveAgents = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LiveAgents |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return 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 *Info_Index_UUID_Committed) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/apis/grpc/v1/rpc/errdetails/error_details.pb.go b/apis/grpc/v1/rpc/errdetails/error_details.pb.go index c126c47fa86..3ffd0b13fc6 100644 --- a/apis/grpc/v1/rpc/errdetails/error_details.pb.go +++ b/apis/grpc/v1/rpc/errdetails/error_details.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/rpc/errdetails/error_details.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/rpc/error_details.proto +>>>>>>> refactor/manager-index/small-refactor package errdetails diff --git a/apis/grpc/v1/vald/filter.pb.go b/apis/grpc/v1/vald/filter.pb.go index 162881bc5ef..396c3885c0a 100644 --- a/apis/grpc/v1/vald/filter.pb.go +++ b/apis/grpc/v1/vald/filter.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/vald/filter.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/vald/filter.proto +>>>>>>> refactor/manager-index/small-refactor package vald diff --git a/apis/grpc/v1/vald/insert.pb.go b/apis/grpc/v1/vald/insert.pb.go index 8a5f6997f6d..615edaafb72 100644 --- a/apis/grpc/v1/vald/insert.pb.go +++ b/apis/grpc/v1/vald/insert.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/vald/insert.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/vald/insert.proto +>>>>>>> refactor/manager-index/small-refactor package vald diff --git a/apis/grpc/v1/vald/object.pb.go b/apis/grpc/v1/vald/object.pb.go index 9730bfff6ab..7e706cdbcf7 100644 --- a/apis/grpc/v1/vald/object.pb.go +++ b/apis/grpc/v1/vald/object.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/vald/object.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/vald/object.proto +>>>>>>> refactor/manager-index/small-refactor package vald diff --git a/apis/grpc/v1/vald/remove.pb.go b/apis/grpc/v1/vald/remove.pb.go index 1e16f2f3b88..a0e03125f31 100644 --- a/apis/grpc/v1/vald/remove.pb.go +++ b/apis/grpc/v1/vald/remove.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/vald/remove.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/vald/remove.proto +>>>>>>> refactor/manager-index/small-refactor package vald diff --git a/apis/grpc/v1/vald/search.pb.go b/apis/grpc/v1/vald/search.pb.go index 960c0b50815..e5615f8ef1b 100644 --- a/apis/grpc/v1/vald/search.pb.go +++ b/apis/grpc/v1/vald/search.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/vald/search.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/vald/search.proto +>>>>>>> refactor/manager-index/small-refactor package vald diff --git a/apis/grpc/v1/vald/update.pb.go b/apis/grpc/v1/vald/update.pb.go index 5c9fa2ed27d..1d698693139 100644 --- a/apis/grpc/v1/vald/update.pb.go +++ b/apis/grpc/v1/vald/update.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/vald/update.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/vald/update.proto +>>>>>>> refactor/manager-index/small-refactor package vald diff --git a/apis/grpc/v1/vald/upsert.pb.go b/apis/grpc/v1/vald/upsert.pb.go index 336c393e1bf..4e1a01fac6b 100644 --- a/apis/grpc/v1/vald/upsert.pb.go +++ b/apis/grpc/v1/vald/upsert.pb.go @@ -16,9 +16,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: +<<<<<<< HEAD // protoc-gen-go v1.34.1 // protoc (unknown) // source: v1/vald/upsert.proto +======= +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: apis/proto/v1/vald/upsert.proto +>>>>>>> refactor/manager-index/small-refactor package vald diff --git a/apis/proto/v1/manager/index/index_manager.proto b/apis/proto/v1/manager/index/index_manager.proto index a18f0c1bba1..edf6e571fb3 100644 --- a/apis/proto/v1/manager/index/index_manager.proto +++ b/apis/proto/v1/manager/index/index_manager.proto @@ -32,4 +32,8 @@ service Index { rpc IndexInfo(payload.v1.Empty) returns (payload.v1.Info.Index.Count) { option (google.api.http).get = "/index/info"; } + // Represent the RPC to get the index information for each agents. + rpc IndexDetail(payload.v1.Empty) returns (payload.v1.Info.Index.Detail) { + option (google.api.http).get = "/index/detail"; + } } diff --git a/apis/proto/v1/payload/payload.proto b/apis/proto/v1/payload/payload.proto index 5f9af665a0e..0ee61b3336f 100644 --- a/apis/proto/v1/payload/payload.proto +++ b/apis/proto/v1/payload/payload.proto @@ -523,6 +523,15 @@ message Info { // The saving index count. bool saving = 4; } + // Represent the index count for each Agents message. + message Detail { + // count infos for each agents + map counts = 1; + // index replica of vald cluster + uint32 replica = 2; + // live agent replica of vald cluster + uint32 live_agents = 3; + } // Represent the UUID message. message UUID { diff --git a/apis/swagger/v1/manager/index/index_manager.swagger.json b/apis/swagger/v1/manager/index/index_manager.swagger.json index 73a3c346cf3..48e30cd239a 100644 --- a/apis/swagger/v1/manager/index/index_manager.swagger.json +++ b/apis/swagger/v1/manager/index/index_manager.swagger.json @@ -12,6 +12,27 @@ "consumes": ["application/json"], "produces": ["application/json"], "paths": { + "/index/detail": { + "get": { + "summary": "Represent the RPC to get the index information for each agents.", + "operationId": "Index_IndexDetail", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/IndexDetail" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "tags": ["Index"] + } + }, "/index/info": { "get": { "summary": "Represent the RPC to get the index information.", @@ -59,6 +80,29 @@ }, "description": "Represent the index count message." }, + "IndexDetail": { + "type": "object", + "properties": { + "counts": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/IndexCount" + }, + "title": "count infos for each agents" + }, + "replica": { + "type": "integer", + "format": "int64", + "title": "index replica of vald cluster" + }, + "liveAgents": { + "type": "integer", + "format": "int64", + "title": "live agent replica of vald cluster" + } + }, + "description": "Represent the index count for each Agents message." + }, "protobufAny": { "type": "object", "properties": { diff --git a/go.mod b/go.mod index 92a8a9826a2..3c701ef6382 100644 --- a/go.mod +++ b/go.mod @@ -348,7 +348,6 @@ replace ( ) require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240401165935-b983156c5e99.1 cloud.google.com/go/storage v1.40.0 code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6 github.com/akrylysov/pogreb v0.0.0-00010101000000-000000000000 diff --git a/go.sum b/go.sum index 268541e1d4d..6b6318825b3 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240401165935-b983156c5e99.1 h1:npqzxtoNbSdWs7XBDzqvqA1ANrQQGc8QpN0zFq9sVHA= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240401165935-b983156c5e99.1/go.mod h1:XF+P8+RmfdufmIYpGUC+6bF7S+IlmHDEnCrO3OXaUAQ= cel.dev/expr v0.15.0 h1:O1jzfJCQBfL5BFoYktaxwIhuttaQPsVWerH9/EEKx0w= cel.dev/expr v0.15.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= cloud.google.com/go v0.112.2 h1:ZaGT6LiG7dBzi6zNOvVZwacaXlmf3lRqnC4DQzqyRQw= diff --git a/internal/observability/trace/status.go b/internal/observability/trace/status.go index 48a9adfd835..dc7390c61d4 100644 --- a/internal/observability/trace/status.go +++ b/internal/observability/trace/status.go @@ -19,7 +19,7 @@ package trace import ( "github.com/vdaas/vald/internal/net/grpc/codes" - "go.opentelemetry.io/otel/attribute" + "github.com/vdaas/vald/internal/observability/attribute" ocodes "go.opentelemetry.io/otel/codes" semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) diff --git a/pkg/agent/core/ngt/handler/grpc/insert.go b/pkg/agent/core/ngt/handler/grpc/insert.go index d4be3907c93..3a6c1fb3fb2 100644 --- a/pkg/agent/core/ngt/handler/grpc/insert.go +++ b/pkg/agent/core/ngt/handler/grpc/insert.go @@ -26,9 +26,9 @@ import ( "github.com/vdaas/vald/internal/net/grpc/codes" "github.com/vdaas/vald/internal/net/grpc/errdetails" "github.com/vdaas/vald/internal/net/grpc/status" + "github.com/vdaas/vald/internal/observability/attribute" "github.com/vdaas/vald/internal/observability/trace" "github.com/vdaas/vald/internal/strings" - "go.opentelemetry.io/otel/attribute" ) // Insert inserts a vector to the NGT. diff --git a/pkg/agent/core/ngt/handler/grpc/linear_search.go b/pkg/agent/core/ngt/handler/grpc/linear_search.go index abe0d374cdc..f3e84f04fb4 100644 --- a/pkg/agent/core/ngt/handler/grpc/linear_search.go +++ b/pkg/agent/core/ngt/handler/grpc/linear_search.go @@ -26,11 +26,11 @@ import ( "github.com/vdaas/vald/internal/net/grpc/codes" "github.com/vdaas/vald/internal/net/grpc/errdetails" "github.com/vdaas/vald/internal/net/grpc/status" + "github.com/vdaas/vald/internal/observability/attribute" "github.com/vdaas/vald/internal/observability/trace" "github.com/vdaas/vald/internal/safety" "github.com/vdaas/vald/internal/strings" "github.com/vdaas/vald/internal/sync" - "go.opentelemetry.io/otel/attribute" ) func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) { diff --git a/pkg/agent/core/ngt/handler/grpc/remove.go b/pkg/agent/core/ngt/handler/grpc/remove.go index f57685bbb14..55654038d01 100644 --- a/pkg/agent/core/ngt/handler/grpc/remove.go +++ b/pkg/agent/core/ngt/handler/grpc/remove.go @@ -26,10 +26,10 @@ import ( "github.com/vdaas/vald/internal/net/grpc/codes" "github.com/vdaas/vald/internal/net/grpc/errdetails" "github.com/vdaas/vald/internal/net/grpc/status" + "github.com/vdaas/vald/internal/observability/attribute" "github.com/vdaas/vald/internal/observability/trace" "github.com/vdaas/vald/internal/strings" "github.com/vdaas/vald/internal/sync" - "go.opentelemetry.io/otel/attribute" ) func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (res *payload.Object_Location, err error) { diff --git a/pkg/agent/core/ngt/handler/grpc/search.go b/pkg/agent/core/ngt/handler/grpc/search.go index 3c0e43dc847..69eed7b0ec0 100644 --- a/pkg/agent/core/ngt/handler/grpc/search.go +++ b/pkg/agent/core/ngt/handler/grpc/search.go @@ -26,11 +26,11 @@ import ( "github.com/vdaas/vald/internal/net/grpc/codes" "github.com/vdaas/vald/internal/net/grpc/errdetails" "github.com/vdaas/vald/internal/net/grpc/status" + "github.com/vdaas/vald/internal/observability/attribute" "github.com/vdaas/vald/internal/observability/trace" "github.com/vdaas/vald/internal/safety" "github.com/vdaas/vald/internal/strings" "github.com/vdaas/vald/internal/sync" - "go.opentelemetry.io/otel/attribute" ) func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) { diff --git a/pkg/agent/core/ngt/handler/grpc/update.go b/pkg/agent/core/ngt/handler/grpc/update.go index 0a76d7395f3..9f56f774a96 100644 --- a/pkg/agent/core/ngt/handler/grpc/update.go +++ b/pkg/agent/core/ngt/handler/grpc/update.go @@ -26,9 +26,9 @@ import ( "github.com/vdaas/vald/internal/net/grpc/codes" "github.com/vdaas/vald/internal/net/grpc/errdetails" "github.com/vdaas/vald/internal/net/grpc/status" + "github.com/vdaas/vald/internal/observability/attribute" "github.com/vdaas/vald/internal/observability/trace" "github.com/vdaas/vald/internal/strings" - "go.opentelemetry.io/otel/attribute" ) func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res *payload.Object_Location, err error) { diff --git a/pkg/agent/core/ngt/service/ngt_test.go b/pkg/agent/core/ngt/service/ngt_test.go index 3adcf187266..6a3b983447b 100644 --- a/pkg/agent/core/ngt/service/ngt_test.go +++ b/pkg/agent/core/ngt/service/ngt_test.go @@ -38,6 +38,7 @@ import ( "github.com/vdaas/vald/internal/file" kvald "github.com/vdaas/vald/internal/k8s/vald" "github.com/vdaas/vald/internal/log" + "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/safety" "github.com/vdaas/vald/internal/strings" "github.com/vdaas/vald/internal/sync" @@ -50,7 +51,6 @@ import ( "github.com/vdaas/vald/pkg/agent/internal/kvs" "github.com/vdaas/vald/pkg/agent/internal/metadata" "github.com/vdaas/vald/pkg/agent/internal/vqueue" - "google.golang.org/grpc" ) var defaultConfig = config.NGT{ @@ -1556,8 +1556,8 @@ func Test_ngt_E2E(t *testing.T) { type args struct { requests []*payload.Upsert_MultiRequest - addr string - dialOpts []grpc.DialOption + addr string + client grpc.Client } type want struct { err error @@ -1612,10 +1612,8 @@ func Test_ngt_E2E(t *testing.T) { createRandomData(500000, new(createRandomDataConfig)), 50, ), - addr: "127.0.0.1:8080", - dialOpts: []grpc.DialOption{ - grpc.WithInsecure(), - }, + addr: "127.0.0.1:8080", + client: grpc.New(grpc.WithInsecure(true)), }, }, } @@ -1637,20 +1635,15 @@ func Test_ngt_E2E(t *testing.T) { if test.checkFunc == nil { checkFunc = defaultCheckFunc } - conn, err := grpc.DialContext(ctx, test.args.addr, test.args.dialOpts...) - if err := checkFunc(test.want, err); err != nil { - t.Fatal(err) - } - defer func() { - if err := conn.Close(); err != nil { - t.Error(err) - } - }() - client := vald.NewValdClient(conn) + + defer test.args.client.Close(ctx) for i := 0; i < 2; i++ { for _, req := range test.args.requests { - _, err := client.MultiUpsert(ctx, req) + _, err := test.args.client.Do(ctx, test.args.addr, + func(ctx context.Context, conn *grpc.ClientConn, opts ...grpc.CallOption) (any, error) { + return vald.NewValdClient(conn).MultiInsert(ctx, req) + }) if err != nil { t.Error(err) } diff --git a/pkg/manager/index/handler/grpc/handler.go b/pkg/manager/index/handler/grpc/handler.go index baa60334b22..bdef144141e 100644 --- a/pkg/manager/index/handler/grpc/handler.go +++ b/pkg/manager/index/handler/grpc/handler.go @@ -53,3 +53,13 @@ func (s *server) IndexInfo(ctx context.Context, _ *payload.Empty) (res *payload. Indexing: s.indexer.IsIndexing(), }, nil } + +func (s *server) IndexDetail(ctx context.Context, _ *payload.Empty) (res *payload.Info_Index_Detail, err error) { + ctx, span := trace.StartSpan(ctx, "vald/manager-index.IndexDetail") + defer func() { + if span != nil { + span.End() + } + }() + return s.indexer.LoadIndexDetail(), nil +} diff --git a/pkg/manager/index/handler/grpc/handler_test.go b/pkg/manager/index/handler/grpc/handler_test.go index 7318ce15fbf..e937ff8a3af 100644 --- a/pkg/manager/index/handler/grpc/handler_test.go +++ b/pkg/manager/index/handler/grpc/handler_test.go @@ -214,3 +214,113 @@ package grpc // }) // } // } +// +// func Test_server_IndexDetail(t *testing.T) { +// type args struct { +// ctx context.Context +// in1 *payload.Empty +// } +// type fields struct { +// indexer service.Indexer +// UnimplementedIndexServer index.UnimplementedIndexServer +// } +// type want struct { +// wantRes *payload.Info_Index_Detail +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Info_Index_Detail, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Info_Index_Detail, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// if !reflect.DeepEqual(gotRes, w.wantRes) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotRes, w.wantRes) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// in1:nil, +// }, +// fields: fields { +// indexer:nil, +// UnimplementedIndexServer:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// in1:nil, +// }, +// fields: fields { +// indexer:nil, +// UnimplementedIndexServer:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// s := &server{ +// indexer: test.fields.indexer, +// UnimplementedIndexServer: test.fields.UnimplementedIndexServer, +// } +// +// gotRes, err := s.IndexDetail(test.args.ctx, test.args.in1) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/pkg/manager/index/service/indexer.go b/pkg/manager/index/service/indexer.go index 4d6b39729b3..6dcf930d36b 100644 --- a/pkg/manager/index/service/indexer.go +++ b/pkg/manager/index/service/indexer.go @@ -43,6 +43,8 @@ type Indexer interface { NumberOfUUIDs() uint32 NumberOfUncommittedUUIDs() uint32 IsIndexing() bool + IsSaving() bool + LoadIndexDetail() *payload.Info_Index_Detail } type index struct { @@ -51,18 +53,21 @@ type index struct { creationPoolSize uint32 indexDuration time.Duration indexDurationLimit time.Duration + saveIndexDuration time.Duration saveIndexDurationLimit time.Duration - saveIndexWaitDuration time.Duration - saveIndexTargetAddrCh chan string - schMap sync.Map[string, any] - concurrency int + shouldSaveList sync.Map[string, struct{}] + createIndexConcurrency int + saveIndexConcurrency int indexInfos sync.Map[string, *payload.Info_Index_Count] - indexing atomic.Value // bool + indexing atomic.Bool + saving atomic.Bool minUncommitted uint32 uuidsCount uint32 uncommittedUUIDsCount uint32 } +var empty = struct{}{} + func New(opts ...Option) (idx Indexer, err error) { i := new(index) for _, opt := range append(defaultOptions, opts...) { @@ -71,7 +76,8 @@ func New(opts ...Option) (idx Indexer, err error) { } } i.indexing.Store(false) - if i.indexDuration+i.indexDurationLimit+i.saveIndexDurationLimit == 0 { + i.saving.Store(false) + if i.indexDuration+i.indexDurationLimit+i.saveIndexDurationLimit <= 0 { return nil, errors.ErrInvalidConfig } return i, nil @@ -87,8 +93,6 @@ func (idx *index) Start(ctx context.Context) (<-chan error, error) { return nil, err } ech := make(chan error, 100) - sech := make(chan error, 10) - idx.saveIndexTargetAddrCh = make(chan string, len(idx.client.GetAddrs(ctx))*2) idx.eg.Go(safety.RecoverFunc(func() (err error) { defer close(ech) if idx.indexDuration <= 0 { @@ -97,56 +101,101 @@ func (idx *index) Start(ctx context.Context) (<-chan error, error) { if idx.indexDurationLimit <= 0 { idx.indexDurationLimit = math.MaxInt64 } + if idx.saveIndexDuration <= 0 { + idx.saveIndexDuration = math.MaxInt64 + } if idx.saveIndexDurationLimit <= 0 { idx.saveIndexDurationLimit = math.MaxInt64 } it := time.NewTicker(idx.indexDuration) itl := time.NewTicker(idx.indexDurationLimit) + st := time.NewTicker(idx.saveIndexDuration) stl := time.NewTicker(idx.saveIndexDurationLimit) defer it.Stop() defer itl.Stop() + defer st.Stop() defer stl.Stop() finalize := func() (err error) { err = ctx.Err() - if err != nil && err != context.Canceled { + if err != nil && + !errors.Is(err, context.Canceled) && + !errors.Is(err, context.DeadlineExceeded) { return err } return nil } + var mu sync.Mutex for { select { case <-ctx.Done(): return finalize() case err = <-dech: - ech <- err - case err = <-sech: - ech <- err - case <-it.C: - err = idx.execute(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateIndex"), true, false) - if err != nil { - ech <- err - log.Error("an error occurred during indexing", err) - err = nil + case <-it.C: // index duration ticker + // execute CreateIndex. This execution ignores low index agent. + err = idx.createIndex(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateIndex"), true) + if err != nil && + !errors.Is(err, context.Canceled) && + !errors.Is(err, context.DeadlineExceeded) { + err = errors.Wrap(err, "an error occurred during create indexing") } it.Reset(idx.indexDuration) - case <-itl.C: - err = idx.execute(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateIndex"), false, false) - if err != nil { - ech <- err - log.Error("an error occurred during indexing", err) - err = nil + case <-itl.C: // index duration limit ticker + // execute CreateIndex. This execution always executes CreateIndex regardless of the state of the uncommitted index. + err = idx.createIndex(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateIndex"), false) + if err != nil && + !errors.Is(err, context.Canceled) && + !errors.Is(err, context.DeadlineExceeded) { + err = errors.Wrap(err, "an error occurred during force create indexing") } itl.Reset(idx.indexDurationLimit) - case <-stl.C: - err = idx.execute(grpc.WithGRPCMethod(ctx, "core.v1.Agent/CreateAndSaveIndex"), false, true) - if err != nil { - ech <- err - log.Error("an error occurred during indexing and saving", err) - err = nil - } - stl.Reset(idx.saveIndexDurationLimit) + case <-st.C: // save index duration ticker + // execute SaveIndex in concurrent. + idx.eg.Go(safety.RecoverFunc(func() (err error) { + if !mu.TryLock() { + return + } + defer mu.Unlock() + defer st.Reset(idx.saveIndexDuration) + err = idx.saveIndex(grpc.WithGRPCMethod(ctx, "core.v1.Agent/SaveIndex"), false) + if err != nil && + !errors.Is(err, context.Canceled) && + !errors.Is(err, context.DeadlineExceeded) { + err = errors.Wrap(err, "an error occurred during save indexing") + log.Error(err) + select { + case <-ctx.Done(): + return nil + case ech <- err: + } + } + return nil + })) + case <-stl.C: // save index duration limit ticker + // execute SaveIndex in concurrent. + idx.eg.Go(safety.RecoverFunc(func() (err error) { + if !mu.TryLock() { + return + } + defer mu.Unlock() + defer stl.Reset(idx.saveIndexDurationLimit) + err = idx.saveIndex(grpc.WithGRPCMethod(ctx, "core.v1.Agent/SaveIndex"), true) + if err != nil && + !errors.Is(err, context.Canceled) && + !errors.Is(err, context.DeadlineExceeded) { + err = errors.Wrap(err, "an error occurred during force save indexing") + log.Error(err) + select { + case <-ctx.Done(): + return nil + case ech <- err: + } + } + return nil + })) } - if err != nil { + if err != nil && + !errors.Is(err, context.Canceled) && + !errors.Is(err, context.DeadlineExceeded) { log.Error(err) select { case <-ctx.Done(): @@ -156,35 +205,10 @@ func (idx *index) Start(ctx context.Context) (<-chan error, error) { } } })) - idx.eg.Go(safety.RecoverFunc(func() (err error) { - defer close(sech) - for { - select { - case <-ctx.Done(): - return - case addr := <-idx.saveIndexTargetAddrCh: - idx.schMap.Delete(addr) - _, err := idx.client.GetClient(). - Do(grpc.WithGRPCMethod(ctx, "core.v1.Agent/SaveIndex"), addr, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) { - return agent.NewAgentClient(conn).SaveIndex(ctx, &payload.Empty{}, copts...) - }) - if err != nil { - log.Warnf("an error occurred while calling SaveIndex of %s: %s", addr, err) - select { - case <-ctx.Done(): - return nil - case sech <- err: - } - } - } - - idx.waitForNextSaving(ctx) - } - })) return ech, nil } -func (idx *index) execute(ctx context.Context, enableLowIndexSkip, immediateSaving bool) (err error) { +func (idx *index) createIndex(ctx context.Context, enableLowIndexSkip bool) (err error) { ctx, span := trace.StartSpan(ctx, "vald/manager-index/service/Indexer.execute") defer func() { if span != nil { @@ -192,79 +216,75 @@ func (idx *index) execute(ctx context.Context, enableLowIndexSkip, immediateSavi } }() - if idx.indexing.Load().(bool) { + if idx.indexing.Load() { return nil } idx.indexing.Store(true) defer idx.indexing.Store(false) - addrs := idx.client.GetAddrs(ctx) - err = idx.client.GetClient().OrderedRangeConcurrent(ctx, addrs, - idx.concurrency, + return errors.Join(idx.client.GetClient().OrderedRangeConcurrent(ctx, idx.client.GetAddrs(ctx), + idx.createIndexConcurrency, func(ctx context.Context, addr string, conn *grpc.ClientConn, copts ...grpc.CallOption, ) (err error) { - select { - case <-ctx.Done(): - return nil - default: - } info, ok := idx.indexInfos.Load(addr) if ok && (info.GetUncommitted() == 0 || (enableLowIndexSkip && info.GetUncommitted() < idx.minUncommitted)) { return nil } - ac := agent.NewAgentClient(conn) - req := &payload.Control_CreateIndexRequest{ + _, err = agent.NewAgentClient(conn).CreateIndex(ctx, &payload.Control_CreateIndexRequest{ PoolSize: idx.creationPoolSize, - } - if !immediateSaving { - _, err = ac.CreateIndex(ctx, req, copts...) - if err != nil { - st, ok := status.FromError(err) - if ok && st != nil && st.Code() == codes.FailedPrecondition { - log.Debugf("CreateIndex of %s skipped, message: %s, err: %v", addr, st.Message(), errors.Join(st.Err(), err)) - return nil - } - log.Warnf("an error occurred while calling CreateIndex of %s: %s", addr, err) - return err - } - _, ok := idx.schMap.Load(addr) - if !ok { - select { - case <-ctx.Done(): - case idx.saveIndexTargetAddrCh <- addr: - idx.schMap.Store(addr, struct{}{}) - } - } - return nil - } - _, err = ac.CreateAndSaveIndex(ctx, req, copts...) + }, copts...) if err != nil { st, ok := status.FromError(err) if ok && st != nil && st.Code() == codes.FailedPrecondition { log.Debugf("CreateIndex of %s skipped, message: %s, err: %v", addr, st.Message(), errors.Join(st.Err(), err)) return nil } - log.Warnf("an error occurred while calling CreateAndSaveIndex of %s: %s", addr, err) + log.Warnf("an error occurred while calling CreateIndex of %s: %s", addr, err) return err } - idx.waitForNextSaving(ctx) + _, ok = idx.shouldSaveList.LoadOrStore(addr, empty) + if ok { + log.Debugf("addr %s already queued for saveIndex", addr) + return nil + } return nil - }) - if err != nil { - return err - } - return idx.loadInfos(ctx) + }), idx.loadInfos(ctx)) } -func (idx *index) waitForNextSaving(ctx context.Context) { - if idx.saveIndexWaitDuration > 0 { - timer := time.NewTimer(idx.saveIndexWaitDuration) - select { - case <-ctx.Done(): - case <-timer.C: +func (idx *index) saveIndex(ctx context.Context, force bool) (err error) { + ctx, span := trace.StartSpan(ctx, "vald/manager-index/service/Indexer.saveIndex") + defer func() { + if span != nil { + span.End() } - timer.Stop() + }() + + if idx.saving.Load() { + return nil } + idx.saving.Store(true) + defer idx.saving.Store(false) + return idx.client.GetClient().OrderedRangeConcurrent(ctx, idx.client.GetAddrs(ctx), + idx.saveIndexConcurrency, + func(ctx context.Context, + addr string, conn *grpc.ClientConn, copts ...grpc.CallOption, + ) (err error) { + _, ok := idx.shouldSaveList.LoadAndDelete(addr) + if !ok && !force { + return nil + } + _, err = agent.NewAgentClient(conn).SaveIndex(ctx, new(payload.Empty), copts...) + if err != nil { + st, ok := status.FromError(err) + if ok && st != nil && st.Code() == codes.FailedPrecondition { + log.Debugf("CreateIndex of %s skipped, message: %s, err: %v", addr, st.Message(), errors.Join(st.Err(), err)) + return nil + } + log.Warnf("an error occurred while calling CreateIndex of %s: %s", addr, err) + return err + } + return nil + }) } func (idx *index) loadInfos(ctx context.Context) (err error) { @@ -318,7 +338,11 @@ func (idx *index) loadInfos(ctx context.Context) (err error) { } func (idx *index) IsIndexing() bool { - return idx.indexing.Load().(bool) + return idx.indexing.Load() +} + +func (idx *index) IsSaving() bool { + return idx.saving.Load() } func (idx *index) NumberOfUUIDs() uint32 { @@ -328,3 +352,12 @@ func (idx *index) NumberOfUUIDs() uint32 { func (idx *index) NumberOfUncommittedUUIDs() uint32 { return atomic.LoadUint32(&idx.uncommittedUUIDsCount) } + +func (idx *index) LoadIndexDetail() (detail *payload.Info_Index_Detail) { + detail = new(payload.Info_Index_Detail) + idx.indexInfos.Range(func(addr string, info *payload.Info_Index_Count) bool { + detail.Counts[addr] = info + return true + }) + return detail +} diff --git a/pkg/manager/index/service/indexer_test.go b/pkg/manager/index/service/indexer_test.go index 40854f98d6e..f5cb8a5ce89 100644 --- a/pkg/manager/index/service/indexer_test.go +++ b/pkg/manager/index/service/indexer_test.go @@ -702,3 +702,148 @@ package service // }) // } // } +// +// func Test_index_LoadIndexDetail(t *testing.T) { +// type fields struct { +// client discoverer.Client +// eg errgroup.Group +// creationPoolSize uint32 +// indexDuration time.Duration +// indexDurationLimit time.Duration +// saveIndexDurationLimit time.Duration +// saveIndexWaitDuration time.Duration +// saveIndexTargetAddrCh chan string +// schMap sync.Map[string, any] +// concurrency int +// indexInfos sync.Map[string, *payload.Info_Index_Count] +// indexing atomic.Value +// minUncommitted uint32 +// uuidsCount uint32 +// uncommittedUUIDsCount uint32 +// } +// type want struct { +// wantDetail *payload.Info_Index_Detail +// } +// type test struct { +// name string +// fields fields +// want want +// checkFunc func(want, *payload.Info_Index_Detail) error +// beforeFunc func(*testing.T) +// afterFunc func(*testing.T) +// } +// defaultCheckFunc := func(w want, gotDetail *payload.Info_Index_Detail) error { +// if !reflect.DeepEqual(gotDetail, w.wantDetail) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotDetail, w.wantDetail) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// fields: fields { +// client:nil, +// eg:nil, +// creationPoolSize:0, +// indexDuration:nil, +// indexDurationLimit:nil, +// saveIndexDurationLimit:nil, +// saveIndexWaitDuration:nil, +// saveIndexTargetAddrCh:nil, +// schMap:nil, +// concurrency:0, +// indexInfos:nil, +// indexing:nil, +// minUncommitted:0, +// uuidsCount:0, +// uncommittedUUIDsCount:0, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// fields: fields { +// client:nil, +// eg:nil, +// creationPoolSize:0, +// indexDuration:nil, +// indexDurationLimit:nil, +// saveIndexDurationLimit:nil, +// saveIndexWaitDuration:nil, +// saveIndexTargetAddrCh:nil, +// schMap:nil, +// concurrency:0, +// indexInfos:nil, +// indexing:nil, +// minUncommitted:0, +// uuidsCount:0, +// uncommittedUUIDsCount:0, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// idx := &index{ +// client: test.fields.client, +// eg: test.fields.eg, +// creationPoolSize: test.fields.creationPoolSize, +// indexDuration: test.fields.indexDuration, +// indexDurationLimit: test.fields.indexDurationLimit, +// saveIndexDurationLimit: test.fields.saveIndexDurationLimit, +// saveIndexWaitDuration: test.fields.saveIndexWaitDuration, +// saveIndexTargetAddrCh: test.fields.saveIndexTargetAddrCh, +// schMap: test.fields.schMap, +// concurrency: test.fields.concurrency, +// indexInfos: test.fields.indexInfos, +// indexing: test.fields.indexing, +// minUncommitted: test.fields.minUncommitted, +// uuidsCount: test.fields.uuidsCount, +// uncommittedUUIDsCount: test.fields.uncommittedUUIDsCount, +// } +// +// gotDetail := idx.LoadIndexDetail() +// if err := checkFunc(test.want, gotDetail); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/pkg/manager/index/service/option.go b/pkg/manager/index/service/option.go index c3fffb7dc24..ec6b76d662b 100644 --- a/pkg/manager/index/service/option.go +++ b/pkg/manager/index/service/option.go @@ -31,7 +31,6 @@ var defaultOptions = []Option{ WithIndexingDuration("1m"), WithIndexingDurationLimit("30m"), WithSaveIndexDurationLimit("3h"), - WithSaveIndexWaitDuration("10m"), WithMinUncommitted(100), WithCreationPoolSize(10000), } @@ -39,27 +38,22 @@ var defaultOptions = []Option{ func WithIndexingConcurrency(c int) Option { return func(idx *index) error { if c != 0 { - idx.concurrency = c + idx.createIndexConcurrency = c } return nil } } -func WithIndexingDuration(dur string) Option { +func WithSaveConcurrency(c int) Option { return func(idx *index) error { - if dur == "" { - return nil - } - d, err := timeutil.Parse(dur) - if err != nil { - return err + if c != 0 { + idx.saveIndexConcurrency = c } - idx.indexDuration = d return nil } } -func WithIndexingDurationLimit(dur string) Option { +func WithIndexingDuration(dur string) Option { return func(idx *index) error { if dur == "" { return nil @@ -68,12 +62,12 @@ func WithIndexingDurationLimit(dur string) Option { if err != nil { return err } - idx.indexDurationLimit = d + idx.indexDuration = d return nil } } -func WithSaveIndexDurationLimit(dur string) Option { +func WithIndexingDurationLimit(dur string) Option { return func(idx *index) error { if dur == "" { return nil @@ -82,12 +76,12 @@ func WithSaveIndexDurationLimit(dur string) Option { if err != nil { return err } - idx.saveIndexDurationLimit = d + idx.indexDurationLimit = d return nil } } -func WithSaveIndexWaitDuration(dur string) Option { +func WithSaveIndexDurationLimit(dur string) Option { return func(idx *index) error { if dur == "" { return nil @@ -96,7 +90,7 @@ func WithSaveIndexWaitDuration(dur string) Option { if err != nil { return err } - idx.saveIndexWaitDuration = d + idx.saveIndexDurationLimit = d return nil } } diff --git a/pkg/manager/index/usecase/indexer.go b/pkg/manager/index/usecase/indexer.go index a891fc487f0..0ca2f303c1d 100644 --- a/pkg/manager/index/usecase/indexer.go +++ b/pkg/manager/index/usecase/indexer.go @@ -98,7 +98,6 @@ func New(cfg *config.Data) (r runner.Runner, err error) { service.WithIndexingDuration(cfg.Indexer.AutoIndexCheckDuration), service.WithIndexingDurationLimit(cfg.Indexer.AutoIndexDurationLimit), service.WithSaveIndexDurationLimit(cfg.Indexer.AutoSaveIndexDurationLimit), - service.WithSaveIndexWaitDuration(cfg.Indexer.AutoSaveIndexWaitDuration), service.WithCreationPoolSize(cfg.Indexer.CreationPoolSize), service.WithMinUncommitted(cfg.Indexer.AutoIndexLength), ) diff --git a/tests/chaos/chart/README.md b/tests/chaos/chart/README.md index a142fc41360..18e44750b7c 100644 --- a/tests/chaos/chart/README.md +++ b/tests/chaos/chart/README.md @@ -41,4 +41,9 @@ A Helm chart for testing Vald using Chaos Mesh. --- +<<<<<<< HEAD Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) +======= +Autogenerated from chart metadata using [helm-docs v1.11.2](https://github.com/norwoodj/helm-docs/releases/v1.11.2) + +> > > > > > > refactor/manager-index/small-refactor diff --git a/versions/HELM_DOCS_VERSION b/versions/HELM_DOCS_VERSION index b50dd27dd92..dd4911affca 100644 --- a/versions/HELM_DOCS_VERSION +++ b/versions/HELM_DOCS_VERSION @@ -1 +1,5 @@ +<<<<<<< HEAD 1.13.1 +======= +1.11.2 +>>>>>>> refactor/manager-index/small-refactor diff --git a/versions/HELM_VERSION b/versions/HELM_VERSION index 362617ca872..83b75d654b4 100644 --- a/versions/HELM_VERSION +++ b/versions/HELM_VERSION @@ -1 +1,5 @@ +<<<<<<< HEAD v3.14.4 +======= +v3.13.0 +>>>>>>> refactor/manager-index/small-refactor diff --git a/versions/JAEGER_OPERATOR_VERSION b/versions/JAEGER_OPERATOR_VERSION index 261d95596f3..4f6bd94b000 100644 --- a/versions/JAEGER_OPERATOR_VERSION +++ b/versions/JAEGER_OPERATOR_VERSION @@ -1 +1,5 @@ +<<<<<<< HEAD 2.53.0 +======= +2.47.0 +>>>>>>> refactor/manager-index/small-refactor diff --git a/versions/OPERATOR_SDK_VERSION b/versions/OPERATOR_SDK_VERSION index e51138b8af9..1bbc28eeba0 100644 --- a/versions/OPERATOR_SDK_VERSION +++ b/versions/OPERATOR_SDK_VERSION @@ -1 +1,5 @@ +<<<<<<< HEAD v1.34 +======= +v1.32 +>>>>>>> refactor/manager-index/small-refactor diff --git a/versions/PROMETHEUS_STACK_VERSION b/versions/PROMETHEUS_STACK_VERSION index 18365ff7ad2..20d97581f8b 100644 --- a/versions/PROMETHEUS_STACK_VERSION +++ b/versions/PROMETHEUS_STACK_VERSION @@ -1 +1,5 @@ +<<<<<<< HEAD 58.4.0 +======= +51.3.0 +>>>>>>> refactor/manager-index/small-refactor diff --git a/versions/PROTOBUF_VERSION b/versions/PROTOBUF_VERSION index dfa88c8ebba..c11c468177c 100644 --- a/versions/PROTOBUF_VERSION +++ b/versions/PROTOBUF_VERSION @@ -1 +1,5 @@ +<<<<<<< HEAD 26.1 +======= +24.4 +>>>>>>> refactor/manager-index/small-refactor diff --git a/versions/TELEPRESENCE_VERSION b/versions/TELEPRESENCE_VERSION index cf8690732fe..8b0a4721904 100644 --- a/versions/TELEPRESENCE_VERSION +++ b/versions/TELEPRESENCE_VERSION @@ -1 +1,5 @@ +<<<<<<< HEAD 2.18.0 +======= +2.16.0 +>>>>>>> refactor/manager-index/small-refactor diff --git a/versions/VALDCLI_VERSION b/versions/VALDCLI_VERSION index b84efa430e0..70cb1cf8c44 100644 --- a/versions/VALDCLI_VERSION +++ b/versions/VALDCLI_VERSION @@ -1 +1,5 @@ +<<<<<<< HEAD v1.7.12 +======= +v1.7.8 +>>>>>>> refactor/manager-index/small-refactor diff --git a/versions/YQ_VERSION b/versions/YQ_VERSION index ec877613c7c..ae42376bc2b 100644 --- a/versions/YQ_VERSION +++ b/versions/YQ_VERSION @@ -1 +1,5 @@ +<<<<<<< HEAD v4.43.1 +======= +v4.35.2 +>>>>>>> refactor/manager-index/small-refactor