diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index 7ba2c51e232..1c600735b22 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -333,11 +333,11 @@ Represents index Property | ---------------------------------- | ----------------- | ----- | ----------- | | dimension | [int32](#int32) | | | | thread_pool_size | [int32](#int32) | | | -| object_type | [int32](#int32) | | | -| distance_type | [int32](#int32) | | | -| index_type | [int32](#int32) | | | -| database_type | [int32](#int32) | | | -| object_alignment | [int32](#int32) | | | +| object_type | [string](#string) | | | +| distance_type | [string](#string) | | | +| index_type | [string](#string) | | | +| database_type | [string](#string) | | | +| object_alignment | [string](#string) | | | | path_adjustment_interval | [int32](#int32) | | | | graph_shared_memory_size | [int32](#int32) | | | | tree_shared_memory_size | [int32](#int32) | | | @@ -349,17 +349,17 @@ Represents index Property | max_magnitude | [float](#float) | | | | n_of_neighbors_for_insertion_order | [int32](#int32) | | | | epsilon_for_insertion_order | [float](#float) | | | -| refinement_object_type | [int32](#int32) | | | +| refinement_object_type | [string](#string) | | | | truncation_threshold | [int32](#int32) | | | | edge_size_for_creation | [int32](#int32) | | | | edge_size_for_search | [int32](#int32) | | | | edge_size_limit_for_creation | [int32](#int32) | | | | insertion_radius_coefficient | [double](#double) | | | | seed_size | [int32](#int32) | | | -| seed_type | [int32](#int32) | | | +| seed_type | [string](#string) | | | | truncation_thread_pool_size | [int32](#int32) | | | | batch_size_for_creation | [int32](#int32) | | | -| graph_type | [int32](#int32) | | | +| graph_type | [string](#string) | | | | dynamic_edge_size_base | [int32](#int32) | | | | dynamic_edge_size_rate | [int32](#int32) | | | | build_time_limit | [float](#float) | | | @@ -1632,8 +1632,7 @@ Represent the index manager service. | 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. | | IndexStatistics | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Statistics](#payload-v1-Info-Index-Statistics) | Represent the RPC to get the index statistics. | | IndexStatisticsDetail | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.StatisticsDetail](#payload-v1-Info-Index-StatisticsDetail) | Represent the RPC to get the index statistics for each agents. | -| IndexProperty | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Property](#payload-v1-Info-Index-Property) | Represent the RPC to get the index property. | -| IndexPropertyDetail | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.PropertyDetail](#payload-v1-Info-Index-PropertyDetail) | Represent the RPC to get the index properties for each agents. | +| IndexProperty | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.PropertyDetail](#payload-v1-Info-Index-PropertyDetail) | Represent the RPC to get the index property. | diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index ec4383d849b..f4300ef09a4 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -5262,11 +5262,11 @@ type Info_Index_Property struct { Dimension int32 `protobuf:"varint,1,opt,name=dimension,proto3" json:"dimension,omitempty"` ThreadPoolSize int32 `protobuf:"varint,2,opt,name=thread_pool_size,json=threadPoolSize,proto3" json:"thread_pool_size,omitempty"` - ObjectType int32 `protobuf:"varint,3,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"` - DistanceType int32 `protobuf:"varint,4,opt,name=distance_type,json=distanceType,proto3" json:"distance_type,omitempty"` - IndexType int32 `protobuf:"varint,5,opt,name=index_type,json=indexType,proto3" json:"index_type,omitempty"` - DatabaseType int32 `protobuf:"varint,6,opt,name=database_type,json=databaseType,proto3" json:"database_type,omitempty"` - ObjectAlignment int32 `protobuf:"varint,7,opt,name=object_alignment,json=objectAlignment,proto3" json:"object_alignment,omitempty"` + ObjectType string `protobuf:"bytes,3,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"` + DistanceType string `protobuf:"bytes,4,opt,name=distance_type,json=distanceType,proto3" json:"distance_type,omitempty"` + IndexType string `protobuf:"bytes,5,opt,name=index_type,json=indexType,proto3" json:"index_type,omitempty"` + DatabaseType string `protobuf:"bytes,6,opt,name=database_type,json=databaseType,proto3" json:"database_type,omitempty"` + ObjectAlignment string `protobuf:"bytes,7,opt,name=object_alignment,json=objectAlignment,proto3" json:"object_alignment,omitempty"` PathAdjustmentInterval int32 `protobuf:"varint,8,opt,name=path_adjustment_interval,json=pathAdjustmentInterval,proto3" json:"path_adjustment_interval,omitempty"` GraphSharedMemorySize int32 `protobuf:"varint,9,opt,name=graph_shared_memory_size,json=graphSharedMemorySize,proto3" json:"graph_shared_memory_size,omitempty"` TreeSharedMemorySize int32 `protobuf:"varint,10,opt,name=tree_shared_memory_size,json=treeSharedMemorySize,proto3" json:"tree_shared_memory_size,omitempty"` @@ -5278,17 +5278,17 @@ type Info_Index_Property struct { MaxMagnitude float32 `protobuf:"fixed32,16,opt,name=max_magnitude,json=maxMagnitude,proto3" json:"max_magnitude,omitempty"` NOfNeighborsForInsertionOrder int32 `protobuf:"varint,17,opt,name=n_of_neighbors_for_insertion_order,json=nOfNeighborsForInsertionOrder,proto3" json:"n_of_neighbors_for_insertion_order,omitempty"` EpsilonForInsertionOrder float32 `protobuf:"fixed32,18,opt,name=epsilon_for_insertion_order,json=epsilonForInsertionOrder,proto3" json:"epsilon_for_insertion_order,omitempty"` - RefinementObjectType int32 `protobuf:"varint,19,opt,name=refinement_object_type,json=refinementObjectType,proto3" json:"refinement_object_type,omitempty"` + RefinementObjectType string `protobuf:"bytes,19,opt,name=refinement_object_type,json=refinementObjectType,proto3" json:"refinement_object_type,omitempty"` TruncationThreshold int32 `protobuf:"varint,20,opt,name=truncation_threshold,json=truncationThreshold,proto3" json:"truncation_threshold,omitempty"` EdgeSizeForCreation int32 `protobuf:"varint,21,opt,name=edge_size_for_creation,json=edgeSizeForCreation,proto3" json:"edge_size_for_creation,omitempty"` EdgeSizeForSearch int32 `protobuf:"varint,22,opt,name=edge_size_for_search,json=edgeSizeForSearch,proto3" json:"edge_size_for_search,omitempty"` EdgeSizeLimitForCreation int32 `protobuf:"varint,23,opt,name=edge_size_limit_for_creation,json=edgeSizeLimitForCreation,proto3" json:"edge_size_limit_for_creation,omitempty"` InsertionRadiusCoefficient float64 `protobuf:"fixed64,24,opt,name=insertion_radius_coefficient,json=insertionRadiusCoefficient,proto3" json:"insertion_radius_coefficient,omitempty"` SeedSize int32 `protobuf:"varint,25,opt,name=seed_size,json=seedSize,proto3" json:"seed_size,omitempty"` - SeedType int32 `protobuf:"varint,26,opt,name=seed_type,json=seedType,proto3" json:"seed_type,omitempty"` + SeedType string `protobuf:"bytes,26,opt,name=seed_type,json=seedType,proto3" json:"seed_type,omitempty"` TruncationThreadPoolSize int32 `protobuf:"varint,27,opt,name=truncation_thread_pool_size,json=truncationThreadPoolSize,proto3" json:"truncation_thread_pool_size,omitempty"` BatchSizeForCreation int32 `protobuf:"varint,28,opt,name=batch_size_for_creation,json=batchSizeForCreation,proto3" json:"batch_size_for_creation,omitempty"` - GraphType int32 `protobuf:"varint,29,opt,name=graph_type,json=graphType,proto3" json:"graph_type,omitempty"` + GraphType string `protobuf:"bytes,29,opt,name=graph_type,json=graphType,proto3" json:"graph_type,omitempty"` DynamicEdgeSizeBase int32 `protobuf:"varint,30,opt,name=dynamic_edge_size_base,json=dynamicEdgeSizeBase,proto3" json:"dynamic_edge_size_base,omitempty"` DynamicEdgeSizeRate int32 `protobuf:"varint,31,opt,name=dynamic_edge_size_rate,json=dynamicEdgeSizeRate,proto3" json:"dynamic_edge_size_rate,omitempty"` BuildTimeLimit float32 `protobuf:"fixed32,32,opt,name=build_time_limit,json=buildTimeLimit,proto3" json:"build_time_limit,omitempty"` @@ -5342,39 +5342,39 @@ func (x *Info_Index_Property) GetThreadPoolSize() int32 { return 0 } -func (x *Info_Index_Property) GetObjectType() int32 { +func (x *Info_Index_Property) GetObjectType() string { if x != nil { return x.ObjectType } - return 0 + return "" } -func (x *Info_Index_Property) GetDistanceType() int32 { +func (x *Info_Index_Property) GetDistanceType() string { if x != nil { return x.DistanceType } - return 0 + return "" } -func (x *Info_Index_Property) GetIndexType() int32 { +func (x *Info_Index_Property) GetIndexType() string { if x != nil { return x.IndexType } - return 0 + return "" } -func (x *Info_Index_Property) GetDatabaseType() int32 { +func (x *Info_Index_Property) GetDatabaseType() string { if x != nil { return x.DatabaseType } - return 0 + return "" } -func (x *Info_Index_Property) GetObjectAlignment() int32 { +func (x *Info_Index_Property) GetObjectAlignment() string { if x != nil { return x.ObjectAlignment } - return 0 + return "" } func (x *Info_Index_Property) GetPathAdjustmentInterval() int32 { @@ -5454,11 +5454,11 @@ func (x *Info_Index_Property) GetEpsilonForInsertionOrder() float32 { return 0 } -func (x *Info_Index_Property) GetRefinementObjectType() int32 { +func (x *Info_Index_Property) GetRefinementObjectType() string { if x != nil { return x.RefinementObjectType } - return 0 + return "" } func (x *Info_Index_Property) GetTruncationThreshold() int32 { @@ -5503,11 +5503,11 @@ func (x *Info_Index_Property) GetSeedSize() int32 { return 0 } -func (x *Info_Index_Property) GetSeedType() int32 { +func (x *Info_Index_Property) GetSeedType() string { if x != nil { return x.SeedType } - return 0 + return "" } func (x *Info_Index_Property) GetTruncationThreadPoolSize() int32 { @@ -5524,11 +5524,11 @@ func (x *Info_Index_Property) GetBatchSizeForCreation() int32 { return 0 } -func (x *Info_Index_Property) GetGraphType() int32 { +func (x *Info_Index_Property) GetGraphType() string { if x != nil { return x.GraphType } - return 0 + return "" } func (x *Info_Index_Property) GetDynamicEdgeSizeBase() int32 { @@ -6337,16 +6337,16 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x6f, 0x6f, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x54, + 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x6d, + 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x18, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x16, 0x70, 0x61, 0x74, 0x68, 0x41, 0x64, 0x6a, 0x75, 0x73, @@ -6383,7 +6383,7 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x01, 0x28, 0x02, 0x52, 0x18, 0x65, 0x70, 0x73, 0x69, 0x6c, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x72, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x72, + 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x72, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, @@ -6405,7 +6405,7 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x69, 0x75, 0x73, 0x43, 0x6f, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, - 0x65, 0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x65, 0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3d, 0x0a, 0x1b, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x18, 0x74, @@ -6415,7 +6415,7 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x62, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1d, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x09, 0x67, 0x72, 0x61, 0x70, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x33, 0x0a, + 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x61, 0x70, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x33, 0x0a, 0x16, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x65, 0x64, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x45, 0x64, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x61, @@ -6669,7 +6669,6 @@ var ( (*status.Status)(nil), // 99: google.rpc.Status } ) - var file_v1_payload_payload_proto_depIdxs = []int32{ 21, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config 15, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request diff --git a/apis/grpc/v1/payload/payload_vtproto.pb.go b/apis/grpc/v1/payload/payload_vtproto.pb.go index 4a9f01cb475..fc0f4126031 100644 --- a/apis/grpc/v1/payload/payload_vtproto.pb.go +++ b/apis/grpc/v1/payload/payload_vtproto.pb.go @@ -9020,12 +9020,14 @@ func (m *Info_Index_Property) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0xf0 } - if m.GraphType != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.GraphType)) + if len(m.GraphType) > 0 { + i -= len(m.GraphType) + copy(dAtA[i:], m.GraphType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GraphType))) i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0xe8 + dAtA[i] = 0xea } if m.BatchSizeForCreation != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BatchSizeForCreation)) @@ -9041,12 +9043,14 @@ func (m *Info_Index_Property) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0xd8 } - if m.SeedType != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SeedType)) + if len(m.SeedType) > 0 { + i -= len(m.SeedType) + copy(dAtA[i:], m.SeedType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SeedType))) i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0xd0 + dAtA[i] = 0xd2 } if m.SeedSize != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SeedSize)) @@ -9091,12 +9095,14 @@ func (m *Info_Index_Property) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0xa0 } - if m.RefinementObjectType != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RefinementObjectType)) + if len(m.RefinementObjectType) > 0 { + i -= len(m.RefinementObjectType) + copy(dAtA[i:], m.RefinementObjectType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RefinementObjectType))) i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x98 + dAtA[i] = 0x9a } if m.EpsilonForInsertionOrder != 0 { i -= 4 @@ -9165,30 +9171,40 @@ func (m *Info_Index_Property) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x40 } - if m.ObjectAlignment != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ObjectAlignment)) + if len(m.ObjectAlignment) > 0 { + i -= len(m.ObjectAlignment) + copy(dAtA[i:], m.ObjectAlignment) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ObjectAlignment))) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x3a } - if m.DatabaseType != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DatabaseType)) + if len(m.DatabaseType) > 0 { + i -= len(m.DatabaseType) + copy(dAtA[i:], m.DatabaseType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DatabaseType))) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x32 } - if m.IndexType != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.IndexType)) + if len(m.IndexType) > 0 { + i -= len(m.IndexType) + copy(dAtA[i:], m.IndexType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.IndexType))) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x2a } - if m.DistanceType != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DistanceType)) + if len(m.DistanceType) > 0 { + i -= len(m.DistanceType) + copy(dAtA[i:], m.DistanceType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DistanceType))) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x22 } - if m.ObjectType != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ObjectType)) + if len(m.ObjectType) > 0 { + i -= len(m.ObjectType) + copy(dAtA[i:], m.ObjectType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ObjectType))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } if m.ThreadPoolSize != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ThreadPoolSize)) @@ -11644,20 +11660,25 @@ func (m *Info_Index_Property) SizeVT() (n int) { if m.ThreadPoolSize != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.ThreadPoolSize)) } - if m.ObjectType != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.ObjectType)) + l = len(m.ObjectType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.DistanceType != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.DistanceType)) + l = len(m.DistanceType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.IndexType != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.IndexType)) + l = len(m.IndexType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.DatabaseType != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.DatabaseType)) + l = len(m.DatabaseType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.ObjectAlignment != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.ObjectAlignment)) + l = len(m.ObjectAlignment) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.PathAdjustmentInterval != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.PathAdjustmentInterval)) @@ -11694,8 +11715,9 @@ func (m *Info_Index_Property) SizeVT() (n int) { if m.EpsilonForInsertionOrder != 0 { n += 6 } - if m.RefinementObjectType != 0 { - n += 2 + protohelpers.SizeOfVarint(uint64(m.RefinementObjectType)) + l = len(m.RefinementObjectType) + if l > 0 { + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.TruncationThreshold != 0 { n += 2 + protohelpers.SizeOfVarint(uint64(m.TruncationThreshold)) @@ -11715,8 +11737,9 @@ func (m *Info_Index_Property) SizeVT() (n int) { if m.SeedSize != 0 { n += 2 + protohelpers.SizeOfVarint(uint64(m.SeedSize)) } - if m.SeedType != 0 { - n += 2 + protohelpers.SizeOfVarint(uint64(m.SeedType)) + l = len(m.SeedType) + if l > 0 { + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.TruncationThreadPoolSize != 0 { n += 2 + protohelpers.SizeOfVarint(uint64(m.TruncationThreadPoolSize)) @@ -11724,8 +11747,9 @@ func (m *Info_Index_Property) SizeVT() (n int) { if m.BatchSizeForCreation != 0 { n += 2 + protohelpers.SizeOfVarint(uint64(m.BatchSizeForCreation)) } - if m.GraphType != 0 { - n += 2 + protohelpers.SizeOfVarint(uint64(m.GraphType)) + l = len(m.GraphType) + if l > 0 { + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.DynamicEdgeSizeBase != 0 { n += 2 + protohelpers.SizeOfVarint(uint64(m.DynamicEdgeSizeBase)) @@ -20453,10 +20477,10 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } } case 3: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ObjectType", wireType) } - m.ObjectType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -20466,16 +20490,29 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ObjectType |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ObjectType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 4: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DistanceType", wireType) } - m.DistanceType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -20485,16 +20522,29 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DistanceType |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DistanceType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 5: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IndexType", wireType) } - m.IndexType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -20504,16 +20554,29 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.IndexType |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IndexType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 6: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DatabaseType", wireType) } - m.DatabaseType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -20523,16 +20586,29 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DatabaseType |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DatabaseType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 7: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ObjectAlignment", wireType) } - m.ObjectAlignment = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -20542,11 +20618,24 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ObjectAlignment |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ObjectAlignment = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PathAdjustmentInterval", wireType) @@ -20767,10 +20856,10 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { iNdEx += 4 m.EpsilonForInsertionOrder = float32(math.Float32frombits(v)) case 19: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RefinementObjectType", wireType) } - m.RefinementObjectType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -20780,11 +20869,24 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RefinementObjectType |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RefinementObjectType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 20: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TruncationThreshold", wireType) @@ -20892,10 +20994,10 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } } case 26: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SeedType", wireType) } - m.SeedType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -20905,11 +21007,24 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SeedType |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SeedType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 27: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TruncationThreadPoolSize", wireType) @@ -20949,10 +21064,10 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } } case 29: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field GraphType", wireType) } - m.GraphType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -20962,11 +21077,24 @@ func (m *Info_Index_Property) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.GraphType |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GraphType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 30: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field DynamicEdgeSizeBase", wireType) diff --git a/apis/grpc/v1/vald/index.pb.go b/apis/grpc/v1/vald/index.pb.go index 44a723b75cf..58728f3ad6f 100644 --- a/apis/grpc/v1/vald/index.pb.go +++ b/apis/grpc/v1/vald/index.pb.go @@ -46,7 +46,7 @@ var file_v1_vald_index_proto_rawDesc = []byte{ 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, 0x1a, 0x18, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xdc, 0x04, 0x0a, 0x05, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xf1, 0x03, 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, @@ -71,26 +71,19 @@ var file_v1_vald_index_proto_rawDesc = []byte{ 0x64, 0x65, 0x78, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2f, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x5c, 0x0a, 0x0d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x50, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x62, 0x0a, 0x0d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1f, 0x2e, 0x70, 0x61, 0x79, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x25, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0x17, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x12, 0x6f, 0x0a, 0x13, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x50, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x79, 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, 0x25, - 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, - 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2f, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x42, 0x52, 0x0a, 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x76, - 0x61, 0x6c, 0x64, 0x42, 0x09, 0x56, 0x61, 0x6c, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x50, 0x01, - 0x5a, 0x27, 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, 0x76, 0x61, 0x6c, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x78, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x42, 0x52, 0x0a, 0x1a, 0x6f, 0x72, + 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x42, 0x09, 0x56, 0x61, 0x6c, 0x64, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x50, 0x01, 0x5a, 0x27, 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, 0x76, 0x61, 0x6c, 0x64, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_v1_vald_index_proto_goTypes = []any{ @@ -99,8 +92,7 @@ var file_v1_vald_index_proto_goTypes = []any{ (*payload.Info_Index_Detail)(nil), // 2: payload.v1.Info.Index.Detail (*payload.Info_Index_Statistics)(nil), // 3: payload.v1.Info.Index.Statistics (*payload.Info_Index_StatisticsDetail)(nil), // 4: payload.v1.Info.Index.StatisticsDetail - (*payload.Info_Index_Property)(nil), // 5: payload.v1.Info.Index.Property - (*payload.Info_Index_PropertyDetail)(nil), // 6: payload.v1.Info.Index.PropertyDetail + (*payload.Info_Index_PropertyDetail)(nil), // 5: payload.v1.Info.Index.PropertyDetail } var file_v1_vald_index_proto_depIdxs = []int32{ @@ -109,15 +101,13 @@ var file_v1_vald_index_proto_depIdxs = []int32{ 0, // 2: vald.v1.Index.IndexStatistics:input_type -> payload.v1.Empty 0, // 3: vald.v1.Index.IndexStatisticsDetail:input_type -> payload.v1.Empty 0, // 4: vald.v1.Index.IndexProperty:input_type -> payload.v1.Empty - 0, // 5: vald.v1.Index.IndexPropertyDetail:input_type -> payload.v1.Empty - 1, // 6: vald.v1.Index.IndexInfo:output_type -> payload.v1.Info.Index.Count - 2, // 7: vald.v1.Index.IndexDetail:output_type -> payload.v1.Info.Index.Detail - 3, // 8: vald.v1.Index.IndexStatistics:output_type -> payload.v1.Info.Index.Statistics - 4, // 9: vald.v1.Index.IndexStatisticsDetail:output_type -> payload.v1.Info.Index.StatisticsDetail - 5, // 10: vald.v1.Index.IndexProperty:output_type -> payload.v1.Info.Index.Property - 6, // 11: vald.v1.Index.IndexPropertyDetail:output_type -> payload.v1.Info.Index.PropertyDetail - 6, // [6:12] is the sub-list for method output_type - 0, // [0:6] is the sub-list for method input_type + 1, // 5: vald.v1.Index.IndexInfo:output_type -> payload.v1.Info.Index.Count + 2, // 6: vald.v1.Index.IndexDetail:output_type -> payload.v1.Info.Index.Detail + 3, // 7: vald.v1.Index.IndexStatistics:output_type -> payload.v1.Info.Index.Statistics + 4, // 8: vald.v1.Index.IndexStatisticsDetail:output_type -> payload.v1.Info.Index.StatisticsDetail + 5, // 9: vald.v1.Index.IndexProperty:output_type -> payload.v1.Info.Index.PropertyDetail + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] 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/vald/index_vtproto.pb.go b/apis/grpc/v1/vald/index_vtproto.pb.go index 572af108a9e..e0d8f29f686 100644 --- a/apis/grpc/v1/vald/index_vtproto.pb.go +++ b/apis/grpc/v1/vald/index_vtproto.pb.go @@ -51,9 +51,7 @@ type IndexClient interface { // Represent the RPC to get the index statistics for each agents. IndexStatisticsDetail(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_StatisticsDetail, error) // Represent the RPC to get the index property. - IndexProperty(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_Property, error) - // Represent the RPC to get the index properties for each agents. - IndexPropertyDetail(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_PropertyDetail, error) + IndexProperty(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Info_Index_PropertyDetail, error) } type indexClient struct { @@ -110,20 +108,9 @@ func (c *indexClient) IndexStatisticsDetail( func (c *indexClient) IndexProperty( ctx context.Context, in *payload.Empty, opts ...grpc.CallOption, -) (*payload.Info_Index_Property, error) { - out := new(payload.Info_Index_Property) - err := c.cc.Invoke(ctx, "/vald.v1.Index/IndexProperty", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *indexClient) IndexPropertyDetail( - ctx context.Context, in *payload.Empty, opts ...grpc.CallOption, ) (*payload.Info_Index_PropertyDetail, error) { out := new(payload.Info_Index_PropertyDetail) - err := c.cc.Invoke(ctx, "/vald.v1.Index/IndexPropertyDetail", in, out, opts...) + err := c.cc.Invoke(ctx, "/vald.v1.Index/IndexProperty", in, out, opts...) if err != nil { return nil, err } @@ -143,9 +130,7 @@ type IndexServer interface { // Represent the RPC to get the index statistics for each agents. IndexStatisticsDetail(context.Context, *payload.Empty) (*payload.Info_Index_StatisticsDetail, error) // Represent the RPC to get the index property. - IndexProperty(context.Context, *payload.Empty) (*payload.Info_Index_Property, error) - // Represent the RPC to get the index properties for each agents. - IndexPropertyDetail(context.Context, *payload.Empty) (*payload.Info_Index_PropertyDetail, error) + IndexProperty(context.Context, *payload.Empty) (*payload.Info_Index_PropertyDetail, error) mustEmbedUnimplementedIndexServer() } @@ -178,14 +163,8 @@ func (UnimplementedIndexServer) IndexStatisticsDetail( func (UnimplementedIndexServer) IndexProperty( context.Context, *payload.Empty, -) (*payload.Info_Index_Property, error) { - return nil, status.Errorf(codes.Unimplemented, "method IndexProperty not implemented") -} - -func (UnimplementedIndexServer) IndexPropertyDetail( - context.Context, *payload.Empty, ) (*payload.Info_Index_PropertyDetail, error) { - return nil, status.Errorf(codes.Unimplemented, "method IndexPropertyDetail not implemented") + return nil, status.Errorf(codes.Unimplemented, "method IndexProperty not implemented") } func (UnimplementedIndexServer) mustEmbedUnimplementedIndexServer() {} @@ -300,26 +279,6 @@ func _Index_IndexProperty_Handler( return interceptor(ctx, in, info, handler) } -func _Index_IndexPropertyDetail_Handler( - srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor, -) (any, error) { - in := new(payload.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IndexServer).IndexPropertyDetail(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/vald.v1.Index/IndexPropertyDetail", - } - handler := func(ctx context.Context, req any) (any, error) { - return srv.(IndexServer).IndexPropertyDetail(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) @@ -347,10 +306,6 @@ var Index_ServiceDesc = grpc.ServiceDesc{ MethodName: "IndexProperty", Handler: _Index_IndexProperty_Handler, }, - { - MethodName: "IndexPropertyDetail", - Handler: _Index_IndexPropertyDetail_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "v1/vald/index.proto", diff --git a/apis/grpc/v1/vald/vald.go b/apis/grpc/v1/vald/vald.go index 0463c83b255..3ff180c0e8f 100644 --- a/apis/grpc/v1/vald/vald.go +++ b/apis/grpc/v1/vald/vald.go @@ -140,7 +140,6 @@ const ( IndexStatisticsRPCName = "IndexStatistics" IndexStatisticsDetailRPCName = "IndexStatisticsDetail" IndexPropertyRPCName = "IndexProperty" - IndexPropertyDetailRPCName = "IndexPropertyDetail" ) type client struct { diff --git a/apis/proto/v1/vald/index.proto b/apis/proto/v1/vald/index.proto index 72ba71fd4b8..4360dc9bbb2 100644 --- a/apis/proto/v1/vald/index.proto +++ b/apis/proto/v1/vald/index.proto @@ -47,12 +47,7 @@ service Index { } // Represent the RPC to get the index property. - rpc IndexProperty(payload.v1.Empty) returns (payload.v1.Info.Index.Property) { + rpc IndexProperty(payload.v1.Empty) returns (payload.v1.Info.Index.PropertyDetail) { option (google.api.http).get = "/index/property"; } - - // Represent the RPC to get the index properties for each agents. - rpc IndexPropertyDetail(payload.v1.Empty) returns (payload.v1.Info.Index.PropertyDetail) { - option (google.api.http).get = "/index/property/detail"; - } } diff --git a/apis/swagger/v1/vald/index.swagger.json b/apis/swagger/v1/vald/index.swagger.json index a3ed5d52bbd..b8032366d55 100644 --- a/apis/swagger/v1/vald/index.swagger.json +++ b/apis/swagger/v1/vald/index.swagger.json @@ -58,27 +58,6 @@ "get": { "summary": "Represent the RPC to get the index property.", "operationId": "Index_IndexProperty", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/IndexProperty" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": ["Index"] - } - }, - "/index/property/detail": { - "get": { - "summary": "Represent the RPC to get the index properties for each agents.", - "operationId": "Index_IndexPropertyDetail", "responses": { "200": { "description": "A successful response.", @@ -199,24 +178,19 @@ "format": "int32" }, "objectType": { - "type": "integer", - "format": "int32" + "type": "string" }, "distanceType": { - "type": "integer", - "format": "int32" + "type": "string" }, "indexType": { - "type": "integer", - "format": "int32" + "type": "string" }, "databaseType": { - "type": "integer", - "format": "int32" + "type": "string" }, "objectAlignment": { - "type": "integer", - "format": "int32" + "type": "string" }, "pathAdjustmentInterval": { "type": "integer", @@ -261,8 +235,7 @@ "format": "float" }, "refinementObjectType": { - "type": "integer", - "format": "int32" + "type": "string" }, "truncationThreshold": { "type": "integer", @@ -289,8 +262,7 @@ "format": "int32" }, "seedType": { - "type": "integer", - "format": "int32" + "type": "string" }, "truncationThreadPoolSize": { "type": "integer", @@ -301,8 +273,7 @@ "format": "int32" }, "graphType": { - "type": "integer", - "format": "int32" + "type": "string" }, "dynamicEdgeSizeBase": { "type": "integer", diff --git a/internal/client/v1/client/vald/vald.go b/internal/client/v1/client/vald/vald.go index 8f8ad0c5efa..288011c2ba2 100644 --- a/internal/client/v1/client/vald/vald.go +++ b/internal/client/v1/client/vald/vald.go @@ -830,7 +830,7 @@ func (c *client) IndexStatisticsDetail( func (c *client) IndexProperty( ctx context.Context, in *payload.Empty, opts ...grpc.CallOption, -) (res *payload.Info_Index_Property, err error) { +) (res *payload.Info_Index_PropertyDetail, err error) { ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.IndexPropertyRPCName), apiName+"/"+vald.IndexPropertyRPCName) defer func() { if span != nil { @@ -850,28 +850,6 @@ func (c *client) IndexProperty( return res, nil } -func (c *client) IndexPropertyDetail( - ctx context.Context, in *payload.Empty, opts ...grpc.CallOption, -) (res *payload.Info_Index_PropertyDetail, err error) { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.IndexPropertyDetailRPCName), apiName+"/"+vald.IndexPropertyDetailRPCName) - defer func() { - if span != nil { - span.End() - } - }() - _, err = c.c.RoundRobin(ctx, func(ctx context.Context, - conn *grpc.ClientConn, - copts ...grpc.CallOption, - ) (any, error) { - res, err = vald.NewValdClient(conn).IndexPropertyDetail(ctx, in, append(copts, opts...)...) - return nil, err - }) - if err != nil { - return nil, err - } - return res, nil -} - func (c *client) GetTimestamp( ctx context.Context, in *payload.Object_TimestampRequest, opts ...grpc.CallOption, ) (res *payload.Object_Timestamp, err error) { @@ -1316,26 +1294,14 @@ func (c *singleClient) IndexStatisticsDetail( func (c *singleClient) IndexProperty( ctx context.Context, in *payload.Empty, opts ...grpc.CallOption, -) (res *payload.Info_Index_Property, err error) { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/singleClient/"+vald.IndexPropertyRPCName), apiName+"/"+vald.IndexPropertyRPCName) - defer func() { - if span != nil { - span.End() - } - }() - return c.vc.IndexProperty(ctx, in, opts...) -} - -func (c *singleClient) IndexPropertyDetail( - ctx context.Context, in *payload.Empty, opts ...grpc.CallOption, ) (res *payload.Info_Index_PropertyDetail, err error) { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.IndexPropertyDetailRPCName), apiName+"/"+vald.IndexPropertyDetailRPCName) + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.IndexPropertyRPCName), apiName+"/"+vald.IndexPropertyRPCName) defer func() { if span != nil { span.End() } }() - return c.vc.IndexPropertyDetail(ctx, in, opts...) + return c.vc.IndexProperty(ctx, in, opts...) } func (c *singleClient) GetTimestamp( diff --git a/internal/core/algorithm/ngt/ngt.go b/internal/core/algorithm/ngt/ngt.go index 0a51bce5a95..4bf3b4b3052 100644 --- a/internal/core/algorithm/ngt/ngt.go +++ b/internal/core/algorithm/ngt/ngt.go @@ -167,9 +167,9 @@ type ( IndexType indexType DatabaseType databaseType ObjectAlignment objectAlignment - pathAdjustmentInterval int32 - graphSharedMemorySize int32 - treeSharedMemorySize int32 + PathAdjustmentInterval int32 + GraphSharedMemorySize int32 + TreeSharedMemorySize int32 ObjectSharedMemorySize int32 PrefetchOffset int32 PrefetchSize int32 @@ -184,9 +184,9 @@ type ( EdgeSizeForSearch int32 EdgeSizeLimitForCreation int32 InsertionRadiusCoefficient float64 - SeedSize string + SeedSize int32 SeedType seedType - TruuncationThreadPoolSize int32 + TruncationThreadPoolSize int32 BatchSizeForCreation int32 GraphType graphType DynamicEdgeSizeBase int32 @@ -1148,5 +1148,42 @@ func (n *ngt) GetGraphStatistics(m statisticsType) (stats *GraphStatistics, err func (n *ngt) GetProperty() (prop *Property, err error) { ne := n.GetErrorBuffer() cprop := C.ngt_get_property_info(n.index, ne.err) - + n.PutErrorBuffer(ne) + + return &Property{ + Dimension: int32(cprop.dimension), + ThreadPoolSize: int32(cprop.thread_pool_size), + ObjectType: objectType(cprop.object_type), + DistanceType: distanceType(cprop.distance_type), + IndexType: indexType(cprop.index_type), + DatabaseType: databaseType(cprop.database_type), + ObjectAlignment: objectAlignment(cprop.object_alignment), + PathAdjustmentInterval: int32(cprop.path_adjustment_interval), + GraphSharedMemorySize: int32(cprop.graph_shared_memory_size), + TreeSharedMemorySize: int32(cprop.tree_shared_memory_size), + ObjectSharedMemorySize: int32(cprop.object_shared_memory_size), + PrefetchOffset: int32(cprop.prefetch_offset), + PrefetchSize: int32(cprop.prefetch_size), + AccuracyTable: C.GoString(cprop.accuracy_table), + SearchType: C.GoString(cprop.search_type), + MaxMagnitude: float32(cprop.max_magnitude), + NOfNeighborsForInsertionOrder: int32(cprop.n_of_neighbors_for_insertion_order), + EpsilonForInsersionOrder: float32(cprop.epsilon_for_insertion_order), + RefinementObjectType: objectType(cprop.refinement_object_type), + TruncationThreshold: int32(cprop.truncation_thread_pool_size), + EdgeSizeForCreation: int32(cprop.edge_size_for_creation), + EdgeSizeForSearch: int32(cprop.edge_size_for_search), + EdgeSizeLimitForCreation: int32(cprop.edge_size_limit_for_creation), + InsertionRadiusCoefficient: float64(cprop.insertion_radius_coefficient), + SeedSize: int32(cprop.seed_size), + SeedType: seedType(cprop.seed_type), + TruncationThreadPoolSize: int32(cprop.truncation_thread_pool_size), + BatchSizeForCreation: int32(cprop.batch_size_for_creation), + GraphType: graphType(cprop.graph_type), + DynamicEdgeSizeBase: int32(cprop.dynamic_edge_size_base), + DynamicEdgeSizeRate: int32(cprop.dynamic_edge_size_rate), + BuildTimeLimit: float32(cprop.build_time_limit), + OutgoingEdge: int32(cprop.outgoing_edge), + IncomingEdge: int32(cprop.incoming_edge), + }, nil } diff --git a/pkg/agent/core/ngt/handler/grpc/index.go b/pkg/agent/core/ngt/handler/grpc/index.go index 3a55be3983c..099e183f7ed 100644 --- a/pkg/agent/core/ngt/handler/grpc/index.go +++ b/pkg/agent/core/ngt/handler/grpc/index.go @@ -240,3 +240,23 @@ func (s *server) IndexStatisticsDetail( }, }, nil } + +func (s *server) IndexProperty( + ctx context.Context, _ *payload.Empty, +) (res *payload.Info_Index_PropertyDetail, err error) { + _, span := trace.StartSpan(ctx, apiName+".IndexProperty") + defer func() { + if span != nil { + span.End() + } + }() + prop, err := s.ngt.IndexProperty() + if err != nil { + return nil, err + } + return &payload.Info_Index_PropertyDetail{ + Details: map[string]*payload.Info_Index_Property{ + s.name: prop, + }, + }, nil +} diff --git a/pkg/agent/core/ngt/service/ngt.go b/pkg/agent/core/ngt/service/ngt.go index ba0c11319ad..3b07ea507c6 100644 --- a/pkg/agent/core/ngt/service/ngt.go +++ b/pkg/agent/core/ngt/service/ngt.go @@ -92,6 +92,7 @@ type NGT interface { BrokenIndexCount() uint64 IndexStatistics() (*payload.Info_Index_Statistics, error) IsStatisticsEnabled() bool + IndexProperty() (*payload.Info_Index_Property, error) Close(ctx context.Context) error } @@ -2044,6 +2045,49 @@ func (n *ngt) IsStatisticsEnabled() bool { return n.enableStatistics } +func (n *ngt) IndexProperty() (*payload.Info_Index_Property, error) { + prop, err := n.core.GetProperty() + if err != nil { + return nil, err + } + return &payload.Info_Index_Property{ + Dimension: prop.Dimension, + ThreadPoolSize: prop.ThreadPoolSize, + ObjectType: prop.ObjectType.String(), + DistanceType: prop.DistanceType.String(), + IndexType: prop.IndexType.String(), + DatabaseType: prop.DatabaseType.String(), + ObjectAlignment: prop.ObjectAlignment.String(), + PathAdjustmentInterval: prop.PathAdjustmentInterval, + GraphSharedMemorySize: prop.GraphSharedMemorySize, + TreeSharedMemorySize: prop.TreeSharedMemorySize, + ObjectSharedMemorySize: prop.ObjectSharedMemorySize, + PrefetchOffset: prop.PrefetchOffset, + PrefetchSize: prop.PrefetchSize, + AccuracyTable: prop.AccuracyTable, + SearchType: prop.SearchType, + MaxMagnitude: prop.MaxMagnitude, + NOfNeighborsForInsertionOrder: prop.NOfNeighborsForInsertionOrder, + EpsilonForInsertionOrder: prop.EpsilonForInsersionOrder, + RefinementObjectType: prop.RefinementObjectType.String(), + TruncationThreshold: prop.TruncationThreshold, + EdgeSizeForCreation: prop.EdgeSizeForCreation, + EdgeSizeForSearch: prop.EdgeSizeForSearch, + EdgeSizeLimitForCreation: prop.EdgeSizeLimitForCreation, + InsertionRadiusCoefficient: prop.InsertionRadiusCoefficient, + SeedSize: prop.SeedSize, + SeedType: prop.SeedType.String(), + TruncationThreadPoolSize: prop.TruncationThreadPoolSize, + BatchSizeForCreation: prop.BatchSizeForCreation, + GraphType: prop.GraphType.String(), + DynamicEdgeSizeBase: prop.DynamicEdgeSizeBase, + DynamicEdgeSizeRate: prop.DynamicEdgeSizeRate, + BuildTimeLimit: prop.BuildTimeLimit, + OutgoingEdge: prop.OutgoingEdge, + IncomingEdge: prop.IncomingEdge, + }, nil +} + func (n *ngt) toSearchResponse( sr []algorithm.SearchResult, ) (res *payload.Search_Response, err error) { diff --git a/pkg/gateway/lb/handler/grpc/handler.go b/pkg/gateway/lb/handler/grpc/handler.go index acfdfad8f31..6ae9a501737 100644 --- a/pkg/gateway/lb/handler/grpc/handler.go +++ b/pkg/gateway/lb/handler/grpc/handler.go @@ -4061,3 +4061,117 @@ func mergeInfoIndexStatistics( return merged } + +func (s *server) IndexProperty( + ctx context.Context, _ *payload.Empty, +) (detail *payload.Info_Index_PropertyDetail, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.IndexRPCServiceName+"/"+vald.IndexPropertyRPCName), apiName+"/"+vald.IndexPropertyRPCName) + defer func() { + if span != nil { + span.End() + } + }() + ech := make(chan error, 1) + var mu sync.Mutex + detail = &payload.Info_Index_PropertyDetail{ + Details: make(map[string]*payload.Info_Index_Property, s.gateway.GetAgentCount(ctx)), + } + + s.eg.Go(safety.RecoverFunc(func() error { + defer close(ech) + ech <- s.gateway.BroadCast(ctx, service.READ, func(ctx context.Context, target string, vc vald.Client, copts ...grpc.CallOption) error { + sctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.IndexStatisticsDetailRPCName+"/"+target) + defer func() { + if sspan != nil { + sspan.End() + } + }() + var prop *payload.Info_Index_PropertyDetail + prop, err = vc.IndexProperty(sctx, new(payload.Empty), copts...) + if err != nil { + var ( + attrs trace.Attributes + st *status.Status + msg string + code codes.Code + ) + switch { + case errors.Is(err, context.Canceled), errors.Is(err, errors.ErrRPCCallFailed(target, context.Canceled)): + attrs = trace.StatusCodeCancelled( + errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.IndexPropertyRPCName + ".BroadCast/" + target + " canceled: " + err.Error()) + code = codes.Canceled + case errors.Is(err, context.DeadlineExceeded), errors.Is(err, errors.ErrRPCCallFailed(target, context.DeadlineExceeded)): + attrs = trace.StatusCodeDeadlineExceeded( + errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.IndexPropertyRPCName + ".BroadCast/" + target + " deadline_exceeded: " + err.Error()) + code = codes.DeadlineExceeded + default: + st, msg, err = status.ParseError(err, codes.NotFound, "error "+vald.IndexPropertyRPCName+" API", + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.IndexPropertyRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }) + if st != nil { + code = st.Code() + } else { + code = codes.NotFound + } + attrs = trace.FromGRPCStatus(code, msg) + } + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(attrs...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + if err != nil && st != nil && code != codes.Canceled && code != codes.DeadlineExceeded && code != codes.InvalidArgument && code != codes.NotFound && code != codes.OK && code != codes.Unimplemented { + return err + } + return nil + } + if prop != nil { + mu.Lock() + detail.Details[target] = prop.Details[target] + mu.Unlock() + } + return nil + }) + return nil + })) + select { + case <-ctx.Done(): + err = ctx.Err() + case err = <-ech: + } + if err != nil { + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.IndexPropertyRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %v", apiName, s.name, s.ip, s.gateway.Addrs(ctx)), + } + var attrs trace.Attributes + switch { + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal(vald.IndexPropertyRPCName+" API connection not found", err, resInfo) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled(vald.IndexPropertyRPCName+" API canceled", err, resInfo) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded(vald.IndexPropertyRPCName+" API deadline exceeded", err, resInfo) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Unknown, vald.IndexPropertyRPCName+" API request returned error", resInfo) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Debug(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return detail, nil +} diff --git a/rust/libs/proto/src/payload.v1.rs b/rust/libs/proto/src/payload.v1.rs index 497c4277c67..17a6a036ce9 100644 --- a/rust/libs/proto/src/payload.v1.rs +++ b/rust/libs/proto/src/payload.v1.rs @@ -964,16 +964,16 @@ pub mod info { pub dimension: i32, #[prost(int32, tag="2")] pub thread_pool_size: i32, - #[prost(int32, tag="3")] - pub object_type: i32, - #[prost(int32, tag="4")] - pub distance_type: i32, - #[prost(int32, tag="5")] - pub index_type: i32, - #[prost(int32, tag="6")] - pub database_type: i32, - #[prost(int32, tag="7")] - pub object_alignment: i32, + #[prost(string, tag="3")] + pub object_type: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub distance_type: ::prost::alloc::string::String, + #[prost(string, tag="5")] + pub index_type: ::prost::alloc::string::String, + #[prost(string, tag="6")] + pub database_type: ::prost::alloc::string::String, + #[prost(string, tag="7")] + pub object_alignment: ::prost::alloc::string::String, #[prost(int32, tag="8")] pub path_adjustment_interval: i32, #[prost(int32, tag="9")] @@ -996,8 +996,8 @@ pub mod info { pub n_of_neighbors_for_insertion_order: i32, #[prost(float, tag="18")] pub epsilon_for_insertion_order: f32, - #[prost(int32, tag="19")] - pub refinement_object_type: i32, + #[prost(string, tag="19")] + pub refinement_object_type: ::prost::alloc::string::String, #[prost(int32, tag="20")] pub truncation_threshold: i32, #[prost(int32, tag="21")] @@ -1010,14 +1010,14 @@ pub mod info { pub insertion_radius_coefficient: f64, #[prost(int32, tag="25")] pub seed_size: i32, - #[prost(int32, tag="26")] - pub seed_type: i32, + #[prost(string, tag="26")] + pub seed_type: ::prost::alloc::string::String, #[prost(int32, tag="27")] pub truncation_thread_pool_size: i32, #[prost(int32, tag="28")] pub batch_size_for_creation: i32, - #[prost(int32, tag="29")] - pub graph_type: i32, + #[prost(string, tag="29")] + pub graph_type: ::prost::alloc::string::String, #[prost(int32, tag="30")] pub dynamic_edge_size_base: i32, #[prost(int32, tag="31")] diff --git a/rust/libs/proto/src/vald.v1.tonic.rs b/rust/libs/proto/src/vald.v1.tonic.rs index 563b4e793af..9c856bfd0d5 100644 --- a/rust/libs/proto/src/vald.v1.tonic.rs +++ b/rust/libs/proto/src/vald.v1.tonic.rs @@ -1838,33 +1838,6 @@ pub mod index_client { pub async fn index_property( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/vald.v1.Index/IndexProperty", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("vald.v1.Index", "IndexProperty")); - self.inner.unary(req, path, codec).await - } - /** Represent the RPC to get the index properties for each agents. -*/ - pub async fn index_property_detail( - &mut self, - request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response< super::super::super::payload::v1::info::index::PropertyDetail, @@ -1882,11 +1855,11 @@ pub mod index_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/vald.v1.Index/IndexPropertyDetail", + "/vald.v1.Index/IndexProperty", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("vald.v1.Index", "IndexPropertyDetail")); + .insert(GrpcMethod::new("vald.v1.Index", "IndexProperty")); self.inner.unary(req, path, codec).await } } @@ -1937,15 +1910,6 @@ pub mod index_server { async fn index_property( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /** Represent the RPC to get the index properties for each agents. -*/ - async fn index_property_detail( - &self, - request: tonic::Request, ) -> std::result::Result< tonic::Response< super::super::super::payload::v1::info::index::PropertyDetail, @@ -2236,7 +2200,7 @@ pub mod index_server { > tonic::server::UnaryService< super::super::super::payload::v1::Empty, > for IndexPropertySvc { - type Response = super::super::super::payload::v1::info::index::Property; + type Response = super::super::super::payload::v1::info::index::PropertyDetail; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -2277,55 +2241,6 @@ pub mod index_server { }; Box::pin(fut) } - "/vald.v1.Index/IndexPropertyDetail" => { - #[allow(non_camel_case_types)] - struct IndexPropertyDetailSvc(pub Arc); - impl< - T: Index, - > tonic::server::UnaryService< - super::super::super::payload::v1::Empty, - > for IndexPropertyDetailSvc { - type Response = super::super::super::payload::v1::info::index::PropertyDetail; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::super::super::payload::v1::Empty, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::index_property_detail(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = IndexPropertyDetailSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } _ => { Box::pin(async move { Ok(