From 0fc1949bd18369b4675940e4def7673d047710d3 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 9 Feb 2023 22:42:59 +0900 Subject: [PATCH 01/93] add mirror definition and update proto dependencies Signed-off-by: hlts2 --- apis/grpc/v1/mirror/mirror.pb.go | 112 +++++ apis/grpc/v1/mirror/mirror_vtproto.pb.go | 165 +++++++ apis/grpc/v1/payload/payload_vtproto.pb.go | 404 ++++++++++++++++++ apis/proto/v1/mirror/mirror.proto | 47 ++ apis/proto/v1/payload/payload.proto | 18 + .../apis/proto/v1/mirror/mirror.swagger.json | 139 ++++++ .../apis/proto/v1/vald/filter.swagger.json | 40 +- .../apis/proto/v1/vald/insert.swagger.json | 32 +- .../apis/proto/v1/vald/object.swagger.json | 32 +- .../apis/proto/v1/vald/search.swagger.json | 32 +- .../apis/proto/v1/vald/update.swagger.json | 32 +- .../apis/proto/v1/vald/upsert.swagger.json | 32 +- 12 files changed, 985 insertions(+), 100 deletions(-) create mode 100644 apis/grpc/v1/mirror/mirror.pb.go create mode 100644 apis/grpc/v1/mirror/mirror_vtproto.pb.go create mode 100644 apis/proto/v1/mirror/mirror.proto create mode 100644 apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go new file mode 100644 index 0000000000..c5938c0f7f --- /dev/null +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -0,0 +1,112 @@ +// +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.12 +// source: apis/proto/v1/mirror/mirror.proto + +package mirror + +import ( + reflect "reflect" + + payload "github.com/vdaas/vald/apis/grpc/v1/payload" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_apis_proto_v1_mirror_mirror_proto protoreflect.FileDescriptor + +var file_apis_proto_v1_mirror_mirror_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 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, 0xcc, 0x01, 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x5f, 0x0a, + 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x73, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x6d, 0x69, 0x72, 0x72, + 0x6f, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x61, + 0x0a, 0x09, 0x41, 0x64, 0x76, 0x65, 0x72, 0x74, 0x69, 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x11, 0x2f, 0x6d, 0x69, + 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x61, 0x64, 0x76, 0x65, 0x72, 0x74, 0x69, 0x73, 0x65, 0x3a, 0x01, + 0x2a, 0x42, 0x57, 0x0a, 0x1c, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, + 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x69, 0x72, 0x72, 0x6f, + 0x72, 0x42, 0x0a, 0x56, 0x61, 0x6c, 0x64, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x50, 0x01, 0x5a, + 0x29, 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, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var file_apis_proto_v1_mirror_mirror_proto_goTypes = []interface{}{ + (*payload.Mirror_Targets)(nil), // 0: payload.v1.Mirror.Targets +} +var file_apis_proto_v1_mirror_mirror_proto_depIdxs = []int32{ + 0, // 0: mirror.v1.Mirror.Register:input_type -> payload.v1.Mirror.Targets + 0, // 1: mirror.v1.Mirror.Advertise:input_type -> payload.v1.Mirror.Targets + 0, // 2: mirror.v1.Mirror.Register:output_type -> payload.v1.Mirror.Targets + 0, // 3: mirror.v1.Mirror.Advertise:output_type -> payload.v1.Mirror.Targets + 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 +} + +func init() { file_apis_proto_v1_mirror_mirror_proto_init() } +func file_apis_proto_v1_mirror_mirror_proto_init() { + if File_apis_proto_v1_mirror_mirror_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_apis_proto_v1_mirror_mirror_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_apis_proto_v1_mirror_mirror_proto_goTypes, + DependencyIndexes: file_apis_proto_v1_mirror_mirror_proto_depIdxs, + }.Build() + File_apis_proto_v1_mirror_mirror_proto = out.File + file_apis_proto_v1_mirror_mirror_proto_rawDesc = nil + file_apis_proto_v1_mirror_mirror_proto_goTypes = nil + file_apis_proto_v1_mirror_mirror_proto_depIdxs = nil +} diff --git a/apis/grpc/v1/mirror/mirror_vtproto.pb.go b/apis/grpc/v1/mirror/mirror_vtproto.pb.go new file mode 100644 index 0000000000..d07e0eab6d --- /dev/null +++ b/apis/grpc/v1/mirror/mirror_vtproto.pb.go @@ -0,0 +1,165 @@ +// +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package mirror + +import ( + context "context" + + payload "github.com/vdaas/vald/apis/grpc/v1/payload" + codes "github.com/vdaas/vald/internal/net/grpc/codes" + status "github.com/vdaas/vald/internal/net/grpc/status" + grpc "google.golang.org/grpc" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// MirrorClient is the client API for Mirror service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MirrorClient interface { + // Register is the RPC to register other mirror servers. + Register(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) + // Advertise is the RPC to advertise other mirror servers. + Advertise(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) +} + +type mirrorClient struct { + cc grpc.ClientConnInterface +} + +func NewMirrorClient(cc grpc.ClientConnInterface) MirrorClient { + return &mirrorClient{cc} +} + +func (c *mirrorClient) Register(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) { + out := new(payload.Mirror_Targets) + err := c.cc.Invoke(ctx, "/mirror.v1.Mirror/Register", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mirrorClient) Advertise(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) { + out := new(payload.Mirror_Targets) + err := c.cc.Invoke(ctx, "/mirror.v1.Mirror/Advertise", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MirrorServer is the server API for Mirror service. +// All implementations must embed UnimplementedMirrorServer +// for forward compatibility +type MirrorServer interface { + // Register is the RPC to register other mirror servers. + Register(context.Context, *payload.Mirror_Targets) (*payload.Mirror_Targets, error) + // Advertise is the RPC to advertise other mirror servers. + Advertise(context.Context, *payload.Mirror_Targets) (*payload.Mirror_Targets, error) + mustEmbedUnimplementedMirrorServer() +} + +// UnimplementedMirrorServer must be embedded to have forward compatible implementations. +type UnimplementedMirrorServer struct { +} + +func (UnimplementedMirrorServer) Register(context.Context, *payload.Mirror_Targets) (*payload.Mirror_Targets, error) { + return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") +} +func (UnimplementedMirrorServer) Advertise(context.Context, *payload.Mirror_Targets) (*payload.Mirror_Targets, error) { + return nil, status.Errorf(codes.Unimplemented, "method Advertise not implemented") +} +func (UnimplementedMirrorServer) mustEmbedUnimplementedMirrorServer() {} + +// UnsafeMirrorServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MirrorServer will +// result in compilation errors. +type UnsafeMirrorServer interface { + mustEmbedUnimplementedMirrorServer() +} + +func RegisterMirrorServer(s grpc.ServiceRegistrar, srv MirrorServer) { + s.RegisterService(&Mirror_ServiceDesc, srv) +} + +func _Mirror_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(payload.Mirror_Targets) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MirrorServer).Register(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/mirror.v1.Mirror/Register", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MirrorServer).Register(ctx, req.(*payload.Mirror_Targets)) + } + return interceptor(ctx, in, info, handler) +} + +func _Mirror_Advertise_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(payload.Mirror_Targets) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MirrorServer).Advertise(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/mirror.v1.Mirror/Advertise", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MirrorServer).Advertise(ctx, req.(*payload.Mirror_Targets)) + } + return interceptor(ctx, in, info, handler) +} + +// Mirror_ServiceDesc is the grpc.ServiceDesc for Mirror service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Mirror_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "mirror.v1.Mirror", + HandlerType: (*MirrorServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Register", + Handler: _Mirror_Register_Handler, + }, + { + MethodName: "Advertise", + Handler: _Mirror_Advertise_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "apis/proto/v1/mirror/mirror.proto", +} diff --git a/apis/grpc/v1/payload/payload_vtproto.pb.go b/apis/grpc/v1/payload/payload_vtproto.pb.go index c18557d221..0213f1b387 100644 --- a/apis/grpc/v1/payload/payload_vtproto.pb.go +++ b/apis/grpc/v1/payload/payload_vtproto.pb.go @@ -7676,6 +7676,129 @@ func (m *Info) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Mirror_Target) 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 *Mirror_Target) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Mirror_Target) 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.Port != 0 { + i = encodeVarint(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x10 + } + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarint(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Mirror_Targets) 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 *Mirror_Targets) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Mirror_Targets) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Targets) > 0 { + for iNdEx := len(m.Targets) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Targets[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Mirror) 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 *Mirror) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Mirror) 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) + } + return len(dAtA) - i, nil +} + func (m *Empty) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -9140,6 +9263,49 @@ func (m *Info) SizeVT() (n int) { return n } +func (m *Mirror_Target) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Ip) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Port != 0 { + n += 1 + sov(uint64(m.Port)) + } + n += len(m.unknownFields) + return n +} + +func (m *Mirror_Targets) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Targets) > 0 { + for _, e := range m.Targets { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Mirror) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + func (m *Empty) SizeVT() (n int) { if m == nil { return 0 @@ -16933,6 +17099,244 @@ func (m *Info) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *Mirror_Target) 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: Mirror_Target: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Mirror_Target: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ip = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= 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 *Mirror_Targets) 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: Mirror_Targets: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Mirror_Targets: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Targets", 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 + } + m.Targets = append(m.Targets, &Mirror_Target{}) + if err := m.Targets[len(m.Targets)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 *Mirror) 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: Mirror: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Mirror: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *Empty) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/apis/proto/v1/mirror/mirror.proto b/apis/proto/v1/mirror/mirror.proto new file mode 100644 index 0000000000..d61f8ac692 --- /dev/null +++ b/apis/proto/v1/mirror/mirror.proto @@ -0,0 +1,47 @@ +// +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +syntax = "proto3"; + +package mirror.v1; + +import "apis/proto/v1/payload/payload.proto"; +import "github.com/googleapis/googleapis/google/api/annotations.proto"; + +option go_package = "github.com/vdaas/vald/apis/grpc/v1/mirror"; +option java_multiple_files = true; +option java_package = "org.vdaas.vald.api.v1.mirror"; +option java_outer_classname = "ValdMirror"; + + +// Represent the mirror service. +service Mirror { + + // Register is the RPC to register other mirror servers. + rpc Register(payload.v1.Mirror.Targets) returns (payload.v1.Mirror.Targets) { + option (google.api.http) = { + post : "/mirror/register" + body : "*" + }; + } + + // Advertise is the RPC to advertise other mirror servers. + rpc Advertise(payload.v1.Mirror.Targets) returns (payload.v1.Mirror.Targets) { + option (google.api.http) = { + post : "/mirror/advertise" + body : "*" + }; + } +} diff --git a/apis/proto/v1/payload/payload.proto b/apis/proto/v1/payload/payload.proto index af3638e823..81b1bf944c 100644 --- a/apis/proto/v1/payload/payload.proto +++ b/apis/proto/v1/payload/payload.proto @@ -582,5 +582,23 @@ message Info { } } +// Mirror related messages. +message Mirror { + + // Represent server information. + message Target { + // The target ip. + string ip = 1; + // The target port. + uint32 port = 2; + } + + // Represent the multiple Target message. + message Targets { + // The multiple target information. + repeated Target targets = 1; + } +} + // Represent an empty message. message Empty {} diff --git a/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json new file mode 100644 index 0000000000..ba39fe8420 --- /dev/null +++ b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json @@ -0,0 +1,139 @@ +{ + "swagger": "2.0", + "info": { + "title": "apis/proto/v1/mirror/mirror.proto", + "version": "version not set" + }, + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/mirror/advertise": { + "post": { + "summary": "Advertise is the RPC to advertise other mirror servers.", + "operationId": "Mirror_Advertise", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/MirrorTargets" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MirrorTargets" + } + } + ], + "tags": ["Mirror"] + } + }, + "/mirror/register": { + "post": { + "summary": "Register is the RPC to register other mirror servers.", + "operationId": "Mirror_Register", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/MirrorTargets" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MirrorTargets" + } + } + ], + "tags": ["Mirror"] + } + } + }, + "definitions": { + "MirrorTargets": { + "type": "object", + "properties": { + "targets": { + "type": "array", + "items": { + "$ref": "#/definitions/v1MirrorTarget" + }, + "description": "The multiple target information." + } + }, + "description": "Represent the multiple Target message." + }, + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + }, + "value": { + "type": "string", + "format": "byte", + "description": "Must be a valid serialized protocol buffer of the above specified type." + } + }, + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + }, + "runtimeError": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1MirrorTarget": { + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "The target ip." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent server information." + } + } +} diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json index 49dc3382ec..056169fcb7 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json @@ -257,21 +257,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectBlob": { "type": "object", "properties": { @@ -456,13 +441,28 @@ "targets": { "type": "array", "items": { - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1InsertConfig": { "type": "object", "properties": { @@ -507,7 +507,7 @@ "description": "The configuration of the insert request." }, "vectorizer": { - "$ref": "#/definitions/FilterTarget", + "$ref": "#/definitions/v1FilterTarget", "description": "Filter configurations." } }, @@ -607,7 +607,7 @@ "description": "The configuration of the search request." }, "vectorizer": { - "$ref": "#/definitions/FilterTarget", + "$ref": "#/definitions/v1FilterTarget", "description": "Filter configuration." } }, @@ -678,7 +678,7 @@ "description": "The configuration of the update request." }, "vectorizer": { - "$ref": "#/definitions/FilterTarget", + "$ref": "#/definitions/v1FilterTarget", "description": "Filter target." } }, @@ -732,7 +732,7 @@ "description": "The configuration of the upsert request." }, "vectorizer": { - "$ref": "#/definitions/FilterTarget", + "$ref": "#/definitions/v1FilterTarget", "description": "Filter target." } }, diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json index 43cde3b9f2..85ef4f072a 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json @@ -71,21 +71,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectLocations": { "type": "object", "properties": { @@ -224,13 +209,28 @@ "targets": { "type": "array", "items": { - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1InsertConfig": { "type": "object", "properties": { diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json index 7d76b24d4a..2c185ac5c5 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json @@ -97,21 +97,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectID": { "type": "object", "properties": { @@ -260,12 +245,27 @@ "targets": { "type": "array", "items": { - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." + }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." } } } diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json index 3cd0d4b763..5ead82c2d1 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json @@ -257,21 +257,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectDistance": { "type": "object", "properties": { @@ -442,13 +427,28 @@ "targets": { "type": "array", "items": { - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1SearchConfig": { "type": "object", "properties": { diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json index 9cbb4a2bf2..7b355f6d23 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json @@ -71,21 +71,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectLocations": { "type": "object", "properties": { @@ -224,13 +209,28 @@ "targets": { "type": "array", "items": { - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1ObjectLocation": { "type": "object", "properties": { diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json index ada6e05746..64ae13be12 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json @@ -71,21 +71,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectLocations": { "type": "object", "properties": { @@ -224,13 +209,28 @@ "targets": { "type": "array", "items": { - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1ObjectLocation": { "type": "object", "properties": { From e0472c212f3a1265005264615c9569d97960bb15 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Tue, 25 Apr 2023 16:51:17 +0900 Subject: [PATCH 02/93] Add mirror gateway component (#1949) * add mirror component Signed-off-by: hlts2 * fix mirror dockerfile path Signed-off-by: hlts2 * fix deepsource warning Signed-off-by: hlts2 * fix insert rpc handler Signed-off-by: hlts2 * deleted unused file Signed-off-by: hlts2 * fix api resource name Signed-off-by: hlts2 * add mirror service and fix handler logic Signed-off-by: hlts2 * fix values and helm template for new configuration Signed-off-by: hlts2 * Format code with gofumpt and prettier * fix template rendering bug of mirror configmap Signed-off-by: hlts2 * fix nil pointer error Signed-off-by: hlts2 * bugfix to advertize different address Signed-off-by: hlts2 * returns error when there is no other mirror gateways Signed-off-by: hlts2 * add info log Signed-off-by: hlts2 * extract only mirror addresses Signed-off-by: hlts2 * fix log variable Signed-off-by: hlts2 * add logging Signed-off-by: hlts2 * bugfix mirror connection logic Signed-off-by: hlts2 * add remove api proxy implementation Signed-off-by: hlts2 * add error handling for register API Signed-off-by: hlts2 * fix debug message Signed-off-by: hlts2 * refactor discover logic Signed-off-by: hlts2 * refactor Signed-off-by: hlts2 * add remove api Signed-off-by: hlts2 * Format code with prettier and gofumpt * add remove api and remove api rollback logic Signed-off-by: hlts2 * refactor Signed-off-by: hlts2 * add update rpc handler Signed-off-by: hlts2 * refactor context variable for grpc method Signed-off-by: hlts2 * fix trace span name Signed-off-by: hlts2 * add getObjects method Signed-off-by: hlts2 * refactor update and remove handler Signed-off-by: hlts2 * Apply suggestions from code review Co-authored-by: Kiichiro YUKAWA * add multi handler implementation Signed-off-by: hlts2 * fix mirror client trace span Signed-off-by: hlts2 * rename discover service to mirror service Signed-off-by: hlts2 * fix build error of bidirectional stream Signed-off-by: hlts2 * add more error handling to search handler Signed-off-by: hlts2 * add debug comment Signed-off-by: hlts2 * add status code log Signed-off-by: hlts2 * add status code log Signed-off-by: hlts2 * add status code log Signed-off-by: hlts2 * fix named return bug Signed-off-by: hlts2 * add debug log Signed-off-by: hlts2 * add debug command Signed-off-by: hlts2 * add debug command Signed-off-by: hlts2 * add debug command Signed-off-by: hlts2 * add force status wrap Signed-off-by: hlts2 * execute upsert method to local cluster's lb Signed-off-by: hlts2 * add target debug log Signed-off-by: hlts2 * fix delete unwrap of circuitbreaker Signed-off-by: hlts2 * refactor error handling for new status parse function Signed-off-by: hlts2 * Format code with prettier and gofumpt * refactor error handling Signed-off-by: hlts2 * style: Format code with prettier and gofumpt * fix error handling for broadcast operation of getobject Signed-off-by: hlts2 * fix error join bug of getobject Signed-off-by: hlts2 * refactor Signed-off-by: hlts2 * deleted unused code Signed-off-by: hlts2 * fix status handling and add address to resource name Signed-off-by: hlts2 * use vald client for update operation Signed-off-by: hlts2 * add rollback test for mirror crud Signed-off-by: hlts2 * style: Format code with prettier and gofumpt * fix variable name Signed-off-by: hlts2 * refactor mirror servie Signed-off-by: hlts2 * deleted unused code Signed-off-by: hlts2 * fix trace attribute and refactor variable name Signed-off-by: hlts2 * add error handling when crud rpc fails Signed-off-by: hlts2 * deleted unused value Signed-off-by: hlts2 * make format Signed-off-by: hlts2 * Revert "make format" This reverts commit f605563f0898987a59f79abc53fb186d560ad0b0. * Apply suggestions from code review Co-authored-by: Kiichiro YUKAWA * apply suggestion Signed-off-by: hlts2 * bugfix and refactor mirror client Signed-off-by: hlts2 --------- Signed-off-by: hlts2 Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> Co-authored-by: Kiichiro YUKAWA --- .../dockers-gateway-mirror-image.yaml | 156 + Makefile | 1 + Makefile.d/build.mk | 28 + Makefile.d/docker.mk | 15 + Makefile.d/k8s.mk | 30 + apis/grpc/v1/vald/vald.go | 40 + .../templates/gateway/mirror/configmap.yaml | 80 + .../templates/gateway/mirror/daemonset.yaml | 134 + .../templates/gateway/mirror/deployment.yaml | 138 + charts/vald/templates/gateway/mirror/hpa.yaml | 38 + charts/vald/templates/gateway/mirror/ing.yaml | 47 + charts/vald/templates/gateway/mirror/pdb.yaml | 34 + .../gateway/mirror/priorityclass.yaml | 32 + charts/vald/templates/gateway/mirror/svc.yaml | 52 + charts/vald/values.yaml | 260 + .../vald/values/multi-vald/dev-vald-01.yaml | 5 + .../vald/values/multi-vald/dev-vald-02.yaml | 7 + .../vald/values/multi-vald/dev-vald-03.yaml | 15 + .../multi-vald/dev-vald-with-mirror.yaml | 88 + cmd/gateway/mirror/main.go | 58 + cmd/gateway/mirror/sample.yaml | 148 + dockers/gateway/mirror/Dockerfile | 81 + internal/circuitbreaker/manager.go | 3 +- internal/client/v1/client/mirror/mirror.go | 98 + internal/client/v1/client/mirror/option.go | 32 + internal/config/mirror.go | 46 + .../grpc/interceptor/server/metric/metric.go | 2 +- internal/net/grpc/metadata.go | 34 + pkg/gateway/mirror/README.md | 1 + pkg/gateway/mirror/config/config.go | 156 + pkg/gateway/mirror/handler/doc.go | 17 + pkg/gateway/mirror/handler/grpc/handler.go | 3283 ++++++++++ .../mirror/handler/grpc/handler_test.go | 5519 +++++++++++++++++ pkg/gateway/mirror/handler/grpc/mock_test.go | 215 + pkg/gateway/mirror/handler/grpc/option.go | 110 + pkg/gateway/mirror/handler/rest/handler.go | 211 + pkg/gateway/mirror/handler/rest/option.go | 32 + pkg/gateway/mirror/router/option.go | 40 + pkg/gateway/mirror/router/router.go | 183 + pkg/gateway/mirror/service/doc.go | 18 + pkg/gateway/mirror/service/gateway.go | 172 + pkg/gateway/mirror/service/mirror.go | 432 ++ pkg/gateway/mirror/service/mirror_option.go | 72 + pkg/gateway/mirror/service/option.go | 58 + pkg/gateway/mirror/usecase/vald.go | 220 + 45 files changed, 12439 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/dockers-gateway-mirror-image.yaml create mode 100644 charts/vald/templates/gateway/mirror/configmap.yaml create mode 100644 charts/vald/templates/gateway/mirror/daemonset.yaml create mode 100644 charts/vald/templates/gateway/mirror/deployment.yaml create mode 100644 charts/vald/templates/gateway/mirror/hpa.yaml create mode 100644 charts/vald/templates/gateway/mirror/ing.yaml create mode 100644 charts/vald/templates/gateway/mirror/pdb.yaml create mode 100644 charts/vald/templates/gateway/mirror/priorityclass.yaml create mode 100644 charts/vald/templates/gateway/mirror/svc.yaml create mode 100644 charts/vald/values/multi-vald/dev-vald-01.yaml create mode 100644 charts/vald/values/multi-vald/dev-vald-02.yaml create mode 100644 charts/vald/values/multi-vald/dev-vald-03.yaml create mode 100644 charts/vald/values/multi-vald/dev-vald-with-mirror.yaml create mode 100644 cmd/gateway/mirror/main.go create mode 100644 cmd/gateway/mirror/sample.yaml create mode 100644 dockers/gateway/mirror/Dockerfile create mode 100644 internal/client/v1/client/mirror/mirror.go create mode 100644 internal/client/v1/client/mirror/option.go create mode 100644 internal/config/mirror.go create mode 100644 internal/net/grpc/metadata.go create mode 100755 pkg/gateway/mirror/README.md create mode 100644 pkg/gateway/mirror/config/config.go create mode 100644 pkg/gateway/mirror/handler/doc.go create mode 100644 pkg/gateway/mirror/handler/grpc/handler.go create mode 100644 pkg/gateway/mirror/handler/grpc/handler_test.go create mode 100644 pkg/gateway/mirror/handler/grpc/mock_test.go create mode 100644 pkg/gateway/mirror/handler/grpc/option.go create mode 100644 pkg/gateway/mirror/handler/rest/handler.go create mode 100644 pkg/gateway/mirror/handler/rest/option.go create mode 100644 pkg/gateway/mirror/router/option.go create mode 100644 pkg/gateway/mirror/router/router.go create mode 100644 pkg/gateway/mirror/service/doc.go create mode 100644 pkg/gateway/mirror/service/gateway.go create mode 100644 pkg/gateway/mirror/service/mirror.go create mode 100644 pkg/gateway/mirror/service/mirror_option.go create mode 100644 pkg/gateway/mirror/service/option.go create mode 100644 pkg/gateway/mirror/usecase/vald.go diff --git a/.github/workflows/dockers-gateway-mirror-image.yaml b/.github/workflows/dockers-gateway-mirror-image.yaml new file mode 100644 index 0000000000..5c3fe5592e --- /dev/null +++ b/.github/workflows/dockers-gateway-mirror-image.yaml @@ -0,0 +1,156 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +name: "Build docker image: gateway-mirror" +on: + push: + branches: + - main + tags: + - "*.*.*" + - "v*.*.*" + - "*.*.*-*" + - "v*.*.*-*" + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-gateway-mirror-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/**/*_mock.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/gateway/mirror/**" + - "cmd/gateway/mirror/**" + - "pkg/gateway/internal/**" + - "dockers/gateway/mirror/Dockerfile" + - "versions/GO_VERSION" + pull_request: + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-gateway-mirror-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/**/*_mock.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/gateway/mirror/**" + - "cmd/gateway/mirror/**" + - "pkg/gateway/internal/**" + - "dockers/gateway/mirror/Dockerfile" + - "versions/GO_VERSION" + pull_request_target: + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-gateway-mirror-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/**/*_mock.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/gateway/mirror/**" + - "cmd/gateway/nirror/**" + - "pkg/gateway/internal/**" + - "dockers/gateway/mirror/Dockerfile" + - "versions/GO_VERSION" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + build: + strategy: + max-parallel: 4 + runs-on: ubuntu-latest + if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} + steps: + - uses: actions/checkout@v3 + - name: set git config + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Setup QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: all + - name: Setup Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + with: + buildkitd-flags: "--debug" + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_PASS }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ secrets.PACKAGE_USER }} + password: ${{ secrets.PACKAGE_TOKEN }} + - name: Build and Publish + id: build_and_publish + uses: ./.github/actions/docker-build + with: + target: gateway-mirror + builder: ${{ steps.buildx.outputs.name }} + - name: Initialize CodeQL + if: startsWith( github.ref, 'refs/tags/') + uses: github/codeql-action/init@v2 + - name: Run vulnerability scanner (table) + if: startsWith( github.ref, 'refs/tags/') + uses: aquasecurity/trivy-action@master + with: + image-ref: "${{ steps.build_and_publish.outputs.IMAGE_NAME }}:${{ steps.build_and_publish.outputs.PRIMARY_TAG }}" + format: "table" + - name: Run vulnerability scanner (sarif) + if: startsWith( github.ref, 'refs/tags/') + uses: aquasecurity/trivy-action@master + with: + image-ref: "${{ steps.build_and_publish.outputs.IMAGE_NAME }}:${{ steps.build_and_publish.outputs.PRIMARY_TAG }}" + format: "template" + template: "@/contrib/sarif.tpl" + output: "trivy-results.sarif" + - name: Upload Trivy scan results to Security tab + if: startsWith( github.ref, 'refs/tags/') + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: "trivy-results.sarif" + slack: + name: Slack notification + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' || startsWith( github.ref, 'refs/tags/') + steps: + - uses: technote-space/workflow-conclusion-action@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: 8398a7/action-slack@v3 + with: + author_name: vald-mirror-gateway image build + status: ${{ env.WORKFLOW_CONCLUSION }} + only_mention_fail: channel + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WEBHOOK_URL }} diff --git a/Makefile b/Makefile index 03ec84dfa7..95455a328a 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ CI_CONTAINER_IMAGE = $(NAME)-ci-container DEV_CONTAINER_IMAGE = $(NAME)-dev-container DISCOVERER_IMAGE = $(NAME)-discoverer-k8s FILTER_GATEWAY_IMAGE = $(NAME)-filter-gateway +MIRROR_GATEWAY_IMAGE = $(NAME)-mirror-gateway HELM_OPERATOR_IMAGE = $(NAME)-helm-operator LB_GATEWAY_IMAGE = $(NAME)-lb-gateway LOADTEST_IMAGE = $(NAME)-loadtest diff --git a/Makefile.d/build.mk b/Makefile.d/build.mk index 580cf34599..b3fb6de69e 100644 --- a/Makefile.d/build.mk +++ b/Makefile.d/build.mk @@ -177,6 +177,34 @@ cmd/gateway/filter/filter: \ $(dir $@)main.go $@ -version +cmd/gateway/mirror/mirror: \ + $(GO_SOURCES_INTERNAL) \ + $(PBGOS) \ + $(shell find ./cmd/gateway/mirror -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go') \ + $(shell find ./pkg/gateway/mirror -type f -name '*.go' -not -name '*_test.go' -not -name 'doc.go') + CGO_ENABLED=0 \ + GO111MODULE=on \ + GOPRIVATE=$(GOPRIVATE) \ + go build \ + --ldflags "-w -extldflags=-static \ + -X '$(GOPKG)/internal/info.Version=$(VERSION)' \ + -X '$(GOPKG)/internal/info.GitCommit=$(GIT_COMMIT)' \ + -X '$(GOPKG)/internal/info.BuildTime=$(DATETIME)' \ + -X '$(GOPKG)/internal/info.GoVersion=$(GO_VERSION)' \ + -X '$(GOPKG)/internal/info.GoOS=$(GOOS)' \ + -X '$(GOPKG)/internal/info.GoArch=$(GOARCH)' \ + -X '$(GOPKG)/internal/info.CGOEnabled=$${CGO_ENABLED}' \ + -X '$(GOPKG)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \ + -buildid=" \ + -mod=readonly \ + -modcacherw \ + -a \ + -tags "osusergo netgo static_build" \ + -trimpath \ + -o $@ \ + $(dir $@)main.go + $@ -version + cmd/manager/index/index: \ $(GO_SOURCES_INTERNAL) \ $(PBGOS) \ diff --git a/Makefile.d/docker.mk b/Makefile.d/docker.mk index 0997f7e1ef..99d0b32eb4 100644 --- a/Makefile.d/docker.mk +++ b/Makefile.d/docker.mk @@ -114,6 +114,21 @@ docker/build/gateway-filter: --build-arg DISTROLESS_IMAGE=$(DISTROLESS_IMAGE) \ --build-arg DISTROLESS_IMAGE_TAG=$(DISTROLESS_IMAGE_TAG) +.PHONY: docker/name/gateway-mirror +docker/name/gateway-mirror: + @echo "$(ORG)/$(MIRROR_GATEWAY_IMAGE)" + +.PHONY: docker/build/gateway-mirror +## build gateway-mirror image +docker/build/gateway-mirror: + $(DOCKER) build \ + $(DOCKER_OPTS) \ + -f dockers/gateway/mirror/Dockerfile \ + -t $(ORG)/$(MIRROR_GATEWAY_IMAGE):$(TAG) . \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg DISTROLESS_IMAGE=$(DISTROLESS_IMAGE) \ + --build-arg DISTROLESS_IMAGE_TAG=$(DISTROLESS_IMAGE_TAG) + .PHONY: docker/name/manager-index docker/name/manager-index: @echo "$(ORG)/$(MANAGER_INDEX_IMAGE)" diff --git a/Makefile.d/k8s.mk b/Makefile.d/k8s.mk index 0962b95407..40b6749c89 100644 --- a/Makefile.d/k8s.mk +++ b/Makefile.d/k8s.mk @@ -15,6 +15,9 @@ # JAEGER_OPERATOR_WAIT_DURATION := 0 +MIRROR01_NAMESPACE = vald-01 +MIRROR02_NAMESPACE = vald-02 +MIRROR03_NAMESPACE = vald-03 .PHONY: k8s/manifest/clean ## clean k8s manifests @@ -103,6 +106,33 @@ k8s/vald/delete: kubectl delete -f $(TEMP_DIR)/vald/templates/agent rm -rf $(TEMP_DIR) +.PHONY: k8s/multi/vald/deploy +## deploy multiple vald sample clusters to k8s +k8s/multi/vald/deploy: + -@kubectl create ns $(MIRROR01_NAMESPACE) + -@kubectl create ns $(MIRROR02_NAMESPACE) + -@kubectl create ns $(MIRROR03_NAMESPACE) + helm install vald-cluster-01 charts/vald \ + -f ./charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ + -f ./charts/vald/values/multi-vald/dev-vald-01.yaml \ + -n $(MIRROR01_NAMESPACE) + helm install vald-cluster-02 charts/vald \ + -f ./charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ + -f ./charts/vald/values/multi-vald/dev-vald-02.yaml \ + -n $(MIRROR02_NAMESPACE) + helm install vald-cluster-03 charts/vald \ + -f ./charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ + -f ./charts/vald/values/multi-vald/dev-vald-03.yaml \ + -n $(MIRROR03_NAMESPACE) + +.PHONY: k8s/multi/vald/delete +## delete multiple vald sample clusters to k8s +k8s/multi/vald/delete: + helm uninstall vald-cluster-01 -n vald-01 + helm uninstall vald-cluster-02 -n vald-02 + helm uninstall vald-cluster-03 -n vald-03 + -@kubectl delete ns vald-01 vald-02 vald-03 + .PHONY: k8s/vald-helm-operator/deploy ## deploy vald-helm-operator to k8s k8s/vald-helm-operator/deploy: diff --git a/apis/grpc/v1/vald/vald.go b/apis/grpc/v1/vald/vald.go index 52b727d8e3..e93a49560c 100644 --- a/apis/grpc/v1/vald/vald.go +++ b/apis/grpc/v1/vald/vald.go @@ -18,6 +18,7 @@ package vald import ( + "github.com/vdaas/vald/apis/grpc/v1/mirror" grpc "google.golang.org/grpc" ) @@ -35,6 +36,11 @@ type ServerWithFilter interface { FilterServer } +type ServerWithMirror interface { + Server + mirror.MirrorServer +} + type UnimplementedValdServer struct { UnimplementedInsertServer UnimplementedUpdateServer @@ -49,6 +55,11 @@ type UnimplementedValdServerWithFilter struct { UnimplementedFilterServer } +type UnimplementedValdServerWithMirror struct { + UnimplementedValdServer + mirror.UnimplementedMirrorServer +} + type Client interface { InsertClient UpdateClient @@ -63,6 +74,11 @@ type ClientWithFilter interface { FilterClient } +type ClientWithMirror interface { + Client + mirror.MirrorClient +} + const PackageName = "vald.v1" const ( @@ -73,6 +89,7 @@ const ( RemoveRPCServiceName = "Remove" ObjectRPCServiceName = "Object" FilterRPCServiceName = "Filter" + MirrorRPCServiceName = "Mirror" ) const ( @@ -125,6 +142,12 @@ const ( GetObjectRPCName = "GetObject" StreamGetObjectRPCName = "StreamGetObject" StreamListObjectRPCName = "StreamListObject" + ExistsRPCName = "Exists" + GetObjectRPCName = "GetObject" + StreamGetObjectRPCName = "StreamGetObject" + + RegisterRPCName = "Register" + AdvertiseRPCName = "Advertise" ) type client struct { @@ -136,6 +159,11 @@ type client struct { ObjectClient } +type clientWithMirror struct { + Client + mirror.MirrorClient +} + func RegisterValdServer(s *grpc.Server, srv Server) { RegisterInsertServer(s, srv) RegisterUpdateServer(s, srv) @@ -150,6 +178,11 @@ func RegisterValdServerWithFilter(s *grpc.Server, srv ServerWithFilter) { RegisterFilterServer(s, srv) } +func RegisterValdServerWithMirror(s *grpc.Server, srv ServerWithMirror) { + RegisterValdServer(s, srv) + mirror.RegisterMirrorServer(s, srv) +} + func NewValdClient(conn *grpc.ClientConn) Client { return &client{ NewInsertClient(conn), @@ -160,3 +193,10 @@ func NewValdClient(conn *grpc.ClientConn) Client { NewObjectClient(conn), } } + +func NewValdClientWithMirror(conn *grpc.ClientConn) ClientWithMirror { + return &clientWithMirror{ + Client: NewValdClient(conn), + MirrorClient: mirror.NewMirrorClient(conn), + } +} diff --git a/charts/vald/templates/gateway/mirror/configmap.yaml b/charts/vald/templates/gateway/mirror/configmap.yaml new file mode 100644 index 0000000000..24e8c87117 --- /dev/null +++ b/charts/vald/templates/gateway/mirror/configmap.yaml @@ -0,0 +1,80 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- $lb := .Values.gateway.lb -}} +{{- if $gateway.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ $gateway.name }}-config + labels: + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror +data: + config.yaml: | + --- + version: {{ $gateway.version }} + time_zone: {{ default .Values.defaults.time_zone $gateway.time_zone }} + logging: + {{- $logging := dict "Values" $gateway.logging "default" .Values.defaults.logging }} + {{- include "vald.logging" $logging | nindent 6 }} + server_config: + {{- $servers := dict "Values" $gateway.server_config "default" .Values.defaults.server_config }} + {{- include "vald.servers" $servers | nindent 6 }} + observability: + {{- $observability := dict "Values" $gateway.observability "default" .Values.defaults.observability }} + {{- include "vald.observability" $observability | nindent 6 }} + gateway: + pod_name: {{ $gateway.gateway_config.pod_name }} + advertise_interval: {{ $gateway.gateway_config.advertise_interval }} + client: + {{- $client := $gateway.gateway_config.client }} + {{- $addrs := default list $client.addrs }} + {{- if $lb.enabled -}} + {{- $defaultHost := printf "%s.%s.svc.cluster.local" $lb.name .Release.Namespace }} + {{- $defaultPort := default .Values.defaults.server_config.servers.grpc.port $lb.server_config.servers.grpc.port }} + {{- $defaultAddr := (list (printf "%s:%d" $defaultHost (int64 $defaultPort))) }} + {{- $addrs = (concat $addrs $defaultAddr) }} + {{- end -}} + {{- if $addrs }} + addrs: + {{- toYaml $addrs | nindent 10 }} + {{- else }} + addrs: [] + {{- end -}} + {{- $GRPCClient := dict "Values" $client "default" .Values.defaults.grpc.client }} + {{- include "vald.grpc.client" $GRPCClient | nindent 8 }} + self_mirror_addr: + {{- if $gateway.ingress.enabled -}} + {{- $defaultHost := $gateway.ingress.host }} + {{- $defaultPort := default .Values.defaults.server_config.servers.grpc.port $gateway.server_config.servers.grpc.port }} + {{- printf "%s:%d" $defaultHost (int64 $defaultPort) | indent 1 }} + {{- else -}} + {{- $defaultHost := printf "%s.%s.svc.cluster.local" $gateway.name .Release.Namespace }} + {{- $defaultPort := default .Values.defaults.server_config.servers.grpc.port $gateway.server_config.servers.grpc.port }} + {{- printf "%s:%d" $defaultHost (int64 $defaultPort) | indent 1 }} + {{- end }} + gateway_addr: + {{- if $lb.enabled -}} + {{- $defaultHost := printf "%s.%s.svc.cluster.local" $lb.name .Release.Namespace }} + {{- $defaultPort := default .Values.defaults.server_config.servers.grpc.port $lb.server_config.servers.grpc.port }} + {{- printf "%s:%d" $defaultHost (int64 $defaultPort) | indent 1 }} + {{- end }} +{{- end }} diff --git a/charts/vald/templates/gateway/mirror/daemonset.yaml b/charts/vald/templates/gateway/mirror/daemonset.yaml new file mode 100644 index 0000000000..bd0e539455 --- /dev/null +++ b/charts/vald/templates/gateway/mirror/daemonset.yaml @@ -0,0 +1,134 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled (eq $gateway.kind "DaemonSet") }} +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ $gateway.name }} + labels: + app: {{ $gateway.name }} + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror + {{- if $gateway.annotations }} + annotations: + {{- toYaml $gateway.annotations | nindent 4 }} + {{- end }} +spec: + revisionHistoryLimit: {{ $gateway.revisionHistoryLimit }} + selector: + matchLabels: + app: {{ $gateway.name }} + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: {{ $gateway.rollingUpdate.maxSurge }} + maxUnavailable: {{ $gateway.rollingUpdate.maxUnavailable }} + template: + metadata: + creationTimestamp: null + labels: + app: {{ $gateway.name }} + app.kubernetes.io/name: {{ include "vald.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: gateway-mirror + annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/gateway/mirror/configmap.yaml") . | sha256sum }} + {{- if $gateway.podAnnotations }} + {{- toYaml $gateway.podAnnotations | nindent 8 }} + {{- end }} + {{- $pprof := default .Values.defaults.server_config.metrics.pprof $gateway.server_config.metrics.pprof }} + {{- if $pprof.enabled }} + pyroscope.io/scrape: "true" + pyroscope.io/application-name: {{ $gateway.name }} + pyroscope.io/profile-cpu-enabled: "true" + pyroscope.io/profile-mem-enabled: "true" + pyroscope.io/port: "{{ $pprof.port }}" + {{- end }} + spec: + {{- if $gateway.initContainers }} + initContainers: + {{- $initContainers := dict "initContainers" $gateway.initContainers "Values" .Values "namespace" .Release.Namespace -}} + {{- include "vald.initContainers" $initContainers | trim | nindent 8 }} + {{- end }} + affinity: + {{- include "vald.affinity" $gateway.affinity | nindent 8 }} + {{- if $gateway.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml $gateway.topologySpreadConstraints | nindent 8 }} + {{- end }} + containers: + - name: {{ $gateway.name }} + image: "{{ $gateway.image.repository }}:{{ default .Values.defaults.image.tag $gateway.image.tag }}" + imagePullPolicy: {{ $gateway.image.pullPolicy }} + {{- $servers := dict "Values" $gateway.server_config "default" .Values.defaults.server_config -}} + {{- include "vald.containerPorts" $servers | trim | nindent 10 }} + resources: + {{- toYaml $gateway.resources | nindent 12 }} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + {{- if $gateway.securityContext }} + securityContext: + {{- toYaml $gateway.securityContext | nindent 12 }} + {{- end }} + {{- if $gateway.env }} + env: + {{- toYaml $gateway.env | nindent 12 }} + {{- end }} + volumeMounts: + - name: {{ $gateway.name }}-config + mountPath: /etc/server/ + {{- if $gateway.volumeMounts }} + {{- toYaml $gateway.volumeMounts | nindent 12 }} + {{- end }} + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + {{- if $gateway.podSecurityContext }} + securityContext: + {{- toYaml $gateway.podSecurityContext | nindent 8 }} + {{- end }} + terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }} + volumes: + - name: {{ $gateway.name }}-config + configMap: + defaultMode: 420 + name: {{ $gateway.name }}-config + {{- if $gateway.volumes }} + {{- toYaml $gateway.volumes | nindent 8 }} + {{- end }} + {{- if $gateway.nodeName }} + nodeName: {{ $gateway.nodeName }} + {{- end }} + {{- if $gateway.nodeSelector }} + nodeSelector: + {{- toYaml $gateway.nodeSelector | nindent 8 }} + {{- end }} + {{- if $gateway.tolerations }} + tolerations: + {{- toYaml $gateway.tolerations | nindent 8 }} + {{- end }} + {{- if $gateway.podPriority }} + {{- if $gateway.podPriority.enabled }} + priorityClassName: {{ .Release.Namespace }}-{{ $gateway.name }}-priority + {{- end }} + {{- end }} +status: +{{- end }} diff --git a/charts/vald/templates/gateway/mirror/deployment.yaml b/charts/vald/templates/gateway/mirror/deployment.yaml new file mode 100644 index 0000000000..e11df4d3f0 --- /dev/null +++ b/charts/vald/templates/gateway/mirror/deployment.yaml @@ -0,0 +1,138 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled (eq $gateway.kind "Deployment") }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ $gateway.name }} + labels: + app: {{ $gateway.name }} + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror + {{- if $gateway.annotations }} + annotations: + {{- toYaml $gateway.annotations | nindent 4 }} + {{- end }} +spec: + progressDeadlineSeconds: {{ $gateway.progressDeadlineSeconds }} + {{- if not $gateway.hpa.enabled }} + replicas: {{ $gateway.minReplicas }} + {{- end }} + revisionHistoryLimit: {{ $gateway.revisionHistoryLimit }} + selector: + matchLabels: + app: {{ $gateway.name }} + strategy: + rollingUpdate: + maxSurge: {{ $gateway.rollingUpdate.maxSurge }} + maxUnavailable: {{ $gateway.rollingUpdate.maxUnavailable }} + type: RollingUpdate + template: + metadata: + creationTimestamp: null + labels: + app: {{ $gateway.name }} + app.kubernetes.io/name: {{ include "vald.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: gateway-mirror + annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/gateway/mirror/configmap.yaml") . | sha256sum }} + {{- if $gateway.podAnnotations }} + {{- toYaml $gateway.podAnnotations | nindent 8 }} + {{- end }} + {{- $pprof := default .Values.defaults.server_config.metrics.pprof $gateway.server_config.metrics.pprof }} + {{- if $pprof.enabled }} + pyroscope.io/scrape: "true" + pyroscope.io/application-name: {{ $gateway.name }} + pyroscope.io/profile-cpu-enabled: "true" + pyroscope.io/profile-mem-enabled: "true" + pyroscope.io/port: "{{ $pprof.port }}" + {{- end }} + spec: + {{- if $gateway.initContainers }} + initContainers: + {{- $initContainers := dict "initContainers" $gateway.initContainers "Values" .Values "namespace" .Release.Namespace -}} + {{- include "vald.initContainers" $initContainers | trim | nindent 8 }} + {{- end }} + affinity: + {{- include "vald.affinity" $gateway.affinity | nindent 8 }} + {{- if $gateway.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml $gateway.topologySpreadConstraints | nindent 8 }} + {{- end }} + containers: + - name: {{ $gateway.name }} + image: "{{ $gateway.image.repository }}:{{ default .Values.defaults.image.tag $gateway.image.tag }}" + imagePullPolicy: {{ $gateway.image.pullPolicy }} + {{- $servers := dict "Values" $gateway.server_config "default" .Values.defaults.server_config -}} + {{- include "vald.containerPorts" $servers | trim | nindent 10 }} + resources: + {{- toYaml $gateway.resources | nindent 12 }} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + {{- if $gateway.securityContext }} + securityContext: + {{- toYaml $gateway.securityContext | nindent 12 }} + {{- end }} + {{- if $gateway.env }} + env: + {{- toYaml $gateway.env | nindent 12 }} + {{- end }} + volumeMounts: + - name: {{ $gateway.name }}-config + mountPath: /etc/server/ + {{- if $gateway.volumeMounts }} + {{- toYaml $gateway.volumeMounts | nindent 12 }} + {{- end }} + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + {{- if $gateway.podSecurityContext }} + securityContext: + {{- toYaml $gateway.podSecurityContext | nindent 8 }} + {{- end }} + terminationGracePeriodSeconds: {{ $gateway.terminationGracePeriodSeconds }} + volumes: + - name: {{ $gateway.name }}-config + configMap: + defaultMode: 420 + name: {{ $gateway.name }}-config + {{- if $gateway.volumes }} + {{- toYaml $gateway.volumes | nindent 8 }} + {{- end }} + {{- if $gateway.nodeName }} + nodeName: {{ $gateway.nodeName }} + {{- end }} + {{- if $gateway.nodeSelector }} + nodeSelector: + {{- toYaml $gateway.nodeSelector | nindent 8 }} + {{- end }} + {{- if $gateway.tolerations }} + tolerations: + {{- toYaml $gateway.tolerations | nindent 8 }} + {{- end }} + {{- if $gateway.podPriority }} + {{- if $gateway.podPriority.enabled }} + priorityClassName: {{ .Release.Namespace }}-{{ $gateway.name }}-priority + {{- end }} + {{- end }} +status: +{{- end }} diff --git a/charts/vald/templates/gateway/mirror/hpa.yaml b/charts/vald/templates/gateway/mirror/hpa.yaml new file mode 100644 index 0000000000..c4227170fa --- /dev/null +++ b/charts/vald/templates/gateway/mirror/hpa.yaml @@ -0,0 +1,38 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled $gateway.hpa.enabled }} +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ $gateway.name }} + labels: + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror +spec: + maxReplicas: {{ $gateway.maxReplicas }} + minReplicas: {{ $gateway.minReplicas }} + scaleTargetRef: + apiVersion: apps/v1 + kind: {{ $gateway.kind }} + name: {{ $gateway.name }} + targetCPUUtilizationPercentage: {{ $gateway.hpa.targetCPUUtilizationPercentage }} +status: +{{- end }} diff --git a/charts/vald/templates/gateway/mirror/ing.yaml b/charts/vald/templates/gateway/mirror/ing.yaml new file mode 100644 index 0000000000..05022fd515 --- /dev/null +++ b/charts/vald/templates/gateway/mirror/ing.yaml @@ -0,0 +1,47 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled $gateway.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + {{- toYaml $gateway.ingress.annotations | nindent 4 }} + labels: + name: {{ $gateway.name }}-ingress + app: {{ $gateway.name }}-ingress + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror + name: {{ $gateway.name }}-ingress +spec: + defaultBackend: + service: + name: {{ $gateway.name }} + {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 6 }} + rules: + - host: {{ $gateway.ingress.host }} + http: + paths: + - backend: + service: + name: {{ $gateway.name }} + {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} + pathType: {{ $gateway.ingress.pathType }} +{{- end }} diff --git a/charts/vald/templates/gateway/mirror/pdb.yaml b/charts/vald/templates/gateway/mirror/pdb.yaml new file mode 100644 index 0000000000..d516368ae5 --- /dev/null +++ b/charts/vald/templates/gateway/mirror/pdb.yaml @@ -0,0 +1,34 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if $gateway.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ $gateway.name }} + labels: + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror +spec: + maxUnavailable: {{ $gateway.maxUnavailable }} + selector: + matchLabels: + app: {{ $gateway.name }} +{{- end }} diff --git a/charts/vald/templates/gateway/mirror/priorityclass.yaml b/charts/vald/templates/gateway/mirror/priorityclass.yaml new file mode 100644 index 0000000000..cb9b3bfa7e --- /dev/null +++ b/charts/vald/templates/gateway/mirror/priorityclass.yaml @@ -0,0 +1,32 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled $gateway.podPriority.enabled }} +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +metadata: + name: {{ .Release.Namespace }}-{{ $gateway.name }}-priority + labels: + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror +value: {{ $gateway.podPriority.value }} +globalDefault: false +description: "A priority class for Vald mirror gateway." +{{- end }} diff --git a/charts/vald/templates/gateway/mirror/svc.yaml b/charts/vald/templates/gateway/mirror/svc.yaml new file mode 100644 index 0000000000..68191b2c62 --- /dev/null +++ b/charts/vald/templates/gateway/mirror/svc.yaml @@ -0,0 +1,52 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if $gateway.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ $gateway.name }} + {{- if $gateway.service.annotations }} + annotations: + {{- toYaml $gateway.service.annotations | nindent 4 }} + {{- end }} + labels: + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror + {{- if $gateway.service.labels }} + {{- toYaml $gateway.service.labels | nindent 4 }} + {{- end }} +spec: + {{- $servers := dict "Values" $gateway.server_config "default" .Values.defaults.server_config }} + {{- include "vald.servicePorts" $servers | nindent 2 }} + selector: + app.kubernetes.io/name: {{ include "vald.name" . }} + app.kubernetes.io/component: gateway-mirror + {{- if eq $gateway.serviceType "ClusterIP" }} + clusterIP: None + {{- end }} + type: {{ $gateway.serviceType }} + {{- if $gateway.externalTrafficPolicy }} + externalTrafficPolicy: {{ $gateway.externalTrafficPolicy }} + {{- end }} + {{- if $gateway.internalTrafficPolicy }} + internalTrafficPolicy: {{ $gateway.internalTrafficPolicy }} + {{- end }} +{{- end }} diff --git a/charts/vald/values.yaml b/charts/vald/values.yaml index b177e5a4e1..acdeea21ce 100644 --- a/charts/vald/values.yaml +++ b/charts/vald/values.yaml @@ -1412,6 +1412,266 @@ gateway: # @schema {"name": "gateway.filter.gateway_config.egress_filter.distance_filters", "type": "array", "items": {"type": "string"}} # gateway.filter.gateway_config.egress_filter.distance_filters -- distance egress vector filter targets distance_filters: [] + # @schema {"name": "gateway.mirror", "type": "object"} + mirror: + # @schema {"name": "gateway.mirror.enabled", "type": "boolean"} + # gateway.mirror.enabled -- gateway enabled + enabled: false + # @schema {"name": "gateway.mirror.version", "type": "string", "pattern": "^v[0-9]+\\.[0-9]+\\.[0-9]$", "anchor": "version"} + # gateway.mirror.version -- version of gateway config + version: v0.0.0 + # @schema {"name": "gateway.mirror.time_zone", "type": "string"} + # gateway.mirror.time_zone -- Time zone + time_zone: "" + # @schema {"name": "gateway.mirror.logging", "alias": "logging"} + # gateway.mirror.logging -- logging config (overrides defaults.logging) + logging: {} + # @schema {"name": "gateway.mirror.name", "type": "string"} + # gateway.mirror.name -- name of gateway deployment + name: vald-mirror-gateway + # @schema {"name": "gateway.mirror.kind", "type": "string", "enum": ["Deployment", "DaemonSet"]} + # gateway.mirror.kind -- deployment kind: Deployment or DaemonSet + kind: Deployment + # @schema {"name": "gateway.mirror.serviceType", "type": "string", "enum": ["ClusterIP", "LoadBalancer", "NodePort"]} + # gateway.mirror.serviceType -- service type: ClusterIP, LoadBalancer or NodePort + serviceType: ClusterIP + # @schema {"name": "gateway.mirror.externalTrafficPolicy", "type": "string"} + # gateway.mirror.externalTrafficPolicy -- external traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local + externalTrafficPolicy: "" + # @schema {"name": "gateway.mirror.internalTrafficPolicy", "type": "string"} + # gateway.mirror.internalTrafficPolicy -- internal traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local + internalTrafficPolicy: "" + # @schema {"name": "gateway.mirror.progressDeadlineSeconds", "type": "integer"} + # gateway.mirror.progressDeadlineSeconds -- progress deadline seconds + progressDeadlineSeconds: 600 + # @schema {"name": "gateway.mirror.minReplicas", "type": "integer", "minimum": 0} + # gateway.mirror.minReplicas -- minimum number of replicas. + # if HPA is disabled, the replicas will be set to this value + minReplicas: 3 + # @schema {"name": "gateway.mirror.maxReplicas", "type": "integer", "minimum": 0} + # gateway.mirror.maxReplicas -- maximum number of replicas. + # if HPA is disabled, this value will be ignored. + maxReplicas: 9 + # @schema {"name": "gateway.mirror.maxUnavailable", "type": "string"} + # gateway.mirror.maxUnavailable -- maximum number of unavailable replicas + maxUnavailable: 50% + # @schema {"name": "gateway.mirror.revisionHistoryLimit", "type": "integer", "minimum": 0} + # gateway.mirror.revisionHistoryLimit -- number of old history to retain to allow rollback + revisionHistoryLimit: 2 + # @schema {"name": "gateway.mirror.terminationGracePeriodSeconds", "type": "integer", "minimum": 0} + # gateway.mirror.terminationGracePeriodSeconds -- duration in seconds pod needs to terminate gracefully + terminationGracePeriodSeconds: 30 + # @schema {"name": "gateway.mirror.podSecurityContext", "type": "object"} + # gateway.mirror.podSecurityContext -- security context for pod + podSecurityContext: + runAsUser: 65532 + runAsNonRoot: true + runAsGroup: 65532 + fsGroup: 65532 + fsGroupChangePolicy: "OnRootMismatch" + # @schema {"name": "gateway.mirror.securityContext", "type": "object"} + # gateway.mirror.securityContext -- security context for container + securityContext: + runAsUser: 65532 + runAsNonRoot: true + runAsGroup: 65532 + privileged: false + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: + - ALL + # @schema {"name": "gateway.mirror.podPriority", "type": "object", "anchor": "podPriority"} + podPriority: + # @schema {"name": "gateway.mirror.podPriority.enabled", "type": "boolean"} + # gateway.mirror.podPriority.enabled -- gateway pod PriorityClass enabled + enabled: true + # @schema {"name": "gateway.mirror.podPriority.value", "type": "integer"} + # gateway.mirror.podPriority.value -- gateway pod PriorityClass value + value: 1000000 + # @schema {"name": "gateway.mirror.annotations", "type": "object"} + # gateway.mirror.annotations -- deployment annotations + annotations: {} + # @schema {"name": "gateway.mirror.podAnnotations", "type": "object"} + # gateway.mirror.podAnnotations -- pod annotations + podAnnotations: {} + # @schema {"name": "gateway.mirror.service", "type": "object", "anchor": "service"} + service: + # @schema {"name": "gateway.mirror.service.annotations", "type": "object"} + # gateway.mirror.service.annotations -- service annotations + annotations: {} + # @schema {"name": "gateway.mirror.service.labels", "type": "object"} + # gateway.mirror.service.labels -- service labels + labels: {} + # @schema {"name": "gateway.mirror.hpa", "type": "object", "anchor": "hpa"} + hpa: + # @schema {"name": "gateway.mirror.hpa.enabled", "type": "boolean"} + # gateway.mirror.hpa.enabled -- HPA enabled + enabled: true + # @schema {"name": "gateway.mirror.hpa.targetCPUUtilizationPercentage", "type": "integer"} + # gateway.mirror.hpa.targetCPUUtilizationPercentage -- HPA CPU utilization percentage + targetCPUUtilizationPercentage: 80 + # @schema {"name": "gateway.mirror.image", "type": "object", "anchor": "image"} + image: + # @schema {"name": "gateway.mirror.image.repository", "type": "string"} + # gateway.mirror.image.repository -- image repository + repository: vdaas/vald-mirror-gateway + # @schema {"name": "gateway.mirror.image.tag", "type": "string"} + # gateway.mirror.image.tag -- image tag (overrides defaults.image.tag) + tag: "" + # @schema {"name": "gateway.mirror.image.pullPolicy", "type": "string", "enum": ["Always", "Never", "IfNotPresent"]} + # gateway.mirror.image.pullPolicy -- image pull policy + pullPolicy: Always + # @schema {"name": "gateway.mirror.rollingUpdate", "type": "object", "anchor": "rollingUpdate"} + rollingUpdate: + # @schema {"name": "gateway.mirror.rollingUpdate.maxSurge", "type": "string"} + # gateway.mirror.rollingUpdate.maxSurge -- max surge of rolling update + maxSurge: 25% + # @schema {"name": "gateway.mirror.rollingUpdate.maxUnavailable", "type": "string"} + # gateway.mirror.rollingUpdate.maxUnavailable -- max unavailable of rolling update + maxUnavailable: 25% + # @schema {"name": "gateway.mirror.initContainers", "type": "array", "items": {"type": "object"}, "anchor": "initContainers"} + # gateway.mirror.initContainers -- init containers + initContainers: + - type: wait-for + name: wait-for-gateway-lb + target: gateway-lb + image: busybox:stable + sleepDuration: 2 + # @schema {"name": "gateway.mirror.env", "type": "array", "items": {"type": "object"}, "anchor": "env"} + # gateway.mirror.env -- environment variables + env: + - name: MY_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: MY_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: MY_POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + # @schema {"name": "gateway.mirror.volumeMounts", "type": "array", "items": {"type": "object"}, "anchor": "volumeMounts"} + # gateway.mirror.volumeMounts -- volume mounts + volumeMounts: [] + # @schema {"name": "gateway.mirror.volumes", "type": "array", "items": {"type": "object"}, "anchor": "volumes"} + # gateway.mirror.volumes -- volumes + volumes: [] + # @schema {"name": "gateway.mirror.nodeName", "type": "string"} + # gateway.mirror.nodeName -- node name + nodeName: "" + # @schema {"name": "gateway.mirror.nodeSelector", "type": "object", "anchor": "nodeSelector"} + # gateway.mirror.nodeSelector -- node selector + nodeSelector: {} + # @schema {"name": "gateway.mirror.tolerations", "type": "array", "items": {"type": "object"}, "anchor": "tolerations"} + # gateway.mirror.tolerations -- tolerations + tolerations: [] + # @schema {"name": "gateway.mirror.affinity", "type": "object", "anchor": "affinity"} + affinity: + # @schema {"name": "gateway.mirror.affinity.nodeAffinity", "type": "object"} + nodeAffinity: + # @schema {"name": "gateway.mirror.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution", "type": "array", "items": {"type": "object"}} + # gateway.mirror.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution -- node affinity preferred scheduling terms + preferredDuringSchedulingIgnoredDuringExecution: [] + # @schema {"name": "gateway.mirror.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution", "type": "object"} + requiredDuringSchedulingIgnoredDuringExecution: + # @schema {"name": "gateway.mirror.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms", "type": "array", "items": {"type": "object"}} + # gateway.mirror.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms -- node affinity required node selectors + nodeSelectorTerms: [] + # @schema {"name": "gateway.mirror.affinity.podAffinity", "type": "object"} + podAffinity: + # @schema {"name": "gateway.mirror.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution", "type": "array", "items": {"type": "object"}} + # gateway.mirror.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution -- pod affinity preferred scheduling terms + preferredDuringSchedulingIgnoredDuringExecution: [] + # @schema {"name": "gateway.mirror.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution", "type": "array", "items": {"type": "object"}} + # gateway.mirror.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod affinity required scheduling terms + requiredDuringSchedulingIgnoredDuringExecution: [] + # @schema {"name": "gateway.mirror.affinity.podAntiAffinity", "type": "object"} + podAntiAffinity: + # @schema {"name": "gateway.mirror.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution", "type": "array", "items": {"type": "object"}} + # gateway.mirror.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity preferred scheduling terms + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + topologyKey: kubernetes.io/hostname + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - vald-mirror-gateway + # @schema {"name": "gateway.mirror.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution", "type": "array", "items": {"type": "object"}} + # gateway.mirror.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms + requiredDuringSchedulingIgnoredDuringExecution: [] + # @schema {"name": "gateway.mirror.topologySpreadConstraints", "type": "array", "items": {"type": "object"}, "anchor": "topologySpreadConstraints"} + # gateway.mirror.topologySpreadConstraints -- topology spread constraints of gateway pods + topologySpreadConstraints: [] + # @schema {"name": "gateway.mirror.server_config", "alias": "server_config"} + # gateway.mirror.server_config -- server config (overrides defaults.server_config) + server_config: + servers: + rest: {} + grpc: {} + healths: + liveness: {} + readiness: {} + startup: {} + metrics: + pprof: {} + # @schema {"name": "gateway.mirror.observability", "alias": "observability"} + # gateway.mirror.observability -- observability config (overrides defaults.observability) + observability: + otlp: + attribute: + service_name: vald-mirror-gateway + # @schema {"name": "gateway.mirror.ingress", "type": "object"} + ingress: + # @schema {"name": "gateway.mirror.ingress.pathType", "type": "string"} + # gateway.mirror.ingress.pathType -- gateway ingress pathType + pathType: ImplementationSpecific + # @schema {"name": "gateway.mirror.ingress.enabled", "type": "boolean"} + # gateway.mirror.ingress.enabled -- gateway ingress enabled + enabled: false + # @schema {"name": "gateway.mirror.ingress.annotations", "type": "object"} + # gateway.mirror.ingress.annotations -- annotations for ingress + annotations: + nginx.ingress.kubernetes.io/grpc-backend: "true" + # @schema {"name": "gateway.mirror.ingress.host", "type": "string"} + # gateway.mirror.ingress.host -- ingress hostname + host: mirror.gateway.vald.vdaas.org + # @schema {"name": "gateway.mirror.ingress.servicePort", "type": "string"} + # gateway.mirror.ingress.servicePort -- service port to be exposed by ingress + servicePort: grpc + # @schema {"name": "gateway.mirror.resources", "type": "object", "anchor": "resources"} + # gateway.mirror.resources -- compute resources + resources: + # @schema {"name": "gateway.mirror.resources.requests", "type": "object"} + requests: + cpu: 200m + memory: 150Mi + # @schema {"name": "gateway.mirror.resources.limits", "type": "object"} + limits: + cpu: 2000m + memory: 700Mi + # @schema {"name": "gateway.mirror.gateway_config", "type": "object"} + gateway_config: + # @schema {"name": "gateway.mirror.gateway_config.client", "alias": "grpc.client"} + # gateway.mirror.gateway_config.client -- gRPC client (overrides defaults.grpc.client) + client: {} + # @schema {"name": "gateway.mirror.gateway_config.self_mirror_addr", "type": "string"} + # gateway.mirror.gateway_config.self_mirror_addr -- address for self mirror-gateway + self_mirror_addr: "" + # @schema {"name": "gateway.mirror.gateway_config.gateway_addr", "type": "string"} + # gateway.mirror.gateway_config.gateway_addr -- address for lb-gateway + gateway_addr: "" + # @schema {"name": "gateway.mirror.gateway_config.pod_name", "type": "string"} + # gateway.mirror.gateway_config.pod_name -- self mirror gateway pod name + pod_name: _MY_POD_NAME_ + # @schema {"name": "gateway.mirror.gateway_config.advertise_interval", "type": "string"} + # gateway.mirror.gateway_config.advertise_interval -- interval to advertise mirror-gateway information to other mirror-gateway. + advertise_interval: "1s" # @schema {"name": "agent", "type": "object"} agent: # @schema {"name": "agent.enabled", "type": "boolean"} diff --git a/charts/vald/values/multi-vald/dev-vald-01.yaml b/charts/vald/values/multi-vald/dev-vald-01.yaml new file mode 100644 index 0000000000..0849bb2433 --- /dev/null +++ b/charts/vald/values/multi-vald/dev-vald-01.yaml @@ -0,0 +1,5 @@ +discoverer: + clusterRoleBinding: + name: vald-01 + serviceAccount: + name: vald-01 diff --git a/charts/vald/values/multi-vald/dev-vald-02.yaml b/charts/vald/values/multi-vald/dev-vald-02.yaml new file mode 100644 index 0000000000..7e60a18b34 --- /dev/null +++ b/charts/vald/values/multi-vald/dev-vald-02.yaml @@ -0,0 +1,7 @@ +discoverer: + clusterRole: + enabled: false + clusterRoleBinding: + name: vald-02 + serviceAccount: + name: vald-02 diff --git a/charts/vald/values/multi-vald/dev-vald-03.yaml b/charts/vald/values/multi-vald/dev-vald-03.yaml new file mode 100644 index 0000000000..27a37502bb --- /dev/null +++ b/charts/vald/values/multi-vald/dev-vald-03.yaml @@ -0,0 +1,15 @@ +gateway: + mirror: + gateway_config: + client: + addrs: + - vald-mirror-gateway.vald-01.svc.cluster.local:8081 + - vald-mirror-gateway.vald-02.svc.cluster.local:8081 + +discoverer: + clusterRole: + enabled: false + clusterRoleBinding: + name: vald-03 + serviceAccount: + name: vald-03 diff --git a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml new file mode 100644 index 0000000000..7c243cffde --- /dev/null +++ b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml @@ -0,0 +1,88 @@ +defaults: + image: + tag: pr-1949 # TODO: Delete it later. + server_config: + metrics: + pprof: + enabled: true + servers: + grpc: + server: + grpc: + interceptors: + - RecoverInterceptor + - TraceInterceptor + - AccessLogInterceptor + - MetricInterceptor + grpc: + client: + dial_option: + interceptors: + - TraceInterceptor + observability: + enabled: true + otlp: + collector_endpoint: "opentelemetry-collector-collector.default.svc.cluster.local:4317" + trace: + enabled: true + +gateway: + lb: + podAnnotations: + profefe.com/enable: "true" + profefe.com/port: "6060" + profefe.com/service: "vald-lb-gateway" + resources: + requests: + cpu: 100m + memory: 50Mi + gateway_config: + index_replica: 2 + + # NOTE: Will work with multiple replicas in the future. + mirror: + enabled: true + minReplicas: 1 + maxReplicas: 1 + ingress: + enabled: false + gateway_config: + lb_client: {} + mirror_client: {} + self_mirror_client: {} + +agent: + podAnnotations: + profefe.com/enable: "true" + profefe.com/port: "6060" + profefe.com/service: "vald-agent-ngt" + minReplicas: 5 + maxReplicas: 10 + podManagementPolicy: Parallel + resources: + requests: + cpu: 100m + memory: 50Mi + ngt: + dimension: 784 + +discoverer: + podAnnotations: + profefe.com/enable: "true" + profefe.com/port: "6060" + profefe.com/service: "vald-discoverer" + resources: + requests: + cpu: 100m + memory: 50Mi + +manager: + index: + podAnnotations: + profefe.com/enable: "true" + profefe.com/port: "6060" + profefe.com/service: "vald-manager-index" + resources: + requests: + cpu: 100m + memory: 30Mi diff --git a/cmd/gateway/mirror/main.go b/cmd/gateway/mirror/main.go new file mode 100644 index 0000000000..9f595fdc81 --- /dev/null +++ b/cmd/gateway/mirror/main.go @@ -0,0 +1,58 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package main provides program main +package main + +import ( + "context" + + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/info" + "github.com/vdaas/vald/internal/log" + "github.com/vdaas/vald/internal/runner" + "github.com/vdaas/vald/internal/safety" + "github.com/vdaas/vald/pkg/gateway/mirror/config" + "github.com/vdaas/vald/pkg/gateway/mirror/usecase" +) + +const ( + maxVersion = "v0.0.10" + minVersion = "v0.0.0" + name = "gateway mirror" +) + +func main() { + if err := safety.RecoverFunc(func() error { + return runner.Do( + context.Background(), + runner.WithName(name), + runner.WithVersion(info.Version, maxVersion, minVersion), + runner.WithConfigLoader(func(path string) (interface{}, *config.GlobalConfig, error) { + cfg, err := config.NewConfig(path) + if err != nil { + return nil, nil, errors.Wrap(err, "failed to load "+name+"'s configuration") + } + return cfg, &cfg.GlobalConfig, nil + }), + runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { + return usecase.New(cfg.(*config.Data)) + }), + ) + })(); err != nil { + log.Fatal(err, info.Get()) + } +} diff --git a/cmd/gateway/mirror/sample.yaml b/cmd/gateway/mirror/sample.yaml new file mode 100644 index 0000000000..ffcd6c861d --- /dev/null +++ b/cmd/gateway/mirror/sample.yaml @@ -0,0 +1,148 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +version: v0.0.0 +time_zone: JST +logging: + format: raw + level: debug + logger: glg +server_config: + servers: + - name: grpc + host: 0.0.0.0 + port: 8081 + grpc: + bidirectional_stream_concurrency: 20 + connection_timeout: "" + header_table_size: 0 + initial_conn_window_size: 0 + initial_window_size: 0 + interceptors: [] + keepalive: + max_conn_age: "" + max_conn_age_grace: "" + max_conn_idle: "" + time: "" + timeout: "" + max_header_list_size: 0 + max_receive_message_size: 0 + max_send_message_size: 0 + read_buffer_size: 0 + write_buffer_size: 0 + mode: GRPC + probe_wait_time: 3s + restart: true + health_check_servers: + - name: liveness + host: 0.0.0.0 + port: 3000 + http: + handler_timeout: "" + idle_timeout: "" + read_header_timeout: "" + read_timeout: "" + shutdown_duration: 5s + write_timeout: "" + mode: "" + probe_wait_time: 3s + - name: readiness + host: 0.0.0.0 + port: 3001 + http: + handler_timeout: "" + idle_timeout: "" + read_header_timeout: "" + read_timeout: "" + shutdown_duration: 0s + write_timeout: "" + mode: "" + probe_wait_time: 3s + metrics_servers: + startup_strategy: + - liveness + - grpc + - readiness + full_shutdown_duration: 600s + tls: + ca: /path/to/ca + cert: /path/to/cert + enabled: false + key: /path/to/key +observability: + enabled: false + trace: + enabled: false +gateway: + client: + addrs: + - vald-discoverer.default.svc.cluster.local:8081 + health_check_duration: "1s" + connection_pool: + enable_dns_resolver: true + enable_rebalance: true + old_conn_close_duration: 3s + rebalance_duration: 30m + size: 3 + backoff: + backoff_factor: 1.1 + backoff_time_limit: 5s + enable_error_log: true + initial_duration: 5ms + jitter_limit: 100ms + maximum_duration: 5s + retry_count: 100 + call_option: + max_recv_msg_size: 0 + max_retry_rpc_buffer_size: 0 + max_send_msg_size: 0 + wait_for_ready: true + dial_option: + backoff_base_delay: 1s + backoff_jitter: 0.2 + backoff_max_delay: 120s + backoff_multiplier: 1.6 + enable_backoff: false + initial_connection_window_size: 0 + initial_window_size: 0 + insecure: true + keepalive: + permit_without_stream: false + time: "" + timeout: "" + max_msg_size: 0 + min_connection_timeout: 20s + read_buffer_size: 0 + tcp: + dialer: + dual_stack_enabled: true + keepalive: "" + timeout: "" + dns: + cache_enabled: true + cache_expiration: 1h + refresh_duration: 30m + tls: + enabled: false + ca: /path/to/ca + cert: /path/to/cert + key: /path/to/key + timeout: "" + write_buffer_size: 0 + tls: + enabled: false + ca: /path/to/ca + cert: /path/to/cert + key: /path/to/key diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile new file mode 100644 index 0000000000..e21ac01dbf --- /dev/null +++ b/dockers/gateway/mirror/Dockerfile @@ -0,0 +1,81 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +ARG GO_VERSION=latest +ARG DISTROLESS_IMAGE=gcr.io/distroless/static +ARG DISTROLESS_IMAGE_TAG=nonroot +ARG MAINTAINER="vdaas.org vald team " + +FROM golang:${GO_VERSION} AS builder + +ENV GO111MODULE on +ENV LANG en_US.UTF-8 +ENV ORG vdaas +ENV REPO vald +ENV PKG gateway/mirror +ENV APP_NAME mirror + +# skipcq: DOK-DL3008 +RUN apt-get update && apt-get install -y --no-install-recommends \ + upx \ + git \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN mkdir -p "$GOPATH/src" + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} + +COPY go.mod . +COPY go.sum . + +RUN go mod download + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal +COPY internal . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/apis/grpc +COPY apis/grpc . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/pkg/${PKG} +COPY pkg/${PKG} . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} +COPY cmd/${PKG} . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions +COPY versions . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d +COPY Makefile.d . + +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} +COPY Makefile . +COPY .git . + +RUN make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" + +FROM ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +LABEL maintainer "${MAINTAINER}" + +ENV APP_NAME mirror + +COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME} + +USER nonroot:nonroot + +ENTRYPOINT ["/go/bin/mirror"] diff --git a/internal/circuitbreaker/manager.go b/internal/circuitbreaker/manager.go index 0b7c0c60e5..4aa155580e 100644 --- a/internal/circuitbreaker/manager.go +++ b/internal/circuitbreaker/manager.go @@ -86,7 +86,8 @@ func (bm *breakerManager) Do(ctx context.Context, key string, fn func(ctx contex if err != nil { switch st { case StateClosed: - err = errors.Wrapf(err, "circuitbreaker state is %s, this error is not caused by circuitbreaker", st.String()) + cerr := errors.Wrapf(err, "circuitbreaker state is %s, this error is not caused by circuitbreaker", st.String()) + log.Debug(cerr) case StateOpen: if !errors.Is(err, errors.ErrCircuitBreakerOpenState) { err = errors.Join(err, errors.ErrCircuitBreakerOpenState) diff --git a/internal/client/v1/client/mirror/mirror.go b/internal/client/v1/client/mirror/mirror.go new file mode 100644 index 0000000000..30c6b25425 --- /dev/null +++ b/internal/client/v1/client/mirror/mirror.go @@ -0,0 +1,98 @@ +package mirror + +import ( + "context" + + "github.com/vdaas/vald/apis/grpc/v1/mirror" + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/apis/grpc/v1/vald" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/net/grpc" + "github.com/vdaas/vald/internal/observability/trace" +) + +const ( + apiName = "vald/internal/client/v1/client/mirror" +) + +type Client interface { + mirror.MirrorClient + GRPCClient() grpc.Client + Start(context.Context) (<-chan error, error) + Stop(context.Context) error +} + +type client struct { + addrs []string + c grpc.Client +} + +func New(opts ...Option) (Client, error) { + c := new(client) + for _, opt := range append(defaultOpts, opts...) { + if err := opt(c); err != nil { + return nil, err + } + } + if c.c == nil { + if len(c.addrs) == 0 { + return nil, errors.ErrGRPCTargetAddrNotFound + } + c.c = grpc.New(grpc.WithAddrs(c.addrs...)) + } + return c, nil +} + +func (c *client) Start(ctx context.Context) (<-chan error, error) { + return c.c.StartConnectionMonitor(ctx) +} + +func (c *client) Stop(ctx context.Context) error { + return c.Stop(ctx) +} + +func (c *client) GRPCClient() grpc.Client { + return c.c +} + +func (c *client) Register(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (res *payload.Mirror_Targets, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.RegisterRPCName), apiName+"/"+vald.RegisterRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = c.c.RoundRobin(ctx, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) { + res, err = mirror.NewMirrorClient(conn).Register(ctx, in, append(copts, opts...)...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + return nil, err + } + return res, nil +} + +func (c *client) Advertise(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (res *payload.Mirror_Targets, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.AdvertiseRPCName), apiName+"/"+vald.AdvertiseRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = c.c.RoundRobin(ctx, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) { + res, err = mirror.NewMirrorClient(conn).Advertise(ctx, in, append(copts, opts...)...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + return nil, err + } + return res, nil +} diff --git a/internal/client/v1/client/mirror/option.go b/internal/client/v1/client/mirror/option.go new file mode 100644 index 0000000000..894e76216b --- /dev/null +++ b/internal/client/v1/client/mirror/option.go @@ -0,0 +1,32 @@ +package mirror + +import ( + "github.com/vdaas/vald/internal/net/grpc" +) + +type Option func(c *client) error + +var defaultOpts = []Option{} + +func WithAddrs(addrs ...string) Option { + return func(c *client) error { + if addrs == nil { + return nil + } + if c.addrs != nil { + c.addrs = append(c.addrs, addrs...) + } else { + c.addrs = addrs + } + return nil + } +} + +func WithClient(gc grpc.Client) Option { + return func(c *client) error { + if gc != nil { + c.c = gc + } + return nil + } +} diff --git a/internal/config/mirror.go b/internal/config/mirror.go new file mode 100644 index 0000000000..43db1ab4ab --- /dev/null +++ b/internal/config/mirror.go @@ -0,0 +1,46 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package config providers configuration type and load configuration logic +package config + +// Mirror represents the Mirror Gateway configuration. +type Mirror struct { + // Client represents the gRPC client configuration for connecting the LB Gateway. + Client *GRPCClient `json:"client" yaml:"client"` + // SelfMirrorAddr represents the address for the self Mirror Gateway. + SelfMirrorAddr string `json:"self_mirror_addr" yaml:"self_mirror_addr"` + // GatewayAddr represents the address for the Vald Gateway (e.g lb-gateway). + GatewayAddr string `json:"gateway_addr" yaml:"gateway_addr"` + // PodName represents self Mirror Gateway Pod name. + PodName string `json:"pod_name" yaml:"pod_name"` + // AdvertiseInterval represents interval to advertise Mirror Gateway information to other mirror gateway. + AdvertiseInterval string `json:"advertise_interval" yaml:"advertise_interval"` +} + +// Bind binds the actual data from the Mirror receiver fields. +func (m *Mirror) Bind() *Mirror { + m.SelfMirrorAddr = GetActualValue(m.SelfMirrorAddr) + m.GatewayAddr = GetActualValue(m.GatewayAddr) + m.PodName = GetActualValue(m.PodName) + m.AdvertiseInterval = GetActualValue(m.AdvertiseInterval) + if m.Client != nil { + m.Client = m.Client.Bind() + } else { + m.Client = new(GRPCClient).Bind() + } + return m +} diff --git a/internal/net/grpc/interceptor/server/metric/metric.go b/internal/net/grpc/interceptor/server/metric/metric.go index a2db800c3b..14b5d77322 100644 --- a/internal/net/grpc/interceptor/server/metric/metric.go +++ b/internal/net/grpc/interceptor/server/metric/metric.go @@ -65,7 +65,7 @@ func MetricInterceptors() (grpc.UnaryServerInterceptor, grpc.StreamServerInterce elapsedTime := time.Since(now) record(ctx, info.FullMethod, err, float64(elapsedTime)/float64(time.Millisecond)) return resp, err - }, func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + }, func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) { now := time.Now() err = handler(srv, ss) elapsedTime := time.Since(now) diff --git a/internal/net/grpc/metadata.go b/internal/net/grpc/metadata.go new file mode 100644 index 0000000000..afc51d6e96 --- /dev/null +++ b/internal/net/grpc/metadata.go @@ -0,0 +1,34 @@ +// +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package grpc provides generic functionality for grpc +package grpc + +import ( + "context" + + "google.golang.org/grpc/metadata" +) + +type MD = metadata.MD + +func NewOutgoingContext(ctx context.Context, md MD) context.Context { + return metadata.NewOutgoingContext(ctx, md) +} + +func FromIncomingContext(ctx context.Context) (metadata.MD, bool) { + return metadata.FromIncomingContext(ctx) +} diff --git a/pkg/gateway/mirror/README.md b/pkg/gateway/mirror/README.md new file mode 100755 index 0000000000..668dce401c --- /dev/null +++ b/pkg/gateway/mirror/README.md @@ -0,0 +1 @@ +# vald Mirror gateway diff --git a/pkg/gateway/mirror/config/config.go b/pkg/gateway/mirror/config/config.go new file mode 100644 index 0000000000..fec0bf3618 --- /dev/null +++ b/pkg/gateway/mirror/config/config.go @@ -0,0 +1,156 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package setting stores all server application settings +package config + +import ( + "github.com/vdaas/vald/internal/config" + "github.com/vdaas/vald/internal/errors" +) + +type ( + GlobalConfig = config.GlobalConfig + Server = config.Server +) + +// Config represent a application setting data content (config.yaml). +// In K8s environment, this configuration is stored in K8s ConfigMap. +type Data struct { + config.GlobalConfig `json:",inline" yaml:",inline"` + + // Server represent all server configurations + Server *config.Servers `json:"server_config" yaml:"server_config"` + + // Observability represent observability configurations + Observability *config.Observability `json:"observability" yaml:"observability"` + + // Mirror represent mirror gateway service configuration + Mirror *config.Mirror `json:"gateway" yaml:"gateway"` +} + +func NewConfig(path string) (cfg *Data, err error) { + cfg = new(Data) + + if err = config.Read(path, &cfg); err != nil { + return nil, err + } + + if cfg != nil { + cfg.Bind() + } else { + return nil, errors.ErrInvalidConfig + } + + if cfg.Server != nil { + cfg.Server = cfg.Server.Bind() + } else { + return nil, errors.ErrInvalidConfig + } + + if cfg.Observability != nil { + cfg.Observability = cfg.Observability.Bind() + } else { + cfg.Observability = new(config.Observability).Bind() + } + + if cfg.Mirror != nil { + cfg.Mirror = cfg.Mirror.Bind() + } else { + return nil, errors.ErrInvalidConfig + } + return cfg, nil +} + +// func FakeData() { +// d := Data{ +// Version: "v0.0.1", +// Server: &config.Servers{ +// Servers: []*config.Server{ +// { +// Name: "agent-rest", +// Host: "127.0.0.1", +// Port: 8080, +// Mode: "REST", +// ProbeWaitTime: "3s", +// ShutdownDuration: "5s", +// HandlerTimeout: "5s", +// IdleTimeout: "2s", +// ReadHeaderTimeout: "1s", +// ReadTimeout: "1s", +// WriteTimeout: "1s", +// }, +// { +// Name: "agent-grpc", +// Host: "127.0.0.1", +// Port: 8082, +// Mode: "GRPC", +// }, +// }, +// MetricsServers: []*config.Server{ +// { +// Name: "pprof", +// Host: "127.0.0.1", +// Port: 6060, +// Mode: "REST", +// ProbeWaitTime: "3s", +// ShutdownDuration: "5s", +// HandlerTimeout: "5s", +// IdleTimeout: "2s", +// ReadHeaderTimeout: "1s", +// ReadTimeout: "1s", +// WriteTimeout: "1s", +// }, +// }, +// HealthCheckServers: []*config.Server{ +// { +// Name: "livenesss", +// Host: "127.0.0.1", +// Port: 3000, +// }, +// { +// Name: "readiness", +// Host: "127.0.0.1", +// Port: 3001, +// }, +// }, +// StartUpStrategy: []string{ +// "livenesss", +// "pprof", +// "agent-grpc", +// "agent-rest", +// "readiness", +// }, +// ShutdownStrategy: []string{ +// "readiness", +// "agent-rest", +// "agent-grpc", +// "pprof", +// "livenesss", +// }, +// FullShutdownDuration: "30s", +// TLS: &config.TLS{ +// Enabled: false, +// Cert: "/path/to/cert", +// Key: "/path/to/key", +// CA: "/path/to/ca", +// }, +// }, +// Mirror: &config.Mirror{ +// }, +// } +// fmt.Println(config.ToRawYaml(d)) +// } diff --git a/pkg/gateway/mirror/handler/doc.go b/pkg/gateway/mirror/handler/doc.go new file mode 100644 index 0000000000..f1014141ea --- /dev/null +++ b/pkg/gateway/mirror/handler/doc.go @@ -0,0 +1,17 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package handler diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go new file mode 100644 index 0000000000..7b65ce351c --- /dev/null +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -0,0 +1,3283 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package grpc provides grpc server logic +package grpc + +import ( + "context" + "fmt" + "reflect" + "sync" + + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/apis/grpc/v1/vald" + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/log" + "github.com/vdaas/vald/internal/net/grpc" + "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/trace" + "github.com/vdaas/vald/internal/safety" + "github.com/vdaas/vald/pkg/gateway/mirror/service" +) + +type server struct { + eg errgroup.Group + gateway service.Gateway // Mirror Gateway client service. + mirror service.Mirror + vAddr string // Vald Gateway address (lb-gateway). + streamConcurrency int + name string + ip string + vald.UnimplementedValdServerWithMirror +} + +const apiName = "vald/gateway/mirror" + +func New(opts ...Option) (vald.ServerWithMirror, error) { + s := new(server) + for _, opt := range append(defaultOptions, opts...) { + if err := opt(s); err != nil { + oerr := errors.ErrOptionFailed(err, reflect.ValueOf(opt)) + e := &errors.ErrCriticalOption{} + if errors.As(err, &e) { + log.Error(oerr) + return nil, oerr + } + log.Warn(oerr) + } + } + return s, nil +} + +func (s *server) Register(ctx context.Context, req *payload.Mirror_Targets) (*payload.Mirror_Targets, error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.MirrorRPCServiceName+"/"+vald.RegisterRPCName), apiName+"/"+vald.RegisterRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err := s.mirror.Connect(ctx, req.GetTargets()...) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RegisterRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.RegisterRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithCanceled( + vald.RegisterRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.RegisterRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInvalidArgument( + vald.RegisterRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.RegisterRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return req, nil +} + +func (s *server) Advertise(ctx context.Context, req *payload.Mirror_Targets) (res *payload.Mirror_Targets, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.MirrorRPCServiceName+"/"+vald.AdvertiseRPCName), apiName+"/"+vald.AdvertiseRPCName) + defer func() { + if span != nil { + span.End() + } + }() + _, err = s.Register(ctx, req) + if err != nil { + return nil, err + } + tgts, err := s.mirror.MirrorTargets() + if err != nil { + err = status.WrapWithInternal(vald.AdvertiseRPCName+" API failed to get connected vald gateway targets", err, + &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "mirror gateway targets", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.AdvertiseRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return &payload.Mirror_Targets{ + Targets: tgts, + }, nil +} + +func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *payload.Object_ID, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.ExistsRPCName), apiName+"/"+vald.ExistsRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + id, err = vc.Exists(ctx, meta, copts...) + if err != nil { + return nil, err + } + return id, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(meta), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.ExistsRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.ExistsRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.ExistsRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.ExistsRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.ExistsRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.ExistsRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return id, nil +} + +func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.SearchRPCName), apiName+"/"+vald.SearchRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + res, err = vc.Search(ctx, req, copts...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetConfig().GetRequestId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.SearchRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.SearchRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.SearchRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.SearchRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.SearchRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.SearchRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return res, nil +} + +func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) ( + res *payload.Search_Response, err error, +) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.SearchByIDRPCName), apiName+"/"+vald.SearchByIDRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + res, err = vc.SearchByID(ctx, req, copts...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetConfig().GetRequestId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.SearchByIDRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.SearchByIDRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.SearchByIDRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.SearchByIDRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.SearchByIDRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.SearchByIDRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return res, nil +} + +func (s *server) StreamSearch(stream vald.Search_StreamSearchServer) (err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamSearchRPCName), apiName+"/"+vald.StreamSearchRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err = grpc.BidirectionalStream(ctx, stream, s.streamConcurrency, + func(ctx context.Context, req *payload.Search_Request) (*payload.Search_StreamResponse, error) { + ctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BidirectionalStream"), apiName+"/"+vald.StreamSearchRPCName+"/requestID-"+req.GetConfig().GetRequestId()) + defer func() { + if sspan != nil { + sspan.End() + } + }() + res, err := s.Search(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.SearchRPCName+" gRPC error response") + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + return &payload.Search_StreamResponse{ + Payload: &payload.Search_StreamResponse_Status{ + Status: st.Proto(), + }, + }, err + } + return &payload.Search_StreamResponse{ + Payload: &payload.Search_StreamResponse_Response{ + Response: res, + }, + }, nil + }, + ) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.StreamSearchRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} + +func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamSearchByIDRPCName), apiName+"/"+vald.StreamSearchByIDRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err = grpc.BidirectionalStream(ctx, stream, s.streamConcurrency, + func(ctx context.Context, req *payload.Search_IDRequest) (*payload.Search_StreamResponse, error) { + ctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BidirectionalStream"), apiName+"."+vald.StreamSearchByIDRPCName+"/id-"+req.GetId()) + defer func() { + if sspan != nil { + sspan.End() + } + }() + res, err := s.SearchByID(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.SearchByIDRPCName+" gRPC error response") + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + return &payload.Search_StreamResponse{ + Payload: &payload.Search_StreamResponse_Status{ + Status: st.Proto(), + }, + }, err + } + return &payload.Search_StreamResponse{ + Payload: &payload.Search_StreamResponse_Response{ + Response: res, + }, + }, nil + }, + ) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.StreamSearchByIDRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} + +func (s *server) MultiSearch(ctx context.Context, req *payload.Search_MultiRequest) (res *payload.Search_Responses, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiSearchRPCName), apiName+"/"+vald.MultiSearchRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + res, err = vc.MultiSearch(ctx, req, copts...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiSearchRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.MultiSearchRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.MultiSearchRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.MultiSearchRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.MultiSearchRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.MultiSearchRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return res, nil +} + +func (s *server) MultiSearchByID(ctx context.Context, req *payload.Search_MultiIDRequest) (res *payload.Search_Responses, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiSearchByIDRPCName), apiName+"/"+vald.MultiSearchByIDRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + res, err = vc.MultiSearchByID(ctx, req, copts...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiSearchByIDRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.MultiSearchByIDRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.MultiSearchByIDRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.MultiSearchByIDRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.MultiSearchByIDRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.MultiSearchByIDRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return res, nil +} + +func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.LinearSearchRPCName), apiName+"/"+vald.LinearSearchRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + res, err = vc.LinearSearch(ctx, req, copts...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetConfig().GetRequestId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.LinearSearchRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.LinearSearchRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.LinearSearchRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.LinearSearchRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.LinearSearchRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.LinearSearchRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return res, nil +} + +func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDRequest) ( + res *payload.Search_Response, err error, +) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.LinearSearchByIDRPCName), apiName+"/"+vald.LinearSearchByIDRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + res, err = vc.LinearSearchByID(ctx, req, copts...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetConfig().GetRequestId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.LinearSearchByIDRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.LinearSearchByIDRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.LinearSearchByIDRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.LinearSearchByIDRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.LinearSearchByIDRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.LinearSearchByIDRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return res, nil +} + +func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer) (err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamLinearSearchRPCName), apiName+"/"+vald.StreamLinearSearchRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err = grpc.BidirectionalStream(ctx, stream, s.streamConcurrency, + func(ctx context.Context, req *payload.Search_Request) (*payload.Search_StreamResponse, error) { + ctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BidirectionalStream"), apiName+"/"+vald.StreamLinearSearchRPCName+"/requestID-"+req.GetConfig().GetRequestId()) + defer func() { + if sspan != nil { + sspan.End() + } + }() + res, err := s.LinearSearch(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.LinearSearchRPCName+" gRPC error response") + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + return &payload.Search_StreamResponse{ + Payload: &payload.Search_StreamResponse_Status{ + Status: st.Proto(), + }, + }, err + } + return &payload.Search_StreamResponse{ + Payload: &payload.Search_StreamResponse_Response{ + Response: res, + }, + }, nil + }, + ) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.StreamLinearSearchRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} + +func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByIDServer) (err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamLinearSearchByIDRPCName), apiName+"/"+vald.StreamLinearSearchByIDRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err = grpc.BidirectionalStream(ctx, stream, s.streamConcurrency, + func(ctx context.Context, req *payload.Search_IDRequest) (*payload.Search_StreamResponse, error) { + ctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BidirectionalStream"), apiName+"."+vald.StreamLinearSearchByIDRPCName+"/id-"+req.GetId()) + defer func() { + if sspan != nil { + sspan.End() + } + }() + res, err := s.LinearSearchByID(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.LinearSearchByIDRPCName+" gRPC error response") + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + return &payload.Search_StreamResponse{ + Payload: &payload.Search_StreamResponse_Status{ + Status: st.Proto(), + }, + }, err + } + return &payload.Search_StreamResponse{ + Payload: &payload.Search_StreamResponse_Response{ + Response: res, + }, + }, nil + }, + ) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.StreamLinearSearchByIDRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} + +func (s *server) MultiLinearSearch(ctx context.Context, req *payload.Search_MultiRequest) (res *payload.Search_Responses, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiLinearSearchRPCName), apiName+"/"+vald.MultiLinearSearchRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + res, err = vc.MultiLinearSearch(ctx, req, copts...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiLinearSearchRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.MultiLinearSearchRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.MultiLinearSearchRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.MultiLinearSearchRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.MultiLinearSearchRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.MultiLinearSearchRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return res, nil +} + +func (s *server) MultiLinearSearchByID(ctx context.Context, req *payload.Search_MultiIDRequest) (res *payload.Search_Responses, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiLinearSearchByIDRPCName), apiName+"/"+vald.MultiLinearSearchByIDRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + res, err = vc.MultiLinearSearchByID(ctx, req, copts...) + if err != nil { + return nil, err + } + return res, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiLinearSearchByIDRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.MultiLinearSearchByIDRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.MultiLinearSearchByIDRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.MultiLinearSearchByIDRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.MultiLinearSearchByIDRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.MultiLinearSearchByIDRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return res, nil +} + +func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.InsertRPCName), apiName+"/"+vald.InsertRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + reqSrcPodName := s.gateway.FromForwardedContext(ctx) + + // When this condition is matched, the request is proxied to another Mirror gateway. + // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. + if len(reqSrcPodName) != 0 { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + loc, err = vc.Insert(ctx, req, copts...) + if err != nil { + return nil, err + } + return loc, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.InsertRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.InsertRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.InsertRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.InsertRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Debugf("Insert API succeeded to %#v", loc) + return loc, nil + } + + var mu sync.Mutex + var result sync.Map + loc = &payload.Object_Location{ + Uuid: req.GetVector().GetId(), + Ips: make([]string, 0), + } + err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.InsertRPCName+"/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + ce, err := s.insert(ctx, vc, req, copts...) + if err != nil { + st, _, _ := status.ParseError(err, codes.Internal, + "failed to parse "+vald.InsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.AlreadyExists { + // NOTE: If it is strictly necessary to check, fix this logic. + return nil + } + } + if err == nil && ce != nil { + mu.Lock() + loc.Name = ce.GetName() + loc.Ips = append(loc.Ips, ce.GetIps()...) + mu.Unlock() + } + result.Store(target, err) + return err + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + ".BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.InsertRPCName+" API connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + var errs error + targets := make([]string, 0, 10) + result.Range(func(target, err any) bool { + if err == nil { + targets = append(targets, target.(string)) + } else { + if err, ok := err.(error); ok && err != nil { + if errs != nil { + errs = errors.Join(errs, err) + } else { + errs = err + } + } + } + return true + }) + switch { + case errs == nil: + log.Debugf("Insert API mirror request succeeded to %#v", loc) + return loc, nil + case len(targets) == 0 && errs != nil: + log.Error("failed to Insert API mirror request: %v and can not rollback because success target length is 0", errs) + st, msg, err := status.ParseError(errs, codes.Internal, + "failed to parse "+vald.InsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Error("failed to Insert API mirror request: %v, so starts the rollback request", errs) + + var emu sync.Mutex + var rerrs error + rmReq := &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: req.GetVector().GetId(), + }, + } + err = s.gateway.DoMulti(ctx, targets, + func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "rollback/BroadCast/"+target), apiName+"/"+vald.InsertRPCName+"/rollback/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + _, err := s.remove(ctx, vc, rmReq, copts...) + if err != nil { + st, _, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" for "+vald.InsertRPCName+" error response for "+target, + &errdetails.RequestInfo{ + RequestId: rmReq.GetId().GetId(), + ServingData: errdetails.Serialize(rmReq), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + "." + vald.RemoveRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.NotFound { + return nil + } + emu.Lock() + if rerrs != nil { + rerrs = errors.Join(rerrs, err) + } else { + rerrs = err + } + emu.Unlock() + return err + } + return nil + }, + ) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: rmReq.GetId().GetId(), + ServingData: errdetails.Serialize(rmReq), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + "." + vald.RemoveRPCName + ".BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.RemoveRPCName+" for "+vald.InsertRPCName+" API connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" for "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + if rerrs == nil { + log.Debugf("rollback for Insert API mirror request succeeded to %v", targets) + st, msg, err := status.ParseError(errs, codes.Internal, + "failed to parse "+vald.InsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Debugf("failed to rollback for Insert API mirror request succeeded to %v: %v", targets, rerrs) + st, msg, err := status.ParseError(rerrs, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" for "+vald.InsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: rmReq.GetId().GetId(), + ServingData: errdetails.Serialize(rmReq), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + "." + vald.RemoveRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) %v", apiName, s.name, s.ip, targets), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err +} + +func (s *server) insert(ctx context.Context, client vald.InsertClient, req *payload.Insert_Request, opts ...grpc.CallOption) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "insert"), apiName+"/insert") + defer func() { + if span != nil { + span.End() + } + }() + + loc, err = client.Insert(ctx, req, opts...) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.InsertRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.InsertRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.InsertRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return loc, nil +} + +func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.StreamInsertRPCName), apiName+"/"+vald.StreamInsertRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err = grpc.BidirectionalStream(ctx, stream, s.streamConcurrency, + func(ctx context.Context, req *payload.Insert_Request) (*payload.Object_StreamLocation, error) { + ctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BidirectionalStream"), apiName+"/"+vald.StreamInsertRPCName+"/id-"+req.GetVector().GetId()) + defer func() { + if sspan != nil { + sspan.End() + } + }() + res, err := s.Insert(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.InsertRPCName+" gRPC error response") + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + return &payload.Object_StreamLocation{ + Payload: &payload.Object_StreamLocation_Status{ + Status: st.Proto(), + }, + }, err + } + return &payload.Object_StreamLocation{ + Payload: &payload.Object_StreamLocation_Location{ + Location: res, + }, + }, nil + }, + ) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.StreamInsertRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} + +func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequest) (res *payload.Object_Locations, errs error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.MultiInsertRPCName), apiName+"/"+vald.MultiInsertRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + res = &payload.Object_Locations{ + Locations: make([]*payload.Object_Location, len(reqs.GetRequests())), + } + + var mu, emu sync.Mutex + var wg sync.WaitGroup + + for i, r := range reqs.GetRequests() { + idx, req := i, r + wg.Add(1) + s.eg.Go(safety.RecoverFunc(func() error { + defer wg.Done() + ti := "errgroup.Go/id-" + req.GetVector().GetId() + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, ti), apiName+"/"+vald.MultiInsertRPCName+"/"+ti) + defer func() { + if span != nil { + span.End() + } + }() + + loc, err := s.Insert(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.InsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + emu.Lock() + if errs != nil { + errs = errors.Join(errs, err) + } else { + errs = err + } + emu.Unlock() + return nil + } + mu.Lock() + res.Locations[idx] = loc + mu.Unlock() + return nil + })) + } + wg.Wait() + if errs != nil { + st, msg, err := status.ParseError(errs, codes.Internal, "failed to parse "+vald.MultiInsertRPCName+" gRPC error response", + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiInsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return res, err + } + return res, nil +} + +func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.UpdateRPCName), apiName+"/"+vald.UpdateRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + reqSrcPodName := s.gateway.FromForwardedContext(ctx) + + // When this condition is matched, the request is proxied to another Mirror gateway. + // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. + if len(reqSrcPodName) != 0 { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + loc, err = vc.Update(ctx, req, copts...) + if err != nil { + return nil, err + } + return loc, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.UpdateRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.UpdateRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.UpdateRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.UpdateRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Debugf("Update API succeeded to %#v", loc) + return loc, nil + } + + objReq := &payload.Object_VectorRequest{ + Id: &payload.Object_ID{ + Id: req.GetVector().GetId(), + }, + } + oldVecs, err := s.getObjects(ctx, objReq) + if err != nil { + return nil, err + } + + var mu sync.Mutex + var result sync.Map + loc = &payload.Object_Location{ + Uuid: req.GetVector().GetId(), + Ips: make([]string, 0), + } + + err = s.gateway.BroadCast(ctx, + func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.UpdateRPCName+"/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + ce, err := s.update(ctx, vc, req, copts...) + if err != nil { + st, _, _ := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" API error response for "+target, + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.AlreadyExists { + // NOTE: If it is strictly necessary to check, fix this logic. + return nil + } + } + if err == nil && ce != nil { + mu.Lock() + loc.Name = ce.GetName() + loc.Ips = append(loc.Ips, ce.GetIps()...) + mu.Unlock() + } + result.Store(target, err) + return err + }, + ) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + ".BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.UpdateRPCName+" API connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + var errs error + targets := make([]string, 0, 10) + result.Range(func(target, err any) bool { + if err == nil { + targets = append(targets, target.(string)) + } else { + if err, ok := err.(error); ok && err != nil { + if errs != nil { + errs = errors.Join(errs, err) + } else { + errs = err + } + } + } + return true + }) + switch { + case errs == nil: + log.Debugf("Update API mirror request succeeded to %#v", loc) + return loc, nil + case len(targets) == 0 && errs != nil: + log.Error("failed to Update API mirror request: %v and can not rollback because success target length is 0", errs) + st, msg, err := status.ParseError(errs, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Error("failed to Update API mirror request: %v, so starts the rollback request", errs) + + var emu sync.Mutex + var rerrs error + rmReq := &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: req.GetVector().GetId(), + }, + } + + err = s.gateway.DoMulti(ctx, targets, + func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "rollback/BroadCast/"+target), apiName+"/"+vald.RemoveRPCName+"/rollback/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + oldVec, ok := oldVecs.Load(target) + if !ok || oldVec == nil { + _, err := s.remove(ctx, vc, rmReq, copts...) + if err != nil { + st, _, _ := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" for "+vald.UpdateRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: rmReq.GetId().GetId(), + ServingData: errdetails.Serialize(rmReq), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.RemoveRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.NotFound { + return nil + } + emu.Lock() + if rerrs != nil { + rerrs = errors.Join(rerrs, err) + } else { + rerrs = err + } + emu.Unlock() + return err + } + return nil + } + + req := &payload.Update_Request{ + Vector: oldVec.(*payload.Object_Vector), + Config: &payload.Update_Config{ + SkipStrictExistCheck: true, + }, + } + _, err := s.update(ctx, vc, req, copts...) + if err != nil { + st, _, _ := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" for "+vald.UpdateRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.UpdateRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.AlreadyExists { + return nil + } + emu.Lock() + if rerrs != nil { + rerrs = errors.Join(rerrs, err) + } else { + rerrs = err + } + emu.Unlock() + return err + } + return nil + }, + ) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + ".Rollback.BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.UpdateRPCName+" for Rollback connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" for Rollback gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + if rerrs == nil { + log.Debugf("rollback for Update API mirror request succeeded to %v", targets) + st, msg, err := status.ParseError(errs, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Debugf("failed to rollback for Update API mirror request succeeded to %v: %v", targets, rerrs) + st, msg, err := status.ParseError(rerrs, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" for Rollback gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + ".Rollback", + ResourceName: fmt.Sprintf("%s: %s(%s) %v", apiName, s.name, s.ip, targets), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err +} + +func (s *server) update(ctx context.Context, client vald.UpdateClient, req *payload.Update_Request, opts ...grpc.CallOption) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "update"), apiName+"/update") + defer func() { + if span != nil { + span.End() + } + }() + + loc, err = client.Update(ctx, req, opts...) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.UpdateRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.UpdateRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.UpdateRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return loc, nil +} + +func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.StreamUpdateRPCName), apiName+"/"+vald.StreamUpdateRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err = grpc.BidirectionalStream(ctx, stream, s.streamConcurrency, + func(ctx context.Context, req *payload.Update_Request) (*payload.Object_StreamLocation, error) { + ctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BidirectionalStream"), apiName+"/"+vald.StreamUpdateRPCName+"/id-"+req.GetVector().GetId()) + defer func() { + if sspan != nil { + sspan.End() + } + }() + res, err := s.Update(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.UpdateRPCName+" gRPC error response") + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + return &payload.Object_StreamLocation{ + Payload: &payload.Object_StreamLocation_Status{ + Status: st.Proto(), + }, + }, err + } + return &payload.Object_StreamLocation{ + Payload: &payload.Object_StreamLocation_Location{ + Location: res, + }, + }, nil + }, + ) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.StreamUpdateRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} + +func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequest) (res *payload.Object_Locations, errs error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.MultiUpdateRPCName), apiName+"/"+vald.MultiUpdateRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + res = &payload.Object_Locations{ + Locations: make([]*payload.Object_Location, len(reqs.GetRequests())), + } + + var mu, emu sync.Mutex + var wg sync.WaitGroup + + for i, r := range reqs.GetRequests() { + idx, req := i, r + wg.Add(1) + s.eg.Go(safety.RecoverFunc(func() error { + defer wg.Done() + ti := "errgroup.Go/id-" + req.GetVector().GetId() + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, ti), apiName+"/"+vald.MultiUpdateRPCName+"/"+ti) + defer func() { + if span != nil { + span.End() + } + }() + + loc, err := s.Update(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.UpdateRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + emu.Lock() + if errs != nil { + errs = errors.Join(errs, err) + } else { + errs = err + } + emu.Unlock() + return nil + } + mu.Lock() + res.Locations[idx] = loc + mu.Unlock() + return nil + })) + } + wg.Wait() + if errs != nil { + st, msg, err := status.ParseError(errs, codes.Internal, "failed to parse "+vald.MultiUpdateRPCName+" gRPC error response", + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiUpdateRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return res, err + } + return res, nil +} + +func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.UpsertRPCName), apiName+"/"+vald.UpsertRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + reqSrcPodName := s.gateway.FromForwardedContext(ctx) + + // When this condition is matched, the request is proxied to another Mirror gateway. + // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. + if len(reqSrcPodName) != 0 { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + loc, err = vc.Upsert(ctx, req, copts...) + if err != nil { + return nil, err + } + return loc, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.UpsertRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.UpsertRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.UpsertRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.UpsertRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Debugf("Upsert API succeeded to %#v", loc) + return loc, nil + } + + objReq := &payload.Object_VectorRequest{ + Id: &payload.Object_ID{ + Id: req.GetVector().GetId(), + }, + } + oldVecs, err := s.getObjects(ctx, objReq) + if err != nil { + return nil, err + } + + var mu sync.Mutex + var result sync.Map + loc = &payload.Object_Location{ + Uuid: req.GetVector().GetId(), + Ips: make([]string, 0), + } + err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.UpsertRPCName+"/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + ce, err := s.upsert(ctx, vc, req, copts...) + if err != nil { + st, _, _ := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.AlreadyExists { + // NOTE: If it is strictly necessary to check, fix this logic. + return nil + } + } + if err == nil && ce != nil { + mu.Lock() + loc.Name = ce.GetName() + loc.Ips = append(loc.Ips, ce.GetIps()...) + mu.Unlock() + } + result.Store(target, err) + return err + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + ".BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.UpsertRPCName+" API connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + var errs error + targets := make([]string, 0, 10) + result.Range(func(target, err any) bool { + if err == nil { + targets = append(targets, target.(string)) + } else { + if err, ok := err.(error); ok && err != nil { + if errs != nil { + errs = errors.Join(errs, err) + } else { + errs = err + } + } + } + return true + }) + switch { + case errs == nil: + log.Debugf("Upsert API mirror request succeeded to %#v", loc) + return loc, nil + case len(targets) == 0 && errs != nil: + log.Error("failed to Upsert API mirror request: %v and can not rollback because success target length is 0", errs) + st, msg, err := status.ParseError(errs, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Error("failed to Upsert API mirror request: %v, so starts the rollback request", errs) + + var emu sync.Mutex + var rerrs error + rmReq := &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: req.GetVector().GetId(), + }, + } + err = s.gateway.DoMulti(ctx, targets, + func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "rollback/BroadCast/"+target), apiName+"/"+vald.UpsertRPCName+"/rollback/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + oldVec, ok := oldVecs.Load(target) + if !ok || oldVec == nil { + _, err := s.remove(ctx, vc, rmReq, copts...) + if err != nil { + st, _, _ := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" for "+vald.UpsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: rmReq.GetId().GetId(), + ServingData: errdetails.Serialize(rmReq), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + "." + vald.RemoveRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.NotFound { + return nil + } + emu.Lock() + if rerrs != nil { + rerrs = errors.Join(rerrs, err) + } else { + rerrs = err + } + emu.Unlock() + return err + } + return nil + } + + req := &payload.Update_Request{ + Vector: oldVec.(*payload.Object_Vector), + Config: &payload.Update_Config{ + SkipStrictExistCheck: true, + }, + } + _, err := s.update(ctx, vc, req, copts...) + if err != nil { + st, _, _ := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" for "+vald.UpsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + "." + vald.UpdateRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.AlreadyExists { + return nil + } + emu.Lock() + if rerrs != nil { + rerrs = errors.Join(rerrs, err) + } else { + rerrs = err + } + emu.Unlock() + return err + } + return nil + }, + ) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + ".Rollback.BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.UpsertRPCName+" for Rollback connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" for Rollback gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + if rerrs == nil { + log.Debugf("rollback for Upsert API mirror request succeeded to %v", targets) + st, msg, err := status.ParseError(errs, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Debugf("failed to rollback for Upsert API mirror request succeeded to %v: %v", targets, rerrs) + st, msg, err := status.ParseError(rerrs, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" for Rollback gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + ".Rollback", + ResourceName: fmt.Sprintf("%s: %s(%s) %v", apiName, s.name, s.ip, targets), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err +} + +func (s *server) upsert(ctx context.Context, client vald.UpsertClient, req *payload.Upsert_Request, opts ...grpc.CallOption) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "upsert"), apiName+"/upsert") + defer func() { + if span != nil { + span.End() + } + }() + + loc, err = client.Upsert(ctx, req, opts...) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.UpsertRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.UpsertRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.UpsertRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn("failed to process Upsert request\terror: %s", err.Error()) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return loc, nil +} + +func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.StreamUpsertRPCName), apiName+"/"+vald.StreamUpsertRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err = grpc.BidirectionalStream(ctx, stream, s.streamConcurrency, + func(ctx context.Context, req *payload.Upsert_Request) (*payload.Object_StreamLocation, error) { + ctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BidirectionalStream"), apiName+"/"+vald.StreamUpsertRPCName+"/id-"+req.GetVector().GetId()) + defer func() { + if sspan != nil { + sspan.End() + } + }() + res, err := s.Upsert(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.UpsertRPCName+" gRPC error response") + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + return &payload.Object_StreamLocation{ + Payload: &payload.Object_StreamLocation_Status{ + Status: st.Proto(), + }, + }, err + } + return &payload.Object_StreamLocation{ + Payload: &payload.Object_StreamLocation_Location{ + Location: res, + }, + }, nil + }, + ) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.StreamUpsertRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} + +func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequest) (res *payload.Object_Locations, errs error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.MultiUpsertRPCName), apiName+"/"+vald.MultiUpsertRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + res = &payload.Object_Locations{ + Locations: make([]*payload.Object_Location, len(reqs.GetRequests())), + } + + var mu, emu sync.Mutex + var wg sync.WaitGroup + + for i, r := range reqs.GetRequests() { + idx, req := i, r + wg.Add(1) + s.eg.Go(safety.RecoverFunc(func() error { + defer wg.Done() + ti := "errgroup.Go/id-" + req.GetVector().GetId() + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, ti), apiName+"/"+vald.MultiUpsertRPCName+"/"+ti) + defer func() { + if span != nil { + span.End() + } + }() + + loc, err := s.Upsert(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.UpsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + emu.Lock() + if errs != nil { + errs = errors.Join(errs, err) + } else { + errs = err + } + emu.Unlock() + return nil + } + mu.Lock() + res.Locations[idx] = loc + mu.Unlock() + return nil + })) + } + wg.Wait() + if errs != nil { + st, msg, err := status.ParseError(errs, codes.Internal, "failed to parse "+vald.MultiUpsertRPCName+" gRPC error response", + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiUpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return res, err + } + return res, nil +} + +func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.RemoveRPCName), apiName+"/"+vald.RemoveRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + reqSrcPodName := s.gateway.FromForwardedContext(ctx) + + // When this condition is matched, the request is proxied to another Mirror gateway. + // So this component sends the request only to the Vald gateway (LB gateway) of own cluster. + if len(reqSrcPodName) != 0 { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + loc, err = vc.Remove(ctx, req, copts...) + if err != nil { + return nil, err + } + return loc, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.RemoveRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.RemoveRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.RemoveRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Debugf("Remove API remove succeeded to %#v", loc) + return loc, nil + } + + objReq := &payload.Object_VectorRequest{ + Id: &payload.Object_ID{ + Id: req.GetId().GetId(), + }, + } + oldVecs, err := s.getObjects(ctx, objReq) + if err != nil { + return nil, err + } + + var mu sync.Mutex + var result sync.Map + loc = &payload.Object_Location{ + Uuid: req.GetId().GetId(), + Ips: make([]string, 0), + } + + err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.RemoveRPCName+"/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + ce, err := s.remove(ctx, vc, req, copts...) + if err != nil { + st, _, _ := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response for "+target, + &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.NotFound { + // NOTE: If it is strictly necessary to check, fix this logic. + return nil + } + } + if err == nil && ce != nil { + mu.Lock() + loc.Name = ce.GetName() + loc.Ips = append(loc.Ips, ce.GetIps()...) + mu.Unlock() + } + result.Store(target, err) + return err + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + ".BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + var errs error + targets := make([]string, 0, 10) + result.Range(func(target, err any) bool { + if err == nil { + targets = append(targets, target.(string)) + } else { + if err, ok := err.(error); ok && err != nil { + if errs != nil { + errs = errors.Join(errs, err) + } else { + errs = err + } + } + } + return true + }) + switch { + case errs == nil: + log.Debugf("Remove API mirror request succeeded to %#v", loc) + return loc, nil + case len(targets) == 0 && errs != nil: + log.Error("failed to Remove API mirror request: %v and can not rollback because success target length is 0", errs) + st, msg, err := status.ParseError(errs, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Error("failed to Remove API mirror request: %v, so starts the rollback request", errs) + + var emu sync.Mutex + var rerrs error + err = s.gateway.DoMulti(ctx, targets, + func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "rollback/BroadCast/"+target), apiName+"/"+vald.RemoveRPCName+"/rollback/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + objv, ok := oldVecs.Load(target) + if !ok || objv == nil { + log.Debug("failed to load old vector from %s", target) + return nil + } + req := &payload.Upsert_Request{ + Vector: objv.(*payload.Object_Vector), + Config: &payload.Upsert_Config{ + SkipStrictExistCheck: true, + }, + } + _, err := s.upsert(ctx, vc, req, copts...) + if err != nil { + st, _, _ := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" for "+vald.RemoveRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + "." + vald.UpsertRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + if st.Code() == codes.AlreadyExists { + return nil + } + emu.Lock() + if rerrs != nil { + rerrs = errors.Join(rerrs, err) + } else { + rerrs = err + } + emu.Unlock() + return err + } + return nil + }, + ) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + "." + vald.UpsertRPCName + ".BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.UpsertRPCName+" for "+vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" for "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + if rerrs == nil { + log.Debugf("rollback for Remove API mirror request succeeded to %v", targets) + st, msg, err := status.ParseError(errs, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + log.Debugf("failed to rollback for Remove API mirror request succeeded to %v: %v", targets, rerrs) + st, msg, err := status.ParseError(rerrs, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" for "+vald.RemoveRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + "." + vald.UpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) %v", apiName, s.name, s.ip, targets), + }, + ) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err +} + +func (s *server) remove(ctx context.Context, client vald.RemoveClient, req *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "remove"), apiName+"/remove") + defer func() { + if span != nil { + span.End() + } + }() + + loc, err := client.Remove(ctx, req, opts...) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.RemoveRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.RemoveRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return loc, nil +} + +func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.StreamRemoveRPCName), apiName+"/"+vald.StreamRemoveRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err = grpc.BidirectionalStream(ctx, stream, s.streamConcurrency, + func(ctx context.Context, req *payload.Remove_Request) (*payload.Object_StreamLocation, error) { + ctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BidirectionalStream"), apiName+"/"+vald.StreamRemoveRPCName+"/id-"+req.GetId().GetId()) + defer func() { + if sspan != nil { + sspan.End() + } + }() + res, err := s.Remove(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.RemoveRPCName+" gRPC error response") + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + return &payload.Object_StreamLocation{ + Payload: &payload.Object_StreamLocation_Status{ + Status: st.Proto(), + }, + }, err + } + return &payload.Object_StreamLocation{ + Payload: &payload.Object_StreamLocation_Location{ + Location: res, + }, + }, nil + }, + ) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.StreamRemoveRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} + +func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequest) (res *payload.Object_Locations, errs error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.MultiRemoveRPCName), apiName+"/"+vald.MultiRemoveRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + res = &payload.Object_Locations{ + Locations: make([]*payload.Object_Location, len(reqs.GetRequests())), + } + + var mu, emu sync.Mutex + var wg sync.WaitGroup + + for i, r := range reqs.GetRequests() { + idx, req := i, r + wg.Add(1) + s.eg.Go(safety.RecoverFunc(func() error { + defer wg.Done() + ti := "errgroup.Go/id-" + req.GetId().GetId() + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, ti), apiName+"/"+vald.MultiRemoveRPCName+"/"+ti) + defer func() { + if span != nil { + span.End() + } + }() + + loc, err := s.Remove(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.RemoveRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + emu.Lock() + if errs != nil { + errs = errors.Join(errs, err) + } else { + errs = err + } + emu.Unlock() + return nil + } + mu.Lock() + res.Locations[idx] = loc + mu.Unlock() + return nil + })) + } + wg.Wait() + if errs != nil { + st, msg, err := status.ParseError(errs, codes.Internal, "failed to parse "+vald.MultiRemoveRPCName+" gRPC error response", + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.MultiRemoveRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return res, err + } + return res, nil +} + +func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + vec, err = vc.GetObject(ctx, req, copts...) + if err != nil { + return nil, err + } + return vec, nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.GetObjectRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.GetObjectRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.GetObjectRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.GetObjectRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.GetObjectRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return vec, nil +} + +func (s *server) getObjects(ctx context.Context, req *payload.Object_VectorRequest) (vecs *sync.Map, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "getObjects"), apiName+"/"+vald.GetObjectRPCName+"/getObjects") + defer func() { + if span != nil { + span.End() + } + }() + + var errs error + var emu sync.Mutex + vecs = new(sync.Map) + err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.GetObjectRPCName+"/getObjects/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + vec, err := vc.GetObject(ctx, req, copts...) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + } + var attrs trace.Attributes + var code codes.Code + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.GetObjectRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + code = codes.Canceled + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.GetObjectRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + code = codes.DeadlineExceeded + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.GetObjectRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + code = codes.Internal + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.GetObjectRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + code = codes.Internal + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.GetObjectRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + code = st.Code() + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + if code == codes.NotFound { + return nil + } + emu.Lock() + if errs == nil { + errs = err + } else { + errs = errors.Join(errs, err) + } + emu.Unlock() + return err + } + vecs.Store(target, vec) + return nil + }) + if err != nil { + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.GetObjectRPCName+" API connection not found", err, + &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName + ".BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + errs = errors.Join(errs, err) + } + if errs != nil { + st, msg, err := status.ParseError(errs, codes.Internal, + "failed to parse "+vald.GetObjectRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName + "." + "BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return vecs, nil +} + +func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.StreamGetObjectRPCName), apiName+"/"+vald.StreamGetObjectRPCName) + defer func() { + if span != nil { + span.End() + } + }() + err = grpc.BidirectionalStream(ctx, stream, s.streamConcurrency, + func(ctx context.Context, req *payload.Object_VectorRequest) (*payload.Object_StreamVector, error) { + ctx, sspan := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BidirectionalStream"), apiName+"/"+vald.StreamInsertRPCName+"/id-"+req.GetId().GetId()) + defer func() { + if sspan != nil { + sspan.End() + } + }() + res, err := s.GetObject(ctx, req) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.GetObjectRPCName+" gRPC error response") + if sspan != nil { + sspan.RecordError(err) + sspan.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + sspan.SetStatus(trace.StatusError, err.Error()) + } + return &payload.Object_StreamVector{ + Payload: &payload.Object_StreamVector_Status{ + Status: st.Proto(), + }, + }, err + } + return &payload.Object_StreamVector{ + Payload: &payload.Object_StreamVector_Vector{ + Vector: res, + }, + }, nil + }, + ) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.StreamGetObjectRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go new file mode 100644 index 0000000000..6127d02463 --- /dev/null +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -0,0 +1,5519 @@ +package grpc + +import ( + "context" + "reflect" + "sync" + "sync/atomic" + "testing" + + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/apis/grpc/v1/vald" + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/net/grpc" + "github.com/vdaas/vald/internal/net/grpc/codes" + "github.com/vdaas/vald/internal/net/grpc/status" + "github.com/vdaas/vald/internal/test/data/vector" + "github.com/vdaas/vald/internal/test/goleak" + "github.com/vdaas/vald/pkg/gateway/mirror/service" +) + +func Test_server_Insert(t *testing.T) { + const dimension = 128 + defaultInsertConfig := &payload.Insert_Config{ + SkipStrictExistCheck: true, + } + type args struct { + ctx context.Context + req *payload.Insert_Request + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantCe *payload.Object_Location + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Location, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotCe *payload.Object_Location, 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(gotCe, w.wantCe) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotCe, w.wantCe) + } + return nil + } + tests := []test{ + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + } + wantLoc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1", "127.0.0.1"}, + } + return test{ + name: "success insert with new ID", + args: args{ + ctx: egctx, + req: &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultInsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + }, + }, + want: want{ + wantCe: wantLoc, + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + } + return test{ + name: "fail insert with new ID but remove rollback success", + args: args{ + ctx: egctx, + req: &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultInsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + "vald-lb-gateway-01": &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + }, + }, + } + return test{ + name: "fail insert with new ID and fail remove rollback", + args: args{ + ctx: egctx, + req: &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultInsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + } + + 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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotCe, err := s.Insert(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotCe, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_Update(t *testing.T) { + const dimension = 128 + defaultUpdateConfig := &payload.Update_Config{ + SkipStrictExistCheck: true, + } + type args struct { + ctx context.Context + req *payload.Update_Request + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantLoc *payload.Object_Location + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Location, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, 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(gotLoc, w.wantLoc) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) + } + return nil + } + tests := []test{ + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + } + wantLoc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1", "127.0.0.1"}, + } + return test{ + name: "success update with new ID", + args: args{ + ctx: egctx, + req: &payload.Update_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpdateConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + }, + }, + want: want{ + wantLoc: wantLoc, + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + } + return test{ + name: "fail update with new ID but remove rollback success", + args: args{ + ctx: egctx, + req: &payload.Update_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpdateConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + ovec := &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return ovec, nil + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + } + return test{ + name: "fail update with new ID but update rollback success", + args: args{ + ctx: egctx, + req: &payload.Update_Request{ + Vector: ovec, + Config: defaultUpdateConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + }, + }, + } + return test{ + name: "fail update with new ID and fail remove rollback", + args: args{ + ctx: egctx, + req: &payload.Update_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpdateConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + ovec := &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + } + var cnt uint32 + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return ovec, nil + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + if atomic.AddUint32(&cnt, 1) == 1 { + return loc, nil + } + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + }, + }, + } + return test{ + name: "fail update with new ID and fail update rollback", + args: args{ + ctx: egctx, + req: &payload.Update_Request{ + Vector: ovec, + Config: defaultUpdateConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + } + + 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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotLoc, err := s.Update(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotLoc, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_Upsert(t *testing.T) { + const dimension = 128 + defaultUpsertConfig := &payload.Upsert_Config{ + SkipStrictExistCheck: true, + } + type args struct { + ctx context.Context + req *payload.Upsert_Request + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantLoc *payload.Object_Location + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Location, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, 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(gotLoc, w.wantLoc) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) + } + return nil + } + tests := []test{ + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + } + wantLoc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1", "127.0.0.1"}, + } + return test{ + name: "success upsert with new ID", + args: args{ + ctx: egctx, + req: &payload.Upsert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + }, + }, + want: want{ + wantLoc: wantLoc, + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpsertFunc: func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + } + return test{ + name: "fail upsert with new ID but remove rollback success", + args: args{ + ctx: egctx, + req: &payload.Upsert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + ovec := &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return ovec, nil + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + } + return test{ + name: "fail upsert with new ID but update rollback success", + args: args{ + ctx: egctx, + req: &payload.Upsert_Request{ + Vector: ovec, + Config: defaultUpsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpsertFunc: func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + }, + }, + } + return test{ + name: "fail upsert with new ID and fail remove rollback", + args: args{ + ctx: egctx, + req: &payload.Upsert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + ovec := &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return ovec, nil + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + }, + }, + } + return test{ + name: "fail upsert with new ID and fail update rollback", + args: args{ + ctx: egctx, + req: &payload.Upsert_Request{ + Vector: ovec, + Config: defaultUpsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + } + + 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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotLoc, err := s.Upsert(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotLoc, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_Remove(t *testing.T) { + const dimension = 128 + defaultRemoveConfig := &payload.Remove_Config{ + SkipStrictExistCheck: true, + } + type args struct { + ctx context.Context + req *payload.Remove_Request + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantLoc *payload.Object_Location + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Location, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, 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(gotLoc, w.wantLoc) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) + } + return nil + } + tests := []test{ + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + ovec := &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return ovec, nil + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + }, + } + wantLoc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + return test{ + name: "success remove with existing ID", + args: args{ + ctx: egctx, + req: &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: uuid, + }, + Config: defaultRemoveConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + }, + }, + want: want{ + wantLoc: wantLoc, + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + ovec := &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return ovec, nil + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + } + return test{ + name: "fail remove with existing ID but upsert rollback success", + args: args{ + ctx: egctx, + req: &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: uuid, + }, + Config: defaultRemoveConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + ovec := &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + } + cmap := map[string]vald.ClientWithMirror{ + "vald-mirror-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return ovec, nil + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + "vald-lb-gateway-01": &mockClient{ + GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + }, + }, + } + return test{ + name: "fail remove with existing ID and fail upsert rollback", + args: args{ + ctx: egctx, + req: &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: uuid, + }, + Config: defaultRemoveConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for tgt, c := range cmap { + f(ctx, tgt, c) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + if len(targets) != 1 { + return errors.New("invalid target") + } + if c, ok := cmap[targets[0]]; ok { + f(ctx, targets[0], c) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + } + + 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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotLoc, err := s.Remove(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotLoc, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +// NOT IMPLEMENTED BELOW + +func TestNew(t *testing.T) { + type args struct { + opts []Option + } + type want struct { + want vald.ServerWithMirror + err error + } + type test struct { + name string + args args + want want + checkFunc func(want, vald.Server, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, got vald.Server, 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(got, w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + opts: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 { + opts: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 + } + + got, err := New(test.args.opts...) + if err := checkFunc(test.want, got, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_Register(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Mirror_Targets + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + want *payload.Mirror_Targets + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Mirror_Targets, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, got *payload.Mirror_Targets, 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(got, w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx:nil, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + got, err := s.Register(test.args.ctx, test.args.req) + if err := checkFunc(test.want, got, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_Advertise(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Mirror_Targets + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Mirror_Targets + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Mirror_Targets, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Mirror_Targets, 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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.Advertise(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_Exists(t *testing.T) { + type args struct { + ctx context.Context + meta *payload.Object_ID + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantId *payload.Object_ID + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_ID, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotId *payload.Object_ID, 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(gotId, w.wantId) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotId, w.wantId) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx:nil, + meta:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + meta:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotId, err := s.Exists(test.args.ctx, test.args.meta) + if err := checkFunc(test.want, gotId, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_Search(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Search_Request + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Search_Response + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Search_Response, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.Search(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_SearchByID(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Search_IDRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Search_Response + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Search_Response, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.SearchByID(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_StreamSearch(t *testing.T) { + type args struct { + stream vald.Search_StreamSearchServer + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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 { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + err := s.StreamSearch(test.args.stream) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_StreamSearchByID(t *testing.T) { + type args struct { + stream vald.Search_StreamSearchByIDServer + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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 { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + err := s.StreamSearchByID(test.args.stream) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_MultiSearch(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Search_MultiRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Search_Responses + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Search_Responses, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.MultiSearch(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_MultiSearchByID(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Search_MultiIDRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Search_Responses + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Search_Responses, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.MultiSearchByID(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_LinearSearch(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Search_Request + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Search_Response + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Search_Response, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.LinearSearch(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_LinearSearchByID(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Search_IDRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Search_Response + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Search_Response, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.LinearSearchByID(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_StreamLinearSearch(t *testing.T) { + type args struct { + stream vald.Search_StreamLinearSearchServer + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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 { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + err := s.StreamLinearSearch(test.args.stream) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_StreamLinearSearchByID(t *testing.T) { + type args struct { + stream vald.Search_StreamLinearSearchByIDServer + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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 { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + err := s.StreamLinearSearchByID(test.args.stream) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_MultiLinearSearch(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Search_MultiRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Search_Responses + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Search_Responses, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.MultiLinearSearch(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_MultiLinearSearchByID(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Search_MultiIDRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Search_Responses + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Search_Responses, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.MultiLinearSearchByID(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_insert(t *testing.T) { + type args struct { + ctx context.Context + client vald.InsertClient + req *payload.Insert_Request + opts []grpc.CallOption + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantLoc *payload.Object_Location + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Location, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, 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(gotLoc, w.wantLoc) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx:nil, + client:nil, + req:nil, + opts:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + client:nil, + req:nil, + opts:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotLoc, err := s.insert(test.args.ctx, test.args.client, test.args.req, test.args.opts...) + if err := checkFunc(test.want, gotLoc, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_StreamInsert(t *testing.T) { + type args struct { + stream vald.Insert_StreamInsertServer + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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 { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + err := s.StreamInsert(test.args.stream) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_MultiInsert(t *testing.T) { + type args struct { + ctx context.Context + reqs *payload.Insert_MultiRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Object_Locations + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Locations, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, + reqs:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + reqs:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.MultiInsert(test.args.ctx, test.args.reqs) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_update(t *testing.T) { + type args struct { + ctx context.Context + client vald.UpdateClient + req *payload.Update_Request + opts []grpc.CallOption + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantLoc *payload.Object_Location + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Location, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, 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(gotLoc, w.wantLoc) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx:nil, + client:nil, + req:nil, + opts:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + client:nil, + req:nil, + opts:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotLoc, err := s.update(test.args.ctx, test.args.client, test.args.req, test.args.opts...) + if err := checkFunc(test.want, gotLoc, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_StreamUpdate(t *testing.T) { + type args struct { + stream vald.Update_StreamUpdateServer + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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 { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + err := s.StreamUpdate(test.args.stream) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_MultiUpdate(t *testing.T) { + type args struct { + ctx context.Context + reqs *payload.Update_MultiRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Object_Locations + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Locations, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, + reqs:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + reqs:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.MultiUpdate(test.args.ctx, test.args.reqs) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_upsert(t *testing.T) { + type args struct { + ctx context.Context + client vald.UpsertClient + req *payload.Upsert_Request + opts []grpc.CallOption + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantLoc *payload.Object_Location + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Location, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, 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(gotLoc, w.wantLoc) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx:nil, + client:nil, + req:nil, + opts:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + client:nil, + req:nil, + opts:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotLoc, err := s.upsert(test.args.ctx, test.args.client, test.args.req, test.args.opts...) + if err := checkFunc(test.want, gotLoc, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_StreamUpsert(t *testing.T) { + type args struct { + stream vald.Upsert_StreamUpsertServer + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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 { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + err := s.StreamUpsert(test.args.stream) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_MultiUpsert(t *testing.T) { + type args struct { + ctx context.Context + reqs *payload.Upsert_MultiRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Object_Locations + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Locations, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, + reqs:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + reqs:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.MultiUpsert(test.args.ctx, test.args.reqs) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_remove(t *testing.T) { + type args struct { + ctx context.Context + client vald.RemoveClient + req *payload.Remove_Request + opts []grpc.CallOption + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + want *payload.Object_Location + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Location, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, got *payload.Object_Location, 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(got, w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx:nil, + client:nil, + req:nil, + opts:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + client:nil, + req:nil, + opts:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + got, err := s.remove(test.args.ctx, test.args.client, test.args.req, test.args.opts...) + if err := checkFunc(test.want, got, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_StreamRemove(t *testing.T) { + type args struct { + stream vald.Remove_StreamRemoveServer + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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 { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + err := s.StreamRemove(test.args.stream) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_MultiRemove(t *testing.T) { + type args struct { + ctx context.Context + reqs *payload.Remove_MultiRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantRes *payload.Object_Locations + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Locations, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, + reqs:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + reqs:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotRes, err := s.MultiRemove(test.args.ctx, test.args.reqs) + if err := checkFunc(test.want, gotRes, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_GetObject(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Object_VectorRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantVec *payload.Object_Vector + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *payload.Object_Vector, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotVec *payload.Object_Vector, 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(gotVec, w.wantVec) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotVec, w.wantVec) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx:nil, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotVec, err := s.GetObject(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotVec, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_getObjects(t *testing.T) { + type args struct { + ctx context.Context + req *payload.Object_VectorRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + wantVecs *sync.Map + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, *sync.Map, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, gotVecs *sync.Map, 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(gotVecs, w.wantVecs) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotVecs, w.wantVecs) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + ctx:nil, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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, + req:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + gotVecs, err := s.getObjects(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotVecs, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_server_StreamGetObject(t *testing.T) { + type args struct { + stream vald.Object_StreamGetObjectServer + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + // TODO test cases + /* + { + name: "test_case_1", + args: args { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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 { + stream:nil, + }, + fields: fields { + eg:nil, + gateway:nil, + mirror:nil, + vAddr:"", + streamConcurrency:0, + name:"", + ip:"", + UnimplementedValdServerWithMirror: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{ + eg: test.fields.eg, + gateway: test.fields.gateway, + mirror: test.fields.mirror, + vAddr: test.fields.vAddr, + streamConcurrency: test.fields.streamConcurrency, + name: test.fields.name, + ip: test.fields.ip, + UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + } + + err := s.StreamGetObject(test.args.stream) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} diff --git a/pkg/gateway/mirror/handler/grpc/mock_test.go b/pkg/gateway/mirror/handler/grpc/mock_test.go new file mode 100644 index 0000000000..f62078105a --- /dev/null +++ b/pkg/gateway/mirror/handler/grpc/mock_test.go @@ -0,0 +1,215 @@ +package grpc + +import ( + "context" + + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/apis/grpc/v1/vald" + "github.com/vdaas/vald/internal/net/grpc" + "github.com/vdaas/vald/pkg/gateway/mirror/service" +) + +type mockClient struct { + InsertFunc func(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + StreamInsertFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Insert_StreamInsertClient, error) + MultiInsertFunc func(ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) + + UpdateFunc func(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + StreamUpdateFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Update_StreamUpdateClient, error) + MultiUpdateFunc func(ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) + + UpsertFunc func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + StreamUpsertFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Upsert_StreamUpsertClient, error) + MultiUpsertFunc func(ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) + + SearchFunc func(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) + SearchByIDFunc func(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) + StreamSearchFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamSearchClient, error) + StreamSearchByIDFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamSearchByIDClient, error) + MultiSearchFunc func(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) + MultiSearchByIDFunc func(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) + LinearSearchFunc func(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) + LinearSearchByIDFunc func(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) + StreamLinearSearchFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamLinearSearchClient, error) + StreamLinearSearchByIDFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamLinearSearchByIDClient, error) + MultiLinearSearchFunc func(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) + MultiLinearSearchByIDFunc func(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) + + RemoveFunc func(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + StreamRemoveFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Remove_StreamRemoveClient, error) + MultiRemoveFunc func(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) + + ExistsFunc func(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (*payload.Object_ID, error) + GetObjectFunc func(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) + StreamGetObjectFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Object_StreamGetObjectClient, error) + + RegisterFunc func(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) + AdvertiseFunc func(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) +} + +func (m *mockClient) Insert(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return m.InsertFunc(ctx, in, opts...) +} + +func (m *mockClient) StreamInsert(ctx context.Context, opts ...grpc.CallOption) (vald.Insert_StreamInsertClient, error) { + return m.StreamInsertFunc(ctx, opts...) +} + +func (m *mockClient) MultiInsert(ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { + return m.MultiInsertFunc(ctx, in, opts...) +} + +func (m *mockClient) Update(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return m.UpdateFunc(ctx, in, opts...) +} + +func (m *mockClient) StreamUpdate(ctx context.Context, opts ...grpc.CallOption) (vald.Update_StreamUpdateClient, error) { + return m.StreamUpdateFunc(ctx, opts...) +} + +func (m *mockClient) MultiUpdate(ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { + return m.MultiUpdateFunc(ctx, in, opts...) +} + +func (m *mockClient) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return m.UpsertFunc(ctx, in, opts...) +} + +func (m *mockClient) StreamUpsert(ctx context.Context, opts ...grpc.CallOption) (vald.Upsert_StreamUpsertClient, error) { + return m.StreamUpsertFunc(ctx, opts...) +} + +func (m *mockClient) MultiUpsert(ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { + return m.MultiUpsertFunc(ctx, in, opts...) +} + +func (m *mockClient) Search(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) { + return m.SearchFunc(ctx, in, opts...) +} + +func (m *mockClient) SearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) { + return m.SearchByIDFunc(ctx, in, opts...) +} + +func (m *mockClient) StreamSearch(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamSearchClient, error) { + return m.StreamSearchFunc(ctx, opts...) +} + +func (m *mockClient) StreamSearchByID(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamSearchByIDClient, error) { + return m.StreamSearchByIDFunc(ctx, opts...) +} + +func (m *mockClient) MultiSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { + return m.MultiSearchFunc(ctx, in, opts...) +} + +func (m *mockClient) MultiSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { + return m.MultiSearchByIDFunc(ctx, in, opts...) +} + +func (m *mockClient) LinearSearch(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) { + return m.LinearSearchFunc(ctx, in, opts...) +} + +func (m *mockClient) LinearSearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) { + return m.LinearSearchByIDFunc(ctx, in, opts...) +} + +func (m *mockClient) StreamLinearSearch(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamLinearSearchClient, error) { + return m.StreamLinearSearchFunc(ctx, opts...) +} + +func (m *mockClient) StreamLinearSearchByID(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamLinearSearchByIDClient, error) { + return m.StreamLinearSearchByIDFunc(ctx, opts...) +} + +func (m *mockClient) MultiLinearSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { + return m.MultiLinearSearchFunc(ctx, in, opts...) +} + +func (m *mockClient) MultiLinearSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { + return m.MultiLinearSearchByIDFunc(ctx, in, opts...) +} + +func (m *mockClient) Remove(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return m.RemoveFunc(ctx, in, opts...) +} + +func (m *mockClient) StreamRemove(ctx context.Context, opts ...grpc.CallOption) (vald.Remove_StreamRemoveClient, error) { + return m.StreamRemoveFunc(ctx, opts...) +} + +func (m *mockClient) MultiRemove(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { + return m.MultiRemoveFunc(ctx, in, opts...) +} + +func (m *mockClient) Exists(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (*payload.Object_ID, error) { + return m.ExistsFunc(ctx, in, opts...) +} + +func (m *mockClient) GetObject(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) { + return m.GetObjectFunc(ctx, in, opts...) +} + +func (m *mockClient) StreamGetObject(ctx context.Context, opts ...grpc.CallOption) (vald.Object_StreamGetObjectClient, error) { + return m.StreamGetObjectFunc(ctx, opts...) +} + +func (m *mockClient) Register(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) { + return m.RegisterFunc(ctx, in) +} + +func (m *mockClient) Advertise(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) { + return m.AdvertiseFunc(ctx, in) +} + +var _ vald.ClientWithMirror = (*mockClient)(nil) + +type mockGateway struct { + StartFunc func(ctx context.Context) (<-chan error, error) + ForwardedContextFunc func(ctx context.Context, podName string) context.Context + FromForwardedContextFunc func(ctx context.Context) string + BroadCastFunc func(ctx context.Context, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error + DoFunc func(ctx context.Context, target string, + f func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error)) (interface{}, error) + DoMultiFunc func(ctx context.Context, targets []string, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error + GRPCClientFunc func() grpc.Client +} + +func (m *mockGateway) Start(ctx context.Context) (<-chan error, error) { + return m.StartFunc(ctx) +} + +func (m *mockGateway) ForwardedContext(ctx context.Context, podName string) context.Context { + return m.ForwardedContextFunc(ctx, podName) +} + +func (m *mockGateway) FromForwardedContext(ctx context.Context) string { + return m.FromForwardedContextFunc(ctx) +} + +func (m *mockGateway) BroadCast(ctx context.Context, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error, +) error { + return m.BroadCastFunc(ctx, f) +} + +func (m *mockGateway) Do(ctx context.Context, target string, + f func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error), +) (interface{}, error) { + return m.DoFunc(ctx, target, f) +} + +func (m *mockGateway) DoMulti(ctx context.Context, targets []string, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error, +) error { + return m.DoMultiFunc(ctx, targets, f) +} + +func (m *mockGateway) GRPCClient() grpc.Client { + return m.GRPCClientFunc() +} + +var _ service.Gateway = (*mockGateway)(nil) diff --git a/pkg/gateway/mirror/handler/grpc/option.go b/pkg/gateway/mirror/handler/grpc/option.go new file mode 100644 index 0000000000..09f0996e17 --- /dev/null +++ b/pkg/gateway/mirror/handler/grpc/option.go @@ -0,0 +1,110 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package grpc provides grpc server logic +package grpc + +import ( + "os" + "runtime" + + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/log" + "github.com/vdaas/vald/internal/net" + "github.com/vdaas/vald/pkg/gateway/mirror/service" +) + +type Option func(*server) error + +var defaultOptions = []Option{ + WithErrGroup(errgroup.Get()), + WithStreamConcurrency(runtime.GOMAXPROCS(-1) * 10), + WithName(func() string { + name, err := os.Hostname() + if err != nil { + log.Warn(err) + } + return name + }()), + WithIP(net.LoadLocalIP()), +} + +// WithIP returns the option to set the IP for server. +func WithIP(ip string) Option { + return func(s *server) error { + if len(ip) != 0 { + s.ip = ip + } + return nil + } +} + +// WithName returns the option to set the name for server. +func WithName(name string) Option { + return func(s *server) error { + if len(name) != 0 { + s.name = name + } + return nil + } +} + +func WithGateway(g service.Gateway) Option { + return func(s *server) error { + if g != nil { + s.gateway = g + } + return nil + } +} + +func WithMirror(m service.Mirror) Option { + return func(s *server) error { + if m != nil { + s.mirror = m + } + return nil + } +} + +func WithErrGroup(eg errgroup.Group) Option { + return func(s *server) error { + if eg != nil { + s.eg = eg + } + return nil + } +} + +func WithStreamConcurrency(c int) Option { + return func(s *server) error { + if c > 0 { + s.streamConcurrency = c + } + return nil + } +} + +func WithValdAddr(addr string) Option { + return func(s *server) error { + if len(addr) == 0 { + return errors.NewErrCriticalOption("valdAddr", addr) + } + s.vAddr = addr + return nil + } +} diff --git a/pkg/gateway/mirror/handler/rest/handler.go b/pkg/gateway/mirror/handler/rest/handler.go new file mode 100644 index 0000000000..55a856e928 --- /dev/null +++ b/pkg/gateway/mirror/handler/rest/handler.go @@ -0,0 +1,211 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package rest provides rest api logic +package rest + +import ( + "net/http" + + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/apis/grpc/v1/vald" + "github.com/vdaas/vald/internal/net/http/dump" + "github.com/vdaas/vald/internal/net/http/json" +) + +type Handler interface { + Register(w http.ResponseWriter, r *http.Request) (int, error) + Advertise(w http.ResponseWriter, r *http.Request) (int, error) + Index(w http.ResponseWriter, r *http.Request) (int, error) + Exists(w http.ResponseWriter, r *http.Request) (int, error) + Search(w http.ResponseWriter, r *http.Request) (int, error) + SearchByID(w http.ResponseWriter, r *http.Request) (int, error) + MultiSearch(w http.ResponseWriter, r *http.Request) (int, error) + MultiSearchByID(w http.ResponseWriter, r *http.Request) (int, error) + LinearSearch(w http.ResponseWriter, r *http.Request) (int, error) + LinearSearchByID(w http.ResponseWriter, r *http.Request) (int, error) + MultiLinearSearch(w http.ResponseWriter, r *http.Request) (int, error) + MultiLinearSearchByID(w http.ResponseWriter, r *http.Request) (int, error) + Insert(w http.ResponseWriter, r *http.Request) (int, error) + MultiInsert(w http.ResponseWriter, r *http.Request) (int, error) + Update(w http.ResponseWriter, r *http.Request) (int, error) + MultiUpdate(w http.ResponseWriter, r *http.Request) (int, error) + Upsert(w http.ResponseWriter, r *http.Request) (int, error) + MultiUpsert(w http.ResponseWriter, r *http.Request) (int, error) + Remove(w http.ResponseWriter, r *http.Request) (int, error) + MultiRemove(w http.ResponseWriter, r *http.Request) (int, error) + GetObject(w http.ResponseWriter, r *http.Request) (int, error) +} + +type handler struct { + vald vald.ServerWithMirror +} + +func New(opts ...Option) Handler { + h := new(handler) + + for _, opt := range append(defaultOptions, opts...) { + opt(h) + } + return h +} + +func (h *handler) Register(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Mirror_Targets + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.Register(r.Context(), req) + }) +} + +func (h *handler) Advertise(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Mirror_Targets + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.Advertise(r.Context(), req) + }) +} + +func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { + data := make(map[string]interface{}) + return json.Handler(w, r, &data, func() (interface{}, error) { + return dump.Request(nil, data, r) + }) +} + +func (h *handler) Search(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Search_Request + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.Search(r.Context(), req) + }) +} + +func (h *handler) SearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Search_IDRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.SearchByID(r.Context(), req) + }) +} + +func (h *handler) MultiSearch(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Search_MultiRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.MultiSearch(r.Context(), req) + }) +} + +func (h *handler) MultiSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Search_MultiIDRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.MultiSearchByID(r.Context(), req) + }) +} + +func (h *handler) LinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Search_Request + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.LinearSearch(r.Context(), req) + }) +} + +func (h *handler) LinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Search_IDRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.LinearSearchByID(r.Context(), req) + }) +} + +func (h *handler) MultiLinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Search_MultiRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.MultiLinearSearch(r.Context(), req) + }) +} + +func (h *handler) MultiLinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Search_MultiIDRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.MultiLinearSearchByID(r.Context(), req) + }) +} + +func (h *handler) Insert(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Insert_Request + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.Insert(r.Context(), req) + }) +} + +func (h *handler) MultiInsert(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Insert_MultiRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.MultiInsert(r.Context(), req) + }) +} + +func (h *handler) Update(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Update_Request + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.Update(r.Context(), req) + }) +} + +func (h *handler) MultiUpdate(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Update_MultiRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.MultiUpdate(r.Context(), req) + }) +} + +func (h *handler) Upsert(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Upsert_Request + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.Upsert(r.Context(), req) + }) +} + +func (h *handler) MultiUpsert(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Upsert_MultiRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.MultiUpsert(r.Context(), req) + }) +} + +func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Remove_Request + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.Remove(r.Context(), req) + }) +} + +func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Remove_MultiRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.MultiRemove(r.Context(), req) + }) +} + +func (h *handler) GetObject(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Object_VectorRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.GetObject(r.Context(), req) + }) +} + +func (h *handler) Exists(w http.ResponseWriter, r *http.Request) (code int, err error) { + var req *payload.Object_ID + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.Exists(r.Context(), req) + }) +} diff --git a/pkg/gateway/mirror/handler/rest/option.go b/pkg/gateway/mirror/handler/rest/option.go new file mode 100644 index 0000000000..109a418fe3 --- /dev/null +++ b/pkg/gateway/mirror/handler/rest/option.go @@ -0,0 +1,32 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package rest provides rest api logic +package rest + +import ( + "github.com/vdaas/vald/apis/grpc/v1/vald" +) + +type Option func(*handler) + +var defaultOptions = []Option{} + +func WithVald(v vald.ServerWithMirror) Option { + return func(h *handler) { + h.vald = v + } +} diff --git a/pkg/gateway/mirror/router/option.go b/pkg/gateway/mirror/router/option.go new file mode 100644 index 0000000000..d27a01fa5a --- /dev/null +++ b/pkg/gateway/mirror/router/option.go @@ -0,0 +1,40 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package router provides implementation of Go API for routing http Handler wrapped by rest.Func +package router + +import ( + "github.com/vdaas/vald/pkg/gateway/mirror/handler/rest" +) + +type Option func(*router) + +var defaultOptions = []Option{ + WithTimeout("3s"), +} + +func WithHandler(h rest.Handler) Option { + return func(r *router) { + r.handler = h + } +} + +func WithTimeout(timeout string) Option { + return func(r *router) { + r.timeout = timeout + } +} diff --git a/pkg/gateway/mirror/router/router.go b/pkg/gateway/mirror/router/router.go new file mode 100644 index 0000000000..b2b0d06a24 --- /dev/null +++ b/pkg/gateway/mirror/router/router.go @@ -0,0 +1,183 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package router provides implementation of Go API for routing http Handler wrapped by rest.Func +package router + +import ( + "net/http" + + "github.com/vdaas/vald/internal/net/http/routing" + "github.com/vdaas/vald/pkg/gateway/mirror/handler/rest" +) + +type router struct { + handler rest.Handler + timeout string +} + +// New returns REST route&method information from handler interface. +func New(opts ...Option) http.Handler { + r := new(router) + + for _, opt := range append(defaultOptions, opts...) { + opt(r) + } + + h := r.handler + + return routing.New( + routing.WithRoutes([]routing.Route{ + { + "Index", + []string{ + http.MethodGet, + }, + "/", + h.Index, + }, + { + "Register", + []string{ + http.MethodPost, + }, + "/register", + h.Register, + }, + { + "Advertise", + []string{ + http.MethodPost, + }, + "/register", + h.Advertise, + }, + { + "Search", + []string{ + http.MethodPost, + }, + "/search", + h.Search, + }, + { + "Search By ID", + []string{ + http.MethodGet, + }, + "/search/{id}", + h.SearchByID, + }, + + { + "Multi Search", + []string{ + http.MethodPost, + }, + "/search/multi", + h.MultiSearch, + }, + { + "Multi Search By ID", + []string{ + http.MethodGet, + }, + "/search/multi/{id}", + h.MultiSearchByID, + }, + { + "Insert", + []string{ + http.MethodPost, + }, + "/insert", + h.Insert, + }, + { + "Multiple Insert", + []string{ + http.MethodPost, + }, + "/insert/multi", + h.MultiInsert, + }, + { + "Update", + []string{ + http.MethodPost, + http.MethodPatch, + http.MethodPut, + }, + "/update", + h.Update, + }, + { + "Multiple Update", + []string{ + http.MethodPost, + http.MethodPatch, + http.MethodPut, + }, + "/update/multi", + h.MultiUpdate, + }, + { + "Upsert", + []string{ + http.MethodPost, + http.MethodPatch, + http.MethodPut, + }, + "/upsert", + h.Upsert, + }, + { + "Multiple Upsert", + []string{ + http.MethodPost, + http.MethodPatch, + http.MethodPut, + }, + "/upsert/multi", + h.MultiUpsert, + }, + { + "Remove", + []string{ + http.MethodDelete, + }, + "/delete/{id}", + h.Remove, + }, + { + "Multiple Remove", + []string{ + http.MethodDelete, + http.MethodPost, + }, + "/delete/multi", + h.MultiRemove, + }, + { + "GetObject", + []string{ + http.MethodGet, + }, + "/object/{id}", + h.GetObject, + }, + }...)) +} diff --git a/pkg/gateway/mirror/service/doc.go b/pkg/gateway/mirror/service/doc.go new file mode 100644 index 0000000000..266389f73d --- /dev/null +++ b/pkg/gateway/mirror/service/doc.go @@ -0,0 +1,18 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package service manages the main logic of server. +package service diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go new file mode 100644 index 0000000000..40690d4dc0 --- /dev/null +++ b/pkg/gateway/mirror/service/gateway.go @@ -0,0 +1,172 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package service +package service + +import ( + "context" + "reflect" + + "github.com/vdaas/vald/apis/grpc/v1/vald" + client "github.com/vdaas/vald/internal/client/v1/client/mirror" + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/log" + "github.com/vdaas/vald/internal/net/grpc" + "github.com/vdaas/vald/internal/observability/trace" +) + +const ( + forwardedContextKey = "forwarded-for" + forwardedContextValue = "gateway mirror" +) + +type Gateway interface { + ForwardedContext(ctx context.Context, podName string) context.Context + FromForwardedContext(ctx context.Context) string + BroadCast(ctx context.Context, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error + Do(ctx context.Context, target string, + f func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error)) (interface{}, error) + DoMulti(ctx context.Context, targets []string, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error + GRPCClient() grpc.Client +} + +type gateway struct { + client client.Client // Mirror Gateway client for other clusters and to the Vald gateway (LB gateway) client for own cluster. + eg errgroup.Group + podName string +} + +func NewGateway(opts ...Option) (Gateway, error) { + g := new(gateway) + for _, opt := range append(defaultGWOpts, opts...) { + if err := opt(g); err != nil { + oerr := errors.ErrOptionFailed(err, reflect.ValueOf(opt)) + e := &errors.ErrCriticalOption{} + if errors.As(err, &e) { + log.Error(oerr) + return nil, oerr + } + log.Warn(oerr) + return nil, oerr + } + } + return g, nil +} + +func (g *gateway) GRPCClient() grpc.Client { + return g.client.GRPCClient() +} + +func (g *gateway) ForwardedContext(ctx context.Context, podName string) context.Context { + return grpc.NewOutgoingContext(ctx, grpc.MD{ + forwardedContextKey: []string{ + podName, + }, + }) +} + +func (g *gateway) FromForwardedContext(ctx context.Context) string { + md, ok := grpc.FromIncomingContext(ctx) + if !ok { + return "" + } + vals, ok := md[forwardedContextKey] + if !ok { + return "" + } + if len(vals) > 0 { + return vals[0] + } + return "" +} + +func (g *gateway) BroadCast(ctx context.Context, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error, +) (err error) { + ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Gateway.BroadCast") + defer func() { + if span != nil { + span.End() + } + }() + return g.client.GRPCClient().RangeConcurrent(g.ForwardedContext(ctx, g.podName), -1, func(ictx context.Context, + addr string, conn *grpc.ClientConn, copts ...grpc.CallOption, + ) (err error) { + select { + case <-ictx.Done(): + return nil + default: + err = f(ictx, addr, vald.NewValdClientWithMirror(conn), copts...) + if err != nil { + return err + } + } + return nil + }) +} + +func (g *gateway) Do(ctx context.Context, target string, + f func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error), +) (res interface{}, err error) { + ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Gateway.Do") + defer func() { + if span != nil { + span.End() + } + }() + + if len(target) == 0 { + return nil, errors.ErrTargetNotFound + } + return g.client.GRPCClient().Do(g.ForwardedContext(ctx, g.podName), target, + func(ictx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) { + return f(ictx, vald.NewValdClientWithMirror(conn), copts...) + }, + ) +} + +func (g *gateway) DoMulti(ctx context.Context, targets []string, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error, +) error { + ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Gateway.DoMulti") + defer func() { + if span != nil { + span.End() + } + }() + + if len(targets) == 0 { + return errors.ErrTargetNotFound + } + return g.client.GRPCClient().OrderedRangeConcurrent(g.ForwardedContext(ctx, g.podName), targets, -1, + func(ictx context.Context, addr string, conn *grpc.ClientConn, copts ...grpc.CallOption) (err error) { + select { + case <-ictx.Done(): + return nil + default: + err = f(ictx, addr, vald.NewValdClientWithMirror(conn), copts...) + if err != nil { + return err + } + } + return nil + }, + ) +} diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go new file mode 100644 index 0000000000..31d68340e8 --- /dev/null +++ b/pkg/gateway/mirror/service/mirror.go @@ -0,0 +1,432 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package service +package service + +import ( + "context" + "reflect" + "sync" + "time" + + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/apis/grpc/v1/vald" + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/log" + "github.com/vdaas/vald/internal/net" + "github.com/vdaas/vald/internal/net/grpc" + "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/trace" +) + +// Mirror manages other mirror gateway connection. +// If there is a new Mirror Gateway components, registers new connection. +type Mirror interface { + Start(ctx context.Context) (<-chan error, error) + Connect(ctx context.Context, targets ...*payload.Mirror_Target) error + MirrorTargets() ([]*payload.Mirror_Target, error) +} + +type mirr struct { + addrl sync.Map // List of all connected addresses + selfMirrAddrs []string // Address of self mirror gateway + selfMirrAddrl sync.Map // List of self Mirror gateway addresses + gwAddrs []string // Address of Vald Gateway (LB gateway) + gwAddrl sync.Map // List of Vald Gateway addresses + gateway Gateway + eg errgroup.Group + advertiseDur time.Duration +} + +func NewMirror(opts ...MirrorOption) (Mirror, error) { + m := new(mirr) + for _, opt := range append(defaultMirrOpts, opts...) { + if err := opt(m); err != nil { + oerr := errors.ErrOptionFailed(err, reflect.ValueOf(opt)) + e := &errors.ErrCriticalOption{} + if errors.As(err, &e) { + log.Error(oerr) + return nil, oerr + } + log.Warn(oerr) + } + } + for _, addr := range m.selfMirrAddrs { + m.selfMirrAddrl.Store(addr, struct{}{}) + } + for _, addr := range m.gwAddrs { + m.gwAddrl.Store(addr, struct{}{}) + } + return m, nil +} + +func (m *mirr) Start(ctx context.Context) (<-chan error, error) { + ech := make(chan error, 100) + + aech, err := m.startAdvertise(ctx) + if err != nil { + close(ech) + return nil, err + } + + m.eg.Go(func() (err error) { + defer close(ech) + for { + select { + case <-ctx.Done(): + return ctx.Err() + case err = <-aech: + } + if err != nil { + select { + case <-ctx.Done(): + case ech <- err: + } + err = nil + } + } + }) + return ech, nil +} + +func (m *mirr) startAdvertise(ctx context.Context) (<-chan error, error) { + ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.startAdvertise") + defer func() { + if span != nil { + span.End() + } + }() + ech := make(chan error, 100) + + tgts, err := m.toMirrorTargets(m.selfMirrAddrs...) + if err != nil { + close(ech) + return nil, err + } + err = m.registers(ctx, tgts) + if err != nil && + !errors.Is(err, errors.ErrTargetNotFound) && + !errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.InsertRPCName+" API canceld", err, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.InsertRPCName+" API deadline exceeded", err, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, "failed to parse "+vald.RegisterRPCName+" gRPC error response") + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + close(ech) + return nil, err + } + + m.eg.Go(func() (err error) { + tic := time.NewTicker(m.advertiseDur) + defer close(ech) + defer tic.Stop() + + for { + select { + case <-ctx.Done(): + return err + case <-tic.C: + tgts, err := m.toMirrorTargets(append(m.selfMirrAddrs, m.gateway.GRPCClient().ConnectedAddrs()...)...) + if err != nil || len(tgts.GetTargets()) == 0 { + if err == nil { + err = errors.ErrTargetNotFound + } + select { + case <-ctx.Done(): + return ctx.Err() + case ech <- err: + } + continue + } + resTgts, err := m.advertises(ctx, tgts) + if err != nil || len(resTgts) == 0 { + if err == nil { + err = errors.ErrTargetNotFound + } + select { + case <-ctx.Done(): + return ctx.Err() + case ech <- err: + } + continue + } + if err = m.Connect(ctx, resTgts...); err != nil { + select { + case <-ctx.Done(): + return ctx.Err() + case ech <- err: + } + } + log.Debugf("[mirror]: connected mirror gateway targets: %v", m.gateway.GRPCClient().ConnectedAddrs()) + } + } + }) + return ech, nil +} + +func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) error { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.MirrorRPCServiceName+"/"+vald.RegisterRPCName), "vald/gateway/mirror/service/Mirror.registers") + defer func() { + if span != nil { + span.End() + } + }() + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(tgts), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RegisterRPCName, + } + + return m.gateway.DoMulti(ctx, m.connectedMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.registers/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + _, err := vc.Register(ctx, tgts, copts...) + if err != nil { + var attrs trace.Attributes + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.RegisterRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithCanceled( + vald.RegisterRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.RegisterRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.RegisterRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Error("failed to send Register API to %s\t: %v", target, err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + + return nil + }) +} + +func (m *mirr) advertises(ctx context.Context, tgts *payload.Mirror_Targets) ([]*payload.Mirror_Target, error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.MirrorRPCServiceName+"/"+vald.AdvertiseRPCName), "vald/gateway/vald/service/Mirror.advertises") + defer func() { + if span != nil { + span.End() + } + }() + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(tgts), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.AdvertiseRPCName, + } + resTgts := make([]*payload.Mirror_Target, 0, len(tgts.GetTargets())) + var mu sync.Mutex + + err := m.gateway.DoMulti(ctx, m.connectedMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.advertises/"+target) + defer func() { + if span != nil { + span.End() + } + }() + res, err := vc.Advertise(ctx, tgts) + if err != nil { + var attrs trace.Attributes + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.AdvertiseRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithCanceled( + vald.AdvertiseRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.AdvertiseRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.AdvertiseRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Errorf("failed to process advertise requst to %s\terror: %s", target, err.Error()) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + if res != nil && len(res.GetTargets()) > 0 { + mu.Lock() + resTgts = append(resTgts, res.GetTargets()...) + mu.Unlock() + } + return nil + }) + return resTgts, err +} + +func (m *mirr) Connect(ctx context.Context, targets ...*payload.Mirror_Target) error { + ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.Connect") + defer func() { + if span != nil { + span.End() + } + }() + if len(targets) == 0 { + return errors.ErrTargetNotFound + } + for _, target := range targets { + addr := net.JoinHostPort(target.GetIp(), uint16(target.GetPort())) // addr: host:port + if !m.isSelfMirrorAddr(addr) && !m.isGatewayAddr(addr) { + _, ok := m.addrl.Load(addr) + if !ok || !m.gateway.GRPCClient().IsConnected(ctx, addr) { + _, err := m.gateway.GRPCClient().Connect(ctx, addr) + if err != nil { + m.addrl.Delete(addr) + return err + } + } + m.addrl.Store(addr, struct{}{}) + } + } + return nil +} + +func (m *mirr) MirrorTargets() ([]*payload.Mirror_Target, error) { + addrs := append(m.selfMirrAddrs, m.gateway.GRPCClient().ConnectedAddrs()...) + tgts := make([]*payload.Mirror_Target, 0, len(addrs)) + for _, addr := range addrs { + if !m.isGatewayAddr(addr) { + host, port, err := net.SplitHostPort(addr) + if err != nil { + return nil, err + } + tgts = append(tgts, &payload.Mirror_Target{ + Ip: host, + Port: uint32(port), + }) + } + } + return tgts, nil +} + +func (m *mirr) isSelfMirrorAddr(addr string) bool { + if _, ok := m.selfMirrAddrl.Load(addr); ok { + return true + } + return false +} + +func (m *mirr) isGatewayAddr(addr string) bool { + if _, ok := m.gwAddrl.Load(addr); ok { + return true + } + return false +} + +func (m *mirr) connectedMirrorAddrs() []string { + connectedAddrs := m.gateway.GRPCClient().ConnectedAddrs() + addrs := make([]string, 0, len(connectedAddrs)) + for _, addr := range connectedAddrs { + if !m.isSelfMirrorAddr(addr) && + !m.isGatewayAddr(addr) { + addrs = append(addrs, addr) + } + } + return addrs +} + +func (m *mirr) toMirrorTargets(addrs ...string) (*payload.Mirror_Targets, error) { + tgts := make([]*payload.Mirror_Target, 0, len(addrs)) + for _, addr := range addrs { + if ok := m.isGatewayAddr(addr); !ok { + host, port, err := net.SplitHostPort(addr) + if err != nil { + return nil, err + } + tgts = append(tgts, &payload.Mirror_Target{ + Ip: host, + Port: uint32(port), + }) + } + } + return &payload.Mirror_Targets{ + Targets: tgts, + }, nil +} diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go new file mode 100644 index 0000000000..e942322c7f --- /dev/null +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -0,0 +1,72 @@ +package service + +import ( + "time" + + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" +) + +type MirrorOption func(m *mirr) error + +var defaultMirrOpts = []MirrorOption{ + WithAdvertiseInterval("1s"), +} + +func WithErrorGroup(eg errgroup.Group) MirrorOption { + return func(m *mirr) error { + if eg != nil { + m.eg = eg + } + return nil + } +} + +func WithValdAddrs(addrs ...string) MirrorOption { + return func(m *mirr) error { + if len(addrs) == 0 { + return errors.NewErrCriticalOption("lbAddrs", addrs) + } + if m.gwAddrs == nil { + m.gwAddrs = make([]string, 0, len(addrs)) + } + m.gwAddrs = append(m.gwAddrs, addrs...) + return nil + } +} + +func WithSelfMirrorAddrs(addrs ...string) MirrorOption { + return func(m *mirr) error { + if len(addrs) == 0 { + return errors.NewErrCriticalOption("selfMirrorAddrs", addrs) + } + if m.selfMirrAddrs == nil { + m.selfMirrAddrs = make([]string, 0, len(addrs)) + } + m.selfMirrAddrs = append(m.selfMirrAddrs, addrs...) + return nil + } +} + +func WithGateway(g Gateway) MirrorOption { + return func(m *mirr) error { + if g != nil { + m.gateway = g + } + return nil + } +} + +func WithAdvertiseInterval(s string) MirrorOption { + return func(m *mirr) error { + if len(s) == 0 { + return errors.NewErrInvalidOption("advertiseInterval", s) + } + dur, err := time.ParseDuration(s) + if err != nil { + return errors.NewErrInvalidOption("advertiseInterval", s, err) + } + m.advertiseDur = dur + return nil + } +} diff --git a/pkg/gateway/mirror/service/option.go b/pkg/gateway/mirror/service/option.go new file mode 100644 index 0000000000..6ee360463d --- /dev/null +++ b/pkg/gateway/mirror/service/option.go @@ -0,0 +1,58 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package service represents gateway's service logic +package service + +import ( + "github.com/vdaas/vald/internal/client/v1/client/mirror" + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" +) + +type Option func(g *gateway) error + +var defaultGWOpts = []Option{ + WithErrGroup(errgroup.Get()), +} + +func WithMirrorClient(c mirror.Client) Option { + return func(g *gateway) error { + if c != nil { + g.client = c + } + return nil + } +} + +func WithErrGroup(eg errgroup.Group) Option { + return func(g *gateway) error { + if eg != nil { + g.eg = eg + } + return nil + } +} + +func WithPodName(s string) Option { + return func(g *gateway) error { + if len(s) == 0 { + return errors.NewErrCriticalOption("podName", s) + } + g.podName = s + return nil + } +} diff --git a/pkg/gateway/mirror/usecase/vald.go b/pkg/gateway/mirror/usecase/vald.go new file mode 100644 index 0000000000..bde3b59b3c --- /dev/null +++ b/pkg/gateway/mirror/usecase/vald.go @@ -0,0 +1,220 @@ +// +// Copyright (C) 2019-2022 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package usecase represents gateways usecase layer +package usecase + +import ( + "context" + + "github.com/vdaas/vald/apis/grpc/v1/vald" + mclient "github.com/vdaas/vald/internal/client/v1/client/mirror" + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/net/grpc" + "github.com/vdaas/vald/internal/observability" + backoffmetrics "github.com/vdaas/vald/internal/observability/metrics/backoff" + cbmetrics "github.com/vdaas/vald/internal/observability/metrics/circuitbreaker" + "github.com/vdaas/vald/internal/runner" + "github.com/vdaas/vald/internal/safety" + "github.com/vdaas/vald/internal/servers/server" + "github.com/vdaas/vald/internal/servers/starter" + "github.com/vdaas/vald/pkg/gateway/mirror/config" + handler "github.com/vdaas/vald/pkg/gateway/mirror/handler/grpc" + "github.com/vdaas/vald/pkg/gateway/mirror/handler/rest" + "github.com/vdaas/vald/pkg/gateway/mirror/router" + "github.com/vdaas/vald/pkg/gateway/mirror/service" +) + +type run struct { + eg errgroup.Group + cfg *config.Data + server starter.Server + c mclient.Client + gw service.Gateway + mgw service.Mirror + observability observability.Observability +} + +func New(cfg *config.Data) (r runner.Runner, err error) { + eg := errgroup.Get() + + cOpts, err := cfg.Mirror.Client.Opts() + if err != nil { + return nil, err + } + cOpts = append(cOpts, grpc.WithErrGroup(eg)) + + c, err := mclient.New( + mclient.WithAddrs(cfg.Mirror.Client.Addrs...), + mclient.WithClient(grpc.New(cOpts...)), + ) + if err != nil { + return nil, err + } + + gw, err := service.NewGateway( + service.WithErrGroup(eg), + service.WithMirrorClient(c), + service.WithPodName(cfg.Mirror.PodName), + ) + if err != nil { + return nil, err + } + mgw, err := service.NewMirror( + service.WithErrorGroup(eg), + service.WithAdvertiseInterval(cfg.Mirror.AdvertiseInterval), + service.WithValdAddrs(cfg.Mirror.GatewayAddr), + service.WithSelfMirrorAddrs(cfg.Mirror.SelfMirrorAddr), + service.WithGateway(gw), + ) + if err != nil { + return nil, err + } + + v, err := handler.New( + handler.WithValdAddr(cfg.Mirror.GatewayAddr), + handler.WithErrGroup(eg), + handler.WithGateway(gw), + handler.WithMirror(mgw), + handler.WithStreamConcurrency(cfg.Server.GetGRPCStreamConcurrency()), + ) + if err != nil { + return nil, err + } + + grpcServerOptions := []server.Option{ + server.WithGRPCRegistFunc(func(srv *grpc.Server) { + vald.RegisterValdServerWithMirror(srv, v) + }), + server.WithPreStopFunction(func() error { + return nil + }), + } + + var obs observability.Observability + if cfg.Observability.Enabled { + obs, err = observability.NewWithConfig( + cfg.Observability, + backoffmetrics.New(), + cbmetrics.New(), + ) + if err != nil { + return nil, err + } + } + + srv, err := starter.New( + starter.WithConfig(cfg.Server), + starter.WithREST(func(sc *config.Server) []server.Option { + return []server.Option{ + server.WithHTTPHandler( + router.New( + router.WithHandler( + rest.New( + rest.WithVald(v), + ), + ), + ), + ), + } + }), + starter.WithGRPC(func(sc *config.Server) []server.Option { + return grpcServerOptions + }), + ) + if err != nil { + return nil, err + } + + return &run{ + eg: eg, + cfg: cfg, + server: srv, + c: c, + gw: gw, + mgw: mgw, + observability: obs, + }, nil +} + +func (r *run) PreStart(ctx context.Context) error { + if r.observability != nil { + return r.observability.PreStart(ctx) + } + return nil +} + +func (r *run) Start(ctx context.Context) (<-chan error, error) { + ech := make(chan error, 6) + var mech, cech, sech, oech <-chan error + var err error + + sech = r.server.ListenAndServe(ctx) + if r.c != nil { + cech, err = r.c.Start(ctx) + if err != nil { + close(ech) + return nil, err + } + } + if r.mgw != nil { + mech, err = r.mgw.Start(ctx) + if err != nil { + close(ech) + return nil, err + } + } + if r.observability != nil { + oech = r.observability.Start(ctx) + } + + r.eg.Go(safety.RecoverFunc(func() (err error) { + defer close(ech) + for { + select { + case <-ctx.Done(): + return ctx.Err() + case err = <-mech: + case err = <-cech: + case err = <-sech: + case err = <-oech: + } + if err != nil { + select { + case <-ctx.Done(): + return ctx.Err() + case ech <- err: + } + } + } + })) + return ech, nil +} + +func (r *run) PreStop(ctx context.Context) error { + return nil +} + +func (r *run) Stop(ctx context.Context) error { + if r.observability != nil { + r.observability.Stop(ctx) + } + return r.server.Shutdown(ctx) +} + +func (*run) PostStop(_ context.Context) error { + return nil +} From b0aef5897bd19b6417e6df8e5fa79284f8b5bc47 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Thu, 18 May 2023 13:30:42 +0900 Subject: [PATCH 03/93] Rename ip to host of proto payload field for mirror gateway (#2031) * fix field name and yaml indent Signed-off-by: hlts2 * make proto/add format Signed-off-by: hlts2 --------- Signed-off-by: hlts2 --- .../workflows/dockers-gateway-mirror-image.yaml | 2 +- apis/grpc/v1/mirror/mirror.pb.go | 14 +++++++------- apis/grpc/v1/payload/payload_vtproto.pb.go | 14 +++++++------- apis/proto/v1/payload/payload.proto | 4 ++-- .../apis/proto/v1/mirror/mirror.swagger.json | 6 +++--- charts/vald/values/multi-vald/dev-vald-01.yaml | 15 +++++++++++++++ charts/vald/values/multi-vald/dev-vald-02.yaml | 15 +++++++++++++++ charts/vald/values/multi-vald/dev-vald-03.yaml | 15 +++++++++++++++ .../values/multi-vald/dev-vald-with-mirror.yaml | 15 +++++++++++++++ cmd/gateway/mirror/main.go | 8 ++------ cmd/gateway/mirror/sample.yaml | 4 ++-- dockers/gateway/mirror/Dockerfile | 3 +-- internal/client/v1/client/mirror/mirror.go | 13 +++++++++++++ internal/client/v1/client/mirror/option.go | 13 +++++++++++++ internal/config/mirror.go | 16 ++++++---------- pkg/gateway/mirror/config/config.go | 8 ++------ pkg/gateway/mirror/handler/doc.go | 7 ++----- pkg/gateway/mirror/handler/grpc/handler.go | 13 ++++++------- pkg/gateway/mirror/handler/grpc/handler_test.go | 13 +++++++++++++ pkg/gateway/mirror/handler/grpc/mock_test.go | 13 +++++++++++++ pkg/gateway/mirror/handler/grpc/option.go | 8 ++------ pkg/gateway/mirror/handler/rest/handler.go | 8 ++------ pkg/gateway/mirror/handler/rest/option.go | 8 ++------ pkg/gateway/mirror/router/option.go | 8 ++------ pkg/gateway/mirror/router/router.go | 8 ++------ pkg/gateway/mirror/service/doc.go | 8 ++------ pkg/gateway/mirror/service/gateway.go | 8 ++------ pkg/gateway/mirror/service/mirror.go | 8 ++------ pkg/gateway/mirror/service/mirror_option.go | 13 +++++++++++++ pkg/gateway/mirror/service/option.go | 8 ++------ pkg/gateway/mirror/usecase/vald.go | 8 ++------ 31 files changed, 186 insertions(+), 118 deletions(-) diff --git a/.github/workflows/dockers-gateway-mirror-image.yaml b/.github/workflows/dockers-gateway-mirror-image.yaml index 5c3fe5592e..b95c98b86b 100644 --- a/.github/workflows/dockers-gateway-mirror-image.yaml +++ b/.github/workflows/dockers-gateway-mirror-image.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2022 vdaas.org vald team +# Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index c5938c0f7f..001926e83c 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -16,8 +16,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc-gen-go v1.30.0 +// protoc v4.22.3 // source: apis/proto/v1/mirror/mirror.proto package mirror @@ -55,15 +55,15 @@ var file_apis_proto_v1_mirror_mirror_proto_rawDesc = []byte{ 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x73, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x6d, 0x69, 0x72, 0x72, - 0x6f, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x61, + 0x73, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x6d, + 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x61, 0x0a, 0x09, 0x41, 0x64, 0x76, 0x65, 0x72, 0x74, 0x69, 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x73, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x11, 0x2f, 0x6d, 0x69, - 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x61, 0x64, 0x76, 0x65, 0x72, 0x74, 0x69, 0x73, 0x65, 0x3a, 0x01, - 0x2a, 0x42, 0x57, 0x0a, 0x1c, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, + 0x65, 0x74, 0x73, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, + 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x61, 0x64, 0x76, 0x65, 0x72, 0x74, 0x69, 0x73, + 0x65, 0x42, 0x57, 0x0a, 0x1c, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x56, 0x61, 0x6c, 0x64, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x64, 0x61, 0x61, diff --git a/apis/grpc/v1/payload/payload_vtproto.pb.go b/apis/grpc/v1/payload/payload_vtproto.pb.go index 0213f1b387..d73a1c22c6 100644 --- a/apis/grpc/v1/payload/payload_vtproto.pb.go +++ b/apis/grpc/v1/payload/payload_vtproto.pb.go @@ -7711,10 +7711,10 @@ func (m *Mirror_Target) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if len(m.Ip) > 0 { - i -= len(m.Ip) - copy(dAtA[i:], m.Ip) - i = encodeVarint(dAtA, i, uint64(len(m.Ip))) + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarint(dAtA, i, uint64(len(m.Host))) i-- dAtA[i] = 0xa } @@ -9269,7 +9269,7 @@ func (m *Mirror_Target) SizeVT() (n int) { } var l int _ = l - l = len(m.Ip) + l = len(m.Host) if l > 0 { n += 1 + l + sov(uint64(l)) } @@ -17130,7 +17130,7 @@ func (m *Mirror_Target) UnmarshalVT(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17158,7 +17158,7 @@ func (m *Mirror_Target) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ip = string(dAtA[iNdEx:postIndex]) + m.Host = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { diff --git a/apis/proto/v1/payload/payload.proto b/apis/proto/v1/payload/payload.proto index 81b1bf944c..d6f2466d0f 100644 --- a/apis/proto/v1/payload/payload.proto +++ b/apis/proto/v1/payload/payload.proto @@ -587,8 +587,8 @@ message Mirror { // Represent server information. message Target { - // The target ip. - string ip = 1; + // The target hostname. + string host = 1; // The target port. uint32 port = 2; } diff --git a/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json index ba39fe8420..55c719d71e 100644 --- a/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json +++ b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json @@ -97,7 +97,7 @@ "description": "Must be a valid serialized protocol buffer of the above specified type." } }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "runtimeError": { "type": "object", @@ -123,9 +123,9 @@ "v1MirrorTarget": { "type": "object", "properties": { - "ip": { + "host": { "type": "string", - "description": "The target ip." + "description": "The target hostname." }, "port": { "type": "integer", diff --git a/charts/vald/values/multi-vald/dev-vald-01.yaml b/charts/vald/values/multi-vald/dev-vald-01.yaml index 0849bb2433..467d488e03 100644 --- a/charts/vald/values/multi-vald/dev-vald-01.yaml +++ b/charts/vald/values/multi-vald/dev-vald-01.yaml @@ -1,3 +1,18 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# discoverer: clusterRoleBinding: name: vald-01 diff --git a/charts/vald/values/multi-vald/dev-vald-02.yaml b/charts/vald/values/multi-vald/dev-vald-02.yaml index 7e60a18b34..7b4f21c1b7 100644 --- a/charts/vald/values/multi-vald/dev-vald-02.yaml +++ b/charts/vald/values/multi-vald/dev-vald-02.yaml @@ -1,3 +1,18 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# discoverer: clusterRole: enabled: false diff --git a/charts/vald/values/multi-vald/dev-vald-03.yaml b/charts/vald/values/multi-vald/dev-vald-03.yaml index 27a37502bb..1783b246a6 100644 --- a/charts/vald/values/multi-vald/dev-vald-03.yaml +++ b/charts/vald/values/multi-vald/dev-vald-03.yaml @@ -1,3 +1,18 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# gateway: mirror: gateway_config: diff --git a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml index 7c243cffde..257aa42486 100644 --- a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml +++ b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml @@ -1,3 +1,18 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# defaults: image: tag: pr-1949 # TODO: Delete it later. diff --git a/cmd/gateway/mirror/main.go b/cmd/gateway/mirror/main.go index 9f595fdc81..8eb77f8ebd 100644 --- a/cmd/gateway/mirror/main.go +++ b/cmd/gateway/mirror/main.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package main provides program main package main import ( diff --git a/cmd/gateway/mirror/sample.yaml b/cmd/gateway/mirror/sample.yaml index ffcd6c861d..d9d32c8a59 100644 --- a/cmd/gateway/mirror/sample.yaml +++ b/cmd/gateway/mirror/sample.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2022 vdaas.org vald team +# Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -143,6 +143,6 @@ gateway: write_buffer_size: 0 tls: enabled: false - ca: /path/to/ca + ca: /path/to/ca cert: /path/to/cert key: /path/to/key diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index e21ac01dbf..4407751816 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2022 vdaas.org vald team +# Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - ARG GO_VERSION=latest ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot diff --git a/internal/client/v1/client/mirror/mirror.go b/internal/client/v1/client/mirror/mirror.go index 30c6b25425..4c100024fb 100644 --- a/internal/client/v1/client/mirror/mirror.go +++ b/internal/client/v1/client/mirror/mirror.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package mirror import ( diff --git a/internal/client/v1/client/mirror/option.go b/internal/client/v1/client/mirror/option.go index 894e76216b..fb8deb2ccf 100644 --- a/internal/client/v1/client/mirror/option.go +++ b/internal/client/v1/client/mirror/option.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package mirror import ( diff --git a/internal/config/mirror.go b/internal/config/mirror.go index 43db1ab4ab..345acfa4bc 100644 --- a/internal/config/mirror.go +++ b/internal/config/mirror.go @@ -1,32 +1,28 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package config providers configuration type and load configuration logic package config // Mirror represents the Mirror Gateway configuration. type Mirror struct { // Client represents the gRPC client configuration for connecting the LB Gateway. - Client *GRPCClient `json:"client" yaml:"client"` + Client *GRPCClient `json:"client" yaml:"client"` // SelfMirrorAddr represents the address for the self Mirror Gateway. - SelfMirrorAddr string `json:"self_mirror_addr" yaml:"self_mirror_addr"` + SelfMirrorAddr string `json:"self_mirror_addr" yaml:"self_mirror_addr"` // GatewayAddr represents the address for the Vald Gateway (e.g lb-gateway). - GatewayAddr string `json:"gateway_addr" yaml:"gateway_addr"` + GatewayAddr string `json:"gateway_addr" yaml:"gateway_addr"` // PodName represents self Mirror Gateway Pod name. - PodName string `json:"pod_name" yaml:"pod_name"` + PodName string `json:"pod_name" yaml:"pod_name"` // AdvertiseInterval represents interval to advertise Mirror Gateway information to other mirror gateway. AdvertiseInterval string `json:"advertise_interval" yaml:"advertise_interval"` } diff --git a/pkg/gateway/mirror/config/config.go b/pkg/gateway/mirror/config/config.go index fec0bf3618..d70f98ba2b 100644 --- a/pkg/gateway/mirror/config/config.go +++ b/pkg/gateway/mirror/config/config.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package setting stores all server application settings package config import ( diff --git a/pkg/gateway/mirror/handler/doc.go b/pkg/gateway/mirror/handler/doc.go index f1014141ea..fc21413970 100644 --- a/pkg/gateway/mirror/handler/doc.go +++ b/pkg/gateway/mirror/handler/doc.go @@ -1,17 +1,14 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - package handler diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 7b65ce351c..40ca2e49e1 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package grpc provides grpc server logic package grpc import ( @@ -794,7 +790,10 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer) } func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByIDServer) (err error) { - ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamLinearSearchByIDRPCName), apiName+"/"+vald.StreamLinearSearchByIDRPCName) + ctx, span := trace.StartSpan( + grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamLinearSearchByIDRPCName), + apiName+"/"+vald.StreamLinearSearchByIDRPCName, + ) defer func() { if span != nil { span.End() diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index 6127d02463..f49ea0da94 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package grpc import ( diff --git a/pkg/gateway/mirror/handler/grpc/mock_test.go b/pkg/gateway/mirror/handler/grpc/mock_test.go index f62078105a..74175c0f3a 100644 --- a/pkg/gateway/mirror/handler/grpc/mock_test.go +++ b/pkg/gateway/mirror/handler/grpc/mock_test.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package grpc import ( diff --git a/pkg/gateway/mirror/handler/grpc/option.go b/pkg/gateway/mirror/handler/grpc/option.go index 09f0996e17..465aacffce 100644 --- a/pkg/gateway/mirror/handler/grpc/option.go +++ b/pkg/gateway/mirror/handler/grpc/option.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package grpc provides grpc server logic package grpc import ( diff --git a/pkg/gateway/mirror/handler/rest/handler.go b/pkg/gateway/mirror/handler/rest/handler.go index 55a856e928..e5cb5fe064 100644 --- a/pkg/gateway/mirror/handler/rest/handler.go +++ b/pkg/gateway/mirror/handler/rest/handler.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package rest provides rest api logic package rest import ( diff --git a/pkg/gateway/mirror/handler/rest/option.go b/pkg/gateway/mirror/handler/rest/option.go index 109a418fe3..7ff96a2433 100644 --- a/pkg/gateway/mirror/handler/rest/option.go +++ b/pkg/gateway/mirror/handler/rest/option.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package rest provides rest api logic package rest import ( diff --git a/pkg/gateway/mirror/router/option.go b/pkg/gateway/mirror/router/option.go index d27a01fa5a..d9f6d4d1f0 100644 --- a/pkg/gateway/mirror/router/option.go +++ b/pkg/gateway/mirror/router/option.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package router provides implementation of Go API for routing http Handler wrapped by rest.Func package router import ( diff --git a/pkg/gateway/mirror/router/router.go b/pkg/gateway/mirror/router/router.go index b2b0d06a24..73e330dcdb 100644 --- a/pkg/gateway/mirror/router/router.go +++ b/pkg/gateway/mirror/router/router.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package router provides implementation of Go API for routing http Handler wrapped by rest.Func package router import ( diff --git a/pkg/gateway/mirror/service/doc.go b/pkg/gateway/mirror/service/doc.go index 266389f73d..41c6b0a25b 100644 --- a/pkg/gateway/mirror/service/doc.go +++ b/pkg/gateway/mirror/service/doc.go @@ -1,18 +1,14 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package service manages the main logic of server. package service diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index 40690d4dc0..7725d0bb07 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package service package service import ( diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index 31d68340e8..ea63b9d198 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package service package service import ( diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go index e942322c7f..e3c02d7be3 100644 --- a/pkg/gateway/mirror/service/mirror_option.go +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package service import ( diff --git a/pkg/gateway/mirror/service/option.go b/pkg/gateway/mirror/service/option.go index 6ee360463d..c16a5f95b5 100644 --- a/pkg/gateway/mirror/service/option.go +++ b/pkg/gateway/mirror/service/option.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package service represents gateway's service logic package service import ( diff --git a/pkg/gateway/mirror/usecase/vald.go b/pkg/gateway/mirror/usecase/vald.go index bde3b59b3c..13a0a74c2d 100644 --- a/pkg/gateway/mirror/usecase/vald.go +++ b/pkg/gateway/mirror/usecase/vald.go @@ -1,20 +1,16 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team +// Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -// Package usecase represents gateways usecase layer package usecase import ( From c3f987aaab4da790a189b4e1cea55c5af7f3e173 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Fri, 16 Jun 2023 17:38:13 +0900 Subject: [PATCH 04/93] make proto/add & make format Signed-off-by: hlts2 --- apis/grpc/v1/mirror/mirror.pb.go | 2 +- apis/grpc/v1/payload/payload_vtproto.pb.go | 129 ++++++++++++++++++ .../apis/proto/v1/mirror/mirror.swagger.json | 2 +- 3 files changed, 131 insertions(+), 2 deletions(-) diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index 001926e83c..a8f248d289 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v4.22.3 +// protoc v4.23.3 // source: apis/proto/v1/mirror/mirror.proto package mirror diff --git a/apis/grpc/v1/payload/payload_vtproto.pb.go b/apis/grpc/v1/payload/payload_vtproto.pb.go index d73a1c22c6..66954b62b8 100644 --- a/apis/grpc/v1/payload/payload_vtproto.pb.go +++ b/apis/grpc/v1/payload/payload_vtproto.pb.go @@ -1676,6 +1676,64 @@ func (m *Info) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *Mirror_Target) CloneVT() *Mirror_Target { + if m == nil { + return (*Mirror_Target)(nil) + } + r := &Mirror_Target{ + Host: m.Host, + Port: m.Port, + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Mirror_Target) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Mirror_Targets) CloneVT() *Mirror_Targets { + if m == nil { + return (*Mirror_Targets)(nil) + } + r := &Mirror_Targets{} + if rhs := m.Targets; rhs != nil { + tmpContainer := make([]*Mirror_Target, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Targets = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Mirror_Targets) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Mirror) CloneVT() *Mirror { + if m == nil { + return (*Mirror)(nil) + } + r := &Mirror{} + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Mirror) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *Empty) CloneVT() *Empty { if m == nil { return (*Empty)(nil) @@ -3889,6 +3947,77 @@ func (this *Info) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *Mirror_Target) EqualVT(that *Mirror_Target) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Host != that.Host { + return false + } + if this.Port != that.Port { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Mirror_Target) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Mirror_Target) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Mirror_Targets) EqualVT(that *Mirror_Targets) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Targets) != len(that.Targets) { + return false + } + for i, vx := range this.Targets { + vy := that.Targets[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Mirror_Target{} + } + if q == nil { + q = &Mirror_Target{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Mirror_Targets) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Mirror_Targets) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Mirror) EqualVT(that *Mirror) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Mirror) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Mirror) + if !ok { + return false + } + return this.EqualVT(that) +} func (this *Empty) EqualVT(that *Empty) bool { if this == that { return true diff --git a/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json index 55c719d71e..7af975f3ad 100644 --- a/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json +++ b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json @@ -97,7 +97,7 @@ "description": "Must be a valid serialized protocol buffer of the above specified type." } }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "runtimeError": { "type": "object", From 634773629f35478d5c83c17cae4e89d87dda447b Mon Sep 17 00:00:00 2001 From: hlts2 Date: Mon, 19 Jun 2023 11:40:31 +0900 Subject: [PATCH 05/93] fix docker build for mirror Signed-off-by: hlts2 --- dockers/gateway/mirror/Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index 4407751816..a2ca60d78e 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -18,10 +18,17 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM golang:${GO_VERSION} AS builder +FROM golang:${GO_VERSION} AS golang + +FROM ubuntu:devel AS builder ENV GO111MODULE on +ENV DEBIAN_FRONTEND noninteractive +ENV INITRD No ENV LANG en_US.UTF-8 +ENV GOROOT /opt/go +ENV GOPATH /go +ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin ENV ORG vdaas ENV REPO vald ENV PKG gateway/mirror @@ -34,6 +41,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +COPY --from=golang /usr/local/go $GOROOT RUN mkdir -p "$GOPATH/src" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} From 2c0d1467879d5c80ff1a5ead60c1762a58ca5093 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Mon, 19 Jun 2023 11:50:18 +0900 Subject: [PATCH 06/93] Revert "fix docker build for mirror" This reverts commit 53ab94ff7d1a348d870ea624d9a334683333d5f2. --- dockers/gateway/mirror/Dockerfile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index a2ca60d78e..4407751816 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -18,17 +18,10 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM golang:${GO_VERSION} AS golang - -FROM ubuntu:devel AS builder +FROM golang:${GO_VERSION} AS builder ENV GO111MODULE on -ENV DEBIAN_FRONTEND noninteractive -ENV INITRD No ENV LANG en_US.UTF-8 -ENV GOROOT /opt/go -ENV GOPATH /go -ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin ENV ORG vdaas ENV REPO vald ENV PKG gateway/mirror @@ -41,7 +34,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -COPY --from=golang /usr/local/go $GOROOT RUN mkdir -p "$GOPATH/src" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} From e90500811e7752ceeb979d22e9bbbb0805b9cf48 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Mon, 19 Jun 2023 11:50:51 +0900 Subject: [PATCH 07/93] fix docker build error for mirror gateway Signed-off-by: hlts2 --- dockers/gateway/mirror/Dockerfile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index 4407751816..729406bf49 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -18,10 +18,17 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM golang:${GO_VERSION} AS builder +FROM golang:${GO_VERSION} AS golang + +FROM ubuntu:devel AS builder ENV GO111MODULE on +ENV DEBIAN_FRONTEND noninteractive +ENV INITRD No ENV LANG en_US.UTF-8 +ENV GOROOT /opt/go +ENV GOPATH /go +ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin ENV ORG vdaas ENV REPO vald ENV PKG gateway/mirror @@ -29,11 +36,15 @@ ENV APP_NAME mirror # skipcq: DOK-DL3008 RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + build-essential \ + curl \ upx \ git \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +COPY --from=golang /usr/local/go $GOROOT RUN mkdir -p "$GOPATH/src" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} From 48ad7600824f5dd4fae903cd1bb4a1b888909f95 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Tue, 4 Jul 2023 10:18:47 +0900 Subject: [PATCH 08/93] Add Custom Resource for mirror target (#2023) * add mirror definition and update proto dependencies Signed-off-by: hlts2 * Add mirror gateway component (#1949) * add mirror component Signed-off-by: hlts2 * fix mirror dockerfile path Signed-off-by: hlts2 * fix deepsource warning Signed-off-by: hlts2 * fix insert rpc handler Signed-off-by: hlts2 * deleted unused file Signed-off-by: hlts2 * fix api resource name Signed-off-by: hlts2 * add mirror service and fix handler logic Signed-off-by: hlts2 * fix values and helm template for new configuration Signed-off-by: hlts2 * Format code with gofumpt and prettier * fix template rendering bug of mirror configmap Signed-off-by: hlts2 * fix nil pointer error Signed-off-by: hlts2 * bugfix to advertize different address Signed-off-by: hlts2 * returns error when there is no other mirror gateways Signed-off-by: hlts2 * add info log Signed-off-by: hlts2 * extract only mirror addresses Signed-off-by: hlts2 * fix log variable Signed-off-by: hlts2 * add logging Signed-off-by: hlts2 * bugfix mirror connection logic Signed-off-by: hlts2 * add remove api proxy implementation Signed-off-by: hlts2 * add error handling for register API Signed-off-by: hlts2 * fix debug message Signed-off-by: hlts2 * refactor discover logic Signed-off-by: hlts2 * refactor Signed-off-by: hlts2 * add remove api Signed-off-by: hlts2 * Format code with prettier and gofumpt * add remove api and remove api rollback logic Signed-off-by: hlts2 * refactor Signed-off-by: hlts2 * add update rpc handler Signed-off-by: hlts2 * refactor context variable for grpc method Signed-off-by: hlts2 * fix trace span name Signed-off-by: hlts2 * add getObjects method Signed-off-by: hlts2 * refactor update and remove handler Signed-off-by: hlts2 * Apply suggestions from code review Co-authored-by: Kiichiro YUKAWA * add multi handler implementation Signed-off-by: hlts2 * fix mirror client trace span Signed-off-by: hlts2 * rename discover service to mirror service Signed-off-by: hlts2 * fix build error of bidirectional stream Signed-off-by: hlts2 * add more error handling to search handler Signed-off-by: hlts2 * add debug comment Signed-off-by: hlts2 * add status code log Signed-off-by: hlts2 * add status code log Signed-off-by: hlts2 * add status code log Signed-off-by: hlts2 * fix named return bug Signed-off-by: hlts2 * add debug log Signed-off-by: hlts2 * add debug command Signed-off-by: hlts2 * add debug command Signed-off-by: hlts2 * add debug command Signed-off-by: hlts2 * add force status wrap Signed-off-by: hlts2 * execute upsert method to local cluster's lb Signed-off-by: hlts2 * add target debug log Signed-off-by: hlts2 * fix delete unwrap of circuitbreaker Signed-off-by: hlts2 * refactor error handling for new status parse function Signed-off-by: hlts2 * Format code with prettier and gofumpt * refactor error handling Signed-off-by: hlts2 * style: Format code with prettier and gofumpt * fix error handling for broadcast operation of getobject Signed-off-by: hlts2 * fix error join bug of getobject Signed-off-by: hlts2 * refactor Signed-off-by: hlts2 * deleted unused code Signed-off-by: hlts2 * fix status handling and add address to resource name Signed-off-by: hlts2 * use vald client for update operation Signed-off-by: hlts2 * add rollback test for mirror crud Signed-off-by: hlts2 * style: Format code with prettier and gofumpt * fix variable name Signed-off-by: hlts2 * refactor mirror servie Signed-off-by: hlts2 * deleted unused code Signed-off-by: hlts2 * fix trace attribute and refactor variable name Signed-off-by: hlts2 * add error handling when crud rpc fails Signed-off-by: hlts2 * deleted unused value Signed-off-by: hlts2 * make format Signed-off-by: hlts2 * Revert "make format" This reverts commit f605563f0898987a59f79abc53fb186d560ad0b0. * Apply suggestions from code review Co-authored-by: Kiichiro YUKAWA * apply suggestion Signed-off-by: hlts2 * bugfix and refactor mirror client Signed-off-by: hlts2 --------- Signed-off-by: hlts2 Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> Co-authored-by: Kiichiro YUKAWA * add discovery logic for other mirror target Signed-off-by: hlts2 * add k8s template file Signed-off-by: hlts2 * add crd for mirror target resource Signed-off-by: hlts2 * add new values for mirror discovery logic Signed-off-by: hlts2 * style: Format code with gofumpt and prettier * fix schema register error and fix manifest to multi vald cluster Signed-off-by: hlts2 * style: Format code with gofumpt and prettier * bugfix: adapt the service account and add early return Signed-off-by: hlts2 * bugfix: usage of errors join Signed-off-by: hlts2 * bugfix: type conversion bug Signed-off-by: hlts2 * fix metadata hash logic and add mirror group function Signed-off-by: hlts2 * add status handling for network connection Signed-off-by: hlts2 * refactoring Signed-off-by: hlts2 * bugfix: status update handling Signed-off-by: hlts2 * bugfix: update status using status writer Signed-off-by: hlts2 * add status timestamp Signed-off-by: hlts2 * fix yaml field format Signed-off-by: hlts2 * improve status changes handling Signed-off-by: hlts2 * reduced number of status updates Signed-off-by: hlts2 * added status check handling before changing status Signed-off-by: hlts2 * update vald mirror target definition and add new cluster role Signed-off-by: hlts2 * style: Format code with gofumpt and prettier * deploy multiple vald clusters and mirror target resource to connect with each other Signed-off-by: hlts2 * fix e2d test to mirror-gateway and crd view field Signed-off-by: hlts2 * define mirror app name Signed-off-by: hlts2 * deleted unused code Signed-off-by: hlts2 * fix golangci warning Signed-off-by: hlts2 * crd generate command for mirror target using mirror-target-values Signed-off-by: hlts2 * add string field validation Signed-off-by: hlts2 * fix build error Signed-off-by: hlts2 * add configuration comment Signed-off-by: hlts2 * style: Format code with gofumpt and prettier * add image tag for debug Signed-off-by: hlts2 * fix rebase error Signed-off-by: hlts2 * fix wait timeout option Signed-off-by: hlts2 * add new option to set mirror address Signed-off-by: hlts2 * add new comment Signed-off-by: hlts2 * bugfix for ingress configuration Signed-off-by: hlts2 * not create lb ingress when mirror is enabled Signed-off-by: hlts2 * not create filter ingress when mirror is enabled Signed-off-by: hlts2 * add error handling for unimplemented codes error Signed-off-by: hlts2 * bugfix register addr process Signed-off-by: hlts2 * fix build error Signed-off-by: hlts2 * Revert "update docker file for build error" This reverts commit f40986df7d4ffc5eab4c9b324fdf63c0a24cd6e4. * add new package for docker build error Signed-off-by: hlts2 * Add mirror gateway example (#2082) * add example code Signed-off-by: hlts2 * execute search and getobject request to all vald clusters Signed-off-by: hlts2 * fixed to send data to each cluster based on the dataset Signed-off-by: hlts2 --------- Signed-off-by: hlts2 * add mirror target metrics Signed-off-by: hlts2 * fix example ngt dimension Signed-off-by: hlts2 * make proto/all & make format Signed-off-by: hlts2 --------- Signed-off-by: hlts2 Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> Co-authored-by: Kiichiro YUKAWA --- Makefile | 2 +- Makefile.d/helm.mk | 11 + Makefile.d/k8s.mk | 6 + apis/proto/v1/mirror/mirror.proto | 12 +- apis/proto/v1/payload/payload.proto | 1 - charts/vald/crds/valdmirrortarget.yaml | 101 ++++++ charts/vald/schemas/mirror-target-values.yaml | 25 ++ charts/vald/templates/gateway/filter/ing.yaml | 2 + charts/vald/templates/gateway/lb/ing.yaml | 2 + .../templates/gateway/mirror/clusterrole.yaml | 58 +++ .../gateway/mirror/clusterrolebinding.yaml | 37 ++ .../templates/gateway/mirror/configmap.yaml | 10 +- .../templates/gateway/mirror/daemonset.yaml | 1 + .../templates/gateway/mirror/deployment.yaml | 1 + .../gateway/mirror/serviceaccount.yaml | 29 ++ charts/vald/values.yaml | 83 +++++ .../vald/values/multi-vald/dev-vald-01.yaml | 14 + .../vald/values/multi-vald/dev-vald-02.yaml | 16 + .../vald/values/multi-vald/dev-vald-03.yaml | 24 +- .../multi-vald/dev-vald-with-mirror.yaml | 11 +- .../vald/values/multi-vald/mirror-target.yaml | 35 ++ example/client/mirror/main.go | 246 +++++++++++++ internal/config/mirror.go | 26 +- internal/k8s/reconciler.go | 32 ++ .../k8s/vald/mirror/api/v1/target_types.go | 181 ++++++++++ internal/k8s/vald/mirror/target/option.go | 93 +++++ internal/k8s/vald/mirror/target/target.go | 142 ++++++++ .../k8s/vald/mirror/target/target_template.go | 37 ++ .../mirror/target/target_template_option.go | 90 +++++ .../metrics/gateway/mirror/mirror.go | 77 ++++ pkg/gateway/mirror/handler/grpc/handler.go | 7 - pkg/gateway/mirror/service/discovery.go | 337 ++++++++++++++++++ .../mirror/service/discovery_option.go | 120 +++++++ pkg/gateway/mirror/service/gateway.go | 4 +- pkg/gateway/mirror/service/mirror.go | 178 ++++++--- pkg/gateway/mirror/service/mirror_option.go | 10 +- pkg/gateway/mirror/usecase/vald.go | 53 ++- 37 files changed, 2010 insertions(+), 104 deletions(-) create mode 100644 charts/vald/crds/valdmirrortarget.yaml create mode 100644 charts/vald/schemas/mirror-target-values.yaml create mode 100644 charts/vald/templates/gateway/mirror/clusterrole.yaml create mode 100644 charts/vald/templates/gateway/mirror/clusterrolebinding.yaml create mode 100644 charts/vald/templates/gateway/mirror/serviceaccount.yaml create mode 100644 charts/vald/values/multi-vald/mirror-target.yaml create mode 100644 example/client/mirror/main.go create mode 100644 internal/k8s/vald/mirror/api/v1/target_types.go create mode 100644 internal/k8s/vald/mirror/target/option.go create mode 100644 internal/k8s/vald/mirror/target/target.go create mode 100644 internal/k8s/vald/mirror/target/target_template.go create mode 100644 internal/k8s/vald/mirror/target/target_template_option.go create mode 100644 internal/observability/metrics/gateway/mirror/mirror.go create mode 100644 pkg/gateway/mirror/service/discovery.go create mode 100644 pkg/gateway/mirror/service/discovery_option.go diff --git a/Makefile b/Makefile index 95455a328a..b0b445e26f 100644 --- a/Makefile +++ b/Makefile @@ -294,7 +294,7 @@ E2E_UPSERT_COUNT ?= 10 E2E_REMOVE_COUNT ?= 3 E2E_WAIT_FOR_CREATE_INDEX_DURATION ?= 8m E2E_TARGET_NAME ?= vald-lb-gateway -E2E_TARGET_POD_NAME ?= $(eval E2E_TARGET_POD_NAME := $(shell kubectl get pods --selector=app=$(E2E_TARGET_NAME) | tail -1 | cut -f1 -d " "))$(E2E_TARGET_POD_NAME) +E2E_TARGET_POD_NAME ?= $(eval E2E_TARGET_POD_NAME := $(shell kubectl get pods --selector=app=$(E2E_TARGET_NAME) -n $(E2E_TARGET_NAMESPACE) | tail -1 | cut -f1 -d " "))$(E2E_TARGET_POD_NAME) E2E_TARGET_NAMESPACE ?= default E2E_TARGET_PORT ?= 8081 E2E_PORTFORWARD_ENABLED ?= true diff --git a/Makefile.d/helm.mk b/Makefile.d/helm.mk index 663a71ed54..2137a41de6 100644 --- a/Makefile.d/helm.mk +++ b/Makefile.d/helm.mk @@ -121,3 +121,14 @@ helm/schema/crd/vald-helm-operator: \ charts/vald-helm-operator/values.yaml > $(TEMP_DIR)/valdhelmoperatorrelease-spec.yaml $(BINDIR)/yq eval-all 'select(fileIndex==0).spec.versions[0].schema.openAPIV3Schema.properties.spec = select(fileIndex==1).spec | select(fileIndex==0)' \ $(TEMP_DIR)/valdhelmoperatorrelease.yaml $(TEMP_DIR)/valdhelmoperatorrelease-spec.yaml > charts/vald-helm-operator/crds/valdhelmoperatorrelease.yaml + +.PHONY: helm/schema/crd/vald/mirror-target +## generate OpenAPI v3 schema for ValdMirrorTarget +helm/schema/crd/vald/mirror-target: \ + yq/install + mv charts/vald/crds/valdmirrortarget.yaml $(TEMP_DIR)/valdmirrortarget.yaml + GOPRIVATE=$(GOPRIVATE) \ + go run -mod=readonly hack/helm/schema/crd/main.go \ + charts/vald/schemas/mirror-target-values.yaml > $(TEMP_DIR)/valdmirrortarget-spec.yaml + $(BINDIR)/yq eval-all 'select(fileIndex==0).spec.versions[0].schema.openAPIV3Schema.properties.spec = select(fileIndex==1).spec | select(fileIndex==0)' \ + $(TEMP_DIR)/valdmirrortarget.yaml $(TEMP_DIR)/valdmirrortarget-spec.yaml > charts/vald/crds/valdmirrortarget.yaml diff --git a/Makefile.d/k8s.mk b/Makefile.d/k8s.mk index 40b6749c89..e4b42c75ff 100644 --- a/Makefile.d/k8s.mk +++ b/Makefile.d/k8s.mk @@ -18,6 +18,7 @@ JAEGER_OPERATOR_WAIT_DURATION := 0 MIRROR01_NAMESPACE = vald-01 MIRROR02_NAMESPACE = vald-02 MIRROR03_NAMESPACE = vald-03 +MIRROR_APP_NAME = vald-mirror-gateway .PHONY: k8s/manifest/clean ## clean k8s manifests @@ -124,6 +125,11 @@ k8s/multi/vald/deploy: -f ./charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ -f ./charts/vald/values/multi-vald/dev-vald-03.yaml \ -n $(MIRROR03_NAMESPACE) + kubectl wait --for=condition=ready pod -l app=$(MIRROR_APP_NAME) --timeout=120s -n $(MIRROR01_NAMESPACE) + kubectl wait --for=condition=ready pod -l app=$(MIRROR_APP_NAME) --timeout=120s -n $(MIRROR02_NAMESPACE) + kubectl wait --for=condition=ready pod -l app=$(MIRROR_APP_NAME) --timeout=120s -n $(MIRROR03_NAMESPACE) + kubectl apply -f ./charts/vald/values/multi-vald/mirror-target.yaml \ + -n $(MIRROR03_NAMESPACE) .PHONY: k8s/multi/vald/delete ## delete multiple vald sample clusters to k8s diff --git a/apis/proto/v1/mirror/mirror.proto b/apis/proto/v1/mirror/mirror.proto index d61f8ac692..cbebfbf352 100644 --- a/apis/proto/v1/mirror/mirror.proto +++ b/apis/proto/v1/mirror/mirror.proto @@ -22,26 +22,24 @@ import "github.com/googleapis/googleapis/google/api/annotations.proto"; option go_package = "github.com/vdaas/vald/apis/grpc/v1/mirror"; option java_multiple_files = true; -option java_package = "org.vdaas.vald.api.v1.mirror"; option java_outer_classname = "ValdMirror"; - +option java_package = "org.vdaas.vald.api.v1.mirror"; // Represent the mirror service. service Mirror { - // Register is the RPC to register other mirror servers. rpc Register(payload.v1.Mirror.Targets) returns (payload.v1.Mirror.Targets) { option (google.api.http) = { - post : "/mirror/register" - body : "*" + post: "/mirror/register" + body: "*" }; } // Advertise is the RPC to advertise other mirror servers. rpc Advertise(payload.v1.Mirror.Targets) returns (payload.v1.Mirror.Targets) { option (google.api.http) = { - post : "/mirror/advertise" - body : "*" + post: "/mirror/advertise" + body: "*" }; } } diff --git a/apis/proto/v1/payload/payload.proto b/apis/proto/v1/payload/payload.proto index d6f2466d0f..c568471c76 100644 --- a/apis/proto/v1/payload/payload.proto +++ b/apis/proto/v1/payload/payload.proto @@ -584,7 +584,6 @@ message Info { // Mirror related messages. message Mirror { - // Represent server information. message Target { // The target hostname. diff --git a/charts/vald/crds/valdmirrortarget.yaml b/charts/vald/crds/valdmirrortarget.yaml new file mode 100644 index 0000000000..a32a7731a7 --- /dev/null +++ b/charts/vald/crds/valdmirrortarget.yaml @@ -0,0 +1,101 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: valdmirrortargets.vald.vdaas.org +spec: + group: vald.vdaas.org + names: + kind: ValdMirrorTarget + shortNames: + - vmt + - vmts + listKind: ValdMirrorTargetList + plural: valdmirrortargets + singular: valdmirrortarget + scope: Namespaced + versions: + - name: v1 + served: true + storage: true + subresources: + status: {} + additionalPrinterColumns: + - name: Host + type: string + jsonPath: .spec.target.host + priority: 1 + - name: Port + type: integer + jsonPath: .spec.target.port + priority: 1 + - name: Status + type: string + jsonPath: .status.phase + - name: "Last Transition Time" + type: string + jsonPath: .status.lastTransitionTime + - name: Age + type: date + jsonPath: .metadata.creationTimestamp + schema: + openAPIV3Schema: + description: ValdMirrorTarget is the Schema for the valdmirrortargets API + type: object + properties: + apiVersion: + description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + metadata: + type: object + status: + description: ValdMirrorTargetStatus defines the observed state of ValdMirrorTarget + type: object + default: {} + properties: + phase: + type: string + enum: + - Pending + - Connected + - Disconnected + - Unknown + default: Pending + lastTransitionTime: + type: string + spec: + type: object + properties: + colocation: + type: string + minLength: 1 + target: + type: object + properties: + host: + type: string + minLength: 1 + port: + type: integer + maximum: 65535 + minimum: 0 + required: + - host + - port diff --git a/charts/vald/schemas/mirror-target-values.yaml b/charts/vald/schemas/mirror-target-values.yaml new file mode 100644 index 0000000000..c47d200d39 --- /dev/null +++ b/charts/vald/schemas/mirror-target-values.yaml @@ -0,0 +1,25 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +colocation: dc1 +# @schema {"name": "target", "type": "object", "required": ["host", "port"]} +# target -- Mirror target information +target: + # @schema {"name": "target.host", "type": "string", "minLength": 1} + # host -- Mirror target host name + host: "vald-mirror-gateway.vald.svc.cluster.local" + # @schema {"name": "target.port", "type": "integer", "minimum": 0, "maximum": 65535} + # target.port -- Mirror target port + port: 8081 diff --git a/charts/vald/templates/gateway/filter/ing.yaml b/charts/vald/templates/gateway/filter/ing.yaml index a1f4ada5bc..f540bc50bd 100644 --- a/charts/vald/templates/gateway/filter/ing.yaml +++ b/charts/vald/templates/gateway/filter/ing.yaml @@ -16,6 +16,8 @@ {{- $gateway := .Values.gateway.filter -}} {{- if and $gateway.enabled $gateway.ingress.enabled }} {{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} +{{- $mgateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled $gateway.ingress.enabled (not $mgateway.enabled) }} apiVersion: networking.k8s.io/v1 {{- else }} apiVersion: networking.k8s.io/v1alpha1 diff --git a/charts/vald/templates/gateway/lb/ing.yaml b/charts/vald/templates/gateway/lb/ing.yaml index b8cf2f79a1..6f213f1cb9 100644 --- a/charts/vald/templates/gateway/lb/ing.yaml +++ b/charts/vald/templates/gateway/lb/ing.yaml @@ -16,6 +16,8 @@ {{- $gateway := .Values.gateway.lb -}} {{- if and $gateway.enabled $gateway.ingress.enabled }} {{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} +{{- $mgateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled $gateway.ingress.enabled (not $mgateway.enabled) }} apiVersion: networking.k8s.io/v1 {{- else }} apiVersion: networking.k8s.io/v1alpha1 diff --git a/charts/vald/templates/gateway/mirror/clusterrole.yaml b/charts/vald/templates/gateway/mirror/clusterrole.yaml new file mode 100644 index 0000000000..5965647c7f --- /dev/null +++ b/charts/vald/templates/gateway/mirror/clusterrole.yaml @@ -0,0 +1,58 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled $gateway.clusterRole.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ $gateway.clusterRole.name }} + labels: + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror +rules: + - apiGroups: + - vald.vdaas.org + resources: + - valdmirrortargets + verbs: + - create + - update + - delete + - get + - list + - watch + - patch + - apiGroups: + - vald.vdaas.org + resources: + - valdmirrortargets/status + verbs: + - create + - update + - get + - list + - patch + - apiGroups: + - vald.vdaas.org + resources: + - valdmirrortargets/finalizers + verbs: + - update +{{- end }} diff --git a/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml b/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml new file mode 100644 index 0000000000..0f2e8a93f8 --- /dev/null +++ b/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml @@ -0,0 +1,37 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled $gateway.clusterRoleBinding.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ $gateway.clusterRoleBinding.name }} + labels: + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ $gateway.clusterRole.name }} +subjects: + - kind: ServiceAccount + name: {{ $gateway.serviceAccount.name }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/vald/templates/gateway/mirror/configmap.yaml b/charts/vald/templates/gateway/mirror/configmap.yaml index 24e8c87117..45a15e1bb1 100644 --- a/charts/vald/templates/gateway/mirror/configmap.yaml +++ b/charts/vald/templates/gateway/mirror/configmap.yaml @@ -44,6 +44,12 @@ data: gateway: pod_name: {{ $gateway.gateway_config.pod_name }} advertise_interval: {{ $gateway.gateway_config.advertise_interval }} + namespace: {{ $gateway.gateway_config.namespace }} + discovery_duration: {{ $gateway.gateway_config.discovery_duration }} + colocation: {{ $gateway.gateway_config.colocation }} + group: {{ $gateway.gateway_config.group }} + net: + {{- toYaml $gateway.gateway_config.net | nindent 8 }} client: {{- $client := $gateway.gateway_config.client }} {{- $addrs := default list $client.addrs }} @@ -63,9 +69,7 @@ data: {{- include "vald.grpc.client" $GRPCClient | nindent 8 }} self_mirror_addr: {{- if $gateway.ingress.enabled -}} - {{- $defaultHost := $gateway.ingress.host }} - {{- $defaultPort := default .Values.defaults.server_config.servers.grpc.port $gateway.server_config.servers.grpc.port }} - {{- printf "%s:%d" $defaultHost (int64 $defaultPort) | indent 1 }} + {{- $gateway.gateway_config.self_mirror_addr | indent 1 }} {{- else -}} {{- $defaultHost := printf "%s.%s.svc.cluster.local" $gateway.name .Release.Namespace }} {{- $defaultPort := default .Values.defaults.server_config.servers.grpc.port $gateway.server_config.servers.grpc.port }} diff --git a/charts/vald/templates/gateway/mirror/daemonset.yaml b/charts/vald/templates/gateway/mirror/daemonset.yaml index bd0e539455..0abf21be4f 100644 --- a/charts/vald/templates/gateway/mirror/daemonset.yaml +++ b/charts/vald/templates/gateway/mirror/daemonset.yaml @@ -101,6 +101,7 @@ spec: dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler + serviceAccountName: {{ $gateway.serviceAccount.name }} {{- if $gateway.podSecurityContext }} securityContext: {{- toYaml $gateway.podSecurityContext | nindent 8 }} diff --git a/charts/vald/templates/gateway/mirror/deployment.yaml b/charts/vald/templates/gateway/mirror/deployment.yaml index e11df4d3f0..4cac47128b 100644 --- a/charts/vald/templates/gateway/mirror/deployment.yaml +++ b/charts/vald/templates/gateway/mirror/deployment.yaml @@ -105,6 +105,7 @@ spec: dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler + serviceAccountName: {{ $gateway.serviceAccount.name }} {{- if $gateway.podSecurityContext }} securityContext: {{- toYaml $gateway.podSecurityContext | nindent 8 }} diff --git a/charts/vald/templates/gateway/mirror/serviceaccount.yaml b/charts/vald/templates/gateway/mirror/serviceaccount.yaml new file mode 100644 index 0000000000..c9b6ff4508 --- /dev/null +++ b/charts/vald/templates/gateway/mirror/serviceaccount.yaml @@ -0,0 +1,29 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $gateway := .Values.gateway.mirror -}} +{{- if and $gateway.enabled $gateway.serviceAccount.enabled }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ $gateway.serviceAccount.name }} + labels: + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: gateway-mirror +{{- end }} diff --git a/charts/vald/values.yaml b/charts/vald/values.yaml index acdeea21ce..2b27c8e7f4 100644 --- a/charts/vald/values.yaml +++ b/charts/vald/values.yaml @@ -1657,6 +1657,53 @@ gateway: memory: 700Mi # @schema {"name": "gateway.mirror.gateway_config", "type": "object"} gateway_config: + # @schema {"name": "gateway.mirror.gateway_config.net", "alias": "net"} + net: + dns: + # gateway.mirror.gateway_config.net.dns.cache_enabled -- TCP DNS cache enabled + cache_enabled: true + # gateway.mirror.gateway_config.net.dns.refresh_duration -- TCP DNS cache refresh duration + refresh_duration: 5m + # gateway.mirror.gateway_config.net.dns.cache_expiration -- TCP DNS cache expiration + cache_expiration: 24h + dialer: + # gateway.mirror.gateway_config.net.dialer.timeout -- TCP dialer timeout + timeout: 30s + # gateway.mirror.gateway_config.net.dialer.keepalive -- TCP dialer keep alive + keepalive: 10m + # gateway.mirror.gateway_config.net.dialer.dual_stack_enabled -- TCP dialer dual stack enabled + dual_stack_enabled: false + tls: + # gateway.mirror.gateway_config.net.tls.enabled -- TLS enabled + enabled: false + # gateway.mirror.gateway_config.net.tls.cert -- TLS cert path + cert: /path/to/cert + # gateway.mirror.gateway_config.net.tls.key -- TLS key path + key: /path/to/key + # gateway.mirror.gateway_config.net.tls.ca -- TLS ca path + ca: /path/to/ca + # gateway.mirror.gateway_config.net.tls.insecure_skip_verify -- enable/disable skip SSL certificate verification + insecure_skip_verify: false + # @schema {"name": "gateway.mirror.gateway_config.net.socket_option", "alias": "socket_option"} + socket_option: + # gateway.mirror.gateway_config.net.socket_option.reuse_port -- server listen socket option for reuse_port functionality + reuse_port: true + # gateway.mirror.gateway_config.net.socket_option.reuse_addr -- server listen socket option for reuse_addr functionality + reuse_addr: true + # gateway.mirror.gateway_config.net.socket_option.tcp_fast_open -- server listen socket option for tcp_fast_open functionality + tcp_fast_open: true + # gateway.mirror.gateway_config.net.socket_option.tcp_no_delay -- server listen socket option for tcp_no_delay functionality + tcp_no_delay: true + # gateway.mirror.gateway_config.net.socket_option.tcp_cork -- server listen socket option for tcp_cork functionality + tcp_cork: false + # gateway.mirror.gateway_config.net.socket_option.tcp_quick_ack -- server listen socket option for tcp_quick_ack functionality + tcp_quick_ack: true + # gateway.mirror.gateway_config.net.socket_option.tcp_defer_accept -- server listen socket option for tcp_defer_accept functionality + tcp_defer_accept: true + # gateway.mirror.gateway_config.net.socket_option.ip_transparent -- server listen socket option for ip_transparent functionality + ip_transparent: false + # gateway.mirror.gateway_config.net.socket_option.ip_recover_destination_addr -- server listen socket option for ip_recover_destination_addr functionality + ip_recover_destination_addr: false # @schema {"name": "gateway.mirror.gateway_config.client", "alias": "grpc.client"} # gateway.mirror.gateway_config.client -- gRPC client (overrides defaults.grpc.client) client: {} @@ -1672,6 +1719,42 @@ gateway: # @schema {"name": "gateway.mirror.gateway_config.advertise_interval", "type": "string"} # gateway.mirror.gateway_config.advertise_interval -- interval to advertise mirror-gateway information to other mirror-gateway. advertise_interval: "1s" + # @schema {"name": "gateway.mirror.gateway_config.namespace", "type": "string"} + # gateway.mirror.gateway_config.namespace -- namespace to discovery + namespace: _MY_POD_NAMESPACE_ + # @schema {"name": "gateway.mirror.gateway_config.discovery_duration", "type": "string"} + # gateway.mirror.gateway_config.discovery_duration -- duration to discovery + discovery_duration: 1s + # @schema {"name": "gateway.mirror.gateway_config.colocation", "type": "string"} + # gateway.mirror.gateway_config.colocation -- colocation name + colocation: "dc1" + # @schema {"name": "gateway.mirror.gateway_config.group", "type": "string"} + # gateway.mirror.gateway_config.group -- mirror group name + group: "" + # @schema {"name": "gateway.mirror.clusterRole", "type": "object"} + clusterRole: + # @schema {"name": "gateway.mirror.clusterRole.enabled", "type": "boolean"} + # gateway.mirror.clusterRole.enabled -- creates clusterRole resource + enabled: true + # @schema {"name": "gateway.mirror.clusterRole.name", "type": "string"} + # gateway.mirror.clusterRole.name -- name of clusterRole + name: gateway-mirror + # @schema {"name": "gateway.mirror.clusterRoleBinding", "type": "object"} + clusterRoleBinding: + # @schema {"name": "gateway.mirror.clusterRoleBinding.enabled", "type": "boolean"} + # gateway.mirror.clusterRoleBinding.enabled -- creates clusterRoleBinding resource + enabled: true + # @schema {"name": "gateway.mirror.clusterRoleBinding.name", "type": "string"} + # gateway.mirror.clusterRoleBinding.name -- name of clusterRoleBinding + name: gateway-mirror + # @schema {"name": "gateway.mirror.serviceAccount", "type": "object"} + serviceAccount: + # @schema {"name": "gateway.mirror.serviceAccount.enabled", "type": "boolean"} + # gateway.mirror.serviceAccount.enabled -- creates service account + enabled: true + # @schema {"name": "gateway.mirror.serviceAccount.name", "type": "string"} + # gateway.mirror.serviceAccount.name -- name of service account + name: gateway-mirror # @schema {"name": "agent", "type": "object"} agent: # @schema {"name": "agent.enabled", "type": "boolean"} diff --git a/charts/vald/values/multi-vald/dev-vald-01.yaml b/charts/vald/values/multi-vald/dev-vald-01.yaml index 467d488e03..dd6ed28343 100644 --- a/charts/vald/values/multi-vald/dev-vald-01.yaml +++ b/charts/vald/values/multi-vald/dev-vald-01.yaml @@ -18,3 +18,17 @@ discoverer: name: vald-01 serviceAccount: name: vald-01 + +gateway: + mirror: + enabled: true + image: + tag: pr-2023 # TODO: Delete it later. + clusterRoleBinding: + name: vald-mirror-01 + serviceAccount: + name: vald-mirror-01 + +agent: + ngt: + dimension: 784 diff --git a/charts/vald/values/multi-vald/dev-vald-02.yaml b/charts/vald/values/multi-vald/dev-vald-02.yaml index 7b4f21c1b7..c3acd6a9fa 100644 --- a/charts/vald/values/multi-vald/dev-vald-02.yaml +++ b/charts/vald/values/multi-vald/dev-vald-02.yaml @@ -20,3 +20,19 @@ discoverer: name: vald-02 serviceAccount: name: vald-02 + +gateway: + mirror: + enabled: true + image: + tag: pr-2023 # TODO: Delete it later. + clusterRole: + enabled: false + clusterRoleBinding: + name: vald-mirror-02 + serviceAccount: + name: vald-mirror-02 + +agent: + ngt: + dimension: 784 diff --git a/charts/vald/values/multi-vald/dev-vald-03.yaml b/charts/vald/values/multi-vald/dev-vald-03.yaml index 1783b246a6..5aef7cc24b 100644 --- a/charts/vald/values/multi-vald/dev-vald-03.yaml +++ b/charts/vald/values/multi-vald/dev-vald-03.yaml @@ -13,14 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -gateway: - mirror: - gateway_config: - client: - addrs: - - vald-mirror-gateway.vald-01.svc.cluster.local:8081 - - vald-mirror-gateway.vald-02.svc.cluster.local:8081 - discoverer: clusterRole: enabled: false @@ -28,3 +20,19 @@ discoverer: name: vald-03 serviceAccount: name: vald-03 + +gateway: + mirror: + enabled: true + image: + tag: pr-2023 # TODO: Delete it later. + clusterRole: + enabled: false + clusterRoleBinding: + name: vald-mirror-03 + serviceAccount: + name: vald-mirror-03 + +agent: + ngt: + dimension: 784 diff --git a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml index 257aa42486..3dc07692da 100644 --- a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml +++ b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml @@ -15,7 +15,7 @@ # defaults: image: - tag: pr-1949 # TODO: Delete it later. + tag: pr-2023 # TODO: Delete it later. server_config: metrics: pprof: @@ -54,17 +54,14 @@ gateway: gateway_config: index_replica: 2 - # NOTE: Will work with multiple replicas in the future. mirror: enabled: true - minReplicas: 1 - maxReplicas: 1 + minReplicas: 3 + maxReplicas: 3 ingress: enabled: false gateway_config: - lb_client: {} - mirror_client: {} - self_mirror_client: {} + self_mirror_addr: "" agent: podAnnotations: diff --git a/charts/vald/values/multi-vald/mirror-target.yaml b/charts/vald/values/multi-vald/mirror-target.yaml new file mode 100644 index 0000000000..75d3cf4161 --- /dev/null +++ b/charts/vald/values/multi-vald/mirror-target.yaml @@ -0,0 +1,35 @@ +--- +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +apiVersion: vald.vdaas.org/v1 +kind: ValdMirrorTarget +metadata: + name: mirror-target-01 +spec: + colocation: dc1 + target: + host: vald-mirror-gateway.vald-01.svc.cluster.local + port: 8081 +--- +apiVersion: vald.vdaas.org/v1 +kind: ValdMirrorTarget +metadata: + name: mirror-target-02 +spec: + colocation: dc1 + target: + host: vald-mirror-gateway.vald-02.svc.cluster.local + port: 8081 diff --git a/example/client/mirror/main.go b/example/client/mirror/main.go new file mode 100644 index 0000000000..3fca226305 --- /dev/null +++ b/example/client/mirror/main.go @@ -0,0 +1,246 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package main + +import ( + "context" + "encoding/json" + "flag" + "log" + "strings" + "time" + + "github.com/kpango/fuid" + "github.com/kpango/glg" + "github.com/vdaas/vald-client-go/v1/payload" + "github.com/vdaas/vald-client-go/v1/vald" + "gonum.org/v1/hdf5" + "google.golang.org/grpc" +) + +const ( + insertCount = 400 + testCount = 20 +) + +var ( + datasetPath string + grpcServerAddr string + grpcServerAddrs []string + indexingWaitSeconds uint +) + +func init() { + /** + Path option specifies hdf file by path. Default value is `fashion-mnist-784-euclidean.hdf5`. + Addr option specifies grpc server addresses. Default value is `127.0.0.1:8080`,`127.0.0.1:8081`,`127.0.0.1:8082`. + Wait option specifies indexing wait time (in seconds). Default value is `60`. + **/ + flag.StringVar(&datasetPath, "path", "fashion-mnist-784-euclidean.hdf5", "dataset path") + flag.StringVar(&grpcServerAddr, "addrs", "localhost:8080,localhost:8081,localhost:8082", "gRPC server addresses") + flag.UintVar(&indexingWaitSeconds, "wait", 60, "indexing wait seconds") + flag.Parse() + grpcServerAddrs = strings.Split(grpcServerAddr, ",") +} + +func main() { + /** + Gets training data, test data and ids based on the dataset path. + the number of ids is equal to that of training dataset. + **/ + ids, train, test, err := load(datasetPath) + if err != nil { + glg.Fatal(err) + } + ctx := context.Background() + + // Creates Vald clients for connecting to Vald clusters. + clients := make([]vald.Client, 0, len(grpcServerAddrs)) + for _, addr := range grpcServerAddrs { + conn, err := grpc.DialContext(ctx, addr, grpc.WithInsecure()) + if err != nil { + glg.Fatal(err) + } + defer conn.Close() + + // Creates Vald client for gRPC. + clients = append(clients, vald.NewValdClient(conn)) + } + + glg.Infof("Start Inserting %d training vector to Vald", insertCount) + // Insert 400 example vectors into Vald cluster. + for i := range ids[:insertCount] { + // Calls `Insert` function of Vald client. + // Sends set of vector and id to server via gRPC. + _, err := clients[0].Insert(ctx, &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: ids[i], + Vector: train[i], + }, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: true, + }, + }) + if err != nil { + glg.Fatal(err) + } + if i%10 == 0 { + glg.Infof("Inserted: %d", i+10) + } + } + glg.Info("Finish Inserting dataset. \n\n") + + // Vald starts indexing automatically after insert. It needs to wait until the indexing is completed before a search action is performed. + wt := time.Duration(indexingWaitSeconds) * time.Second + glg.Infof("Wait %s for indexing to finish", wt) + time.Sleep(wt) + + /** + Gets approximate vectors, which is based on the value of `SearchConfig`, from the indexed tree based on the training data. + In this example, Vald gets 10 approximate vectors each search vector. + **/ + glg.Infof("Start searching %d times", testCount) + for i, vec := range test[:testCount] { + for j, client := range clients { + // Send searching vector and configuration object to the Vald server via gRPC. + res, err := client.Search(ctx, &payload.Search_Request{ + Vector: vec, + // Conditions for hitting the search. + Config: &payload.Search_Config{ + Num: 10, // the number of search results + Radius: -1, // Radius is used to determine the space of search candidate radius for neighborhood vectors. -1 means infinite circle. + Epsilon: 0.1, // Epsilon is used to determines how much to expand from search candidate radius. + Timeout: 100000000, // Timeout is used for search time deadline. The unit is nano-seconds. + }, + }) + if err != nil { + glg.Fatal(err) + } + + // NOTE: Search result may differ due to the indexing timing of each Vald cluster. + b, _ := json.MarshalIndent(res.GetResults(), "", " ") + glg.Infof("%s: %d - Results : %s\n\n", grpcServerAddrs[j], i+1, string(b)) + } + time.Sleep(1 * time.Second) + } + glg.Infof("Finish searching %d times", testCount) + + /** + Gets the vector using inserted vector id from Vald cluster. + **/ + glg.Infof("Start getting %d times", insertCount) + for i, id := range ids[:insertCount] { + for j, client := range clients { + vec, err := client.GetObject(ctx, &payload.Object_VectorRequest{ + Id: &payload.Object_ID{ + Id: id, + }, + }) + if err != nil { + log.Fatal(err) + } + glg.Infof("%s: %d - Result : %s", grpcServerAddrs[j], i+1, vec.GetId()) + } + } + glg.Infof("Finish getting %d times", insertCount) + + glg.Info("Start removing vector") + // Remove indexed 400 vectors from vald cluster. + for i := range ids[:insertCount] { + // Call `Remove` function of Vald client. + // Sends id to server via gRPC. + _, err := clients[0].Remove(ctx, &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: ids[i], + }, + }) + if err != nil { + glg.Fatal(err) + } + if i%10 == 0 { + glg.Infof("Removed: %d", i+10) + } + } + glg.Info("Finish removing vector") +} + +// load function loads training and test vector from hdf file. The size of ids is same to the number of training data. +// Each id, which is an element of ids, will be set a random number. +func load(path string) (ids []string, train, test [][]float32, err error) { + var f *hdf5.File + f, err = hdf5.OpenFile(path, hdf5.F_ACC_RDONLY) + if err != nil { + return nil, nil, nil, err + } + defer f.Close() + + // readFn function reads vectors of the hierarchy with the given the name. + readFn := func(name string) ([][]float32, error) { + // Opens and returns a named Dataset. + // The returned dataset must be closed by the user when it is no longer needed. + d, err := f.OpenDataset(name) + if err != nil { + return nil, err + } + defer d.Close() + + // Space returns an identifier for a copy of the dataspace for a dataset. + sp := d.Space() + defer sp.Close() + + // SimpleExtentDims returns dataspace dimension size and maximum size. + dims, _, _ := sp.SimpleExtentDims() + row, dim := int(dims[0]), int(dims[1]) + + // Gets the stored vector. All are represented as one-dimensional arrays. + // The type of the slice depends on your dataset. + // For fashion-mnist-784-euclidean.hdf5, the datatype is float32. + vec := make([]float32, sp.SimpleExtentNPoints()) + if err := d.Read(&vec); err != nil { + return nil, err + } + + // Converts a one-dimensional array to a two-dimensional array. + // Use the `dim` variable as a separator. + vecs := make([][]float32, row) + for i := 0; i < row; i++ { + vecs[i] = make([]float32, dim) + for j := 0; j < dim; j++ { + vecs[i][j] = float32(vec[i*dim+j]) + } + } + + return vecs, nil + } + + // Gets vector of `train` hierarchy. + train, err = readFn("train") + if err != nil { + return nil, nil, nil, err + } + + // Gets vector of `test` hierarchy. + test, err = readFn("test") + if err != nil { + return nil, nil, nil, err + } + + // Generate as many random ids for training vectors. + ids = make([]string, 0, len(train)) + for i := 0; i < len(train); i++ { + ids = append(ids, fuid.String()) + } + + return +} diff --git a/internal/config/mirror.go b/internal/config/mirror.go index 345acfa4bc..01fabf9c05 100644 --- a/internal/config/mirror.go +++ b/internal/config/mirror.go @@ -15,16 +15,27 @@ package config // Mirror represents the Mirror Gateway configuration. type Mirror struct { - // Client represents the gRPC client configuration for connecting the LB Gateway. + // Net represents the network configuration tcp, udp, unix domain socket. + Net *Net `json:"net,omitempty" yaml:"net"` + // GRPCClient represents the configurations for gRPC client. Client *GRPCClient `json:"client" yaml:"client"` // SelfMirrorAddr represents the address for the self Mirror Gateway. SelfMirrorAddr string `json:"self_mirror_addr" yaml:"self_mirror_addr"` // GatewayAddr represents the address for the Vald Gateway (e.g lb-gateway). GatewayAddr string `json:"gateway_addr" yaml:"gateway_addr"` - // PodName represents self Mirror Gateway Pod name. + // PodName represents the mirror gateway pod name. PodName string `json:"pod_name" yaml:"pod_name"` - // AdvertiseInterval represents interval to advertise Mirror Gateway information to other mirror gateway. + // AdvertiseInterval represents the interval to advertise addresses of Mirror Gateway to other Mirror Gateway. AdvertiseInterval string `json:"advertise_interval" yaml:"advertise_interval"` + // Namespace represents the target namespace to discover ValdMirrorTarget resource. + Namespace string `json:"namespace" yaml:"namespace"` + // DiscoveryDuration represents the duration to discover. + DiscoveryDuration string `json:"discovery_duration" yaml:"discovery_duration"` + // Colocation represents the colocation name. + Colocation string `json:"colocation" yaml:"colocation"` + // Group represents the group name of the Mirror Gateways. + // It is used to discover ValdMirrorTarget resources with the same group name. + Group string `json:"group" yaml:"group"` } // Bind binds the actual data from the Mirror receiver fields. @@ -33,6 +44,15 @@ func (m *Mirror) Bind() *Mirror { m.GatewayAddr = GetActualValue(m.GatewayAddr) m.PodName = GetActualValue(m.PodName) m.AdvertiseInterval = GetActualValue(m.AdvertiseInterval) + m.Namespace = GetActualValue(m.Namespace) + m.DiscoveryDuration = GetActualValue(m.DiscoveryDuration) + m.Colocation = GetActualValue(m.Colocation) + m.Group = GetActualValue(m.Group) + if m.Net != nil { + m.Net = m.Net.Bind() + } else { + m.Net = new(Net).Bind() + } if m.Client != nil { m.Client = m.Client.Bind() } else { diff --git a/internal/k8s/reconciler.go b/internal/k8s/reconciler.go index b5533169d4..51ecc54800 100644 --- a/internal/k8s/reconciler.go +++ b/internal/k8s/reconciler.go @@ -25,19 +25,44 @@ import ( "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/safety" "github.com/vdaas/vald/internal/sync/errgroup" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" + cli "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" ) +// TODO delete <<<--- + +type ( + Manager = manager.Manager + OwnerReference = v1.OwnerReference +) + +type ( + Object = cli.Object + ObjectKey = cli.ObjectKey + DeleteAllOfOptions = cli.DeleteAllOfOptions + ListOptions = cli.ListOptions + MatchingLabels = cli.MatchingLabels + InNamespace = cli.InNamespace +) + +// TODO delete --->>> + type Controller interface { Start(ctx context.Context) (<-chan error, error) + // TODO delete <<<--- + GetManager() Manager + // TODO delete --->>> } +var Now = v1.Now + type ResourceController interface { GetName() string NewReconciler(ctx context.Context, mgr manager.Manager) reconcile.Reconciler @@ -135,3 +160,10 @@ func (c *controller) Start(ctx context.Context) (<-chan error, error) { return ech, nil } + +// TODO delete <<<--- +func (c *controller) GetManager() Manager { + return c.mgr +} + +// TODO delete --->>> diff --git a/internal/k8s/vald/mirror/api/v1/target_types.go b/internal/k8s/vald/mirror/api/v1/target_types.go new file mode 100644 index 0000000000..f3f57e2f05 --- /dev/null +++ b/internal/k8s/vald/mirror/api/v1/target_types.go @@ -0,0 +1,181 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "vald.vdaas.org", Version: "v1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +func init() { + SchemeBuilder.Register( + &ValdMirrorTarget{}, + &ValdMirrorTargetList{}, + ) +} + +// ValdMirrorTarget is a mirror information. +type ValdMirrorTarget struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + Spec MirrorTargetSpec `json:"spec,omitempty"` + Status MirrorTargetStatus `json:"status,omitempty"` +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValdMirrorTarget) DeepCopyInto(out *ValdMirrorTarget) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValdMirror. +func (in *ValdMirrorTarget) DeepCopy() *ValdMirrorTarget { + if in == nil { + return nil + } + out := new(ValdMirrorTarget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValdMirrorTarget) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// MirrorTargetSpec is a description of a ValdMirrorTarget. +type MirrorTargetSpec struct { + Colocation string `json:"colocation,omitempty"` + Target MirrorTarget `json:"target,omitempty"` +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MirrorTargetSpec) DeepCopyInto(out *MirrorTargetSpec) { + *out = *in + out.Colocation = in.Colocation + out.Target = in.Target +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MirrorSpec. +func (in *MirrorTargetSpec) DeepCopy() *MirrorTargetSpec { + if in == nil { + return nil + } + out := new(MirrorTargetSpec) + in.DeepCopyInto(out) + return out +} + +// MirrorTarget is a target information. +type MirrorTarget struct { + Host string `json:"host,omitempty"` + Port int `json:"port,omitempty"` +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MirrorTarget) DeepCopyInto(out *MirrorTarget) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MirrorTarget. +func (in *MirrorTarget) DeepCopy() *MirrorTarget { + if in == nil { + return nil + } + out := new(MirrorTarget) + in.DeepCopyInto(out) + return out +} + +// MirrorTargetStatus is a status of ValdMirrorTarget. +type MirrorTargetStatus struct { + Phase MirrorTargetPhase `json:"phase,omitempty"` + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` +} + +// MirrorTargetPhase is a label for the condition of a ValdMirrorTarget at the current time. +type MirrorTargetPhase string + +const ( + // MirrorTargetConnected means that the ValdMirrorTarget has been accepted by the system. + MirrorTargetPending = MirrorTargetPhase("Pending") + + // MirrorTargetConnected means that the target was connected. + MirrorTargetConnected = MirrorTargetPhase("Connected") + + // MirrorTargetDisconnected means that the target was disconnected. + MirrorTargetDisconnected = MirrorTargetPhase("Disconnected") + + // MirrorTargetUnknown means that for some reason the state of the ValdMirrorTarget could not be obtained. + MirrorTargetUnknown = MirrorTargetPhase("Unknown") +) + +// ValdMirrorList is the whole list of all ValdMirror which have been registered with master. +type ValdMirrorTargetList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + Items []ValdMirrorTarget `json:"items,omitempty"` +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValdMirrorTargetList) DeepCopyInto(out *ValdMirrorTargetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if len(in.Items) != 0 { + out.Items = make([]ValdMirrorTarget, len(in.Items)) + for i := 0; i < len(in.Items); i++ { + out.Items[i] = *in.Items[i].DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValdMirrorList. +func (in *ValdMirrorTargetList) DeepCopy() *ValdMirrorTargetList { + if in == nil { + return nil + } + out := new(ValdMirrorTargetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ValdMirrorTargetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/internal/k8s/vald/mirror/target/option.go b/internal/k8s/vald/mirror/target/option.go new file mode 100644 index 0000000000..b2a2014801 --- /dev/null +++ b/internal/k8s/vald/mirror/target/option.go @@ -0,0 +1,93 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package target + +import ( + "context" + + "github.com/vdaas/vald/internal/errors" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" +) + +// Option represents the functional option for reconciler. +type Option func(r *reconciler) error + +var defaultOptions = []Option{} + +// WithControllerName returns the option to set the name of controller. +func WithControllerName(name string) Option { + return func(r *reconciler) error { + if len(name) == 0 { + return errors.NewErrInvalidOption("controllerName", name) + } + r.name = name + return nil + } +} + +// WithManager returns the option to set the controller manager. +func WithManager(mgr manager.Manager) Option { + return func(r *reconciler) error { + if mgr == nil { + return errors.NewErrInvalidOption("manager", mgr) + } + r.mgr = mgr + return nil + } +} + +// WithOnErrorFunc returns the option to set the function to notify an error. +func WithOnErrorFunc(f func(error)) Option { + return func(r *reconciler) error { + if f == nil { + return errors.NewErrInvalidOption("onErrorFunc", f) + } + r.onError = f + return nil + } +} + +// WithOnReconcileFunc returns the option to set the function to get the reconciled result. +func WithOnReconcileFunc(f func(context.Context, map[string]Target)) Option { + return func(r *reconciler) error { + if f == nil { + return errors.NewErrInvalidOption("onReconcileFunc", f) + } + r.onReconcile = f + return nil + } +} + +// WithNamespace returns the option to set the namespace to get resources matching the given namespace.. +func WithNamespace(ns string) Option { + return func(r *reconciler) error { + if ns == "" { + return errors.NewErrInvalidOption("namespace", ns) + } + r.addListOpts(client.InNamespace(ns)) + return nil + } +} + +// WithLabels returns the option to set the label selector to get resources matching the given label. +func WithLabels(labels map[string]string) Option { + return func(r *reconciler) error { + if len(labels) == 0 { + return errors.NewErrInvalidOption("labels", labels) + } + r.addListOpts(client.MatchingLabels(labels)) + return nil + } +} diff --git a/internal/k8s/vald/mirror/target/target.go b/internal/k8s/vald/mirror/target/target.go new file mode 100644 index 0000000000..b279401c58 --- /dev/null +++ b/internal/k8s/vald/mirror/target/target.go @@ -0,0 +1,142 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package target + +import ( + "context" + "reflect" + "time" + + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/k8s" + mirrv1 "github.com/vdaas/vald/internal/k8s/vald/mirror/api/v1" + "github.com/vdaas/vald/internal/log" + apierr "k8s.io/apimachinery/pkg/api/errors" + "sigs.k8s.io/controller-runtime/pkg/builder" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/reconcile" +) + +type ( + MirrorTargetWatcher k8s.ResourceController + MirrorTarget = mirrv1.ValdMirrorTarget + MirrorTargetStatus = mirrv1.MirrorTargetStatus + MirrorTargetPhase = mirrv1.MirrorTargetPhase +) + +const ( + MirrorTargetPhasePending = mirrv1.MirrorTargetPending + MirrorTargetPhaseConnected = mirrv1.MirrorTargetConnected + MirrorTargetPhaseDisconnected = mirrv1.MirrorTargetDisconnected + MirrorTargetPhaseUnknown = mirrv1.MirrorTargetUnknown +) + +type reconciler struct { + mgr manager.Manager + name string + onError func(err error) + onReconcile func(ctx context.Context, mm map[string]Target) + lopts []client.ListOption +} + +type Target struct { + Colocation string + Host string + Port int + Phase MirrorTargetPhase +} + +func New(opts ...Option) (MirrorTargetWatcher, error) { + r := new(reconciler) + for _, opt := range append(defaultOptions, opts...) { + if err := opt(r); err != nil { + oerr := errors.ErrOptionFailed(err, reflect.ValueOf(opt)) + e := &errors.ErrCriticalOption{} + if errors.As(err, &e) { + log.Error(oerr) + return nil, oerr + } + log.Warn(oerr) + } + } + return r, nil +} + +func (r *reconciler) addListOpts(opt client.ListOption) { + if opt == nil { + return + } + r.lopts = append(r.lopts, opt) +} + +func (r *reconciler) Reconcile(ctx context.Context, req reconcile.Request) (res reconcile.Result, err error) { + ml := &mirrv1.ValdMirrorTargetList{} + if len(r.lopts) != 0 { + err = r.mgr.GetClient().List(ctx, ml, r.lopts...) + } else { + err = r.mgr.GetClient().List(ctx, ml) + } + if err != nil { + r.onError(err) + if apierr.IsNotFound(err) { + log.Errorf("not found: %s", err) + return reconcile.Result{ + Requeue: true, + RequeueAfter: time.Second, + }, nil + } + return reconcile.Result{ + Requeue: true, + RequeueAfter: 100 * time.Millisecond, + }, err + } + tm := make(map[string]Target) + for _, m := range ml.Items { + name := m.GetObjectMeta().GetName() + tm[name] = Target{ + Colocation: m.Spec.Colocation, + Host: m.Spec.Target.Host, + Port: m.Spec.Target.Port, + Phase: m.Status.Phase, + } + } + r.onReconcile(ctx, tm) + return res, nil +} + +func (r *reconciler) GetName() string { + return r.name +} + +func (r *reconciler) NewReconciler(ctx context.Context, mgr manager.Manager) reconcile.Reconciler { + if r.mgr == nil && mgr != nil { + r.mgr = mgr + } + mirrv1.AddToScheme(r.mgr.GetScheme()) + return r +} + +func (r *reconciler) For() (client.Object, []builder.ForOption) { + return new(mirrv1.ValdMirrorTarget), nil +} + +func (r *reconciler) Owns() (client.Object, []builder.OwnsOption) { + return nil, nil +} + +func (r *reconciler) Watches() (client.Object, handler.EventHandler, []builder.WatchesOption) { + return nil, nil, nil +} diff --git a/internal/k8s/vald/mirror/target/target_template.go b/internal/k8s/vald/mirror/target/target_template.go new file mode 100644 index 0000000000..6d205986dd --- /dev/null +++ b/internal/k8s/vald/mirror/target/target_template.go @@ -0,0 +1,37 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package target + +import ( + "reflect" + + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/log" +) + +func NewMirrorTargetTemplate(opts ...MirrorTargetOption) (*MirrorTarget, error) { + mt := new(MirrorTarget) + for _, opt := range append(defaultMirrorTargetOptions, opts...) { + if err := opt(mt); err != nil { + oerr := errors.ErrOptionFailed(err, reflect.ValueOf(opt)) + e := &errors.ErrCriticalOption{} + if errors.As(err, &e) { + log.Error(oerr) + return nil, oerr + } + log.Warn(oerr) + } + } + return mt, nil +} diff --git a/internal/k8s/vald/mirror/target/target_template_option.go b/internal/k8s/vald/mirror/target/target_template_option.go new file mode 100644 index 0000000000..a5db4da9e6 --- /dev/null +++ b/internal/k8s/vald/mirror/target/target_template_option.go @@ -0,0 +1,90 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package target + +import "github.com/vdaas/vald/internal/errors" + +type MirrorTargetOption func(*MirrorTarget) error + +var defaultMirrorTargetOptions = []MirrorTargetOption{ + WithMirrorTargetLabels(map[string]string{ + "app.kubernetes.io/name": "mirror-target", + "app.kubernetes.io/managed-by": "gateway-mirror", + }), +} + +func WithMirrorTargetNamespace(ns string) MirrorTargetOption { + return func(mt *MirrorTarget) error { + if len(ns) != 0 { + mt.ObjectMeta.Namespace = ns + } + return nil + } +} + +func WithMirrorTargetName(name string) MirrorTargetOption { + return func(mt *MirrorTarget) error { + if len(name) == 0 { + return errors.NewErrCriticalOption("name", name) + } + mt.ObjectMeta.Name = name + return nil + } +} + +func WithMirrorTargetStatus(st *MirrorTargetStatus) MirrorTargetOption { + return func(mt *MirrorTarget) error { + mt.Status = *st + return nil + } +} + +func WithMirrorTargetLabels(labels map[string]string) MirrorTargetOption { + return func(mt *MirrorTarget) error { + if len(labels) != 0 { + mt.ObjectMeta.Labels = labels + } + return nil + } +} + +func WithMirrorTargetColocation(n string) MirrorTargetOption { + return func(mt *MirrorTarget) error { + if len(n) == 0 { + return errors.NewErrCriticalOption("colocation", n) + } + mt.Spec.Colocation = n + return nil + } +} + +func WithMirrorTargetHost(n string) MirrorTargetOption { + return func(mt *MirrorTarget) error { + if len(n) == 0 { + return errors.NewErrCriticalOption("host", n) + } + mt.Spec.Target.Host = n + return nil + } +} + +func WithMirrorTargetPort(port int) MirrorTargetOption { + return func(mt *MirrorTarget) error { + if port <= 0 { + return errors.NewErrCriticalOption("port", port) + } + mt.Spec.Target.Port = port + return nil + } +} diff --git a/internal/observability/metrics/gateway/mirror/mirror.go b/internal/observability/metrics/gateway/mirror/mirror.go new file mode 100644 index 0000000000..0ccb40bff4 --- /dev/null +++ b/internal/observability/metrics/gateway/mirror/mirror.go @@ -0,0 +1,77 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package mirror + +import ( + "context" + + "github.com/vdaas/vald/internal/observability/attribute" + "github.com/vdaas/vald/internal/observability/metrics" + "github.com/vdaas/vald/pkg/gateway/mirror/service" + "go.opentelemetry.io/otel/sdk/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/view" +) + +const ( + metricsName = "gateway_mirror_connecting_target" + metricsDescription = "Target to which the mirror gateway is connecting" + + targetAddrKey = "addr" +) + +type mirrorMetrics struct { + mirr service.Mirror +} + +func New(mirr service.Mirror) metrics.Metric { + return &mirrorMetrics{ + mirr: mirr, + } +} + +func (*mirrorMetrics) View() ([]*metrics.View, error) { + target, err := view.New( + view.MatchInstrumentName(metricsName), + view.WithSetDescription(metricsDescription), + view.WithSetAggregation(aggregation.LastValue{}), + ) + if err != nil { + return nil, err + } + return []*metrics.View{ + &target, + }, nil +} + +func (mm *mirrorMetrics) Register(m metrics.Meter) error { + targetGauge, err := m.AsyncInt64().Gauge( + metricsName, + metrics.WithDescription(metricsDescription), + metrics.WithUnit(metrics.Dimensionless), + ) + if err != nil { + return err + } + return m.RegisterCallback( + []metrics.AsynchronousInstrument{ + targetGauge, + }, + func(ctx context.Context) { + mm.mirr.RangeAllMirrorAddr(func(addr string, _ any) bool { + targetGauge.Observe(ctx, 1, attribute.String(targetAddrKey, addr)) + return true + }) + }, + ) +} diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 40ca2e49e1..514b9ef3e8 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -129,16 +129,9 @@ func (s *server) Advertise(ctx context.Context, req *payload.Mirror_Targets) (re span.End() } }() - _, err = s.Register(ctx, req) - if err != nil { - return nil, err - } tgts, err := s.mirror.MirrorTargets() if err != nil { err = status.WrapWithInternal(vald.AdvertiseRPCName+" API failed to get connected vald gateway targets", err, - &errdetails.RequestInfo{ - ServingData: errdetails.Serialize(req), - }, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go new file mode 100644 index 0000000000..c4d5e43f87 --- /dev/null +++ b/pkg/gateway/mirror/service/discovery.go @@ -0,0 +1,337 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package service + +import ( + "context" + "reflect" + "strconv" + "sync/atomic" + "time" + + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/k8s" + "github.com/vdaas/vald/internal/k8s/vald/mirror/target" + "github.com/vdaas/vald/internal/log" + "github.com/vdaas/vald/internal/net" + "github.com/vdaas/vald/internal/strings" + "github.com/zeebo/xxh3" +) + +const ( + resourcePrefix = "mirror-target" + groupKey = "group" +) + +type Discoverer interface { + Start(ctx context.Context) (<-chan error, error) +} + +type discoverer struct { + namespace string + labels map[string]string + colocation string + der net.Dialer + + targetsByName atomic.Pointer[map[string]target.Target] // latest reconciliation results. + ctrl k8s.Controller + dur time.Duration + selfMirrAddrs []string + selfMirrAddrStr string + + mirr Mirror + eg errgroup.Group +} + +func NewDiscoverer(opts ...DiscovererOption) (dsc Discoverer, err error) { + d := new(discoverer) + for _, opt := range append(defaultDiscovererOpts, opts...) { + if err := opt(d); err != nil { + oerr := errors.ErrOptionFailed(err, reflect.ValueOf(opt)) + e := &errors.ErrCriticalOption{} + if errors.As(err, &e) { + log.Error(oerr) + return nil, oerr + } + log.Warn(oerr) + } + } + d.targetsByName.Store(&map[string]target.Target{}) + d.selfMirrAddrStr = strings.Join(d.selfMirrAddrs, ",") + + watcher, err := target.New( + target.WithControllerName("mirror discoverer"), + target.WithNamespace(d.namespace), + target.WithLabels(d.labels), + target.WithOnErrorFunc(func(err error) { + log.Error("failed to reconcile:", err) + }), + target.WithOnReconcileFunc(func(ctx context.Context, list map[string]target.Target) { + log.Debugf("mirror reconciled\t%#v", list) + d.targetsByName.Store(&list) + }), + ) + if err != nil { + return nil, err + } + d.ctrl, err = k8s.New( + k8s.WithDialer(d.der), + k8s.WithControllerName("vald k8s mirror discoverer"), + k8s.WithDisableLeaderElection(), + k8s.WithResourceController(watcher), + ) + if err != nil { + return nil, err + } + return d, nil +} + +func (d *discoverer) Start(ctx context.Context) (<-chan error, error) { + dech, err := d.ctrl.Start(ctx) + if err != nil { + return nil, err + } + ech := make(chan error, 2) + d.eg.Go(func() (err error) { + defer close(ech) + tic := time.NewTicker(d.dur) + defer tic.Stop() + + prev := d.loadTargets() + for { + select { + case <-ctx.Done(): + return ctx.Err() + case <-tic.C: + prev, err = d.startSync(ctx, prev) + if err != nil { + select { + case <-ctx.Done(): + return errors.Join(err, ctx.Err()) + case ech <- err: + } + } + case err := <-dech: + if err != nil { + select { + case <-ctx.Done(): + return errors.Join(err, ctx.Err()) + case ech <- err: + } + } + } + } + }) + return ech, nil +} + +func (d *discoverer) loadTargets() map[string]target.Target { + if v := d.targetsByName.Load(); v != nil { + return *v + } + return nil +} + +type createdTarget struct { + name string + tgt target.Target +} + +type updatedTarget struct { + name string + old target.Target + new target.Target +} + +type deletedTarget struct { + name string + host string + port uint32 +} + +func (d *discoverer) startSync(ctx context.Context, prev map[string]target.Target) (cur map[string]target.Target, err error) { + cur = d.loadTargets() + curAddrs := make(map[string]string) // map[addr: metadata.name] + + created := map[string]*createdTarget{} // map[addr: target.Target] + updated := map[string]*updatedTarget{} // map[addr: *updatedTarget] + for name, ctgt := range cur { + addr := net.JoinHostPort(ctgt.Host, uint16(ctgt.Port)) + curAddrs[addr] = name + if ptgt, ok := prev[name]; !ok { + created[addr] = &createdTarget{ + name: name, + tgt: ctgt, + } + } else { + if ptgt.Host != ctgt.Host || ptgt.Port != ctgt.Port { + updated[addr] = &updatedTarget{name: name, old: ptgt, new: ctgt} + } + } + } + + deleted := map[string]*deletedTarget{} // map[addr: *deletedTarget] + for name, ptgt := range prev { + if _, ok := cur[name]; !ok { + addr := net.JoinHostPort(ptgt.Host, uint16(ptgt.Port)) + deleted[addr] = &deletedTarget{name: name, host: ptgt.Host, port: uint32(ptgt.Port)} + } + } + + if len(created) != 0 || len(deleted) != 0 || len(updated) != 0 { + log.Infof("created: %#v\tupdated: %#v\tdeleted: %#v", created, updated, deleted) + err = errors.Join( + errors.Join( + d.createTarget(ctx, created), + d.deleteTarget(ctx, deleted)), + d.updateTarget(ctx, updated)) + if err != nil { + return cur, err + } + return cur, nil + } + + for addr, name := range curAddrs { + // When the status code of a regularly running Advertise RPC is Unimplemented, the connection to the target will be disconnected + // so the status of the resource (CR) may be misaligned. To prevent this, change the status of the resource to Disconnected. + if !d.mirr.Exist(ctx, addr) && cur[name].Phase == target.MirrorTargetPhaseConnected { + err = errors.Join(err, d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseDisconnected)) + } + } + + d.mirr.RangeAllMirrorAddr(func(addr string, _ any) bool { + connected := d.mirr.IsConnected(ctx, addr) + if name, ok := curAddrs[addr]; ok { + if st := target.MirrorTargetPhaseConnected; connected && cur[name].Phase != st { + err = errors.Join(err, + d.updateMirrorTargetPhase(ctx, name, st)) + } else if st := target.MirrorTargetPhaseDisconnected; !connected && cur[name].Phase != st { + err = errors.Join(err, + d.updateMirrorTargetPhase(ctx, name, st)) + } + } else if !ok && connected { + var ( + host string + port uint16 + ) + host, port, err = net.SplitHostPort(addr) + if err != nil { + log.Error(err) + } + name := resourcePrefix + "-" + strconv.FormatUint(xxh3.HashString(d.selfMirrAddrStr+addr), 10) + err = errors.Join(err, d.createMirrorTargetResource(ctx, name, host, int(port))) + } + return true + }) + return cur, err +} + +func (d *discoverer) createTarget(ctx context.Context, req map[string]*createdTarget) (err error) { + if len(req) == 0 { + return nil + } + for _, created := range req { + phase := target.MirrorTargetPhaseConnected + cerr := d.mirr.Connect(ctx, &payload.Mirror_Target{ + Host: created.tgt.Host, + Port: uint32(created.tgt.Port), + }) + if cerr != nil { + err = errors.Join(err, cerr) + phase = target.MirrorTargetPhaseDisconnected + } + uerr := d.updateMirrorTargetPhase(ctx, created.name, phase) + if uerr != nil { + err = errors.Join(err, uerr) + } + } + return err +} + +func (d *discoverer) createMirrorTargetResource(ctx context.Context, name, host string, port int) error { + mt, err := target.NewMirrorTargetTemplate( + target.WithMirrorTargetName(name), + target.WithMirrorTargetNamespace(d.namespace), + target.WithMirrorTargetStatus(&target.MirrorTargetStatus{ + Phase: target.MirrorTargetPhasePending, + }), + target.WithMirrorTargetLabels(d.labels), + target.WithMirrorTargetColocation(d.colocation), + target.WithMirrorTargetHost(host), + target.WithMirrorTargetPort(port), + ) + if err != nil { + return err + } + return d.ctrl.GetManager().GetClient().Create(ctx, mt) +} + +func (d *discoverer) deleteTarget(ctx context.Context, req map[string]*deletedTarget) error { + if len(req) == 0 { + return nil + } + tgts := make([]*payload.Mirror_Target, 0, len(req)) + for _, deleted := range req { + tgts = append(tgts, &payload.Mirror_Target{ + Host: deleted.host, + Port: deleted.port, + }) + } + return d.mirr.Disconnect(ctx, tgts...) +} + +func (d *discoverer) updateMirrorTargetPhase(ctx context.Context, name string, phase target.MirrorTargetPhase) error { + c := d.ctrl.GetManager().GetClient() + mt := &target.MirrorTarget{} + if err := c.Get(ctx, k8s.ObjectKey{ + Namespace: d.namespace, + Name: name, + }, mt); err != nil { + return err + } + if mt.Status.Phase == phase { + return nil + } + mt.Status.Phase = phase + mt.Status.LastTransitionTime = k8s.Now() + return c.Status().Update(ctx, mt) +} + +func (d *discoverer) updateTarget(ctx context.Context, req map[string]*updatedTarget) (err error) { + if len(req) == 0 { + return nil + } + for _, updated := range req { + derr := d.mirr.Disconnect(ctx, &payload.Mirror_Target{ + Host: updated.old.Host, + Port: uint32(updated.old.Port), + }) + if derr != nil { + err = errors.Join(err, derr) + } else { + if cerr := d.mirr.Connect(ctx, &payload.Mirror_Target{ + Host: updated.new.Host, + Port: uint32(updated.new.Port), + }); cerr != nil { + err = errors.Join(cerr, err) + if uerr := d.updateMirrorTargetPhase(ctx, updated.name, target.MirrorTargetPhaseDisconnected); uerr != nil { + err = errors.Join(err, uerr) + } + } + } + } + return err +} diff --git a/pkg/gateway/mirror/service/discovery_option.go b/pkg/gateway/mirror/service/discovery_option.go new file mode 100644 index 0000000000..345adaa047 --- /dev/null +++ b/pkg/gateway/mirror/service/discovery_option.go @@ -0,0 +1,120 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package service + +import ( + "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/net" + "github.com/vdaas/vald/internal/timeutil" +) + +// Option represents the functional option for discoverer. +type DiscovererOption func(d *discoverer) error + +var defaultDiscovererOpts = []DiscovererOption{ + WithDiscovererDuration("1s"), + WithDiscovererErrGroup(errgroup.Get()), + WithDiscovererColocation("dc1"), +} + +// WithDiscovererMirror returns the option to set the Mirror service. +func WithDiscovererMirror(m Mirror) DiscovererOption { + return func(d *discoverer) error { + if m == nil { + return errors.NewErrCriticalOption("discovererMirror", m) + } + d.mirr = m + return nil + } +} + +// WithDiscovererDialer returns the option to set the dialer for controller manager. +func WithDiscovererDialer(der net.Dialer) DiscovererOption { + return func(d *discoverer) error { + if der != nil { + d.der = der + } + return nil + } +} + +// WithDiscovererNamespace returns the option to set the namespace for discovery. +func WithDiscovererNamespace(ns string) DiscovererOption { + return func(d *discoverer) error { + if len(ns) != 0 { + d.namespace = ns + } + return nil + } +} + +// WithDiscovererGroup returns the option to set the Mirror group for discovery. +func WithDiscovererGroup(g string) DiscovererOption { + return func(d *discoverer) error { + if len(g) != 0 { + if d.labels == nil { + d.labels = make(map[string]string) + } + d.labels[groupKey] = g + } + return nil + } +} + +// WithDiscovererColocation returns the option to set the colocation name of datacenter. +func WithDiscovererColocation(loc string) DiscovererOption { + return func(d *discoverer) error { + if len(loc) != 0 { + d.colocation = loc + } + return nil + } +} + +// WithDiscovererDuration returns the option to set the duration of the discovery. +func WithDiscovererDuration(s string) DiscovererOption { + return func(d *discoverer) error { + if s == "" { + return nil + } + dur, err := timeutil.Parse(s) + if err != nil { + return errors.NewErrInvalidOption("discovererDuration", s, err) + } + d.dur = dur + return nil + } +} + +// WithDiscovererErrGroup returns the option to set the errgroup. +func WithDiscovererErrGroup(eg errgroup.Group) DiscovererOption { + return func(d *discoverer) error { + if eg != nil { + d.eg = eg + } + return nil + } +} + +// WithDiscovererSelfMirrorAddrs returns the option to set the self Mirror addresses. +func WithDiscovererSelfMirrorAddrs(addrs ...string) DiscovererOption { + return func(d *discoverer) error { + if len(addrs) == 0 { + return errors.NewErrCriticalOption("discovererSelfMirrorAddrs", addrs) + } + d.selfMirrAddrs = append(d.selfMirrAddrs, addrs...) + return nil + } +} diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index 7725d0bb07..2c1489d27b 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -18,7 +18,7 @@ import ( "reflect" "github.com/vdaas/vald/apis/grpc/v1/vald" - client "github.com/vdaas/vald/internal/client/v1/client/mirror" + "github.com/vdaas/vald/internal/client/v1/client/mirror" "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/log" @@ -44,7 +44,7 @@ type Gateway interface { } type gateway struct { - client client.Client // Mirror Gateway client for other clusters and to the Vald gateway (LB gateway) client for own cluster. + client mirror.Client // Mirror Gateway client for other clusters and to the Vald gateway (LB gateway) client for own cluster. eg errgroup.Group podName string } diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index ea63b9d198..67ed8257d9 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -37,21 +37,24 @@ import ( type Mirror interface { Start(ctx context.Context) (<-chan error, error) Connect(ctx context.Context, targets ...*payload.Mirror_Target) error + Disconnect(ctx context.Context, targets ...*payload.Mirror_Target) error + IsConnected(ctx context.Context, addr string) bool + Exist(ctx context.Context, addr string) bool MirrorTargets() ([]*payload.Mirror_Target, error) + RangeAllMirrorAddr(f func(addr string, _ any) bool) } type mirr struct { - addrl sync.Map // List of all connected addresses - selfMirrAddrs []string // Address of self mirror gateway - selfMirrAddrl sync.Map // List of self Mirror gateway addresses - gwAddrs []string // Address of Vald Gateway (LB gateway) - gwAddrl sync.Map // List of Vald Gateway addresses - gateway Gateway + addrl sync.Map // List of all connected addresses + selfMirrTgts []*payload.Mirror_Target // Targets of self mirror gateway + selfMirrAddrl sync.Map // List of self Mirror gateway addresses + gwAddrl sync.Map // List of Vald Gateway addresses eg errgroup.Group advertiseDur time.Duration + gateway Gateway } -func NewMirror(opts ...MirrorOption) (Mirror, error) { +func NewMirror(opts ...MirrorOption) (_ Mirror, err error) { m := new(mirr) for _, opt := range append(defaultMirrOpts, opts...) { if err := opt(m); err != nil { @@ -64,13 +67,24 @@ func NewMirror(opts ...MirrorOption) (Mirror, error) { log.Warn(oerr) } } - for _, addr := range m.selfMirrAddrs { - m.selfMirrAddrl.Store(addr, struct{}{}) - } - for _, addr := range m.gwAddrs { - m.gwAddrl.Store(addr, struct{}{}) - } - return m, nil + + m.selfMirrTgts = make([]*payload.Mirror_Target, 0) + m.selfMirrAddrl.Range(func(addr, _ any) bool { + var ( + host string + port uint16 + ) + host, port, err = net.SplitHostPort(addr.(string)) + if err != nil { + return false + } + m.selfMirrTgts = append(m.selfMirrTgts, &payload.Mirror_Target{ + Host: host, + Port: uint32(port), + }) + return true + }) + return m, err } func (m *mirr) Start(ctx context.Context) (<-chan error, error) { @@ -111,12 +125,9 @@ func (m *mirr) startAdvertise(ctx context.Context) (<-chan error, error) { }() ech := make(chan error, 100) - tgts, err := m.toMirrorTargets(m.selfMirrAddrs...) - if err != nil { - close(ech) - return nil, err - } - err = m.registers(ctx, tgts) + err := m.registers(ctx, &payload.Mirror_Targets{ + Targets: m.selfMirrTgts, + }) if err != nil && !errors.Is(err, errors.ErrTargetNotFound) && !errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { @@ -165,8 +176,8 @@ func (m *mirr) startAdvertise(ctx context.Context) (<-chan error, error) { case <-ctx.Done(): return err case <-tic.C: - tgts, err := m.toMirrorTargets(append(m.selfMirrAddrs, m.gateway.GRPCClient().ConnectedAddrs()...)...) - if err != nil || len(tgts.GetTargets()) == 0 { + resTgts, err := m.advertises(ctx, new(payload.Mirror_Targets)) + if err != nil || len(resTgts) == 0 { if err == nil { err = errors.ErrTargetNotFound } @@ -174,26 +185,26 @@ func (m *mirr) startAdvertise(ctx context.Context) (<-chan error, error) { case <-ctx.Done(): return ctx.Err() case ech <- err: + break } - continue } - resTgts, err := m.advertises(ctx, tgts) - if err != nil || len(resTgts) == 0 { - if err == nil { - err = errors.ErrTargetNotFound - } + if err = m.Connect(ctx, resTgts...); err != nil { select { case <-ctx.Done(): return ctx.Err() case ech <- err: + break } - continue } - if err = m.Connect(ctx, resTgts...); err != nil { + + if err := m.registers(ctx, &payload.Mirror_Targets{ + Targets: append(resTgts, m.selfMirrTgts...), + }); err != nil { select { case <-ctx.Done(): return ctx.Err() case ech <- err: + break } } log.Debugf("[mirror]: connected mirror gateway targets: %v", m.gateway.GRPCClient().ConnectedAddrs()) @@ -262,7 +273,6 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) erro } return err } - return nil }) } @@ -281,6 +291,7 @@ func (m *mirr) advertises(ctx context.Context, tgts *payload.Mirror_Targets) ([] ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.AdvertiseRPCName, } resTgts := make([]*payload.Mirror_Target, 0, len(tgts.GetTargets())) + exists := make(map[string]struct{}) var mu sync.Mutex err := m.gateway.DoMulti(ctx, m.connectedMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { @@ -318,6 +329,22 @@ func (m *mirr) advertises(ctx context.Context, tgts *payload.Mirror_Targets) ([] "failed to parse "+vald.AdvertiseRPCName+" gRPC error response", reqInfo, resInfo, ) attrs = trace.FromGRPCStatus(st.Code(), msg) + + // When ingress is deleted, the controller's default backend results(Unimplemented error) are returned so that the connection should be disconnected. + // If it is a different namespace on the same cluster, the connection is automatically disconnected because the net.grpc health check fails. + if st != nil && st.Code() == codes.Unimplemented { + host, port, err := net.SplitHostPort(target) + if err != nil { + log.Warn(err) + } else { + if err := m.Disconnect(ctx, &payload.Mirror_Target{ + Host: host, + Port: uint32(port), + }); err != nil { + log.Errorf("failed to disconnect %s, err: %v", target, err) + } + } + } } log.Errorf("failed to process advertise requst to %s\terror: %s", target, err.Error()) if span != nil { @@ -328,9 +355,15 @@ func (m *mirr) advertises(ctx context.Context, tgts *payload.Mirror_Targets) ([] return err } if res != nil && len(res.GetTargets()) > 0 { - mu.Lock() - resTgts = append(resTgts, res.GetTargets()...) - mu.Unlock() + for _, tgt := range res.GetTargets() { + mu.Lock() + addr := net.JoinHostPort(tgt.Host, uint16(tgt.Port)) + if _, ok := exists[addr]; !ok { + exists[addr] = struct{}{} + resTgts = append(resTgts, res.GetTargets()...) + } + mu.Unlock() + } } return nil }) @@ -348,10 +381,10 @@ func (m *mirr) Connect(ctx context.Context, targets ...*payload.Mirror_Target) e return errors.ErrTargetNotFound } for _, target := range targets { - addr := net.JoinHostPort(target.GetIp(), uint16(target.GetPort())) // addr: host:port + addr := net.JoinHostPort(target.GetHost(), uint16(target.GetPort())) // addr: host:port if !m.isSelfMirrorAddr(addr) && !m.isGatewayAddr(addr) { _, ok := m.addrl.Load(addr) - if !ok || !m.gateway.GRPCClient().IsConnected(ctx, addr) { + if !ok || !m.IsConnected(ctx, addr) { _, err := m.gateway.GRPCClient().Connect(ctx, addr) if err != nil { m.addrl.Delete(addr) @@ -364,9 +397,44 @@ func (m *mirr) Connect(ctx context.Context, targets ...*payload.Mirror_Target) e return nil } +func (m *mirr) Disconnect(ctx context.Context, targets ...*payload.Mirror_Target) error { + ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.Disconnect") + defer func() { + if span != nil { + span.End() + } + }() + if len(targets) == 0 { + return errors.ErrTargetNotFound + } + for _, target := range targets { + addr := net.JoinHostPort(target.GetHost(), uint16(target.GetPort())) + if _, ok := m.gwAddrl.Load(addr); !ok { + _, ok := m.addrl.Load(addr) + if ok || m.IsConnected(ctx, addr) { + if err := m.gateway.GRPCClient().Disconnect(ctx, addr); err != nil && !errors.Is(err, errors.ErrGRPCClientConnNotFound(addr)) { + return err + } + m.addrl.Delete(addr) + } + } + } + return nil +} + +func (m *mirr) IsConnected(ctx context.Context, addr string) bool { + return m.gateway.GRPCClient().IsConnected(ctx, addr) +} + +func (m *mirr) Exist(_ context.Context, addr string) bool { + _, ok := m.addrl.Load(addr) + return ok +} + func (m *mirr) MirrorTargets() ([]*payload.Mirror_Target, error) { - addrs := append(m.selfMirrAddrs, m.gateway.GRPCClient().ConnectedAddrs()...) - tgts := make([]*payload.Mirror_Target, 0, len(addrs)) + addrs := m.gateway.GRPCClient().ConnectedAddrs() + tgts := make([]*payload.Mirror_Target, 0, len(addrs)+1) + tgts = append(tgts, m.selfMirrTgts...) for _, addr := range addrs { if !m.isGatewayAddr(addr) { host, port, err := net.SplitHostPort(addr) @@ -374,7 +442,7 @@ func (m *mirr) MirrorTargets() ([]*payload.Mirror_Target, error) { return nil, err } tgts = append(tgts, &payload.Mirror_Target{ - Ip: host, + Host: host, Port: uint32(port), }) } @@ -383,17 +451,13 @@ func (m *mirr) MirrorTargets() ([]*payload.Mirror_Target, error) { } func (m *mirr) isSelfMirrorAddr(addr string) bool { - if _, ok := m.selfMirrAddrl.Load(addr); ok { - return true - } - return false + _, ok := m.selfMirrAddrl.Load(addr) + return ok } func (m *mirr) isGatewayAddr(addr string) bool { - if _, ok := m.gwAddrl.Load(addr); ok { - return true - } - return false + _, ok := m.gwAddrl.Load(addr) + return ok } func (m *mirr) connectedMirrorAddrs() []string { @@ -408,7 +472,19 @@ func (m *mirr) connectedMirrorAddrs() []string { return addrs } -func (m *mirr) toMirrorTargets(addrs ...string) (*payload.Mirror_Targets, error) { +func (m *mirr) RangeAllMirrorAddr(f func(addr string, _ any) bool) { + m.addrl.Range(func(key, value any) bool { + addr := key.(string) + if !m.isGatewayAddr(addr) { + if !f(key.(string), value) { + return false + } + } + return true + }) +} + +func (m *mirr) toMirrorTargets(addrs ...string) ([]*payload.Mirror_Target, error) { tgts := make([]*payload.Mirror_Target, 0, len(addrs)) for _, addr := range addrs { if ok := m.isGatewayAddr(addr); !ok { @@ -417,12 +493,10 @@ func (m *mirr) toMirrorTargets(addrs ...string) (*payload.Mirror_Targets, error) return nil, err } tgts = append(tgts, &payload.Mirror_Target{ - Ip: host, + Host: host, Port: uint32(port), }) } } - return &payload.Mirror_Targets{ - Targets: tgts, - }, nil + return tgts, nil } diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go index e3c02d7be3..bf95c33f09 100644 --- a/pkg/gateway/mirror/service/mirror_option.go +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -40,10 +40,9 @@ func WithValdAddrs(addrs ...string) MirrorOption { if len(addrs) == 0 { return errors.NewErrCriticalOption("lbAddrs", addrs) } - if m.gwAddrs == nil { - m.gwAddrs = make([]string, 0, len(addrs)) + for _, addr := range addrs { + m.gwAddrl.Store(addr, struct{}{}) } - m.gwAddrs = append(m.gwAddrs, addrs...) return nil } } @@ -53,10 +52,9 @@ func WithSelfMirrorAddrs(addrs ...string) MirrorOption { if len(addrs) == 0 { return errors.NewErrCriticalOption("selfMirrorAddrs", addrs) } - if m.selfMirrAddrs == nil { - m.selfMirrAddrs = make([]string, 0, len(addrs)) + for _, addr := range addrs { + m.selfMirrAddrl.Store(addr, struct{}{}) } - m.selfMirrAddrs = append(m.selfMirrAddrs, addrs...) return nil } } diff --git a/pkg/gateway/mirror/usecase/vald.go b/pkg/gateway/mirror/usecase/vald.go index 13a0a74c2d..8b8f253bff 100644 --- a/pkg/gateway/mirror/usecase/vald.go +++ b/pkg/gateway/mirror/usecase/vald.go @@ -19,10 +19,12 @@ import ( "github.com/vdaas/vald/apis/grpc/v1/vald" mclient "github.com/vdaas/vald/internal/client/v1/client/mirror" "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/observability" backoffmetrics "github.com/vdaas/vald/internal/observability/metrics/backoff" cbmetrics "github.com/vdaas/vald/internal/observability/metrics/circuitbreaker" + mirrormetrics "github.com/vdaas/vald/internal/observability/metrics/gateway/mirror" "github.com/vdaas/vald/internal/runner" "github.com/vdaas/vald/internal/safety" "github.com/vdaas/vald/internal/servers/server" @@ -36,16 +38,26 @@ import ( type run struct { eg errgroup.Group + der net.Dialer cfg *config.Data server starter.Server c mclient.Client gw service.Gateway - mgw service.Mirror + mirr service.Mirror + dsc service.Discoverer observability observability.Observability } func New(cfg *config.Data) (r runner.Runner, err error) { eg := errgroup.Get() + netOpts, err := cfg.Mirror.Net.Opts() + if err != nil { + return nil, err + } + der, err := net.NewDialer(netOpts...) + if err != nil { + return nil, err + } cOpts, err := cfg.Mirror.Client.Opts() if err != nil { @@ -69,7 +81,7 @@ func New(cfg *config.Data) (r runner.Runner, err error) { if err != nil { return nil, err } - mgw, err := service.NewMirror( + mirr, err := service.NewMirror( service.WithErrorGroup(eg), service.WithAdvertiseInterval(cfg.Mirror.AdvertiseInterval), service.WithValdAddrs(cfg.Mirror.GatewayAddr), @@ -79,12 +91,25 @@ func New(cfg *config.Data) (r runner.Runner, err error) { if err != nil { return nil, err } + dsc, err := service.NewDiscoverer( + service.WithDiscovererNamespace(cfg.Mirror.Namespace), + service.WithDiscovererGroup(cfg.Mirror.Group), + service.WithDiscovererDuration(cfg.Mirror.DiscoveryDuration), + service.WithDiscovererSelfMirrorAddrs(cfg.Mirror.SelfMirrorAddr), + service.WithDiscovererColocation(cfg.Mirror.Colocation), + service.WithDiscovererDialer(der), + service.WithDiscovererMirror(mirr), + service.WithDiscovererErrGroup(eg), + ) + if err != nil { + return nil, err + } v, err := handler.New( handler.WithValdAddr(cfg.Mirror.GatewayAddr), handler.WithErrGroup(eg), handler.WithGateway(gw), - handler.WithMirror(mgw), + handler.WithMirror(mirr), handler.WithStreamConcurrency(cfg.Server.GetGRPCStreamConcurrency()), ) if err != nil { @@ -106,6 +131,7 @@ func New(cfg *config.Data) (r runner.Runner, err error) { cfg.Observability, backoffmetrics.New(), cbmetrics.New(), + mirrormetrics.New(mirr), ) if err != nil { return nil, err @@ -137,16 +163,21 @@ func New(cfg *config.Data) (r runner.Runner, err error) { return &run{ eg: eg, + der: der, cfg: cfg, server: srv, c: c, gw: gw, - mgw: mgw, + mirr: mirr, + dsc: dsc, observability: obs, }, nil } func (r *run) PreStart(ctx context.Context) error { + if r.der != nil { + r.der.StartDialerCache(ctx) + } if r.observability != nil { return r.observability.PreStart(ctx) } @@ -155,7 +186,7 @@ func (r *run) PreStart(ctx context.Context) error { func (r *run) Start(ctx context.Context) (<-chan error, error) { ech := make(chan error, 6) - var mech, cech, sech, oech <-chan error + var mech, dech, cech, sech, oech <-chan error var err error sech = r.server.ListenAndServe(ctx) @@ -166,8 +197,15 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { return nil, err } } - if r.mgw != nil { - mech, err = r.mgw.Start(ctx) + if r.mirr != nil { + mech, err = r.mirr.Start(ctx) + if err != nil { + close(ech) + return nil, err + } + } + if r.dsc != nil { + dech, err = r.dsc.Start(ctx) if err != nil { close(ech) return nil, err @@ -184,6 +222,7 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { case <-ctx.Done(): return ctx.Err() case err = <-mech: + case err = <-dech: case err = <-cech: case err = <-sech: case err = <-oech: From 1f244609416cc7d9b50719ffaa569ebb2a35785b Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 4 Jul 2023 10:50:39 +0900 Subject: [PATCH 09/93] fix mirror image tag Signed-off-by: hlts2 --- charts/vald/values/multi-vald/dev-vald-01.yaml | 2 -- charts/vald/values/multi-vald/dev-vald-02.yaml | 2 -- charts/vald/values/multi-vald/dev-vald-03.yaml | 2 -- charts/vald/values/multi-vald/dev-vald-with-mirror.yaml | 2 +- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/charts/vald/values/multi-vald/dev-vald-01.yaml b/charts/vald/values/multi-vald/dev-vald-01.yaml index dd6ed28343..6b30c0c9b3 100644 --- a/charts/vald/values/multi-vald/dev-vald-01.yaml +++ b/charts/vald/values/multi-vald/dev-vald-01.yaml @@ -22,8 +22,6 @@ discoverer: gateway: mirror: enabled: true - image: - tag: pr-2023 # TODO: Delete it later. clusterRoleBinding: name: vald-mirror-01 serviceAccount: diff --git a/charts/vald/values/multi-vald/dev-vald-02.yaml b/charts/vald/values/multi-vald/dev-vald-02.yaml index c3acd6a9fa..64d026e949 100644 --- a/charts/vald/values/multi-vald/dev-vald-02.yaml +++ b/charts/vald/values/multi-vald/dev-vald-02.yaml @@ -24,8 +24,6 @@ discoverer: gateway: mirror: enabled: true - image: - tag: pr-2023 # TODO: Delete it later. clusterRole: enabled: false clusterRoleBinding: diff --git a/charts/vald/values/multi-vald/dev-vald-03.yaml b/charts/vald/values/multi-vald/dev-vald-03.yaml index 5aef7cc24b..4b90cdc27a 100644 --- a/charts/vald/values/multi-vald/dev-vald-03.yaml +++ b/charts/vald/values/multi-vald/dev-vald-03.yaml @@ -24,8 +24,6 @@ discoverer: gateway: mirror: enabled: true - image: - tag: pr-2023 # TODO: Delete it later. clusterRole: enabled: false clusterRoleBinding: diff --git a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml index 3dc07692da..d0d0ff8ad2 100644 --- a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml +++ b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml @@ -15,7 +15,7 @@ # defaults: image: - tag: pr-2023 # TODO: Delete it later. + tag: pr-1948 # TODO: Delete it later. server_config: metrics: pprof: From 8bbe9311d5ed815b3aa1aa7602d655f31b47414b Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Tue, 25 Jul 2023 10:18:35 +0900 Subject: [PATCH 10/93] Add mirror gateway document (#2105) * add mirror document Signed-off-by: hlts2 * fix svg to png Signed-off-by: hlts2 * Update docs/api/mirror-gateway.md Co-authored-by: Kiichiro YUKAWA * Update docs/api/mirror-gateway.md Co-authored-by: Kiichiro YUKAWA * Update docs/api/mirror-gateway.md Co-authored-by: Kiichiro YUKAWA * style: Format code with prettier and gofumpt * Update docs/overview/component/mirror-gateway.md Co-authored-by: Kiichiro YUKAWA * Apply suggestions from code review Co-authored-by: Kiichiro YUKAWA * style: Format code with prettier and gofumpt * Apply suggestions from code review * Update docs/overview/component/mirror-gateway.md * fix expand bug for mirror tutorial Signed-off-by: hlts2 * style: Format code with prettier and gofumpt * fix filename typo Signed-off-by: hlts2 * add new link Signed-off-by: hlts2 * add cluster role settings for mirror gateway Signed-off-by: hlts2 * add hdf5 installation section Signed-off-by: hlts2 * Update docs/user-guides/mirroring-configuration.md Co-authored-by: Kiichiro YUKAWA * update link Signed-off-by: hlts2 * delete quote Signed-off-by: hlts2 * update mirror component overview image Signed-off-by: hlts2 * update mirror component overview image Signed-off-by: hlts2 * Update docs/overview/component/mirror-gateway.md Co-authored-by: Kevin Diu * Update docs/overview/component/mirror-gateway.md * Update docs/api/mirror-gateway.md Co-authored-by: Yusuke Kadowaki * Update docs/api/mirror-gateway.md * Update docs/user-guides/mirroring-configuration.md Co-authored-by: Kevin Diu --------- Signed-off-by: hlts2 Co-authored-by: Kiichiro YUKAWA Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> Co-authored-by: Kevin Diu Co-authored-by: Yusuke Kadowaki --- .../mirror-gateway/full-mesh-connection.png | Bin 0 -> 26793 bytes .../mirror-gateway/mirror-gateway.png | Bin 0 -> 46215 bytes .../mirror-gateway/request-forwarding.png | Bin 0 -> 55962 bytes .../tutorial/vald-multicluster-on-k8s.png | Bin 0 -> 25971 bytes docs/api/mirror-gateway.md | 161 ++++++++++ docs/overview/component/mirror-gateway.md | 78 +++++ docs/tutorial/vald-multicluster-on-k8s.md | 303 ++++++++++++++++++ docs/user-guides/cluster-role-binding.md | 99 ++++++ docs/user-guides/mirroring-configuration.md | 89 +++++ 9 files changed, 730 insertions(+) create mode 100644 assets/docs/overview/component/mirror-gateway/full-mesh-connection.png create mode 100644 assets/docs/overview/component/mirror-gateway/mirror-gateway.png create mode 100644 assets/docs/overview/component/mirror-gateway/request-forwarding.png create mode 100644 assets/docs/tutorial/vald-multicluster-on-k8s.png create mode 100644 docs/api/mirror-gateway.md create mode 100644 docs/overview/component/mirror-gateway.md create mode 100644 docs/tutorial/vald-multicluster-on-k8s.md create mode 100644 docs/user-guides/mirroring-configuration.md diff --git a/assets/docs/overview/component/mirror-gateway/full-mesh-connection.png b/assets/docs/overview/component/mirror-gateway/full-mesh-connection.png new file mode 100644 index 0000000000000000000000000000000000000000..66ae6b4d40a3f273d34c00326e1325e28ddc729c GIT binary patch literal 26793 zcmeFYcT|&W_bnO(1O+LgfFK~Cf+9^odQk*ar0J$e3uPl6M4FT&s0c{aEz*R5AYGdD zmLOH7_fDjTPy(b862g76zrDY4@3`l$^Vbjaw27%nP?%%!r#|wt-BesSt7l;HEm3jFTQ~T{p3=(?Mktz4Z zc5|r)?Zu{MXA=}6+&aFezbJB?(N8zLtbl>(gtHlWo|1l0D&|}D>b%6%()rlv-;~^# zd;H-aE{R=>W;*wS;hqYT670LvUu`+DFunej@O5y#i8o9LPWbAo>G^>$i=xzYq)6M? z-v@3Dq%%7!&p`j7_Rn-8VR8vO?le2=*OZ{jw1BqSY#z9 z{pfLLiiLhu68)c#|Ie%YpRfV8!vEo0#%aAXh|ta^`z2Zgs^Y!SqS{K`?>z-ln-&h+ zdVkdfo*6XllFGDw&zl8QVK(b6qV6^QZS`Yk5O>#aSs2;y%_YzuTQ#G`8~wh}>fCpA zd3B5tWyRawa5!Xkc&66VUtYz1SnVHZJuL6vq`7_RG(?^bEY*O(>WXOUyD3s z?;nKGZ~>Ec!K=8&pzRrIW7ldHHhet-E;86iUi%d0!$}N23BnkA*L!<3zgL)>k%1$_ z$@|piYWL9sYFKb5w?X`jD`#8XDT>D>gy}I2dyH5o?lfcJw2f@qwPUZVh#1+%mA~vs zdbd^1?Y*&wY#&pzk8wGt+cExmIsE;v+D(QTJn#5RWjb?D#RR4;EXUG z@YEnm!1g7Mpiz5sQ!+$z_W#$-EDHK~^I^$Ap!G30=1sX$g~6d4`QCmqAWXO1fIS;hhi5$xiLwLfM^{!{ecGQfz8T~^Jc)8n z7<{8Y{LMysY$@rT+lF0@+pvYMh796h37)debvyeGC+MVscaNKZu{U3?gnKOmDPCdV zUiL9{ee|y@hM}6;@JX3P37stdZX2GxeCs2zgwJR8-poG?{Gsb+!PT7_+&626m_kw4 zlndYTNECc7*}+CIa`0D8tW9B$NT}=z&cGjcYxQmthYz#_ZEjH1h*RZ#LZg#aoqM-< z4gH#1^ud&JIFh#Dx=ib({R$DlG$x@6ODdp*QccQR$2)!lh`j_~d`otNa0gVN3pPt$BZ*Tv0_qZ$wF%4k0N6=N@sT|ON=S&#rZ>rPqnxHK4$A4!AT z6a2s4Ri=7;=K>Fm%Pt%^C0;71a=S6x9WMD=S~8=5l(!59IscWByNA!eT~XNeqRqu+ z2i~{?lj99-!d#+Qf!{zXh8%MQ!+k<+5nfc2Eb9`SiUmTC2;gIaMVEO^Ns4pK#1O`n zH%ad^Y6}8~9&V_rl*Z=Dh7O;vLOw6Qv!%Wx7=Mse%-iMXBM4(z$~?kpANvntEpD`# zK~Q_@y!FfeSluIp+y! zO;t%znNUgj&g&>TKv>rzH5OzWY^lfgN`fe1*;Pr4nVUma@wcSV58?u*ZzWdL{ML{2 zudU?=@$>)vvbE}hz4=JWC%+^J2nI)w#+{4!uHXtzP^??IRd+KAlN#n_V`nFIby~X1 zK!aDhCIJ`3{&XS1tw%0@48KnvgxrnusEtWFBAQ=J?diou3)E>IqVrmPNQ9m?(ddgK zn?ZpGu{l5tn|K%2d5)c~ov-T*8Xvqq@ZKH*ayA@92)KK_^t`ykJy{AK8E+S>OIX+U zJ3EZW+`5fNNOM>)yok-z4yoBhci z@T136QAUOPje}~+^MNH>3!9sUiVE5&`Vp!Ii(w18SrN(yII`r z^6Y$9)d!7h~p2>og5e2 zEN|YyTw@iq(Jk$I6rN5;3?tIC*V5w4A`YpycdGrqM@jxMph=ojG)?%xU{LB?d*$Zo zf)~fDfd*j>I?J>?s|1o&;x&uQf+ZeR(~}z4$M1h|rgS@Mt~U0^em}57SMVpjBF2a( z-s=ETN5tae+2ZXI>&Ch`R4IRfEu=y>o#$-CBK>YQuA;nd&U-L$F$~<1;eQY^SLg z&O?*@tc-HEfN19dx0^*K%TgpUOJ|vNYtEAt+pU>wm7SYFzuOfTe@fNwv#NAbyqF z`6;tm!mS}7Ylz$i6CkG#L3Of@;4^w8nn$m_Eo?2_wQi>1I%2o6q7c zpbeb4`Iw=B9Pp=4 z2Qt%7=BfFbC=7?%Db`&=K}hpPZ0#?O%^B^+IYH>`8K149ZF_}xGsZ(KLm9whkEuk8 zolf@H{Il9o*yYt4*PwT%V#DEqP8Y7150+ljFeAp_HR@mu6=aK-d?Xkhs8~M6TUPyg z`0I}?Pkue~nq3P^WSn!%iRQx#?0-D5E6Z$d5W;PVe zW`VV}Q|nh!ZT~tczF--cy@x1y6_FDdR7B?fPSvJUo3fDc#O7&fz`k3-7_|7R8>KxTlx9RDCtDE+;lj*W8K) z`akZ2az=}`$AZM&FMBkrAaDcfCcsO|#c!1syS@Dib+=Svb1Hdb7Vd6P#XGCl>$+7~ zkz1slplj?@bno0v`S?pwZ0s&Y`scXJKQxI3rlC2 z_gfp3mf`*EOM1@hIc_Of59L+LV3oA0Uk>moTqFNB@*o;_W@v?rM?kZqHAMc6Y_yl|^|8n=TyrrFPi1BuhiIzH86bBbgo z9XUMd`UD^VVHKdZAEvWs9yU(|4dU;YOZ-tRf@LmwzHkev5OZ}mPruN*4nN|LETgB zg6@Ngwj+oIh&&-yirW)eB=vbHUB>X3XuJ=aaWAYH)S`T`3!Ya3v$zGyw&EX!5~p2p zA~mI!6$8gndS+;pT+ZX-?TDa4M4laRhWlphTDxtGjkTnl*BlQhSS0L(n`M$V?L{d1 zbM$lH6hIhR-DVBASSw_zj8V5vR|P&YjA?f1O$h-0;rhv!b$rr@XrUl0nz-_5-3Vhq zcVYA)22wo4;pa;tz5EN@We9n`6FNc<)8s^r(r;clrtnI)fwJy+vy6Q_OtiSNmA87g z^v9+>Nv#Z_vz@GJcgtrk4W#yFhNDPi5x^EM5oTL zS88Ks_Ev$XPneqb%>Hu(w!3`D_ouYr=&KJTu0sY;O}bl4>we0ajYP2Kq(5rXXEu2) zXgp9vJ;da*h>p=IN=}Co8@WU{1k)9;NH8HrLXUesbzfs=09jjAzpJ<|5U_mqGguMb z?ZyGZ=uWW+dDw`8^UfX$HB1iJy;+PbZ+{m2Sp=lRHf`}^vM3VDO@wSEYrcWfO|jP; z3RCYY%p#$~y|VCQmgpp9CMJ-Bx}evO$t`lQE#XDRt<}Jd%zCWPA#cPj3E=;^c@$uj zfx_sE`%1BpKcXX8k3gXAi8AC=Cf@?T$B#+3@w`D&20{ z>^H|@M+wQFgj~TluZdGG&=^2+CkMz&%i?GEl}fjN;idBtj5)1aX%RDVyr}oAhwXp) zgR={art>$PEoElkfk6CrAyeC|gf+_R4v8;p>kl!MKwbZ1goVLMd$jl7ntTzV{$?Q`j^rDTCSQA8*EpDcwB@?dAwqkGpmoVY z<%L34-a~vS=)9x?RsXe>O_9T)=zSL(3boHw>w~fSb`29qE(JO>G`r($7dZVgtknY6 zH5VrTEib(~DJ!kO2x>RD%}ClQ-{zR}T-W$B_`4Ev`~2?wUa7QQ?edO$C4xq%C`2B_ zA%9G2)Ao`Is|VCdCzna{!Qjwi3ZVD~;hO4@!_jQvA3pv?)^EB>D-@rO4t4T6f}}?Q8+0^8D#;szO3zazlCUuCk`1gAt{^KS8frOepJr&E3OAVPoTy*_sZHfedDA z!%Ce!!jE1oEOo`WhJKOYl5yZgDJV(GYz2$htYmTWu*ueB^VqaE7m? zV74=QPsjc^TAS)P1JG#yqlpHTiip{<-tQ;EN$ZxLKVNK5Sr#9~zR;+P6Oh9oo|g+G zdFISA5X81#3&hElS6#Vf{rdR#NG&VdpgI0aOkwq!BJ7_P{V_3!1Mbh`$X+wu`l}P2-oHUy&r}ImucA7TJ zds988#wDYYlex+?Dv%+zbypH=`&f7;OBer~4kn~!v_e}7F~AD=79sSD26TCr!aKEc zW4@>oJ0kg0bt2#H)gge))ZwbEc_#C?=op>d&xTdWe(M!2jRysbJL^3@yo$*$zf<5|e_MX;* zA-*@@7W->cON3vZok6RuUAN>n@T;ldg=#xh%f0H0y4Bkyij}>w+grSGR!MF_0B8Fi_NLo zw1I%GVA#7gp{aSc<)JuUAbhFD)&aj@_Z~}Nvq3XI4_)iOTtPK!8bQ|T-51ge3pWf} zm5zSHKW?;Qjp8HHw0&(78ms!rlT_mPn~A3NEveDk8yg;#t!s6KVcsGMP5mB-Ztp0y z=Xva_3D)8=W|U;^^DeBuV?Ox>aZO*x4CEtgr^8|9doNBAoJ8{X6o?A01DTF2)@FI; zo|Q$_C8G9$0s70E+0WWf9U-8RzE{vvi(pAd$CwORefLgiZeqMzwHIH7UFgZ~WZ8s{ zES4rAQ|(aV?S!s(b1!4sE7UH3p_@H;Zz*(d1?9&O?*?l=$^O*puR+Z97PFkrE3qm3 z8C-A7&-pW&-6`ufhZuM)CSk&__n-KdCYwLK*)wT0B;{{fltUbKX7yC~@)SyPgHgl2Gl8XtG6K;Qw!_%ZGVK;+ zj=AMUQU0q{tYc!A<7On+TH~Hcz50d;xB@A@Wn}@DBC4MKY_V(`k}#U_hk>i&gy&H! zwAKK;49#U|8Vefl{_P=T1Lv8&>n7031`b*M7|!l;J@usz%UDt+r-xTgoXf*4k9@nK z@e>zyRbu(~%|a>W=6pM7TwwF7js!-lE9L2r&V5{fnzqpdW+0~-G>V)#7 zLh)sYKOL>*a7LIvk3tpq7MGM5F`^c5IGZi$ng!p^1A~Tv*;LT^>czE-rKAJtBO~V&{lIi5WZ9fMln%9*gEULF7 z4&~$dJW8fl`uoGTRy6lJ`{e!nZ4m@l7Cif~)evDS&rZ5Seyl#mVo~yRg_l)+nOO}@ z-$BJ{{Bz5A61?*wyfQmnZ2Z>}lKB%KT{S3|xpQ-BQWiIK zm;2%yTbP(+g5kM1`5R3SgM`F7r8*LU$jy`D-Dsfl%)>6H+Cw~{d&to*_t)3DG?qBm zS(zE?3Ri>6?o}tIy^r3OL1HJ}M>bLKEWV=4*T^m+SD}~F$K#t1q0uaA-y(X&!g4Wz zt8(nl_#4Rw9X_yD_=1&^<7QhdAlfG&Og=v zMzsuqd$(_ul{VNs+lOnu0ke};j!Tgnwf%3ZC04gf#F)MgFplC0B0^JgAD%uKHnWE2 z>3rqY$bS|~F|?XMsww_?d2LfL<`GwlT=fl|M|Ni3m&6p=%|MpX6`foO zZpG66%-wS9k_CCe_UYMjrx6~Uzc4}ae-eLw-%-csj=7QW5fz#^m99zbpNejF*?0>W- zFYG-GvcU|yT}(Kv9SeE=B(p$3z{22<&ajvn8JR2R5;CM^%#OP$N!&8yi-=W?)NLmi z1kk=8;E*B5-1_QkP1sB$bv^dWkv-_8KT_8)sI}J@Bl{W~Cl_FvC?MPi4lj zrj_U!FNX)Y1XfEv`!)3T<+<0Qr+Z)6pHr5P6g^!v)nj#DeeW<|Piet9B>Q!i!j;(C zM-QRD8AX0DJJr@|M72k%SYF|Z7ptntOdH2R4e2x8+vGzr6hIyQfLv? zb$oyv$xI*Jciv+mwKzWwvRn8Iq;H5{pdg`C93BftC9kzCCx@fH+_wvCU!bgR($37# zQZie8GlCp~m%W&RyIwse_I3Euc|(}e*nsBq`tagd0JfiX4n7rEA@b{cThhaB*P^4$ z!-4Niip%WFuLXjX#KY?zB}H#?Un+!B5;`BWFq##7c*`Y?DZ(syxzzm9=_JPp+`x36 z6^J?;X%VfN$}K!>Wm`~l4Rym*QC`WNHGW0i!I)R%co0%6T)UZkHs# ziX)z9tI~r0Lwru(69r+!zFXkDniI+c%X}4ry04>4*jJ?mUKj8$n5}(@dnFm0`5cU{ zIInyX0~Jc>k6hk z7ri>JGBo3K;DRBO2yo%;-SjmLc zdo&~nzwR(ATNm(bE>e21eRk0z(k{XOCdm>7Fy^A@UzspxCFc7r#({||&$nKC-$)3p z3>5}A7WN7TG38r)r8LlY%&W>zk9D1kKZ5*x&b<=fd@BLJ$EkJjJBB(d z@)8xBO;fa^fwhw@k@2&*M2#ELq1fW$EV>Igz8b77!0Dtk?+KKPM@$gUU7FVS2xL?m z+D;=`Rd+l{TuQ)2Fl<3@dtAkGUlkl4UfMO2D}Rf318u_eDjR(GM}_Jq=frhpBVHdt zceBB}rhG~dmajKB?@{0Lj()lOgSY3bZahngbrQic?xXjTrgHhtEGh^x9>+d^Zz4GG zOPwHKK;B9C*m$r;8*hSBgnzR6Xv}&xKh;&D`vY01@e^}Xy1ollJYi9OcYWKgoEc1* z6pYJ}{UbWuD`}lmk3COPH`q`rAbm2Q-^*_X>}UChWxL?pZMQSSqZRDgaa|hwtLwo9 zW9Nx_yL?hk-Es~QFB@FPF?cM;6jEZ&Fia>p<@g{`BVaODuuMF3q3e#@__*Klp|}ZR zqM;cxyk2+u@Xo2-l3MEmJtQ2Ru+3_n(K@ny5vIMUD5X?~_Kx-Y!2! z^TCQLLYBG%2&ay<`qgoGrlHg{9y}g-6lx8{mejb-Al!#x&A-R(!&z*On)U2LyB8Ye z>*E&=X1p1*!y2lfaZ&TE6afRzNd79bwa|jbr~W5zX=%Y|R3^C;y4B?5QtP&TG?NsC zWYs(OG1VS-*T-y!AkbsH6`D2Aa};+8D?(co83FWbmc%`o4wv534dabehsviy3-kV$ zXwQmF& z?W=y%r&Sf#6raeS5=P_`!Jgi*zt|&uErad{UV8Pmt;YMWgBQ~0bL{?lMljFJ!?V|Ec;f=SS#0% z8+A6PPEfNd$NFoH`o(^aX0EsZMVa=Kimn3)8oedvsQ{X5_{2p$8}=Ul#BL`!A|Hj> z+Jp%r8j9|mgR(8qQo>Qp%5#~bS<}DLcJ5{_F~sQ)cRehgfkCdBfeH zv|!QDqq^tfp#FXU=kZmJ1BH_}&~ePFOc2nvA>c?}zUoYyOQ(E!ub9I29Hh$w>+H#d zroz^c>!OHWEG3Y%3ikPx)MKiZ0~cF~d*<8EV-h&H+Bmy8T8nBB9qg+2*()5$B_YIz z7XawaL)CZ+Tyt)`!~)9e0HcQ-6QRrHt$?qS=tii$#8Q*WUr>Me*PBL5FtthqN6z|o z(5uR2OZ;ynUiC}LdgdNCz>M@9v^MV-RG=C~J-!n!Gw zxsCFOFqQy%CqwUY=D4s8_D(v>C!tqUu_)(4Mc%*v zTSP{&twKeQL@=>vaY| zQH;qTJ@pWXwffC^>j3d~Em0AWDStN`i2YvQy7K0`*N;P?hKM6=-$Q7Vd)F^T&$&4F zX)r{FL0t9@QK9@W^uea^gHqbsNX_pr&Ldmt(N6*xL1=)Kf!ZSUOpwJNnkA0175uFc zn%IV&F3n#L5N*4ixq`Uk{kV_@YP|Bp0Znp&NMOKBrK2tl22_VZc!NPLki)&)La^2O1KXObuia2TmoW=vB+Low!D7t}Ch*b{t$Gv$N-bI1^AR)5MM2?^>P7 zK0=a%m>_{R0lEMWeUi1QKJ&q`r6$uZX!?rgF%@?zC-Ii=LS}bD>2XPVY8KQZLvy(@ z8NTq&cM!Q|qq=1iF!l*oc^CbsW}J@(`GqyXGW-5|cECe~b|`-QJy5o3HZI1xiG%_L zAmWsB626niV++$Kv&)HEcM&xOtrww|qF)uDBX~T)LzDOohzCElp z-beM|_v^VHLvAsQ-DbzW0P0=)NMHFc zWjuOAe7UJ$`=6vCMu1c>h<+nB_? z=L~2Dw8qtvW7r96U8YdwEQs~tG=>t!i);7|Q0gnk2irB6LD`2NuAZX03Aqd>5IB*l zvQ2(ubrhUqI{1;Ae$p7Uc$=RMqmlFB6eS`t|KRmR;L2y;0qsJO03G`=2MilsEG&Zi zUe}>(cnEmsK0OnJ)&0<;lH)9y<4#z=<|Aj(L|_-bXF+H&l-e zK3dUmppL={W5SMQN5+qF$n{;9kx0K&`lIw-)2WNM!Bh_8nQ!van5IEFJ5bK~biK1^ zEBTf@_C3%{$G0~k59!30Gd+GtHp&eC?Lf-Cf2QYbe9eJS9IAqG;HbI=Xd?t*ATvEW ze^Z-K7?rFW_jsKl>mdN0H3|GpVFYURemIo7(`%~biZqzkkqk%u<=Z0%<}c^Z5L~p! z3$(5;*1C@f!j#Jn#$USwVr7INqAJy|wi0|6q*FTc|10(LfQG!~P)XdoW#me&ds)fEQj6Qh~a{c|Pg4>{{Z*AJ6=NPFb&h((=@3H7Cf; zW_VQg6+&(~=O>wnzt6M3%}T@Loo$>JdJgQ!onY8Cl+5>qF;q6(*FaVacjp9XyYqyQ zPS15*gH_oXj3cqnoqRU#+TA21>$CPlb5a3r@RO@NXXv#!pSc<*7ZUbYQ}hTKOY5Km zBu~;_^9gTb`nu48)%q<+VsJZnU`~;cj{2f1F@Sl}=S)*V{SxKOl5THxKi(dxaq5a~ z`K@o8azrk~*}l6CAbO30COtUv`7quK^1d5QRBr^dtE_&#&6m7C`zVz3mK+*m`fh;B zAG_TcqMIS_tS`LK3hl8Q^+sBK^zF$N)M+ikMHpWNvZx0ZNZdbL>z!5?&}5)+r@YqY zI=pA_MGqThlDi=DFOl;n&Zyd<&hOYk2EuSh7URqy%nv#H9Oo`u85b?S99k|Ps-+RT z13{ImuViym^#)}z;#z}j;v=vv;D33yJ%>@&_?if<6_l9Nyel5us;_*?6Vcq+Rz7t=|v!m1FfaWLGcC8%e z^j>DQ*|DE2E7^ig?Fg%vf#m&FRdn30?5o@c*|noQO&}>6A}Fr|jzn4&V2KI~a*a~I z)kTf6wKTP5(60w_2N>1TfsqWfn|zD%tJZU=GKThcealNoiZusiLc3YdbS!tNdK$>0 zmd~1DK=GE=WjQjUZn08{mEeOYGJpca97Tqzerd>9LtmEk4yY&%?$xcYC6I{#L7h8) z`AE%rT96-H@j#)ey$#L%V=8tbOv<9nczuxEQI11e?o6jbT_0E@p^yxK1)QMMk^njB z);685fRWj>k=Q)CmFK!PgpDsP?`6}zVY3U33yJ>>*HebWWcsIkA8C<#d7-8zS~=I~ z>k#x11j2g;xg7Z54?i_+CaQYH!k^+Q$QB$77ef4?CSyEhMK_ zMoKug@nZSH?r`ET2NFUP!l$ad{@dHxKZc$MoI1 z)};)T+WG14y9R%v<73!iKX%8P*Z)^p$Wk#Kb86O#lvgWd+e z`Jjw=ceErht3Qlpf)+H97X^OQw`GxnH?_QH9>xJ>-@5}jN87z6ZES-6(D~s z5n1IxlFiKCU@ zGC!ypWkx@Z^SNR3!u|xvVTJXdS9{}b+j-uspgT>(Xl;PXgoY!ICJbq}jI`a3YtYHZ zrkh}}op&Cj|51$-{U#if89zUocY z0^-G;Y$r7`R{R*qW@#iWDy^J0)mWURWD~HA@n0*LR^a$s1A?6Y%{gsBT&)Lmfr1cb zctXTSQN?+2F?1WLO%K~jXFmX$yu(2Pt>l!zHxQt3aijGhV*3FAr{9Etd9qocLLMjDDtOEH z=XcbYUGPKyM0mQ0y33yBzA4IrJI<$5KIOf(KdK##Y13#5_3ff<1ZpN;tDt?G7Ln1-&8 zh3H5Ct$U!F%A2V94Ddo~7|qUab2|ju(rXNJrSDP!so@W@ClD^{h~8X55J(!xhXFUF zTXmX$yhN3LMgfnsN~Z2K;u0?s^#+mrKx1fx!J{Vu&WDjgqnSKOy_y{2Q#RG^y`DWx zL%ILG+2+ znHxh40bkR4^ZV9M3>iBuwD6Azez(~fuixaLBd0Gt?`X3~h3@M;dx3w&hTGOwd-{}= zE9i=pMI}z2#WQT*`G-&Fe2V>CJG{Ijk$qGh9`>`WzR=Sbsh+iu()#3U5K%8ZY$(@x zy^R|Xo=Y--$QgI<7QDJ{A6az(i~(+U&=Us$-$ilvKQygx+B_SPcZXQI@s$#z*nApP zN&7YdzvSH~7HwqL{JPD-CWcu1^m1B<_$ZKJ2EH$jL5L3&n8I~F{mU#&d8+Oiq}#}b zV!AMm+{7}~1}W<1X$r6p9H3rD%SrjFzA(>>CeoLk&y8W&Y-~OHBuIw>te8+~-*WCM zUr`?aQnS}0%jkZy#g`BX5#V(KK%}aDi%=ZxKgFlXAgi{`SjTL>BqX_(8=Ny~3=tFwhAQz0pah=VmIKDPPsD z{*wUlP(s%#obUe!4+R29|c{XXyT3L*9%B@LcGuD}f{dD5g= zAS8_z84_Ob7nGrn<-d25!(N&oTJLHbXorAoNo)7v_Vp@S-k;NjoNOaXW;prKd$VuGa>>uqI#<|~BvClP9ambSN(QWY0; zW5m(T#1xU01(?MSGssQ)A4=k8F7LWL(B{15}-6y8?S7}L;c`i54B=L6+1-*pS>cCpMSY)%$l@J-9aegcy1OeMKdRJKXp zIyV)yDiRJxKu2Rgh7cB%kS)NjByra>fTpwnI;Ccj-lNwmTiI&PH=jo9&j*}KRrN9( zYVjC{6Riz^=gkWPf~{1st>!~*crqQAPfQ8ZFHNVw4(c(&&kAqQ9suf%uXQt$&QwX+ z?`Mpjw29y8<@d>iFAR9Sb4^&qI8V$b4kWSFJkpZ* zd}F2xU?LiY;F-d(G+*|kKzPLBe=qsab3!Ynz<5Es?1h`Ra6!{rYAFC5rJEzROrfQ+ zPtsCQwPHqDYPGKNNvxE=5kyxUSksh7+la-P$`C`fBVQzZhYV<<@hh;DwLXm-B&$-2 zZMgU~i>n-?oNAX?ATBY!kudH|8MSS?LwuW#j$S=XfNRtRtSM0FcL%zE=!&YTy|wVs zOyFd|AS1AQ(EWU+TQ^mzBJShS|0z}aCE{KQlgfY9FSjs)D!u7h(a=y~QXHhxGJq3HyY;2xdLsVe-aATo!-F%0eL^<{Re(wAsnTvF>w>X{Er~eR0jM% zFgBFUnk@D#_I!}|)~A|L4)=xGr)%SX_QrmTPe2dz#f6-c&jyEIt%kZjw|LlsAB1Munq#BH6dYh%R1ZA#`Fff*Ip{`H6_9}ahYVcb=2XNC!WNJ)XW(5? z)q(udSTABK`_Fnt%)~5&S%#BX$e|Z<)dL>{5AnqLC<-pzUyu3RJUoiUBxQZ_m2D&t zFCNSX^vnY%o&%EM4*N3m-%l$1D_4*k4>%@xs=xcf*ZNfl-|;TC{+|ZfPLd?N^2K)r z*m_F@?-_^6+zOr)lpQ!CPKH`gm173v8aROuBSRJs;N;@FtA= zFw1W|(0!zLFy9s51`*Q2a4Pr9t)?7w_yy1uT5 z)l@=h(Fyfn>0qd<@FNb;&~^GX0kTn3kgd7@37;==bi?ituiy??{WI0*Zg|*Ex(FY> zO0yF?KaOi&kBsL!1hBM#kffdR$a0F$DTZuwb?2{$3A#+0=CG;r3b|5cHwTn^$?J>J zB5?Gq!l1^7Ti!Ft63(#2H+*Mxn)#J|Z0Vluj4$$NM5dXQ;qU|BJm4v@Tt8lf*}rE* zGW)^|o2W@^SKaigA`EPE>o<&oD;^et350+j!poz9u7eh{-mhmk+*~ou-#cPBR>}D1^?V6+grPa101NO9O6^iSXuW{Q}ea;xIumZZw>4};G zd~lz!;2J=P)ug%YB`gXJV@mm%FiwEQ>;5bG8W~mZ#;~JEuUxVK^-Jsbz9!mk&ocsl ze0Lv#vb2QS3>iQGv>OK>Jj_rF^q|dyp(ubF;;AXr7x=@?%fRW&)mjmGfu|^Ls>9d! znh|GR2sVivbeFAb$`_-1D03^*|)ji=st7?-Gh z(ki@M|mto2}K^;yNFzZp9tcbOnnKia-t zliF_y=L>wp`|1>b)5s^^K}*Z8366Vv$5SqaNQHiGI3tMhGT`=|`~r~ZvDSg>eo;9oa6Tg?n$pen`zAX-DCYv*ysqHSP+!hre4Z9O z*x`wT{7a?mjsYu4PEG6&%i-jQxa{<@&N@T;iko-dy+(K(00RM6=!M13@NjtptH?0N!&1#d zr|%JRy_lv-ySr0RdXpALHvAUAb2OaNuv95z1_)FFWEW5<{zjAEkJllrj$hAN+ex2u zJ0o8Y#$!GyxnRT9*GA)KxmhztIYDZlDmkrxh?}$~BZzrM@;9zqL4{0BUb{< z6kau?--k@)n}6{Fcs)zZ{tkt^RouGP9_9Z1~mr zy*B?1wDL{{(E8wW3ZzfJfX=xH%Y|>E!2HE}=niGZ`_sr=`Kw)L3G6jIqrNTRD?|%5 zh2iwjmOITfao+ieptHK+snS%3U=w6{ge(*=_Ip+FHjtm~ol~<7t3aXMTX0mVUNh^K zcZez~*x3?Yzmk&R{{3edFlobY-mW#3nDHju-0WQUl{-ku(|LOQ4h?{-0}z(JMI9za z%j~0tn)OIORW#$wW2P{`YK(;VLAs$~z?eK7CXY`Y9>1|t8oE- zn(;+&1Ct)x4*!`P(wibxJthK#{B?@uC`4%}PEWZhnhIn@8!&r{ z-oG|SRDDtNTwD%1+K0iCCR5+lC&K|l))m8~_*{}iebGK{pGt$Qc>|Zz+0i#dmNm?jR)|esAA`jbu z<*j3s&HnbyC$K&&b3h_L!X|3B+ez3m;3$ksY>RErH)9fdW4-v; zCoCsN_B)wOg<|Yvh{K=uEN&+95|e<0ZeCy8Jandg8#U=?duA2D=ypyNys^Re8Ej5+ z66U;m$eX964|MVv4nQCow_H*SlI$A2bWcQl9;)WlA1*O~n}~1F2hr$rD**%MN$ZQ^ zt@fM4d^NO*p#q~%Bfw}zYK2LrioDSCAEKvX4_=4=>)imZ3fbx7Jb$_8xRJx9B~)zM zV6|i%Fa-tp>*PY=?5UYw++VT(j9I}muB-*_5Y#-u_r@NN1(_|sDcb&j+B?svrm}XA zql}1xB8q@?EF*|CmEKgEV+JWof|LZvAR!Qn7nz`zVE&3-gQ6SulGIQlC{@4IobQ1{p{!Y|Na|C<`(@0=n`WC)Bk6(4 z27q3He3Rb}_{KRk_-02fwb4r}45&jU9T&&u*SFA{J=ahQZsC+TurA2hZ9{T3MuUsRX4E z?_=HE2p;@bL8@QNjBf@VF~NK7dbn7A14lM%P9dg~q>{g^LZewG0$oUDQ-(tHobX{v z%(ihgA}4TrMqqWTUBdB}(Kr9YDGImQaut>w7VNB=d{{`zM#@av4L{|3Fj`H;q~$c2 zdzMYUkq>5042>&y$i2+d+~1-HS7=1L_%sa%mk+~w8zO&*cga9bk^sDG$@BYO4_ZrN zcj5wPJ?O!SAGja*+I?tX54q;OlP5rWFt(q4vy42TX`lRLwPh@8b+-lS{^Os3*Ct@u zQ&cpoW*e2Pvr-Rz;R2h{g1|87eqZsJQvyapA%gm30yz}$93jRcuX|h)O@R8aY~*?K z(P}F?0Qt2VoHR1<)l0~BPY?X38Gn21-W#VIKp>5HYY-M%DZGkWF0#zZv^kA%!NH4V$MvZZK4+~2n$jF-$HA8RUa1tj9nixut;!&sqk&W*n`kf{N>8;=L4~FL}v>0 z6OIyuZ>1uHwcqSqGm<<NV1Wi&ATw^7l&b@0+RNmG^?AJ& z4pX4&=T5!;`F&fw^6m{Um=JftM}&Hm#>v?FN1c9Oddfz#!mKSXcbs{FWVQu(hHMLf zCE!9Q{)WI*EjP~BWfGm!W=bUB4a!M)Asfo(6cz3R<4=p_#Meu8otv*5`!qodeJk%P zOy(f`l=4-uQlW`@D)}$5S{`DZtPZXCyNb_i$RCuGuAFSr+z2qI?7i81xMvUY`c&@_ z&p-;a1E2{O-AqNk6j|eD`-c!(t11Dn6^S>#5NO>Bplxf_YtTO)B)HVMd|se@aVJtI z<0jwN3eT;D$9hL#u|QC%Mzh&&`c>Y-RgkQfgo}M85$5gYuXko`)A$tRXlr_fi!}u0 zx2UW>->6dfTb%Yvi^HjA7lVVK>A&ochjRXO9h`qtK|`j}zAEKZo3?-W77;sEF7_!k zyu^pstGcn!LxcthqrIf+$y)50z`ee<34o2UcCTj;)JObSIrk?mK9w^tdG^X|v#?|} zybov#j7%j{QMI`ytci=CDxS>WSWzbWv00)!ra1& zDf4Z6c;=wDWSUi7r|f8On!m)c;%;uH#C|Fgq!R)>;gzlXQdn@` z(_WVTjD*nu*meNqtvx`Mn`v-q-6P_<7CYz^R5$LDkABa*)n2bN&C=1@?h!p51oGca zK$Z4ahE}j_YE~dLb2c#X3!!H*MhZTorgT=S;|B@Y_ZI{8G^F5T)Z@zhU_cC5sA!w@ z;9z_a(2{J)a(Fq5fNXarlFLV~_064LVyeYk z;iLB%fHPd`UPpuCyehKZ$}9S;Cb`xp%uQ37?@MQJ>^wx=P27OG+K>tmg|G|XAEtb$ z(uInR;9FGiT@c3f>X^$xB1dulid0=OZ-TBK$5E(bH*owKFFX^_5THDdDEV%r%1VP8 z<4J(mKqGa-Qq)g?jcMq|oGxP50R*0N5r3j$c@+TQ5j!ijb!Cp$K3Utd?xYtumQ?&K z&XI4oI-VbOui%GVr{Q;&hRv78QHbng%=JIb$swrhjaSYs65bMqh8pO*=57sz38swKK1i2==4Z7(g>7>ew7#p!HdfBKQa6=Taj@{XK?By?se#UId74c6DN#RIRNf7Ip~e zACiXvIXi4mfj*h#Xa>b}Zia<)r3GEANF(>`BWoD35xk$fKTreqYsDfm;_g(2$XsSh}ajyUGXB=aN&MI(_2y$e4m@;+UfyvWa(gCg8p%BuNX}G|Eb)Wv-Iw z4F%Kn2{K4wZSG5;etpqn3RIHHyXA{nSmCMCg-QSQOuxxe(S)Pbt?w#D8AgCH+88gS zblM(mb0;LjR93KM+!=8v>JIl~Ib36vEt}|^%bl@UY3a6o{m4UfdY5CT@6NT0;@pKu z5SmzIS4>JKfApz|EVU{#mJ`vF%eRq6ymG*p&u;saoNiKN77>6ka=t`qb(da+ zzkoL?rN1&N(6_<{P9ULmj2lsU*F!}T{j z^O5)``FXvgBBkfF(i(1?Xj`~TfK>*Zv0WMkYv#H?D=sv4e5gCrdvGn6mQC2%2XiI^^;^}`ECEXeJKU_vNvdje*F0=>|AFppTRXO<(ZR+865wPKS0Q3{2wHDOM(V8ePOMRe| zRRPr7Vy8GKb9kzXO>bh^gLjb(&=x5Ck2$$J<`xf$NqEN1Yb%EqK-oew>v+wyhi zyzr@N?i0KBmn982rOfVNIU;0zN&yX-fCzWEgE<<1c1n(unRXf6AFe%b4^S>Jg_W2e z!>9yBVN_181UUAn*Tu~!N24bK=Bpci=y)@;S5>A~x*Bc6`vWoBoYJn-n17;>BBi+T)0 zlv^zn-$#pSznQ*xqi{k~rgqUYg?a(pthdRjGAGS9E!`l48QUEG(dQ4TK! z8fIvTfeyP<-Vw)Mj?0PN?+NLq?3A@?3E^=YN%N){n6Suq5OL#Lmqf1N1+YW;c08~a z($FJ`zWO4%VZGQzy6fur+XXUTzT+&{(K^2QrBuTfxm}#KM$o1;-yd!c(^D^)Q+TSc zGY4@+>5y@h`gUgKNw5It4@1stDx zhM6xEp2+9R&$cP`%f$3q~nD%S-XhQWYBg(Y0FhSmY4#K zD^ROzeCtX4hR;cRatBttFZIUY76Z&L75Hs&&B7tPF+L}>Ko!1R=sI{JhE#%zB&ob4 z4;N1gXEnQ;=c9h5KHZ0e4Y_CXxte#6TN^9dWVbhbUo_C(-Khv+nv`3hZsRvTS1O%W zJwt&)DQ{im*4XFA0a%}zZyOv{jP3T}cM+_wVlqNHEos0X6p;7?+XPTv=$?6Nhvwhx z?wg4c9~19rn?xF+MATf^qK4l)Aye+~K1lh69-ovKbl`#I`xW1g1}#iz2JwnM4%%oF zjXytHDEZalo3X6TbxoIk-Ka}oBwje!H+e!4R_ctKM;uGa?X!)DxzUmDN=x{K)P^yUnR%vA31ts{l@tWZ{s7)78(KR$%Q~ z@fzO&XW!DkrBq|Nmw@YX5%Q*hhf0wGJzMegS}oO;EO3mV6)^tPA0@UPe!xVFRO2 zjD3GtnULJ3)I72j&|RE}EZ4BTcqY+gq8L+p34FihJh69odu_|fhL7>?SAqss8z@{8=iD=N?<$>G^PhC@lC7olqX^%QUoQ(wMl2@ z>#zTG_O0TBqX`m+F_8U#l9Cdu){!K+1>q2OT_rS3wVzeRqU1I0#eu(FnO|zMW{K$W z#N>;mt3|s~;-2>m^fK<-=e0tED0!_cW9d#4bZ#U?)0AdYJ}lN{2QF7=7wl#rSW@_T zxZKP(;jCSC13#SzFE&CipqiPhZwv07qEM#0qdvRrr&giRHhySn$}a@*m<{m3z2e%Z z5WbHLb=Cx#j>SNdD+!uq`zsU_uQJ#2{1W`CC*@M5++iXF${AvG+o{jJQ|@>!sjTV3+ z^_PQ5;n^WEC=8}C(G|8m>1N-2`BOiGl}f?j^-khtQFLaWY_m$E-`6S^u9Bnq7w42u z95M$pYCh1y2iapAuQg4bs9)EVY(2#1?X>2x$zE#HzCzCceOTDVGrPNkML~U>vuhpK z1BkN$w^G4vc}lUW6Z3VyTWK1*KY1+^3i3Hr;rv*tR%!Fqk6 zX|A0!tCh|<*Pm$et?H>)2EAd-Lf2Mo-d%igzAnBh)@a=#Ve`fy5m^#5bK~Wnz+Cg2 z=|+MBdOW~@WmD2-vbuJmm(_V@j`zr=%Mu9Y7r#8xVlK0b;3}$|@cTlb$ZL5B#0I;V zth;R+Q4esIZ!4C-N1KsOBCj=a*Ey5z`?$|bO6stsKwaC2E+9GULWo^v?}BfPwS$gV zAGBpr$rnEa9UxkYB7o^f7FaBS{kX%I%YjgLvvPzzv3U>bO&^7ht7SfM8JbHQ0(>?6 z@KQl*N!ed-9s{lO*bn}g2xuVy##r912a7jm$p~sm)d)pI}OEuSdo`zicb{*TB z%H!a;&I>#le-o54*A+j)no!@?5+4OGy^uS7Y02G#b?OVlZVnsa2Nsr5^2%kxI5KCLZO*^YAjq#C9mv!|-lc~5k0EPJVoM$uqVliG)I_EaRjzX-G*bd1jLf-%{J`fg80gA z442B_p&6I172VxHY#%2mC=3niI~RECUL{r2&zZWol=JR1uFGkC1)HmSP}7j^w0@Y# z=p4Wv0{Kukf6aaNRG%GjE82$tx3Xyej|i;n&*;qdW8ph--)(^)0|dFZc~>ln{6$Q5 zQz}bO{*D8`Yn!km;@Pq1sw$hGCkMNtwQ`|wSyAUZN#yh6hqhv>LGVAcICCYBqVowP z>|ST+5l2lRWHG@V+gi|AerwWgqxAU**KIG=su{q>=e5b;;pf{J;CJyWY6Wj8ew5u1 zd~FB_c=jar$PT7uKVt>Oh5zDmybN>$f9f$EXUjxcCY^Fjt7hjYmq!@E(bPVgm<+!v zMmX{@_LcBQQS8eVvVo2aX4%xd$Se~kwZ4|0E(GXgYmycwMgEHwq@YzN`M45<;*NM6 z4}1Z|mjMC~@!pP48%~OncMCb>%_ZU55!rjHV<0=Vmegaub;`qkcsx!T^}$63fZEAJOlE> zezzR}o(w2}*;>`acNn};fK&{hU~%5d zV?;MPIT6@A;IYtidRMafami;donO`#0L?s+P0OYLCNi=f~M2BjX+kchO<@ghm`vD*j2hYL#5GXTS5cu*?z+GcK zP}P9Q3h?2G$Bo-JK%g1~$Noch5U5_n)Zm77=%IB+#9PPh2pKrj{pFyE9^0GiXS07y zC~~0I^~ZjE4tb$K*AVm&_*_#LJTEXG1%lkD9Z#=JPw$d~`D8me*J4o)$I9;>s=7TX zoMrbpy#I{uwb#~TXW<(PXU@5V{&G2T=9t8B(-$w@bD6pGs@Y!KeSuiumB)maXRf3T z6Dm=}{dOD<^S7XwnAmNgo1p7hVY7d(7ff~z9eg(YKiB_%&Vxvj?9#7qFIH4LXt$?2 zqN0TU{@WA;YV)L#@hcya&2MrDD4OLIGmn5Sxht+c$WghZrKOcAdtSDj#U!$--kkth ze}B%-@lz8=8%VUdHktVOSPP1rYYt98*^R! z$s<7H-Fv_M?s)-uMscxqd7k!^ACDR4f)u*@7d!gqrQpe8&3MyNG89s!Xw<5zCbvBHW`BPlj+~x(>`s3NQQejz~ zr8 z%-rJv^<_T-$NP0Kc1UrL>%$uCEh`I4TUq3^4*6WxZ)siA00r3>>LAapNgRuT6X>{a zeUs2!D>#kiTP(f8n#^O|XL}l1#0*s1E-9nlW*i5(4`fFuG!fhBad8$g{MZiWT8DXG z$FZ|e!>epDyH0*B8x4gn=?=Y7j5V-;!Z_&b%-yI}b71}NIEC$8y(p`%ih~D`wCq)j zQZC!Rgkn6^=<9XE_%yH%vyJ>V*{D-=q0VzMq1RfT2Ujhwa=Nf^zet=>YNy!sC)Tb? ztE3maj{?7`mX>{tM5)R8O*cZsajeol#;R?Hka+FswU~&iyu1rze0<+_v(naMeq9Y9Cd>A#URBh~Gp6Lql+B5V_x!jt8T`eWe`|(hD;WbWJ3v6=NFT3QHBJzVB zSOiiO;4nwM!xCPi2=#WpCi|yQRR=6i-af(F$Fj5{2lVR`(aKDcIE%Ea0^2qFR08j- z$xC2HphEPI+$O>H8$g4VBY7iv&kq(sp{HGH#J0CrAs6qahg?X-L9S?>m*dKdIbo@_ z5Cm(|v;GB*59Q~}3+;kh-sqhkSd*<*wTQ_9r$zsKS$Z8swj}kS`S>cmtB~&Buel=k zf6#5Ce737QwksigDP8hJV@A6%ikOAlUwTPgqMSzb$hy_!-M9X;D)$As!2F$TkqC(@ zkApZDe}Zq;8g-bidsv%O-lpvl@wju<9YcRI;I00NYljQ>VO81VL}^eU&vuDwnpKog z5n!zWotNgk3|^hJmkMw@Xa83bzE;#F$I?G8bpgt*CMyBsOd}7bdG^0a9V%_Y+x#v) zd9C~`I@}VL^@&|gC*F5y`#1m3eXYjQrLnmQcfZkodYZ#BMq!Gi!G(>D!19f*>}V^c zNzW!Cy~#UJd}Y#%OLoV!iQfjqIwPly%$x((5XD@wS#&JWWo!*gpS;(be4miYApgnO z%~@z#RE>>zLtUhV`ER;v*TCn*K!L*B(%U6QfIE5Mw>+tuP->PUXMiVcaHnKA_6P|I z3PN%c_{U4%|K|T)`t`kZUEAODFEwfMef0l)i60r^BLQ1+cEduwBC{HB>DP z<|CbYyrzA^Ci_KcOgEh*V+*3x7HDZbs*OP0bXvEls!w(Ba}_VbH&1Gg^rLgup=$wR ziaaUgo*jufEJ3 zZ(CK!u8RFzMcDG&MO&Z33zsn|DDq&8W7(&1&-7c2ePuWN2{#xW`OdEDExPrpTS97v z8BI`XnwribZE!)s{+BDmGO0gcxXZQt#Dk)UERLEE*g$T^I)t{5M|##mQEkjd1y(R< zaAPD-3hb`3YLRRe#rAZ`WasL+*GdL>$;M)%kE>kFUtAhfXY8v!KiZzgRNGcLW@ucH zeVFjtuO7NiV)X1pto;0l!l|MCMNS|4eY}$LB+>I*CBzHcOEj#26}c7iY1{4WS5!<}25-xLH4O z?Xt*&@;IYhVJX|(-paSgpL{9lTB`kyr*vg(mkRG*8y*|9p=z@|5B*)BYw4d52hQax zi8L{anOB8HW_w;t9LL9jeRR1tVyPv~S&lZiRh`Kr^U8seV%v0KjPZrwa^Dnc4RbSS z+uG*P^3_#~gBR#h)J(ps5I)Yq+6;u{1%}l zdBMUxC#~OQnvfS2soYuw_h<^1!Ge>iO26kNNinY8lD1#RfzF z1q%6wm?{^Z{6z{)hqb3p_`!7tqL>j2LD!rNuRdl!)_$>y@f5+zIjh*4koEwu-$s>g z`&+_^Uj0YpoNZ`)uojkY+)j}t`~$s%SBgUJY7s+nEo4&VEI!Yg$!UPL*tScQ|25G9 zTkGDI)-vSJ?`Pr!T?B6+Ro+KCn_VTE$n&J&$SRh~vRsofZiNeJ<2epB0T;el>02!b z7S+C&yMtUvr&hOOEtBMJ(=jOxb`3-A=z_Y=Jj-LyV&R{5!>7DTKGNPf@H^zdHEb7(v-Z_wHDJhgMh6opsZe;EkI{xx~!A z?h6SC-HaDdGMCPNqG#XqjDUrVaM5wu&ZK7((QQ#qDyka$~_sd zH3wX#4d4r(Zq~Y@6Svmuu>1-QCE3up_#+^Yi~8~*7v#<*4{&@TpJ!;OTIKz^Zq%V> z>w30IrYFD%`qG zjOlT5Itv2rW!Z6tA?*B?fX;JMG?&Sz+Ai2Xah(9TF5{N`(Kcgw)qr;q3Q%dmWd&oA z`Qk-@0^{??f#%F>xd5vJ$?E;Tync^(L+_&z^73+{n6!GI$=Z6a;o=3zhtW6{# zcYzktPRZG-3TgA63i6w7P;h$kjU7d)j@a;CX{8KgL1{s2V|-CcZCgJVEF+cZJrilUYaf5tgm+W|0ZDi0lXul+h`{4M0@a#hQw z?1|-2vBC!}%Z2ej%kNbb&(5_`=Nuek7FufdFQhrD;K?mdyG^AHJx zMxvcmDk6f@)*0qTf_+lbK}7t>L$!CQ|H#9~yR;^{HTcciw9>XJA`gwh)+{4 zluGfu-y;yynp?Z8m4}lj-r9tU5|qZGMl6l_oKUW`i80%by-}AOnrd$c7_K^?PgA2n z?m1t}MPKVh^V5@Bm;_(6PO!H?5D2s^;G$lWZI|e7y0cvXe-^_cEhcdwWKQZKr>P~n zjFrw4_+3BVW*l>;v82^x1l!Mz!#H82d8QNe%HcJ=Sl14Uj=SX#JexwJSPG7V2II}f zV;5k~;C8hUVnECyB4QV%6luxZyFKk$pX=U*Wc7LIT#lSq5QnVmJ4Y$jFFJPYtyb_P zDvYp7SO@90D zTbkh6E}Y2b7I@~EZh$chtQn{@u7Uf#@{$yQo>NpKwS^iSQcdy9iHSG(q-!CcN%fX; z`dIWNKFH|V-*n|skD4~J4mgUjjZ!A)>7H2H`wnaNHN!Vd`^hENwN}os@e|r2tKug* zCL-m%dX?BwjDyG5-^|qkUJH-I7<*k{kbAZZ2N$%83S}+0S**irc)GkfSmu zXr4*wH#eE00@V|Ko6ntcsRj3Is$~8^RaeRW-5xa%S{+pG4lK{LMSTC)QM6JVUh&tt z0n?d{@=;AuJjYEfvY|{!Kd1k*(hiw1-1fzWEb2Ld-)%5JnB)zTAxnq9Bl`Zp}RQwNi(lJB~babcpTDt8p`qGMPV8a!qTx7y(3Rb^EPw-d{uZKTA_C z*kj$Hw(?b)Op( zi&v=;Nlsc{v%+uU0AsR=aXcH{M7fh2oj=3ZoWWtBn7`_vN}f429HEMBdFxQNR7m$1 z0k_v#wzpWOQp1Y{UKo*4=j=mW^hWJM{6rtyw6{etV3oQ=|3g1q+7tFPO#w-&?S_1a zT8)U=@4rMNKFzGY1E;lU5%fG}n}ZgKs?*wPjrIof_i}X$CR0C5xc^8l9jL!r%7+~M zgd@P|yMw)=nZd9Iv7 zWEHIupjKfG`*2e6L}NZ-N^bml&gyW zxftwX=mKnAKbIg;E%)A`bwQ7(qo_sg5a2JlF}EdCc`(XJxe*caA*_Mb7F*+x-!sp- zUl}-xEDY$vkmPsR1{5XA?2AZ>6o~()Nzu(!7|cjt#PGcMFT4QiGew zy>jSA9)Y0=8=B2ZzoWcMR6An>BEF;9?K{1OGSr+yxW@V}`E8OMP{EX%6yiim8n6kQ zqwO}I0JbCo5&B0l#G&kx;j@K|pD{M>n5v2CEoqQQUCXAu!H2a)J`z+K&fIue9-w^AyT$OCn!u|CA7Cucw2u3< zbN}}Hbxu(uK@rryFXdmen!=$00zFZyaisbg%Nt9Z?%d#tSDd1;oeoeP!OTtocC;+! zqOM_D%N1ri4E8bj#(I2oSACWAV$9Jvz(&LqS?nMF7&w z4~fAq^M?EzbPm=bZuW$T_J%mCT)gRF82DlY!Jc9irO82AvB+QE~D4);GD$6*wxi-_k1`j`Nquz-_`A4^hN z?9&{AYGr;b7LvYHNBFj~m+&N%%rLJbiT;1&50+2=7 zM@<#f&LSIWwW3-IxLZm(^~Helo3z|()6+%99OivPZ^iHT5eFX&Y|g0Mb3Ooc(L9(N z1QX!#y$aXye!tw5dmd{E@$C*NXl=H?7tgxpE2Q*`B3aoV!*P>e0nms4rygME@8ss4 zi+`>u6_{Y`C|S%?c?%zOE&N$bi@w`-$V&i@Jvd(@5}2q?U-q&TG+w)1f5gz+!clU; z{I=yFdadcwqclgTsnuHcX4P$&!#TyXTv~sw5541c0T*W)@B@zme*Eqcu*$E6{Y=t; z=)OCfCiLY5s&d9dMcSa~xP5>sDa`-jBmlz>o)re5?310LD=_8i?~NUdjn__9MT3c& z$|&~2`*;r1q881oQ{9FFPS)$4KGGS0fghll`2u5Ve?x#+-u;r zups*y7sEnL)W)={U$iGG)^Ea}lwKvLI@%CG7}(kxwg~y;2wMJNKJL5pSQtdPEk6!m z_mM2DUDf!S@oUoEi$g+1h5)KQfa3WP|9$G_Jyf6{eP&S88NeC;Vh{>0$c*H5?{D8< zaST5@d=&WG4iT64`t|EG|0{O4Ylp+8kO3ZSVdw++yMT%Z4Cj9a_c0s>fsDBtS7Wwj z@P3DoLel{?`rnAdtu)2kXweYIsRmz%sYVExt=Tq^7P&L&5zq4YFSejBuNn@pg}6`9 zeb?z)w|JX#%XdkvrLjtfc$(+|8v-1K{Lxte*@ziS+Sfk#_B^onVhJw`Br)6yWCH$S z1&?~(EnI#O+4cF&xN~@Adi;f4W4SwyB7YtI;spYoO?}~aA=O*Ar~U63j&G*YIqz*g z*;zWu>}<|@*V-<#4c!f2uR-&tGzgXhp3V(ePji50y<5+EwTliV_ee_vRumR($62Zp zasD97lYjnzO&?r=tqEZus7y)5dTfbR#Q=+8HJrDPX1xXenhwCl^vp-%5o-ag`6vfR zN&BE_l)%A;S_0ZCmYOui*+|u{)lLD-qr*9@4pwUJB<&_?k3kHZeu$Z&DX}V>)OZEnbFGk10sauz1-+!M zx}0Av+7>DkfoJW0TcBNNWSwoRh3tNIgHr!^576^d&jKodA}}>QraME_!dHYXoO+q( z>1J9KGwpaD3UzJ{!J*&B0gU&02sh@2>$`|Mlqi-i!;(Z@5@%sT)j9j;3oaxi>ks`DAqu$dL1Zlc*OPYzfLKq>CYr;J3{HRC@>Ea*q4E-0EUsAJbFR- zn|J-OS7de|%s$<`korOuh*hRD?b;T9gcNSjTn@TRJ%jm{m1y$yh`+;5o;Im|x(>K` zi@QeT%}^beP|R^>;HG5-7xjNDAibB~gzy8VkhQZunH;<^mBJ~emHw1=^~#m^{7TN* z=4$gV>z~Yj2ewZFunAjY@Kd*HA%7Ve8U5VZm>wR;(HuTVVELm()A$wat+kFWp@BX3 zvps?ycXRr{hFMCBdh@JXAP@le0>x__>83khWE43qw70E?_9$bG?N=)ukt&B~-O!1m zE0Z313idu0>UdrOU_t<=ei-2L4+j7#PHynepC|Tp?g{aS1Is+w?OTF~;J_!ODmbJ*ojaY}(tI75K4AX0#A;^xfX<&?3K_%; zhuy0G)%_VTx4pFg5(9plUmA2sRQrA#eFy{?O*PP5_9Jm%?LpQr|C`sY)3Gt^IYoTDZ|?8^9$d(D|NYaY4%o_ zG$mf~3he4>bg= zI$ygB`qdF&_R5x_s^R`I@p?0b41J=Qtg|k4dfZ#Vq(ypW)Jvr%VIsBa7tnN_bn4-y zxJO_FY#(`eSdmBIH3oY>(r!MITx0wJ0w*h=JVGFIX-t1g1_1%jcJ56^SEn7_Xhes>oIJzG-`b6#a%wG`(BISJz z);?wUl_p9^GG2`L8Ws|oBTYRS*w)QF55+ILx71)1Umw`pJJ-N7X4xtO=am9etv6_RdKJZ%D)*4cvBBL0m`>yrf^EU>>4XPxwqk?G$du?Ckzb zYkz;RXAcY&SWo8J)U^l~^{`kLCH%*u04?}({ROK?CHp8Bzi7Du_2y6p0T&MYjyl)H zF15K;Uovu+R}4nJt^sqRGcyh#9ZI5g&53wZeD~|oxT^Ufm#tiCYsvCd&TQCPrJ?s- z`4Au%dew2HG*opk_W+w^ zn8=6hHXl$h4M4ezHXGxkkKE&sW|-G6JBAK(tTbD+yL}HIB3t2R!#8@2`4tS^9CCHv z>ZBI8gRaV*SgWXNE|-xn9Hb3|v|F|2arEC&+$WwQIEU`@f#N>e(w^;4Us3C4o zCsJJoV$@2u(SiyVFl6hj%r6S+{0VB)pWhLQI7#qX@~g9Ejlkgcd{G*%P9$N1FF@%! z&S2V10b47g^i7WIOJyyd3!x8CRA)%Pa!K($wWt?Bu;F4URr3)e)|gH!swk(dzc?MR z(UB0+L!$Qn+T`u^Ov7i%E!xI6c-d(_&AP?~Jg!|*9Q_Mf2-^AK{? zx{1``JZ2zi*7IIDBuKU~{nf74&gHQ*LVgT?E;m6Tv8}ao`LA56#Mt&XuE@`!bDj=( zoAW?iHU75(pkYy4ZR`VU_rG;VaRl8Qg(zmhNpbcMbJg&$4*6Pb@7pmx!@S}{>PO!W?R3Q`*TQk`*)A*`UD&x47L!^$>3Fucmm<<<6wyd3Yfc&$c!%^3gnN{;>DpUE z3j{FTI%qPU!?|etTAjr(4X8S>cT6W6DnV2&wuCA#Z40!N?YNak^g4ZYo%KKWhPV`@ zx|bt0J!WYvdUc}#2q?H1ywn*$T3XfuViW0)RRY1mZacLm?~-4c7-k>s8z29-$Y$vB zXyIqX=C6`5Ma~dbNeT)oP~~vfQLRvTH+n8&_fe()>9UUNX2FC~cf&(x6jYFypg^lc z7{@Bd+r95$<=RMo2nz^ZcxdS%bZeqRAQucEuq6 zKETtGluqKSHijNs`Q6L%4cUV~lW8Oy#5)uPH59Gs0Fi*BX2yWQk3lhi3qOm&r_1>b z4oNhaS(+Hj4XEnSQWp}<#97kA*zN+ zF&p^l{4{ZrGx9US50Brt)?$HIBn;1Hwnb|D4=kL<7X3-|TgGpr*rk_BJpQ zHX!$zzT_G10{9G`fcHg_8k!XV!;w3gvNq zM;S%9D`zwzGF-;Vk`DKs-I!Tq5F+VeLr(j`AE%q5)|j&^oBiQj)7?H&feP_@GF0<; zJt>P+p-N6z;RqJKblGrT0An_KRZ}OvYI2Co^9tsy_|65H73?=JV_}!c@n?6=dKQau zDp^b=*7(3f%HwT5bqwjC{2PCUotcgc>QayKMbj=?)C-XxRajm^t0z!09Lh4ayKCVC zy*w?cM7Y43_1^8wdRki<`7~!fa*(Ze5T zExE?ulBK=+L*!*U#!Va@3$M!peZs|Z81OgpVqZD(!jZq;JpVisHew>5>|nAGj%5GP z%G?`6OyELCh*mmF?kHGXY92f(ZllZatiX)FBkehlQzwRgKk7|o-KuMaZp?Cm@howw>Sk16h1P`2R_gqdf_z{IcYb%)2nOL0{!a^xC~Y17&>Aa+dL% zX3k)a4%ZfZ3k<1bzZgGO(B#>LDxSj=oFZVM3JiT-t~I`VAkLhDF~ml8(7>9TsaO-du*^vaG+{{M}vha5PA z5j6)mGUac~b{ONwr8zOEVddvJ8@VpwAZ#L1^dNLB=vgW$9up6vE(B6ga-81VlTMgz z^I-p&)Q`w!wU-&ZkNbJe>yU=~X6@4hYysu*diOV*wFQ=-4j|ASb{Ax4EWR5M>W*}V zhMSrF6q-c}$F^KGq;7`Qz#T>O`q-25q9J~JzMb*pYZXRn4hPp5#ve)-*GgA9p(V+1-5O z9NLcI3OOLrPpxMy0OiPCU6K)F>gZ~I3_!Y57V<{}Guzv=<)vT>xZH?_rLZ%$062`4 zOg#+9m(}RoS9`qW%oc#2Tng!eUN14(*=|~qg89BSbp*z=lzIT`19t9RH~Sh!6|gW1 z(b{@E1%T3z#BO%?&Pn5pEHtxbcWk;Os`ljUp*B|*li}s*DRT%k*a7gu z@Gj_OX&}do$E1}2h9i|9vOZZSt>D}WXyE_L4Ncb##)+bu!IJrO6suzBdHDC^(vtsX zZSi(~!9WW4bKuI)z!`t^M*yUM1QeAE`Qe6XM320PhTW)ZuYG}~K6s*L7qkv|V&M;2 zv~GifLxU&Zb45ND1n{$s?0ank3LOpzPCks%y0O7?35MGkkvz|3^X9HN*3l+zQdgVf# zYm*9prO2)D1*n(svGj^B5CW`LD)j}R7kDf6wBL`3dLx|&hdz!jP}+ARh3uww+}s%4 z+y)lZ+ECL~eVLEU$Da7TT z1*&Pi0H(ucuzYuj=h4R07ef_kHX|9UM13mo_An*i%L1OlQTY9D{q{m>lRoLgfz=mo zrGB_qVZ+D58ezGQ_4+T1_WGyikQ3BbdBREd->aJeNzI;H0b?u%`;dEfP=f4e(Go&5 z=LS0O@P6@9!0_x-3F-Y(u^yeL{Oh<5UBCe454A~1g$hW%yNE8J%Agzf*$8V@}wi&B)UbZs-Gb+8^s}C>xrx~QM$X2REqT2Zz8Bme1c&LcG zd%1IX*!DpSzye->bycX_d!T*w-=>n^v)Sz}2>J5wwKP-D7%%kz)0BW>+k;Z!JIb(9 zzsR}e%Wd@kSODV9n>Qv~_tO8>96P>c^XB@tz(3yMXNaqCJJt##fgsq;) zDH17ptl^ZXU(#>vbWVC}6*86-PB-1Xm;6XvlqZFHP{3>JA1y}tV^#f+WTL(Q+k25X z3oxj_`R0!Y-jrYdyJRqNF6TfAn*-?I&E2b}P6e0WFM?*hs@6^S+B*xmre+J68V|A8YhS{UHp`QhB zEa1g;>^~p7I;0`q2`yyP)zZrLOl;N*mq8zD#=%GUdi4V_*tO)RugNwDV8k9WJb@)P zFFK8IQM;+4D|Ks@$g`I&$|Od0cQ8QI5KoG zvEfKG=Jj7cbLV6EULRn()AHSepQk$jK|G%UJmQMn8Mu0n>f~GJ@}A!^pol`js?lQS zvr(Z_?*g~k(Pr&AB~x{xpt%nsNAvHg*AND%z(jE6TWB$7o{g9b4>+eXS5}h`1TZzY z!!)N9XzG?a=XJT_)qa9v+o-#s()GO14^?U102rxe4~3Y=i3eOmiQGx>3B}bOkdnj> z9h!pcv-uvhnB~ds=7pU!sUxqsbk!X>&LeJCHm_B+`~+m4J6fy*Nky@Fx$t%MO@ki7a?gwV+xP+NRc4~PI4(|{bC_kk>6rG;ySQR>$mzdXJ- zRqtiRwtNLxV37yKy?}$K*%O#p-Qyjr zDsKexxwM%3-#VpSAd=6&k)Kpq*(zkKT$gufS?!;@5Wa)pvm@a+BCi&XbexP zI3QsK$7DN5J&RIs>7$VtekBu3^qdd-{urZWxSvYQ{Jbtt3UkjdPg? z)lLWUlQd8xQ5>3ccy{^Q8U3-$N#VuGzjFOp$?6H3T$L})he}O68{ugBmyy0uM#<$S#%T}m9&0%`EbH(S0_eW z&LXyhRMz-`18Zlmg?LI@!iwi9w!0bcEfwSVZ@4xse$!rQ4tKto3kJkhg{SaaQ%)R` ztlv8V!gHcf4CUxg^v`!A<$LEIsGIm)*^+x+68atmRkpP%LKgO(|Gallb5k&G3Ritz zoe@VwON@y=b7VAwBeq9L5t%-8|5g}hnaGjU@vOt$P;5qeNO@~+Xf;#B;4I@H&k4`4 zGnN-1sO5rzd@zbm+5<{KGK1A0_+3PEm5A6T9t37;YvzIN3EFh+B zX6lh@_|Ux6#p}bx!i8CoksI5~lSl9PD--X|6!a=i1U`~zMmf%G$9&Z~lHh%513#Z#8$fA6d!Rli+4N&z-@% z6xcxF3_jJ9d})otwBD_>ivrjwc`EeNcurJPsvQ=5nuJ| zeK%Zx+;ES%uCy8a_gZZ3*&#VeC4uPy?VDAtWZ;-W&(#)3C83C4bg#g*BCjX?%?7N$ z8LYYca%Ug25F(9I+d}x=`S**A`-z7uG1^ohAfJgCE%p$uA6Q`w?@$T2S@rq0 zWj^SVCch~ENh77VWo%tO&A$Rw@S0bQEZ#!zr0K?Amw#SyjMKIK!?C#YUwhjOir*1z z%5gTI>O{ZYVTjyPf7-tgD&(tc_Jskpc)Pc407+QJpFzx2Nc?uK6j$W`7QA&c_NMc? zzDT$nX8S|IN3SQHw%xh96iBQNsT-o*G@p4zqyEbF`G0yFVV`(dAw#x6fY>4o2?D~q z^^8RFNo;wek7vH%CZGPdUKjHca*k+cSw*7OdYe(?es!HVo6Y8J%P4C1v6Ds821i~a zsd|@hIQJp1WK8yLk9;a?5a(&ODAu_yM-}O5^B_wk7Qy8Ye5kPbFR?=pTJy$J(&Qi& zL(n$QU!M@X$2*4dSTdr`j5V)E!`%j768xG!?p7K{ZP!gfIwVhZcRUmOAflTMg`0Jx zEME5pWOFcJ^42q*7N;y)%#Og7x7IfM>2b)M11jjUJ3irI{2@z8N5{9xE!^J&{W*B_ zdmv36&6nJP&bCPQ3Z(vU2kakT;D~QgHTshtZt!0E5+e6BY0|p)nH^)s9PiAZb9Zwz ziSR13X9uHw+eNWtFIRdSV+0aJXj#HJs}@gdL&%q!-BZ`RD#rOuI|8>zv2hNxhAWr0 zJcaC#8rv%Wnpx+>!?!ca$8*L0V+CI4@3ibaca4AWCoUkhgsUywe@N~FoPf6SzA-;4 zt{wb6#D&(v8jfB3_NdcWRekGIl1Plf)AYk7WT(HSh4n`J{!~Nn@CQia&tAb*ejY9? zG1~M$om_5wmY>djXw#afWnAuP7T$DmQLvC|qy@bsdMH@SWwS($DX3v9CY6c}a8?{s zorJde{puR^`j$8M{;%;Ut&j6Y6br`6^cRkaBEHECmc*Z7@uD%vW&_$fK9q@eivLze0rI!;Mf}% z73%VZpNX1k*Ceo3eBW%3IMuN5*vwO13vh$8g3tUpujzBMkw`~Y{+v>RP@TqzTn)0W6#9ow69=l-Ou`vS*;Pb`dxDsPi*8bp92I0F=$RJhoxZS+7-r8%BNWU8nC+ z*1)XhU8lt+;J99hInoDk&E=E$a8p?N=8qp;F#A)u%4_4Cr3nh$pb=dzY9A^X8E1RSsJWaZK)t@(OM-R~EBNx{2> zC?;WHAHAr=Tu>5Hq+q~I=#-mK?2)_7xyJVGO0P6lRtGJMgr9yWMc1Q?1r#7jMgVfZJhNLpbh#j!)8X3A)yTBn)=1iJe?_q+mrmPWx%Y$6&?c3Yng1&E zcfP#!szaX1i6h&ViB7e(XLybi3%*ol+WY!?FX6sA#zc)**jAg%*?cl-`@KXD5g&7v z2n){!G!LG+76584a3;6`a;?4DrcTN+$qwX7BcK{Wq;4u!vnSeS2L!Ixr*~ z1td}d9Hj9erE_e+1?=K!Uq}8^xhsszkx$29x|GLpe9&@yul`tA|3Mae*g{vEvAz7t z<7a^btJP%xR5lZclN(j>eTK8{I%^giQ^7M&U4K6l|M1Ns!hecJd%u`)5j}0JJ{NgA zZSgX9P@l=>?=UaPoVB&gq?hy|M5MJ=$3mRkPiY-eZ1Gr5a>V?>xx&3VU3%TcG{hq- za}~zH5y3jXkVei97QG|SuX&|-xn$m|PwYGgSM%ocxr-t*NqcEdr7_d1ZH{7rA>X7Rq$@i!ffIM<_spPEWTHW@I zFP&^%Zx44su}Mwwi_vr1)>;T>NmriM4jm?}PvEM+A(xm3p4ZxV-RX>sm|t?XUnM{- zfOrre5i@Ut6u@L&^}Z|D8`7SAv+mgw)gyfYzFQdzu2EpvMK8jp@)w-^lGB@WlWmcg z6MJOPnp8%{okUw>ztBVtj}eQa8_hc3tTyr6N2C56josv_(KFvdL4;!4c12mh+0KWp zwr*X#Bxkr-M}Ya3;mI@p4_d*_I`5)$Om_M|LeErd`KZ3$>h{)$RotpYR0#--%=F&f zJY^G%i=ZaxB0h-n1ciG$tbm@x#0*6u2JYlD8-}7jlj{0px2-QVw#x_5` z;$r+=1}zQLuUBN8zD}AgC3J^KOinyzXtj&$Te-4arjaCg`RU94BFGm8BS=@8{2T)7 zs*N{4=C89LNa3E{-AAx?5olo?#s5)_g}-9a(MRTQmck<7{A<9mKVzC>3RPiD{JdXG zfROU{z{u?iFfb3>OSns8UjU(u6d)>U>VnIIlY2<`q7wH+C0CkSv6eh?+)zbHdcQZe zqbJu&^j$=tcBSv=;A3wGeII%C2W!*UF0z>f$o3<$mxTfB<=Uy|ZTjKacK@ky7r%tL5Dy_5 z4bdG{R4%>u9NO9s}H57^&IasqN`_+v*FtW9kd8+nxwg8ECI{fNN@0Jzn$_U9!ox@CAnX24Aem8 zf2m~IPwTDgXTR9h;=;QJyBr$_VtqrC{-V$Ruq&Nw?ZO$CGc@ug<>KHu7=e$gc`z1o z>oEG$a{Q6ISPcfl>ueafeS>;e*D^6g03UkQz)5>`PTeo28Cq45s>%183I)k%_Z5qpAd~MtlE{ZHAA!a z1BGEc^$ns`tCha@mapOZT?(njxk7$wNp!P5yus$B z@$*Bfdt0ej_9)^Xp9ScqrRx^yc2qYVNB>|(c>P)M-cuP$1GKp|vb75G#r2VSiIud` z@o-0c<24!etGUi$9iY@Bq8NNRE%(qfpn`Au$B{;SB$}IphEBN9IW&E5n3ZHF#hYk8U9VgA&MP3VvvKi-)yQpaq@jhkot&x>%N)%Sh&{EU&3oVtfBquC#Mag>_0 zO{p*}4>AiEd$Zy~#$UQ&_eu3l{>C%Bg*#L5$N-7WCQWju!|<>B1b)?pA06zy{+^Ac zbVAZ)<>m{jacP=-FC9IqEJCkdK2ho@o!Gs-hx}2(Gu<~#f3L}H5dEqZ+}~&E3`Rq& z35cL5CM8cvjAj%ItGDve)lf0JsyzfqzUVw-^z*XR9P!FnPH`$~HJGZmgk``UNobKxcq3QBL8WyPwRa zPhJUK{oCuo_SAy==^_Ng{ICbZvXBv{e#RmSyg_1K5!4S|%pQIVj88g5Q3i9oP##eg zs}VA@tT^5oaNbvzG^>>tIx?;VC~BQ!nkl8##%4)8p4)Vxp!G5#Iz}SJubsBE0P)*` zjDYfzJzyPBE$dt%nRc-G`ECh~3tbH^%q{rkuWDo2>llL9HIniDTyJfQ>A?Q0<01`a z>c@r9mSUs4)vmg0{~)Qhs-f%%T0}YKx^LJ`KVOc3(W%tr;34RkkGI1QTo1PBivsRc zXf4MRKVJ-5Ahrdlx{0^B-zqN92mGgv4!}3BDM*hNKlbIo7j)C?C@M9Zp;wxh`weKt zl1NpT^iN+-OgR-WzSwmA-r!iMm~HE4jB&)gloBZwplzI@*^)zM^w(wRk&- zYVrWD5!fYY8J%cww@$)(fsS8^aAA-b?naYcwL?Fgb+zv}8wawb-;@VxpvYQ_Zukv@ zb<12iZ5<47y7oQR^amxMp#F#Kf#*D3qXdiG3XTaHB^uKN>B<8?^aB@%WRO5LS zml*1{q#uJ){{&anb#fz2S+qQ-Q!Nd3+ww8t8o=TMD@un`jhE_WrQ6&ojJ+&2;83DX z^(~hhKw{#=mJG@x7_z1LUH(uIFJWeAbOSLq=xkm3NUMTHQ^ZW z$6!zDo_nEiBw}x@!3HnpS4U%7SNit*v}6!d4%)o-*w-7)YY~K=JWKjGn&3qZQ}*NTh@COR5N9Xxb~*SLIZb4mbLLWQVq{svW9Fo>m~tF}aKQ z!ZZG+n_y%426A4+0IOVFlJtV30AF~!G#lW>ab1Zz5B%zEJ?I`Pi zrEgm~2iz*T^f7?!ncqSYbHMp7x1;4>hENLeZr}}}52&@#QjSxT0w?fL3o{6~pGZxXgOR`F zRFmz^+U%nW=4+|+-hPrv#zrp-oQ|@&4Nko}=Fk(3 z>fG(5)@x?_s~pE6;4@8cqvhyGIabc}Se{8yd~s+KErKsd&4Q*?=6I?)(Rw$bT{qaO zB>C+`vord3d%Bmqz9g0GZSI|wjUT33+fY*%{*c+~RNUE^tQU9uRd$QmvvC|2YrS;8 zkCro1Qm7ruS`IXX+-zhj=83du{WN7RFl;|!=ir3l^_!KjT3Vl070@6n7#Z$q?H9p; zejwHrGY7DW7~j`+Mz2JHhxb9SZIJ4Gtam@N(g$L1g9L#cph>sdd^-+IPk@|CAvRN) z@RS=@ZctHqb|`!>v2;$WacQ3_W%3$4p#l*VDAuLle*t?{(TgI?SVzMhnZ?*YaTmNU zxeg6pCp;7?vAa|t2C|md0-tO`f=Ixzzx}3l>89m(uXvPD_bQ-<-K7y1GArl1bXW7O zvuTn_>PfZ8S6lV`LNzCstHQhB$sv2wu>+DSI>* zMXSJfmcQoCrIrbgN=_r8@JT*_?ALp#YWj~R-f_?%T-+ixFnuvW=zr!VVESU_)N<+= zDF6LR{37DFKnSL}`dI%>SP17R7^dy!(AKV|AxzxasVcF(vOb%tFA)^TM>6osJ3IOa zt^0LhAf=OmPjY+b&ux*f0W#fB&@G|TJw&tXMYo8-N;sxQqVHoz-0WHAw|$C2k^VFY znBWGN2C$r_(!Jn&kW5&2CRoUku5|TF^VO?aGau+>qjn2!9jTzbbR#C1KK|}ll}`ci z>`$~lp)|gszC@i%PA|w|y_Y^5WK|FoN~aK84Tddf^tR;#ZPNHC9G3PX+HZ46IJ&xS z7bNwU&I*0;Y8JKXC}%uP_%3Ys8*RQk9hs?XIJP%4x;YzDFz}7Lyh`D6urxl=#5m`dFMBUf z1%p`!TM`rca-eIN?HDd=(7+75xmMiknt?T$>qOwgt=E~3hrgyqIXNux!+K*}v5hj( z)yGJ!(fmR%=@py?8JIwz??lb- zYj6CUxn8m)7#urYmpO2=Qb&8YO!_WL{bum`CA)AqhV=LRlg$i9sF#*YV=1AaWbCg> z#Dv1`(ghc*kK>q>vs#6>U;;ITJL(t{OP9F-rh%n>lAI?;*Z?l|-5FS~G<&+ZzNL15 zN#a>R50ZWAPC}cM6%F4fb!yl-4f2xeEv}C*Y@*3wyI~Ur+W(Z0K%xWI%W+lAs->8GngEj5IRPR@S6}i8woqlDYIHoEvZ)mESm*rT9fnX2sdRd`ks; z#VTI6*B5Q!ovk+7%HnQXIX(Syt)3(r+9p-yqyw}WT&xfTV8GNK5Fa$EaW<5ynOhQpvK5att|w+v!}8NV&%KBq6ox}~4+ZSeDKan# z?le`ewz@A3mwbuPWXf5a7q456b?*!(@n2dSv+(y496kj^*7Uq)hcf>iVBTk7m_!6C zB(jt>vN1008JUs${;=HQ4yTrgfUU<+HVvlt<696|DIZ?61#E@MZ4yOZ;t4qBVQ8}9 z4;N-sSjiTVVnhOEPIkn5MM_w1tm{UjiY#Gwy?`IYe_{Dt+<4?kCNweoe;hbnC)v)` zi)TS$XBWk=nMx%#n4Sse-dPIVL(-fD0)RFEECq-NDu<&pa&Wb&OsN=w6ow6DXL(p! zS*N16s)|Y*F4cimKEGMe0`@BZx=G|&0iw!v;t;k!oz3aa)ODHFi5Xc~+StXRH8_aM z!}QE9E^3xE7|E!h_MV)E$+< z^}C85(0X`8S8wrc8#fwNxf0ZMSSWE%2#*m*EDMUvw`CYDra{%hKGgY zhytcBWc((4WdNEs>?+6_p-?A;Na(}?ylu+%(-PA`n@zj3&+WT@CqXmyFa?i6?2sYX zk)b0vs9}vxz(BCseACtcEm63Cx;E7jUjUhScG!F`y2evot6%n!=qSD4LQ-SIz3>$Fyi-f(X&7Cgq>q>vVt8>S+A1kD0y zW3<@s)TnF+i+W3Sz#&ww{P`be=#q<#hxiaCcL4oO>nlnc_?GBl_k`F!Fdc+3l}RnC z$!nh$YG+V$6fQ!&Et~gwserAGDRrJ=$cj+_ zrXT=id}=p(L=JyrvtH90=DgM@(Xg{sUx{A&EiU(2yow0U#7SfblMf7LUh;XG>Do2B z!-U%7e041NMpi-m4k0+{rBZ)UZ<7+dadcs6z|@|wnF;nhDz}|IZfH5wjebYe2V=-K zKwNVaBYvrvhT^`RWEzj=Mw(&M)j@B-Nn z152CeLD3HfBdmlrz}GSVIpI(2fMzB?t=lY!?xQPKy-4EF;W#iZzllt*Wn`W-`F$OVlmKTQz2W_A5r2{N{ybTVLv3&v?qW~=QE zG2_=Yc^Wq#3h60*r-s#Or$m*=d=$t2j*CLlAph-ahHFM{Do~_Ln-dE%Z5SO@pOHUtZ410A{^><5?XRBXUp13&M?|ik{yWX6W%L;ClYK2p^Z~tWB zBXkNjncjCvs#BJb`?qC2V)(<%)|aEeACTe*#;IL;q$QozXsd6 z<=e#K<_|uM!)j-$NRneO9~?JAp$>=&iP-NvaS*(3=l9=i2qscR%<+x| zy?U92R#@xitT+uK^I%d^?9S2hU0@B!g?>1A45GZ?`lrBbD}H^INPafVI0Afy)ek2W zfTzHoP=%fxt6DXCgiFfZJse1~SI1=K*`MtpI)HXel%@oO9Uv2PY<%5_6hsc|F6wY< zyZP^$E&uAZF;!uMO{sV>QtZAt-K69^?%&ECf`O>U8RC~NUCL?=VaTD?lDK&nU`0KW z`ijD{BS1_sFLu-PU2Hky_WvYk^xu(&o

9*)OEUVt0wjdwdKW7I=GZd>NRp zFTuiIDnSl=1jzw7VQMjddpd) zIVw|QkfIGG5)_#({8jQ%3sJz@hKt9{_7<>5#IZdOUD(Vt0qfEBo}Pr&55ryZprdE6 z)++(&7!oGUu=%k)-!;&mr7AoeH^ICi2zS5p{7g`QgRo$(NcD$9F#L z4)FZpHPUrwENrmqarWLlv-4H%kx z6@Z~Bl4Ak3*|EbIk?qE$;3@xB!C@cfsxeXf#V5cs3%%rsCax|=vysfNk5$V4yagT` z>%-Tcewu5wG0u+=6ZKjz1OjFL56n*52CUB~M)jifR-WXVI*i|rX11r+SzMJ^=pD0Y z$RT!92f#@ii%yr^`1oppg4FWx6(NANIs?3~U^+fP9nWAeyg2#!0yu93S&UpCJ^;}O za4vsP!d->@5!pSQ*a!_$(Q4-!uxMP!qO<@ybR(h5l{x>5|Hvd`+4vGd_Agj6O?jd6 z)s$2_ER8%<;eq!_`6ow>=>tKQn+5rIRT{rzO z#i3~DULCC!(Zu#}dma1Jux^9yu4-RLUzasPFq77Cm=b)zl5qo^bQ+n>gvSv}A=31# zS14iS23nif>c$~Q9{|Z><9VIF>u9WBvUq9iYq$2RbsQ6A+xpFzO#yMzr-(QoVa;mYu)5oy5^WG--pc{1#CM;|mslENLg=V6o zu?r0~J7wjQX2X79iqSeo)B3rjSOvOkezu{MhuLaMri=d)v{3Xe0C3~93$n+9FP0;? z;Tqg*^*0a>$xj`6^~2=kE~WUY@aALtRzLO_Rft?FJe~xc=Cuwb5M6k6#1%0D$->qB zkawC&azfc^`}&VJZ5{k~tYf@QraY-{)ZA+X#eT{E(9KHGYxy%{KOv8=9S#|VGtQq$ zPT2snn56U_3%(h0NwJ>P;n^tvxgqy<#gc4*g~UGvq85gzjpt45-8tq0*^oQQNjUqT zk!+a&8Zo)kmDv4td&7Em=!8F?66+6n!u4 z6hS+VY)%g|$4P|IPzkWPJie78Pu7i1bxx2BOyHXt|8bmX?94MRG)9d6ul`l(%|l$I#-4*FAN0#Jz(5F=a@6wfBYT?G3SHDhW4GQb>5)Ibk|y3b35Lx^ofS z)L)`TcxDP9imw_7x$&f6Acioch1cD?30&O`Om?541@DLV*XzcURI23?K`iJ?-|xm& z|B$tnj6^ckN3F^Z z+2pG*Mp${k^weg=%pZ|0TiK~6hEgLp-zs0GX=>L-ZbvoCVOH`B`n7?m+{_UmqyANU zGhc)dx%@y_X6C3Zlxg6a&1a$IvhgZM4F2zBApzJoH_ARhmJNHl5!EQ{`=9h-^@D1XU^>b-H9>lVP;AN-6{uZiQjuanGC)Z z2uNgmBPX-t28>ZhN$y*BrTbZ^*Cic(`3n8vJKY^3zJ43cfP+_g3r-#%(Je287(O)H zA8EF$Vh=oj<)f0Iz5s@yspBCyK>~?CPiYU^lKlE0g*bM#Lh8$k%(FIfI|&&%KOQQ5 zWp3IJ6`zX7w=QLy20u*&(Z*{Uhsk>pO3qAyI6)f!dW%A061#AMqC~x!AQGz{Q zzk8*`EiLkGhtp-*YnB*R@9Ed>kizyx>*~4B+cwXI9C&@-%q>pd@vWSL3GR!6zW^_q zM=pGp070`M#X}`pdX|_O(x+1%6P?#40kG@hQ0FgY4QtWQhLUmz0M+D@hHzzf&IfFd zqrU+400*Cw>58t;b@orUYK}k8&+dpR_j>Pn!Sm0&&upD!8A)k?7>UPL8|GvEpy_E^ zqEC88h)<=W~%lzRJV6dz`XVB?(Svjp1(Al$nKel+eZC>kIyiqcQ2t)841mC7G z*lXW{=>2{hjn&@Bj$3h8+nKr+rw@Tj`yIJ(50%ZBgYrHb$tNL>E&o8cWQ+Dvr5lKo zqebn}oaJF%dRepWZHUltWi%G(6ynzE+!3TxrVa z;&J^vF$6o)2%u;?qXDDU<4*NOM(eU0KG;K-1;-DJv9aMC0!-uK#CRvtcc2w1jr=qJ z^ws=M{D^oFw5PUQGowL&=f%_Qv(D7Rhi#xGELRthA)sN0>}($n1~R;Dh_e^?7V%22+@G z$1^y?28MRJrYCafL-D8)h9*y86||r3b;R!kOV+5Fup)4R#Lyz-NjlekrYY>6tb&OW zYnl!K*A(;KUI2r-b8%!14np)xp8`@7iT)bpW5|$u_8fiNsjZ*#FVpRtz%mW zplN!bx9&zA>{=3{GE>fcW8tah7281yv7dp{H+?U)$Su6$qxc}aeE0GxwL;;8u!NQJ zQERFyOH&}2g>Yfrmi#!+^ixuFNUUt4p7Y^QJ(paFs)hFFaer2hnqXqk4wGxz^{zI8 z%hdfps#HBQ1j%z8a1`RRWI45u&?v^>tzB^YGmQA5k( zfToJP_sc(|_SZG96?gH$78bkj4~s%@4g2HO4**c!Ff4regDZ1$drSt;X`#D6ew!y=NAC2|>4cyV|de3$Uq5o_paQ(5j{Nk!}2E`(=#A#WNwe=lN-kh5q8*jM*`4M>qwl z^Hy>tcOuUnNw`hNp#tz}{2TDknR)vq%yWw=>XOD+Qe*u1MO~jP_btZ^krb~_j^RJu z&wma@or=dW@5w^qwCfAO9-jjCdJHp#lp=_XLp~N6>&f0R6|s}mXQi?NK%_;Oj-0}3 z4b|4^bf}!zZ37=5>FMz2t|l$_2^oLu?|!x!8ckNVEu+0=AU~1I{75squT)IfA#Wn- z)|<@j+78)=mXq_i8-Qh<#_ufd>)EnF-&~hSdDSia-?SKsy$QzGCSTu6u~i}0EA82SR8(72 zj{{i5>#VA`59kwuwht`h^(7Us7)2jT;K}N=Zp3UH8=?8Ege{HW{_>|wWq63sTt6A5 znDQY5WS9k<%a1n}0NdN41|^h-LVN;SuYTF-F?F!A1a!f^nr=A%&f++f6Tbd4E>#0C z)t)xMSibssb9%g8v_Q&MDi#MW2K$g-nzx{oOoK$e9d0~cXL*D+oqo9B)9Lys=HLbY zn-+g&$@m_2?=HfX*K-d?l1JDu_jZqeytZ)=sESxr9b|@^-0qq$f!vksfvOerOTvH(Au%K%=xvlqhM{Z%83MLHv2B~t2V2^sEZ!E zNqwrTlaBbwk4))Fe89yRGIU;xnY@q0V{*1DuokJrOV6%%5TX`+I%O%Pcup@bU7|gu z#jMDh5>3`}&X&J+E>c9dkAve)8K9Wd%iKi9azDnp3d9(R^*HWs#^3SA%DT;Xg(%$R zaupzn2~p^#Jd&kw@u49-LZ#q#QVu?D=o%9_w|%sV0Xe%xvWNCZfJ)SuB7g^i8RPZ9_dYG(y-lAM+%6Xw=Fw&)pAMOLX6@DkP1q4LY3DpU80#eZgCkr`1pgM%Q_`O zdn6M>R(^*%HJ|hc*aOV+B|hg2x)Y*Nm~Fv=Z7;W1EaS)f)ficHn72GKRbu!MvD30< ze1uc3RaHBw)|FpIkpG+~c6q(ObD+dSaj-|Cxvfd#ubC!yptCac=11P!>VQ<=qQmtyxWr9BHSh5A_)|>x+e@xSdh%qtz)sul$1gy{ zyN&kSE_EA!U5`vjtvx|j|A-1##l}j+dQ#-q8mh=78l(6YMX7g!=R3RFwpwhC!h+Y1 z5hlMdjClGcEAqIX`%;j)o-ckmXK~JVaQy}DUyOw;+qglPwx*<E2m&#R>uiwiTYW0lC_mPCV$ietY;{fPYm#U= zN>VVaUg-nmUr$f2&>|fMlbdm*`IYJnE(x zc9Kqis`n|xZ%pw!dQ>-?-poypZJLoMuAYd$sqf(K44vMDd@gIB5pJ*g-Cu#NW08$zrAC+|Bd^GL{0k30bM ziS)c!kAM54aW2;YC*h=^lXMoqESBzcc~uKVE>xYSzOtJiRtr3gUuv`0ZhR67?;3Xq9Gy#cbSQwwSnO+sA0a4`|$vzk6>PEsY6Q^#bN`E!KOW*t- zhmpZ1)yk-!uqvlJpl)8Af`?}iZx2RZ5K>E!>RRrg*8-$;K4j+R-Qs1*i61=ti>yRDg4$~OSQ z67I^JCJMgje~&tO1Hnl$m?>A#829%e4SW)|tyl9u zr14h?AT$IaLsZ|p0Y}{TgF;*|NgT+NnRIVexXyQyKL@cvBpB2LY4%gSk!LQ@e*t0S ztlW1hFLofozOv_C{XiKn82jqzilQ(a2p3z*RRO#09=ifF^I%nn61ZIp+`bRw0pnkv zJF6|V{H4OOHJIIKqTZ{75|@5K$+^fXT((MWqUEJ#{6`Qe2GQat`=FDoZ}NVDbOwc?=j`4sVfn6t; z2H=gRx0La4h|K{e)$%)9Ej6g77_1jNsGnY+Tksf6FTG9x;}}CD{GdJ6uTl!d^MmzC%71?!QpekD+02LeDC zl*aOeR*@aZ9Z&}_4wJ+5bBfP5s+z}G0FBY-HM%sA%E3!TZx|lDY?t0c-#6j^?HnBM z`X&RZC-!q_qhqz?Jnum#3efqedtb+^uo3y^t>k`q(n0n(+gKEcExtT%OxnODgOjH= z7^oNTJTRwAJ5b+mVjcxLjwf3Yh660rjfpAX;0-{qZUE|Woc@=-G!AjQ9ciQbxp_c%o24ZqWA1tv4p7W z!9rsz2k&DzkSD6}w*?9OZ|;Nor|=+4Qqd$XPOQqEsF>;Yx|ju7K;h2PpIDLGmDw1E z@gVvETgfx9SIfBtr+0yxgY8>uUWG3Eq9lmUzdKb;okg82ruSlvnVEFwgF=fGJ~#ZO}#Xr5g82n50J3m8V7f3>AkuhMBjISM(C_Lujvq^6G}Tm!*73(eHZY8 zE)SBz$#_gxlo#NM=y#!j%D^giUens|F{Y0(9;9N* zqTFy9pBu>yJ*4lD)H3K7Qg@*{MVoSgwXvRSM%m6!&5}VmCVnoZl%PY4i?0tM0=q}0 z#}IYg==Skz5mSf}JOKFW!I)4pk0Jfm#jQ~w;cMRp0*z89$=-4?Mm84v!=}!T_OHsX4m&bO!)S+YA`#q10MZpv0=PT=~2U)A@K3VbgoD0fFz4dWlbPZW_3U0HgLGjs> zaASYp8=;#1yME)Suo@rLh6eLslNh8)aF0$oEL!(_jedYeI^>T|()-@{657_px*X_?K13}M1E_}Bty^(!m?GaM85q9P2B;|-JNP1Y>}=q>Y= z{FQtkNe}%c0cZrmWsXcVy5csT(HEsM;L12aw0G9Vj57G?)$%-r_cAiX1fC zdhAd*JHzrZeHUU;8pp$WR38deMww+eK5qP(B%b3L7_6G2dW)C-X4tLjj95N1NFRcm zSy3h&5frR)#Au1wb1R?g>;ddRd329T*SyEc3cr^#u-ue4^f~>?{*j?R_<4T<3MmL)pq3XU z)T&um66yI~hDHm-_LNIf&lR0~M4Ay~0CGV(xtZn(7}W!qIpy`xJxi?3Qv z^*L9MA+s|p`pP0l&kMbM*Z2H}dT#SP`?m~zEq{$#I|xt{0go3w7dvG;lw!}~^Jb~c z$g_^#83>!_7UUOLujKcFTx?x8K(ha%k3D#t1Z?V}!RoxZ@utzY_v=K9@5eGV^dieC=mc>-f z{WH;$^;3g$ZL6q7+<`bR|9qzgAc5;x@blhuL1+9E9oIoCq}s|`9lLk&Sv&e0F}KNZ0Jy2GpG5)pb{dp#JAvlmb3FnOGmaJ%-J&b1%o@%G6&>OoJb=8H)> zO+mpuXBf-`pK5*bcgugg#PIQ&zc>cJXd6bb7aQ|6tSrqr;C0$K-GlTVgxKqUEj<12PAx?V! zonB;o*uH+XihY%?XU9L?N|nxVRMRg$rSn0pZoug87S&ctM4KjbwbS4_7KJ{TKXaMd z_Te{F>xwCC=owY1eM8%Rt=)iiMKA%XHKVc`I7E$V2e!`&5=FZ?$&QRyHXHtBf-8a z`R|v5-NLliJ_V>gt8Kj-BK=(X{f+7yD$j3X7_RHvm)RzKlzut?-0k_3{9@A2U_{vY zCa7ouWl>nDQY*V5(vq#SDAA<>>~iymQeA|k4Fmd(cA+@F8}q}%xoOed_rp3(hz)o4 z7HiQN*Sp$FqpMj6iPe+c6T+dxR|rF$QUFz#U7TNh9n3cQOBboJJ9iVuevBTh|1;vY zU-WM*h5ct1BzaT^l$I(n0c|)_kj69j-`A-;KRig6^k1=*^xkNqo#cTHzp?B0U$|oEzWrG7$ej)3{jXeO_z`{ZAvCiqq|- znuZB4R0;)#ndmZdFaDhKpZA!PF7z0fYl9@wfV#4~Va%^1rx*I4Rby)V{u5RyKl!q* zQt$CXvbb2v3!0(hS-KwjBj~B#RSXC_0?WXs_P@nZc*U)JcK(Mris6e6vlO{1C%eQv z)I@_g!fJqzmRIYSzh26HANIMUL!`9Qt&CqpThH3uxr)^=M`LMT%eDOOQ!rqFd#qz{ zR4e)49ImxpDA&8FeYpAiZf0Mk@7{rh7Rq~aM_D z5C_I?wk^~S@)ha4i)nZAq$XA)6tDjpPBIAYGo)O zYHNXb2|29se&KoHRHK;3-Rh45f0f(h2=_>2+NW7@TJJ3Ugk%})rW$;P9KY=bKGy)? zwxWIB;0>#2kvBQU#2io$R{sWo?(rwxY`%C|_!_9q zV0KHiG@24rdNrc6<|^gQ()p9A)@M{=RLb6$h{huG@KWBmR8YJ_N~5sz;SGvct_g8K z_Y($t|LEV^m-lZ2C^(3a{of1*botf$rI4T_?0ottB=q!5M{`wlHkIK-0~mZZKrw(wr*7}^$qS<|mcz(jIJDHO2w&q>*yu|cN^0tKa0;eio^F`lYi^ZW}$fX8@k#~9PX)O z0vf*TIAZRNJpIIa06gd=SaG`*MyK~rbYodO5Z!05@%WHGS?K+5ziJS$@SE2eF(;iW zzX#$R;FH3@bV*w@2aN_5S6i&t!OPvLLCcxJd{DrK+TTOkO@EREJPGU9Ei_-_Su9n~DI7q(coVc{(-i8(u_`~oQ@zRH z^V3Et1aCs6N6E;@{#F$Q%CAA|o+}g4{IYwp%fQ{%cF#eh(StZ#s+P=Fi-_0y1i4jT zSRANFMg;fMf*uv5g6funa+O*DZJ}9igVh4ktLl(k=$`E4Dkwap?OsAgLG@*_-plZP z5(C`7R7!xu*xjQ4qi4gzv8{E`iSf*!ZH~d@TSJEMBI{S5T|0Sz=cx7ITQ>-y#_odD zo?dws&;h&{#NKS%{&WF!?#EQ^*)z7f-Q?GpnI8hzx0w8jb#6SRE5LaewtiM)OxKd8 z5>EAGesT;tXzcPSn>$Cr2{%epFABN=r%vE59Ni#gV`Y7gd`$xC;ctgvfmYm9iG{Gv z!uQfN<{DEVnbI4!?dedLj)4#D{UGbN{{=*OIn(@F&Td31{R8f0Ta!@m`}+z%8RPvk zlees0TKhH6jkzqzje*E6^wf@=rh8rq!ZuoOq`(af|G5FI?*HAE46XYA+68`Fg~HBn z|0(bra4Y$v$w!aX5-EchivQT@Uc zDP;=P*|7|!Ybw9|;;zzxxBF!A?ld(;|A$ZlHN1LZi^Xne=)$cKn7M*9m3uHVF!n9k zt~!mcH&rYU8;fiM##8ft`KeS!w4Ht1Pza5hCTZ8_H^sgWDXlXpkm*KDPOB@h)OO*r=bM5tGXOA zVxDkfpWBRCYf|kW5NM1=pKPJ}hF#*#*0=&fUCU}Lw?4bicKR%Th-ufLKb8H-lX;0# z684E_|K3werS(KVQWgH>m%xc#C8^E3^(sjwgQ5NSZOMryew_tn`G9ma$<}rBc4TWj z3r!r8VUKn-9P#Gam9)1N0F2jh>Q$XF@%v={-h6=+qu*^Q7w$Y`DMLmM#dz*mBR&I+?-CJQyV(TxqKW`Ysc{9Uk zGg&C4G^t=8l{jH%0>h-GCi+xvUle<) zWoxAi=H$1@M&;bkBjU#-5qf;eU`)d#m{nos^aU|Mp|!4?T&_Xi2Y`9#D%XQNo%Hd zED?WQ>_IdrbDCn9obWOWl@wHbJ{g$}GU znS1^A(Ud+?aVaDb-=pB6hsri=ua$&{Tt2u)JD&__(?&TH+lb9b3%9QR3Oru%-pJ$& zoEB;`3!Y=TF&@e4YdxJy5DR_|k9acWONw1_**ZK!EbmX0w@4hGsB=F=z*7!$3e7>> zaA-sg$zJ;+x+LV8Z9`D+!ySM~&GG|a#+U5UiHG$qMD$juGjq(158z`~bW`)gBw1bl zs3D;uI^+-8*1Wy?!Ui1YVBc)J|Gect_{m0e= zj_)5ECWn6MjNSt$_KdkAx`BQ+EpCb8yw=_1D4k*_Xu_;ZA=ygx|w-TqDZ$7k4iOnw2;V=7l& zH-X&y-b@fv?ytcEF_%Y=50h2~Sg>#xGZRsF!lk%w=NG74wMVMsg2+1&hb?89*24F< z%S!w)pW^N-&qUMyP!lPsnF)@y{@7yWwtelu*@JS}yVY%w7I#dT0>v_iun~8{cI!A^ zcT?_yqdh;%!I+uD!ta<1blorRj#dvJa#xo$DSyP%*ur#(@PF<9ioHv9xIB3G#l%AK(lXJr@ zIS9v6GhU32^cu1WG6xfGNmJZ3SrRH{E5ef78+7W=h#OZa&5lE7oiC3pa*EPy9ZH5p zMSaE3x(A;2(~|X= z%UX@+XRSywn3YgD^?5<_)OQ~DG1}8B@AjP6H3srx=54I(%uds*KShWsS;*081hX3l zwQylC2X0tptJ+p=`53?-?8l*w;sWA?TW42=Ik-$ygoIdq>&JmMCdztA1{T8Jh%G)Do=sAPLxh0Ta+>%tcBa%)pjzAlSeuW)R+(n62w@ zM}C-Fv5KAISTdmtzM4A4NU3VZu3iI5zZNJ7$-Vwcx2KdPcOi2iNF~KCLLee-p)rVE z(s92dCTi>RmY?$Xp>-V3ppAEnYrTJmu%7D-lb_7-NeP_g{XO$@Ghw{}q?xwQRUQ0gTk6uEp%2AE^uRHt*-2rKPke&oHVh z({~tfDin1uG1?iZ@Fg{AE6uj8-?Z@38nfgXRO`?}G;ga_tdxj4Z?guOO~GVCFy_a} z+Z)W3`kc@A5XCA{Yz)G}uCB@R^OinV$1(&CnjfDps%*y}cz2Er(V`_5a^&{%o|Xul zV7IDmkL6oQ;;6CbX0BUlzdkZ9sr+YxM1ctctP_3%oIs|rDv1KMC9cVKFx-d|;~6-S zE`_U=gv>c`1!}u~&c)Mw#V<_nk@IrDjnEqucX7U@{*lmj@qJrkvMY^n%t}|C3Rqnn zO$8f{(Ioz#*3okq_$)4Oh!a47P&wY{QZX%%3D~}6;ih$tBfX2@JVXkQ7+e^MJBT~~ zbAP3i(q<|%-*^i!k37vlU*`;f!^Y^&?0bHC!t)mEI(gFG5|c69>-W)eYsr+3Iafgx zHHOi5>Vmec&)EJ2p1!cAw{~3KJ8ND8&wji{X_2$5=V9OE3UK5*TTTVz9p2${Xv1t$ zb0kz`oXa&b@fYKcgWmbj?z{vMlbk*aH`!|+jahv@sAy#;HJco3F2R{Bce%_v?Um{8NU%;S-oNw^sNMB z_qADCv$@x<21sqSBdcyA)-&To8;Nd)=CSCb%+zdA$hyS0lWuEfS1Mu&JK|FhfcyV= zg>KbgGFoc6Uzor(uX~kyC9*tBBkHEWsjihE<-nF3ky&bO+l9ft-^CM+PNL%&T0g#1 zlbB(g{pH?>mMPMiefVCjLghj43e#XXr}ZkM5L+cYJ|H4SmPKZF&w9VOEXu-24&U-;!B{;_~JEF8i`&}fy? zBfsNI+iw5$joyp9kGp>bFL$4U94Zi`f-D2CNs1nAZOpF8SXKQI>%G1!C=krZlOm7~ zF(*Qm?AZ&cg!g_0L^+juZ5e^6)%^m7Y>gyNTeA8br|cg-V43I}rhej5v^X6*6es=u zP^n3+kli@&3l~j-zd57hup*~c>ELagxBwZ`3m;wXIc=ejS;kf!CH2PtB*bZp_JjrE zct|N*UcuydP%Gf*$^k{s?nIzXDTzrY91Mk1VW5MCmdL zr^eEiuZpabgpduHgyPx*=K_KWVAjwc(KHwsREbwyq;Q5{)(05`37G;)pCRDHw9 zRfpBCUZ>T=G3C*%9j9=xRL4AXZ!qyeNDB3oBP+#SX9EBW^AErcs zSs;+~LMuR&4JG~uU$-=o=@$0whSUmh%MhcEE<_BmSJ}#`3XInTX6x`_iaq79DEF88 z5ho^3L^r)LadTY%`>0bHW4ZE-HwWVW?8+*Gw#FMZ=b*;4?d~f~b-Ez>k<}lDWd;T& zXU3`9O77EfC#^WWRo;0< zHI=n{Jd_czAVm~~0E#0jDj*7kkkCP-iHHpa1xM*I0ulnDIU_|#EDTkOAfkXEO*5boiIUIJ*K4L8e;P`A>FCq^%+t5 zD`oCI6XlC}6tm%v@TQY+8CJbd7twYfu#gY@<+p|f&gC?BEu$XvUf3A0btWtNwKhDg z_Cv3edeuyan;(2C`yQ7y*|f>&dly5KF+Lz2pG)g^DDJO1Qin5c=a&NKK-ame_~we4v=tB1`fCRvY0wfc?OmN`uksxlssZhR%H(31N$0tvo4 zDeH@oF|9{1P*_@K zT5Js}74jhG_$_acv#7f#sW<{`khDLQ{t@x+8K-ChKj-3 zD~ZP?8ixz6Bmf`FgIidL>G^<0YQZd&X0=qM#$g>*-~v=5B{|!*F@u#TBkLlej_Q)J z+6zww^f2N#A(Hlg;q4u-0Hp+IkIbE`5}7I)>$na8=d2Bg0IeUX@b3OuYzzf8f#q;G z5)d~02l|5oR!hKw0#YqQLqj1}3SmPogbgzxY>`L4Bm? zs4-Hs1Ko%Y(P&B2)jfWt=%D9Fx!NqP8p)@A=@=J37NeQttr6#C&;i;V0m>2$2%TQC z(=7yl+tPG@@?L)R3(u2PD63AT)NZKNc=|t>=l6rKp_4$k@oCz7=YqaVG)My@BOp=% z*k?iIjs&^FQ{Eu(u{X$rO=uB}6vXx&b57o#4G&K=LyD>*0MBgN|FjOU*Q_k__=}$y zAmY$tRa9NCrSB>khqWt@{FbCDF{{;L0T^c_!0-tn!e=gl>VAh!>33=_5a481yW~0a zEY2U?!bR10 zx-wqSzy9u@vVr1gZwBo8u_>H={7S60>(LE)J-_piw1n?_Kl-3ItG@l|jYIo>-gdc0 z^cU3>RKn!eb5R$^k`6C=(z^$p9A#^|e`%bxDH$nN^6k2?E|;~g`=Q`H<(al?PSDPD z?$7a}l;iZTZZ#`VD;N1~fe#M7LH|`QgpU8grvD{oE8$rPRP5xGs_NtS7#*( zX{TxDmxZ6yCtN7WCTLJ#UKq8D)I*f3@>e_p#ttt{ni#v`xY2dIT)PJ+>`c_eI9x5dWyYzdbE|Wnk*qdB^3|J5 z2zh++0^esa9M7SZug`Z@x31}_0B!P4V+8HPAKSVov(vncvcnrUH$d$Z%Y}({Yy0;e zX4Rk9^zNed{7YDZv)uh{LSYM`4(S7?)=>n66NxC@`aldGbZjDmXOE9r2sNn=MC+NA zuue&^wB)r6$cCSGahYanVUqA_aa0jbrGWyXmuJpYH?8SqI-up#4-Wb5i}ZWGQ+7Y? z#jPm9;>&@A)5{(qm0%%RzIBHcn4ai>`gvB8IIC8i0Y94s{_{Rr**x@p_!JSfJm3~- zT7X4&SQMo0JSQ=WY>n{yBFq-e`uViOLjGAo>i2``&Zz`n3}>2J2HGSKCZ9kpl>2Z` zD_wAW5kDinZprzsj_i8SK4Y&nBbph4@360# z8|1#fP{)co}acODr(w1(?%{%Q0p$4L1W9~ld zs**cq5D8w@7<2Pto!yJ@XI|v-Ri9oiCzpz1e@LAQjQHYzN*or9VN&S!)jG#zwYR`* zP00cbczOWPU6L8Lr6v+7>(mno@h1@8hndysnAi2GzN_yS;@U0C*1v|8IJ@|)M^3D~ zoNyYOvf&S5?HDzkZ?=#!zhbg2Q1NTkc*|Ihb^0UgTX~NZv^)mNH_s`oPko6nyD8WV z>KtnMpqG?juZTDy@cmcLgP0K`Q}WF*%FTW-z1dR7bG)n2Wdt5k+Cd1TwryUCASAN|d| zDFS}%v(_G>%%u$>GXnHAp!6+Nieg{pg7r>!<9by-OA z;YGVZRRn7io(>?a0(fnmdsnb>fuLQ57d}9+5iF{fFlTX=Pbw}O8R4gGP8LW3wvZ<- z|E7DStQiCR;CKApZ3QxX4aAuu~De{_nol8H(7qte3kn zQK-J#-D)4;&Ey{&R{jW!=;srib4@S34=}3F@0n<{*by{6VUT;^W6XGagodg(Bc)A} zF)weKXI75Z12Y*P9R1R|=Vwt3I`y!hV07mssZYO& z!06I44l3a`7201pAhyz4@Eh5w;iSnCK)wA}aTYPSg8s$;za`&CIjn^rv8KV~+@XQ$ z!J-0kta2EweDg)jD7U-c3vcbaDK^nn`{f1do)cn_^TOyZx!7z9e92AT;qK{7 z=k}BUTEt47{9GQ|6)0*WpQyL{3dMbu6$fJUn{eNbunHZipiG24Zyhut%igE&KGTt@ zz5$^7J=|HsOr*HEF+<|Om-UaP=&nV|e*US1i)qNk^5eQ16cg$--TP<2F=Mg|B6vC)xR zYS=-a)xlh*(J^YAQIAuIeA0@05T=oEk0H(agbx|S(Qz26#4`>SwDoISgj5993NDbh zfu)1YuS{+EG2h-huNqE1*D7e*$8MXrx1NgKXi(#8G9)X~^ucfF98jr`N9}kyoy;VD zpEn_2QpsE9l(TC*tTyN6t-Puhh~gCCqy;7&XB3k3pq05j^FcIGO?y;WYdUijOJ}-F zn;S8>%o1-UxMFkboV`3EdRkHSqrN-Eny0nK5l$UDJx=Yz$auavEBFKPy1gB7o#6{L z{;-5zEvOMq${d9|cXV~K$+?74vHMvO=lhIW6t6;P6VbT0~9f%|E> zg|Xj2O3}q7&D4fje4pYLqQRT%a8r)C|{7NcIDB^z4ZbH1?$j9 z2W{@I?%hF}ApUxMZOQ2I=xj1pz}6ak`Mr_2Yy=yuk+(An!}o-I#%Z=*pC7g%|G^vM z##SgfNLxs#`=a)0?h7Sx>P=CaaOq$#kOCB}}d2IS@+DUSx93!hdCnZS^uVz3oEfF zbw*uwIw@CJ=<8vElA{OQv`%`hgMThb(UG`Dm(^~Lv=e;!Wz}^ULD-Q%^!G11sRig9_=@|;@A!jQhnV}K{L#i__2;+=VYZcf12R0q z?*<-hJC6>zN19a~(*CfA&o#nI$0R({Il5rKNzWAAySkp#hTv~6#{|+33rVOY#gXP$P6r!t$Lz#ejrk?`}w2OKM_hIG zFm!TqYuZ6VCZ~QvKaf6yURyKe`e*#e?rucvQ$G(I+7FEh+_^h$5q?*}3(`4Qyz{D9 zrbl=0B$eq9STy>9vK-&ogIr{;PxI;VI66~tr|&oU)01xhI5bc_v(0hUp!DTIlO#o0 zOj^~Fv~%K_lNvVDnzQDbFa2lHd0WxbEZ%_m8ylM88*EPn`8@dlRA4+3I2gxL?g}OZ3GNK zYhSvdmfu|GPNt7_f18?8{JPft?FYd-T?d|QLS>1Yw=kAS@7YMb6r3qp9V{L_VyqG? zvVdZ7^q#BlZYIT*$Odg#&gupeF?I*^RyY;N&}0O zc9Q3MYQ^>Vs@VyVQZ$f%sS5xYQbo zre*Qu@{$$OdaXUc@ptAp3#{BZk{FHSy8KhZVi~qXE8XSUh+0j#J^f`I*Q+u2I>hivnVx9U%T(PD#tS<1xc-HZ+`Bih;fdS+_V-ru}s>iLLK3X_T zD~3YAzyA80fBp3RUegXmaiFaS*j6#5W6b+tCW0!CrRcU=pP`+@W_XNEETU(9V{Kx+OcyXgzc>Mi1!Jf4G zAb84BX)^7Z*SZQOEA+*R`+Mj48>KI}kb3n=%>2&%8HDOgB|yyC1-#^ym-ibFV}md~ zl9Wo}s09}vO7OM5{Ok6=6k@NF)5h3{*KaZ9a(rGRa{Bi~Q^yF>`tGRJyx=J3>m!=M z{0_U@rOaIz6=Sk+PxlIs zN`B9dMvsDMhfIwbfV!=&p5B#C1Aw@jYGfJ&xOtcEdiXQb?V@tmLEMn%?E4oXj4$t| zp@<;VY9igt_E+se9nYGLmB<@fq;=z3WNOXzvIxBw{X>uMw}-E%dijiXAntN|l`e$3 zsbe>eF_ZrUp%f*PvlxoE!f5q!%3{N|0Al5AU3;ol{=vKCDSZ!=OZ4w*ZBJGM8Y|9K zI_StBax3Ce-Z0Ixi)(gQ`NsXVUt~*xhtDdT$*qL2InYWp8V)=9a5~NIuqUy=X+ggA z4>Ub3p?O|tRC?f{@PQ2ud)88yox5+a$`zY*R($+B&n@E_sq;OP>8+Gz+Qal@%aIf` zX;r?Y?Z0BNh}i9N^i#q_YrMyN@bzRVo`6uO6reVO`~jiKG5-1G7}H-4DyzzK63q5Un);sbS!f@94aHL zv7jj9zU8A!u};w$h0X4zM_oP=5UgA_YsZxm~GLwfk)tGVluX+&v$9B0&-b4 zFRt{|@U|QqK?-)}4?_3K3pRRm2NSHjVl2?Dn{!o)c`rBIC2q8 z>n3Wook<(|Mg0n`7GKohK>}k2Oy*a+0^u10S5Upl<0^y>ij=e62QI=7NB# zHd|Eo0FAHm4{*Y{W5!odb(X%CU$X`MtnYrO`gon&QOj&Vf>lR|xdm^ZAXpgc8~p>t z{Y>e}mtrLndX)V1HKTUq)s*4=OC7t3s2W!;`_lCe&9{GF8}fcZr0lbUCOMdEld=5V zc33QMXn^4mlGySXBn^YRO@! znT7s!vJ#`Z)BX9*Q{A}}0Alrn9VyvHts}Je{qv18;qOIE-pg`MpC)NM zgCLXk`Ob41vmjTMBH#M+Xi)iVa1&b(Y2I|D<^ry?6)= z*qTdAE@8C-g7ysHuZ#hq(`rR~_SCMy&K;da%6<)moqhRo2Q;<+rXl>M)Rt6K6$cMJ zkg%-bn&99Jl+!OTeB|ZOHyHz_)WxMGJ4ZTx`gqJfm@yJJe`AR3@4dtW)KT)SxH7Cm zxnZkC7D7aOJl59AOr>W19vg|UFERc}&K6rEElvD%AeKNJM+umnpEX4&NJEs6sy>wB0 zQx=x43D?1?deX=hoS?5C{&@2YIyKzlH*hL-yQt{KA*loWJ@Jk~gC9@9&i#I+_;wa( zu!DqNRo|#p5!j9LHxYH(Z(ch&Muhlwzp`|t65(JzWQ;=wp)>)+x7Z^hCmX>fZRH>M sp2hx^Zp5@h$L#sHpQ-LJg1rxhvrJeZPC|J@?*m?)l@4aqk*?593;Mt@+OO&i8$uXZqa8 z;N}q?Q63NobmaD}YY#x6{Y(&O-`K$ez@5_2j(5Nxhdgdsc!NN^0_^`eKq>E!0XI3k zAKcUh6?cix0)N@>q@%9`l#l1#vf~1Qhzhr_>6ip?%#(TF3{0j?vu?`wk$bG4fjS)$ zj&Yq6*SRKe&Nl0s|NB2~IG(;Tcko>BWrNRTiAP;gGoQ~;&IUjFI{)GI!>g%(q|F?9 zC*jrbuH*BuY&HAHGcnOyReAfP@9u+n!!l9}Sd6Qk6#;XEdUP?mc%hgv$n-U^7=+XZ z-}Yb2tsk4dl3P?nMQ{TK0$0Y*HP5|Ypg$u@`1gL^I@ko>`*rfvL7?I6EBx8X`F(po z|BU?q3-0yA|KC0T-<%XP)4Su(b;a}NGg7I2Gz<>+%{4^%fx`QaT@5IKIXio7GuQp4 zx~{YTeq9)w2*#k3NG=rGQs6`Ty7udfv9X)TFeHjbHOKqWC1{T3#NX zV658toB>I3ZC`ZgPS;#$h}ee@3i|o^IUjN&_fPic1b_5o>g|LMKBCNEPqML91L3icHRaoh(j#DMyXZ@+S4Ykqil8skYRPb--;Bj~A$^&4QiQCeCy1{{%MEyS=6EECtR%5>5|(sH+MFC537!PJgs-T(QZyDJwXZaxoXJ| zin%__o$>T-g{wEe=6V+Yrr^e8RuAp_h@@{t_ao~+fL%@ZLcoKEIf}P9ERWS*=ui^& zuuv2-$jj8e3za!$Y@P(GRYjWH4JJpTH5MvQ({5k6jDrqax-y4Ub|_)nm<3}L!(_;p znw(8-bZzL%?t>XJdGq^zAnd*vk}JZNTo^E9P(^pj!qmOgpCrEtDRGmATvAOZ zcgW28YJq#@dEu_?IuQ`)q#=)=>^0-Wl~xUyQ&GN zcxwP$Lf#ka-pS`ik;$PG(L|EhD!4CnbH%YNa)>H|>DWKEwg%>K*dgBW3QNWNFk zInMh(awqzId-bQq<0=RvrF`OQinNQ1uAg2S6<<7heLR;dlgGCCmsQDt&*zRwkuA`~3ae8)1ZYsPbGv?IF<#&ImiORNc#S(G2 zkEynVC5sKG*Z-J{dA(O0?KcmrN}}E?FH)60yyRnT2lFtO%P;*yZ~XCj9#`Hpq2r)W zc9DD;cj~I_EBKio1a(kV0i(_pKNqaJ=d&-=v4h#iPDQnU9`Ns_o5MyR4UctDO}G&B zLX***#&@`nC-ny%Hp@9lrOr^(SVyH_#9tC4=srOZaWntAMPm-<&CY5uO+QW6H^b1r z?IlT8X_yUZVC_)6Rx!HU@c_;n+tA%LnAD5&wJLZ1M~2HrMB@at-LjXKZ;N9p6!GP-(sV~qIJF}>rZxuPx1D}q2$D$X#utQN3 zoWTCHQ&dk_HofR97+S~LVS)vD3&e{crj73)XQdC8dlQs<_2n9PhAw9p7ypx1K+m2m zd{rVd7NY8E=e-VWP^`vz@fx&{uIP#?Z<)O1qU3Gv@TyT1!MXi2e8Q?2sX*J;& zM!Cxe*mFq5b@&Gjh>_H!$$+lVBN0WA($fCUT*O z=At0`*D`03A$E{4h)5dkzZ4s&D|7nTx=;h#)XFJXtiA(p1oq2_vF|{uw4TL^<_tY5B)aJq( zAOMhFyekFrQNVZm9RX&pS2a{iXMhqC(-$HboeEs!C`%^F_RE zpB+Mf^`hLGIuM)wx%98s^|iP&T$FcyLZDw%orsUu8)6BLztzS$=%k?gzh>vUYSs$T?n4!q;E)e6da8!xUD`w7lUt00Lv0zzu5gQ5!l|( z@Ccm;_0(;ENy@;~5~}vzZ1YjfJ?XYhCm&a$p+((^l?VI>Kdg|yH1rH)@@Rx5#N9u_+1F>J(=-S<|9~Idio=uB(_kQdxN7d|4{CR(gq6}3JJ;f(9 zU4cyID-$B?)$k1Wkf;2Mf~z*-N~fZSunmTZ5%r-zykCxUbAz-$X8+s|sume@s)+(7 z(4Rb`=g9Q~T0_GjhO%2LkwZt0+~)H4RN8Q~T0hMnMyOy&3vP}4Gz8MY@H;IEnZLUN zAs&ua3>zuiu}$<%39LA3dA@d1Y;~mCP}Z4Wn7yd@UI*-Ub$H(?U_ys;s$hS`So#N7 zC;D}*e#4^;2X2TP%ZJY(X!l7IbeQMdC zs;6!m-dE0qtXpgx-2L_)z$4tMY!R_tTc_HQHj7m)hVvGe$Wz;ZKLxHg!gi7g9t!n? zwu1zc4obuOuu4@cdM$M~O#?~EHGxky^5Jk*Yb1YWt9P!U=j4wzUXoSd*i|LFy$Ylx z*kxpAUcYEnuJlrbZ#jptfaK%9eEuPKJT6BP)`9nW*t)b3%>Db@MWKA!k0hMoE9;Yg zu72ww(l0XShXIp}s^Y}2{Is;R9Bq8cO@1zLUOfCe#MpSk1qLI3{pYj|YiC;mEdZGP zkh@*ci23wnz`)B|z(oR(9Vkzhova7b=RG?+JB!`N@NOH6<8BS%96J}ozkALNT<~9= zxi8t^{=IgDRbw*KTHijWH_UxzI3nA0#0(rk?5VZ{97lND#|(GMP!ax>`)H-78<2|g zX$Owf_+vG3@n0UBs@|FWqhwMN_FzH+hU;{DyK zjvB<==PQg||2;JlkrtW}ZG9N1R`i@M&_(7|hT)!zGZ**#DtkKKQWPuemY!|99u&#f zvWFmMe8`*Jk8S|EW3(OcQeJk{n!PL;WMm0AhR6%QUPq?~UtAj#VK*KGx}`!4;8+#q zJ-s)Np8yfbnc=Bu5nv$!*KQZ=m#KJuW%sYz>woRla`Msij`2dindR05m)Sr~X){9| zl(+vk`tiQhk8*K6ZJNItOB27VwLXv{tm;0c?ceRIcW@i@MsqLG)*gJpyQwQfkXTYh zhN^yadmH8vzAxPC+8$bxXPJf!xi8GPFkdsxIQ1+P)b<-?$(R!qUH(#3?>Azr8rV_g zHZJru1S<)8v+rMD4H)+?3jG=TNDrTb@Qddq_RD`|7=E zDl~ugl-07@nq6Iqtq&MPFp*~4_L>;NC67R)78US~B zmwB8N$`~XVSE!Dr<~u|W3{^hKcc{O}ih4Qew)4Gg#~02j9e}MDZ9H+2toKiq+$mTE z1AQC5fLmOuJ9}tz4%X!<2d6n*t?*{umSp6A@!uq$mH@2^H-R&Fq-KnrMSOoaTSZTs z)s=n&GNpSh-aKp~M>husD}3P>$?dL5=lb(}U$^DtorPWq_s{j$)fbZ_!@u{na%g8P-3w4H$F*!T zBD$+^4p8s0%FP3;_qx@&VQbZ4g)v}WhOmuBJ3KU?)GF07l(=z#HEPq&>WvON#k*-j z&Lt%fcNgk{r_{5 zu)q*mBRDBl0}4X!D zu@Xbw74!0zJGM6(D(GoAlVfUMh2}<_P`+bZQ>xn&-C;W`3rSXP-vSWrNpcGS%C#0h z-SKYXM95-ehzbSF9O~|$RIN3;G+m7t^*#j)& zp0W`C8%MV~->G~FD=xrwJJg4sFQfcg=5_h22;vO;}UH{$pgyIqh@SXu^Z@13R^Eq zl41=$HGU8Srp4s#MijVzHs|*6LfZCyRy6qocUWqQflsp0={Q|Y$Ru?%tSzj_bJL3p zk$J(s%k&VgJe@A!Cv{Nv8Uj&=!5io0O5>A~gjw(JgQSieITCsW^f%zXP5ycM&&Aat z_c4i@QEHj|l4|b<@q)48`38}bgPgj2gFWw!0PLfODY z!A{}p)3<-NP)JzX8`72e4`HsE)(E)dSds?Kss^F9@pWtbI7O-f1}(;jS$i8WHfdMG zzAA&m6zxX{->)pRbjfa+EyRayO@QZ(dvY7Pbu|(2M1+!4*F6Qybb9c@l?oU^o`og4 zVDJo=`m`?RwDai!f7Q8_zbY{rW9_Wl0Pt|?Mf<4K%THdhEL-K!*Gwp$U}o6t$G4*y zI!{AnynSk_PuzVgzZQ{OSG+dJ2`AiS4&mghXR=;y&-%($1gGzvJ|-p+U6FWdp_K+Aj~!=1dX;s3+A0MljsckV;Ou-PL{WFf>+6Z1Uk z9F`r}q6qZ0w~vtF>^KK~LIjxq84t|QM|;b3KMM_;VW$JH{wgl=`xY~`I&l;1o1W@F ztIaZRgic6Edhoub`a+@DvFNa6!0WEh%+U``Pj!kX^Kf>1M?Z-8QP<9b&db(|rN-5y zTBpgFlqV9J@Rh>0$cNR)^7k#HFT_?9K7`NX0M`-ii7VDEfAj=FE{Ah@^};2=A!>+w zBXsw~Se{|o4&Dk_Bg#gED@#;MaWpRdh3!7BEa+yNSzo)en56;1Jf2ofk!RK7@iaVB z-G)!fsiTG0Bx3PtN>gS0)m57?NjSks+kX%_%>)@r(k}~-P4XkU5x>T1Id3;#C<%p) zt0_RumyA_|mQIHT!U>M!XJ>%?D(|Xjm&48{r!6Oq&Y1#(_&XJ)uSYzUzuQ*6Y+1It zK zyRO%er+Csh{NuxWB-4yRh%j+BS++y~(tccj|DOv`o%dXbDqO)t{}p1O3zHZZM=p-w zO0sjv)W4S%b5mbxxkIV@LxH5PHSRrEk!L%Sw6E=WA`pQa-7V(4%H^3g^pfdb+fuPc z^qvx1are;MN=9IqzVBfyqwG2D&T1HkZ7_4eX^UZL%7Jnt(%(OMO;&Z=5dgeH_03K) z)K7|A#`@J4{dv#rjg`^;W)_!2(;bOa*LT5h>!%AgTKHh7C;p8>Yi`qcpnwpm*bEfBo)8;$xYL7#{AWx-teZ$8suu@>f->Slp?!v1U8|Q_EV>mTBEeol6 zS%!lM+9gQ_>Z#_aRoK81a zQxKXb|JbpIGX0w2VlAueQFUe9%j*t^j!*MQbhI}PZ7uXzxU1!2P(h7BGgXu&XhwB! zi&7NsoU)&KS-*M6DiG3}+we_S3N{YO$Vs?om()_%zu{$h4wcc>@|Cy3iDZ)JAoTQ0 zOk83v0Jbp&Ra&S}FRE7I%nP^kR%f%*U}{Ux(W2C<8S}_ZdG0q#z|Pwyc&XnK-#+(r ztf#sc2%J|7*<0dFpqPs5;<|CJf$wBtflvnH<+_Mu-RI6U@L4k1Zrb*?ZM#x(0p?0; z1r`0#>=deZI7GC*+i@oGn|+tBTv6_&^cO2lG|Lw}%qELK_yODJT}=gZ%DlBr^f8Y# zHBk+P)Z&*TZ!y+P!e{Z3XG#KhkGV#1;*`Rf{Ql34l$P*4O&Mta97)e9eRqKt#1>zZ$EF!MIPr!-`Na>kW>I zha)Gn^f331_m7di$%}la9-55GHUN|2d&ybV_ee9lH(ZGEYl1u<)Ondr+H&eQpyqM} zo2I#|Vq=)(Z7a$r=X>}?N~MF)uUW_Ov`DSAdN*`Nx!+7k5-`~X*ytokJCTi}hlWh) z^UL|k>?|i;(=W$ejBkK{8?^%uSox42sxq6g_-cjsjs9NJqgKmK&6kFHmt|PY86T-* zHME?cq;xr>2R%+4=4v%=IMd+}OOIv`{X`exbHu_jvOdJ$R3i7=MZvt;V}d4ADH*4w z4hFp2~;MQm^9b!wP?N$ySH{?Owm#7f*M%H++%S7qKIZ#!x4$LVYnY4SA2wP2Y0Y zaGn(6dTduIbihy4sw=6}NyP?k)tJdC$7P-JMsG0mWAbxVNtN#zx|fkoDk|x9N$wdr zluT_yj$CBaBOT{qx~tL=*kAly;l%isE0@in2rOoGSuke5i$=xe@W9E&=l^Yrcq(uK+sj^37)TSFqCwl+TN#`e~;D>Pu-(F_E~% zi5;ZL#bKfG!zH~V4}~6Cd_*?oKf<6F{|#lx*iMn zK{qj5ZeE6uJdpGI`S#nB-WI>$)RluxtXlATu(z=J_c+{Dyf-^1kP=f_;uP>%jk}YY zaoQ~__R;L<`FqJfZoE7;E`57qC0gC&d%lZ;dSFXa>$+d^6aViW5uvZ*tOXB-A_hY% zyvYBodar-rYyjeKPqMy%u~eS%F`+cBit|GXSmr`aceJazF!tDVJJG`z<6DOG!oBRe zqF&=(JlQlfai@QDbRGvMnbOC~bQ6~mIP2aPUUqLCy6jJU15B`9A#^RNoKorDtsGSA zJvQ=9S%s=TbZSO`cd>~_yR$`u*-RDs2YtX5l{fL2;Ty{&2m%W51e1G3HF*Qo>=5$qHSeb@q z@PaXH8RdMca99AsyfEK?=7b9q{zM}!RNsC}b2)!S{L>3DB}E1!&Hwu>ND#=>*j6V5 zq+HW0s#(EfHH5l+5tn6<$oOJ#LREZ<_ZIj7LGfy+(`CmD^!nv<>6Xu9Tjq_AejN_b zUivK(f#?)f-raFcMm?#J3B_k(^{^=CO9>@pkt%Y)MC{IijPecdT?8`2rK83tqbB#o z#4HkCb3?$(xeyGRf$t?};pnVG8uIlI!(|fF-zV$?sRO|q+qOLQSl$~O-!50*A(;c) zD3FN#rmgeTRqUeA4N3)xIi36U@I4qb`HXgp{YE(YLxS5RG}h0s&TAN3o-QA-4Wxns zs~l1qA!ck^7Gxr)rAHGddT^ZKhS#!h0AAvMkQYDcuIwK+GPd`Pz~4#eFX}+PF`xFN zTHx{rJzoI7VL$%$F^sjdu(31&Ja7h-0|2MZHwZwG>}LsY0XU;(YRZv2!>b%%zllW4 z=(*qR{Q9B^j9pqF*AO_Q!Wb23m(hPt-&AL(_Ut#cZ4dB?&qVP{F8EQ2lW`|B=Rj{1 zur#+ZJeidW;RU0C@Sk1oq&xcP1CJ8Vi5t>e0QwM?nyTtfw_l4DRc_0yUS-20fQ9*N zPz2B$fbSU%_M~eDTLY1GK|#R^hGRy;rBusrK3UStI3C#JGBAdcbG2vycVxepagt|E zR8(~I?>|n5%=rKM`p3BiP+K_KE&7Pq)V=^LIa?jTpx6atvL4#a50~;K7ELWEFq!O) z3?wayeb0XOKRyI|Z~srzF!Xk3y1rNQY@!aAHe+$P>i%3qjSOq}a7iP_q~qd`#^TJ( z#x>g57`sK<*sM>Odr~vOl%fjuupDH7G7d)bNq7OC8^;P|E6G5EF>Uxuy#oWk^zfN_ z(bX62TPnebuXgw2OgC5tY3hRbo9U>E-|IsNCyOPMi($CX_K zbtFN8w~A_9#uITkmEBb_7-N#(p*SQ663hk0Y-fi(-`JI*h5jcgIeNQyM=Ts&!id#( z+m6c_CY%Ub`0^5?aDwoI9qNNj09=4wB?$dFVrYmjGyOT3^|>h!nBAGN0PG8_L+OkD z3_;cM;++1;sG*@sl9SC(kjaUEzm;I}Hvl)kF?gG*$CNiJ{q0Ti{@OH|Cxc;8`;6ZG z`<9uFPiU9v_e0Im3TTPy2} zLTK-HE^8IFi=ke_c2{fk*40j~@4z(UU{o$63+D;_iGH{O1&SZcKHtDid?omAaET@k1>Q}Zj7TKp|gQvcMUWD;mi)(d>eK<{zxtX zTNKhlDl557k#?Oc{G#fHfS_kL%H3g*P9f{rtA!F4az%DW9fjP82E)q*luYjdn7V1* z4#3}DBF~9NIcC}SVXe!Z@2ejh3_@4;!+=cbe#N3CvNebLqDjN1pS7vQ%B6HL)+qh) zSesyeY>{R#{R0L|#8HQR4_6-uB3o9mhxz2&Q&?s2FR_&BT%^dY15Nn-4`#9(?%5@9 z<|_v9S_R0R`SeiQl{HY!^To&5T=+oLeI9%vkG^0WIdD2H(6B9&N11wlv?A_0$>=K` z#aapLsxFrBwl08`r$OMwb_wTsM1)?>Ci|wjj*XW-6R`bkBLmk{h3id7T8d%i>?7<( zJskybGdD1Gc-%@)=o)w~$H=H@oh?9}F}N8g?kOiHxA3F!=>p(F_!6JYuD#u49uZSf zGr^^#h?-ehQEtSE&ob6&G^4bG%s+40y_O~y-Z9j9&2__$7o(Z$qQaXa81Tdfsn0V$ zzvgNOEhn2qyl%QtFhF?;AwGxXJlDUJ377dgH+SZEHJ@<8g=ghPU7XqyPvdNu)juM6 zw~_-M4aS<f^4VZnW?1|=+|qk3ex2mZ0SfhTYKLz=dq3h;DJ0^hgtc7It52wHI<3 zGPRZ_CSk|sMj=;{J?j#-vm63_oDQ+#d>wDpAN3yk;ST;Z#Oi z@@(HLZ@YIY!?r?OajfKmwfy_}(}nUKUz%=mJ+k|e11fr>#6>#xjE7Qgh&@Ppd=7`| zLQgb#V_mfEGp(#Qgw2GG<20jX=Vcr!53vn+wZ|Q>bvO(^9nj=WAq1n&3%~}!8*J5K z-ic?3Lpev=&v_YrO@xbA&Lju()Rh+}(e6x|gDLdK4k^;yzM6tA(u-x3EURH+YV6Km zk6i!!C*(6+iE!-itfPIAMybx9pJkp_q5W2dvgA+B7``i<|}%)%hIS>*tV1h>-;0JJ2}`c;iKu$OhO<($dL)%Yj9?q#=@d%UGYR&DHk>jdt^H0@EKP_BQf`42Mqx@C6-6;s)X6F zsJKDHML6*?+j*}FLJp<{FI1H;a0=-Ph1U2{y@37oula(%5aNHfTLzvzypSbVYkI-4 zY~v1if_huc;#uT%UaE;)vY|`~wuh)rHwPpht_>q-svsz8I`@YGM|!OCvA&gxQLh)N zN=|WMWMWXWk=%k9R87Nu*u{0)rQMlS{Uqo6gM;VKmbzR!bpCR0X&yuruw~{#QBhGb z9{-&qPdp`0&rTA}orpLDXiYMmwIAD$Tu?MNcYwI7OhM%>363<##>WPkYO=M7MDF4p z3UR;4DM5E>~CA)%BrAVuS^kvSp&D#hRVkAJIb<-h{x}9N~x5yJbQY(UB^b zI*&hJ7n?AVu8#J+@{$2RBKX>eJH7yRXdCvLBTnCV=>d|CMtcrM#?R?EK%0=S9slMm za1O`;wM!2PMqc>(AmI%yz{67O{XIPrfwB4WNv^|SpJ>|4W?W_x$-4ZW&)9e&KGQ>s zXS3W&qXph$RmSY%HLyMqhu4^dhFqY%5V+af8LTNBwHN zYLTDrTuardtQZ*Gb_g58&BOSlZcZ-N34($+wO$9CDYI&Os|=GBBj&&vk$q=<+;7WzcfrN5@6tUg{G8kw&HYy&P`F@?P!|L0=Y#$*Kh zarmcCYz~O1(K z2ANDkTM_B2szuzO!M|yt?DxXm{x~v0v~rF1%lj_#EK-M;yJ(K4(Jk4Lw-HQDn{b=I z7fROuBxi-IWP|w|Suf<-5@0@U4Lox<)~ZHIFY5CA66~nMVLLl_Jko0BBRQ_?=Vad2 zvK{W3t5{hXK=}NOkJWD_>lb(Veo-b^Pc)xF-crDCJc=gJYG~l~cIZx@mMzvL5%6pG za!FgA?x7QGPKD75a4D5Ft9^IN+tiFE@*q0WY^Ox{$){0G4 z-bB5In`YFNaTI#hF|1NWXlt%`X0f+YcuXA@f&K!@Qj>f;5hn0(R8lB|u^{y`65yM$Ufywh#; z%8a=zLAa|>_iHzneUCTQcElhBV=jo7wNBm}d@j5?YYs_sZY^BDjiGFTS)1K809B=t zk@CBH?zq|aKR0;$4w$O-01WtJbt9OEm9#ZeXHvP2$9zw{vWT zwLqB9jq!A@$GvT8urci9we|}>Jgu*c9|o)qnoUDCbA9Em4J-=}2?cei<4PEEhreb` zXWqd9j7ygmex*xed($P5_lk&u?L3sAB9t}a*;41&m`cxdPywQi`k^YRqmVDw0r%42 z=Re%JZiNRDKJGVm1x3Y)#i^Ddz6N$`V(WNkNz0q9ju?P^7_QHm81nP!pyNlDW|cK_ z*C80nF&|gMt4q(IZh)+RcBLE<1L28kcVVf=b;TLt0je&iThn!#50ee&Kl-m>siSw5 zMket)ks%+yH#r2`0IZ3WdWmtnyIB*s)YO)DT=roMZc+MksY*{mQt;F}r!6^xnn&-& zwes)Pz7*?B*?C^Qx<&JBJ5<*<^bgrl9+W_^tBy%ALGabA@TWy;Mg2BheRa-N^1dZO zYCfhWDd;;|wwW-<02(9JVC<~s+>`Or-ZVTXwXTAP*kq4gDP4!O&!kX>ealJ=Ddxku zCn4>#S6!`w3|3kC<;qvCg1G`1th?Q_wSsdao3pIrq;y^520_(rKw%ABR|?6*HP4mm zau#QEiyHdJC6`zsE(PH(^U4oLTLGD)0nd}dKjjP4Ut|+xXUga%TsL~dr6qYHOtwGT zm;dPC#6Lpg1HAfL}rm-6@v7U6+#zzeyM> z&epvo5nqfk|B>ggR$H7pqbB>fpCOzx!Wd_|&{ET~(@xIhYv zAkni)SV|V*oyq=F(#&1M&sKO&dlFKYpPXK}SDt7#Zfow~Sd@k4Gya-;v{kxh)m$j} zRna5;rlf~lkB8{!wQPvjX7UwpM|E@KgO4ZHgaqhM5E8EsHCNBThFnC`qs^Hm*b(Bf zh!LDXtEKA~-7DEEv7bhwnsH_|6+HT6SdH*yQHcr!+%6Soe+p$=hI>RVx6#aXfO`q@ z9`jwO-rauGJ>+3Lg^8xDlo*l5({0EF4GtW2ecfaaQQ_nSB8zV;*s*WDI) zcFk#@d=%FO;kFTk8ZU-ZhAg-|>OY16FQ#hvyV;V=oCV0Xm1DX{`{@y22EBW>k_a1Z zm{}SLbY_hQKC`nNy;n^>Zt|qwk1q&1&{wd2)@(!cllPxk60vhfvc$u1;*uz`(Jx*2 z#|ZQ2k?HvjpI9#m=&>P7WInPhNUl(u>)GD%7VX%*dw{&1n|Q_j_A*wQwAMD+FHw z$ij9t@HWfQ9uy@gK4)E+)y;V`68!l$Aou2tF3v0CcwmjR>m=6nPVjg0yxfv=?_Zuq zl^C{5i^s(EikNY|<>#^|Iu3i01j@<{QZ8ShUp-UEkhxKrPIPF_82ldX5h;-EXI=+Y zdFl?Z1K@%5qBWtskzap}m=BA@{gb!eNJPU?<1AHxqm9)B>v#Qmgy|YwrR&ttvj-SU z4@Gel%bCK25)HJ<{mp;Pqk&1u!VBMAD{Xv7xb|6J zFqgp`+9y_umgfo?VjMr(qR}_FAnM#O zC2WRa;{Y3Cj``T8j)W2MI0*ySN3Obu?FXYQO$nxnK_j~61tkN_oCbXXuV=K_mcFv* z7iC|TeKS83l;+ft{0}(C$mh~gF{{$D2>~1X)PvW4o;%O+?`Z{W5)b_Y@AV9Ml}}6W zoQt2O3EQZCPK@Nba!%bKCGr%~g2zsnirk3z1w*0k+R&UL%;*jI?JQgJW)1+XpU)8{1Cenc8gcx6Z@#;+uU1`|Bj8h z-xQ?O)X&pMNr+C4$-ikIL1?c38t^v89=n*;@8G|nH7hJnO0CvP3@ygv;sG&zhRLyH zjb~OhYspZy8izb7*ckiYq<9hmjd4~vlxZt2wz;QTl?KWDV*wdh6t8 ze{HsP+7%Wa*Xu}Cv^T+XiE#qg%xBhD#<1y!W*Ls;I9)uT#8906EGa7E(J1s(JmE50 z&BPbApzL|e-_#%rz^(Rz$-!4udgPp(35%!IA`k3PZYz#_^NQ)HmM!D2Y=-DPvvMmk z<(2+djyI{r_l6_cffLZ8s?JH~>6|fkP@uSlC-OGPKVKKY*`6F#TBWrg9r>0EAsEyf$C= zR%2sJtXTfyzP2|za5q5A89%7%G9VQ_*S800C*nNT-;TE zAj3cJ%g%7AeWt?sxhp6%&apwQp4iaJPRi`n-?mQ`yS!Fg>yTO#I?MkFZ|lAOR^#e= z*%y>2fV$&%Lkmz{G_avdNR^9On!R3M2E>WGnin7)J`Bv!zp*n!i$DbpC!*l);s6Cn z0+KUxGn>m7X%4isv@pdzF>p0M`?gDa=lMmp9^HM<$$;wOfvnPW^JTNyt(v_Ie#RE) z@lS2JniUCt(A_@ksRQQ0W91LHb56;*1n2Qx_mmL=RQ~nJ!s<5*Xbl^V-YvSTcYE)K z@_h~%E5Iba2N3z)2U6@qpXE+BC=hV532(3HkQS(Aj=L@* z@n-YVFC{wNXuC0N=q$jZ08vVU2xMheFTye)e>cRFeqHUieEgLYAGJoCP5&lTTqkrr z0ytD)AettPOK+<38&w@E<0sDnQt0B3AHPUk4d?*`$xWG`VrjI|$%$@nKsDl#cMqT* zi*dN2Sn(@;znQEIhB+Zlzd__W@QIOw%pN%d6qrh%ADIAFtIZf5L0%khCWmwE+p;$) zUg_2v%k)Z9_idBV3>x5GWHX5@c_GFU4LGBm!FVRHc>Rx6j>Om!{U zXKVmUFhAHbAmZ`w1NDNF{~5UiJ00oaK8nK1`tG2)0)rOnET{jOP#+c+{cm6Mb+$j3 z%%*C+y~`w9ZVH4RIi?tX3K4GW^WPJ+1I+<_P5pm@XdeQOi2zsNe{VGYLv3GgjIi_v zcwx^*&>Kv3wYsWf$1%V$3x)p2G3V*djCyx}%;L{Gs^T~XFrngTZhJb%bz&8Zy@3m} z0@zxydBqlOpi1peZ04202m<(U=d3v3RDDfU)Pd+Z?O|>~XX=ps0st8Kz{aj5g)RVl zt{b52SV*Tt9c2JLeX{hj=@`I712kNwi#7H~b`ant0%QJwAi@?ZvNVduSBM2Z+f}{zQ&p z8P8Q?07MUvc`PIq4o{1sw0;3GX)*u{vM(RtnCZ!q|4W@UyO?%9@b7Y59rLrwa={zk zEAqZO#n*{P6@47p`-=A8CH!jk{aq8qZ-lMy(?and8UZP>C+?GeO){PB<)pB5&kFu3 zRH4RCP=+O-NqN6y`GE-Z&4Jv=>YZ7PGCjRz`9;}}wjkB2@zGU+eK(9BQ0h^pt^7pf z!W2&buwoimNgo#f#j`eF)?Mu$x{|uHG_A!7^lz7|cwCEjXczVesBT89_f&@`KX~II zIMo-mJ?}&YN{aads?_RM$*`-_pP<`wX5_iSg6#=k%8+k$C!6$!6qvHL`WZD+qgLsR z!V{rWjvcN5I}S8yf{+iA_u1r9URdVmJD8sDEeFrtP7XfBg}6KQxne$svp$i9C=d1- zjPNlxcNL=nz*{mOGjy{Z>UWSSSd46EZ>_g|^QegR*95*?u)QRG!v5w+@(3W$M;`&s z2({(p2uPe8_&eK3!L>c@YED>JhQeisjuGibAWkZkyrpgoh0+RW*B~Ksa_O%w5d~lv*UOX#}i-pIh>s)>V56X2yLei2&fV=eKKHjy$=CIC%&Fd^}bC9LHJv zwRV=`nLJ=F1kaZ2KtI8BL>1`Y)#acC;5>&nKzS@f3ySD-1sFPM_T^CE&*$g+C^uvd z@vd#t!o~o%P<33%vGVrobDJ2s5|gu8mhmeiEH)T-;E3oit9RL?!8P-0pM3tSRNo>% zhE@YewQ;_^*F_xW4Kc8)&Qw+A!@*+6YUQ#GTSD+LJApQ<96h?M9F1tz&y-#5cVY%A zQAPoz{7W3>2q-bGgx_Ncj=gJoIag8(P!x^U-X*o~tc_p@iO38ycR=3)pbktQ|Wa;vJ zb*rJ`Ue4(h6&x)xw}h&~ts<;_NB}i&AZd)-ri8#{wRu;XsFsT&rrIuB4IUan@EWf2p|LyhOVL}?^x$GKV0oXs z4{X8@RQxV!6t|Fg-}ah^0?SQPiA2!RI$8p#bg3NwRi%5{brOP1Eo}w3QvDB^Jh;{q z!5xNpyFu69ql(gpzY0FQaI7CE^iw~_JAZA^>xMwYGp5;5Cmm=pb#B8a&MzIv zgR|``U=Jf4%q^S+Ug!P1FA#Her9)|U?xw_BIVT<1sMk0hu(wCquBJG$>cM`*ebIQP zK>UIi)Uvdj#t(WG-Uc?&j78e-O zN0xS$!)nA|uIrs|vCHUJ`l^tsk&eotrh=Yt#5<7LT!(9Ng`N}J$kl3O5HSi;@I=FV zx{KBqJD94el=n=t4M!amGVGCErc_CP;TK|@G{c1K)c$15 z^mt{!(oa5W7ob-K;+*39BKkgFwO!7yG-C^jy4Oc`W=`B>_D+XDHaWCEo}SkmBn|ug zg_#uWLd@RmoW!rZkitXRdL>U_*g~QH!Q0pOQAZ=HSwiiv8l2%yq<3D zBik7AmK`z>eyzN#2Cqf0uzl)VL`h3$y5(zz9%E!m84*hO&2kLQeijEPm9s!xb?_M? zF99!0MQXe^7`)3-` zY!D_KfTY%st9xGdvsJM=y-tCM9aGRT!btY^ ztmEqypg(`s97BI67QxfxvtNZmR%bB?QPs!ufe3_{I}^5TJ<-Hp$<>{pS4UgWcdU1dw#F(dU@ z`4=s}c;yts|8- zT&xq$hN;NfOUTtP*T)+~N0u_X%8+VtTz43a&i}3SmflQoOryG?tIH&pQ^fTmfPXJU z$D#O;dR9}9;`=SV>5L>RvaBG)2%Sny_uX-cz?nWNrMR{~2_8w>oez1O3Lmr$8b=An zsAlMfjaBdKC(d*Urd;GjSs>Owa8{K$+_Nm2jE zv>m)ZsZ;p^wDSGAR?15`F@NKm_csD-l;|V26A>_*Bk|d(#qSnY>f}ed?y7>{W~VHj z=RNtNh3oX_uhQ-9iIO*Ay=!_~(eVn~&d`=;5-ai&GwzuTA{akuw$AYQ6VmZZd=}1K zRGSqpd$^*h!9Yt9J`&>CKZp|&pX0`H%5NVv#X>JQ{_Kp7Rn0r9uk``$dNo*XOmejP z1kb9Vho!TW@Utj*w@QD>xn(0z-nR35J#T;+VWPoS27v12%kEq&9;uXBiT}xPUFdqk z&mn1p?T+?A_w`HuRH(^l@gI7et<_ggH%P5FQ$|Hizw;kCNeE~?sP)HK)+8;>hEDCO z302S5DyNj?g3E5yn0yAmp4+reJD+$Bg<0D)M`aJ*fBgc1?;a}6rg)R!6`Ry+t&FZ{ zTv0cLp{Y$)(^mcqa0bDv#?4Bh4XKQ3utW=`CpzZ3A>My#>2`fOXMLBh24w%-zOSz& zm2<5S*M*+i*cH{%)jsg^+da%pg=CFDH&&a~NV17c*Ijn#jxB z2?Tx^@5!~wghRTk`)qYS+Hhxk|8LyAc_5VU-~LS{q3|hN*0d>ElI&{~N|rEoBOzJF zzB5B*QVDG$yM(M`-^~<7c47=;OJXqgWd>u+@0>oL@ArE@_wRmw|2)t0&*LAd#$4B2 z=XGA^`96;0_3n2!zxIhb%>1}C^bX3s+KzJS-HI<5#uwra)IJbEsi)Y~ilvx1WInwy7$Umbow6~nK=sH@mxKU_RrGwR=L zK?|6PU*8RfWh4R>CZI?!hn;#4W6B3_HCK44E<)ThgCr7V%MiR}y)*cCh?Tw-zIv&J z@-mHW;!cU-(IaM;n!)T2zuU(_t?g*|BwhTVhwp-=h!z^{hROJNh8O%x^sCEr4TRhJ z-WC`3SZ#u`J&M%XIv1rKr#M{NNw^vhq77$~{+N8lQd{fim>4!9{%S}K_yvK}q2_$WJ7s$i{- zTVc-0ghw&vrlFLbu4lwo2-Q5&WYgN(QQ8yqiWsZmu?L#XSM~TdJF%wRfJzORjYF0J zDQ{T-*7p3!breyp&)r%V<349i1dEnu+t+au&rf?~>{44096xY@!gw??p)Ss-$SxEJ zZ0PmAIqEh$sQvxw=n^MYZT(Q=(?;RUa zIifk#sl){=+ZLRP88`umu?fB9Em-T{3&gb+l4An=2{vpyD)ehUc_RzR4S^1O}M~wXKe+BBJ;zur}P?B{i?a z?Gm;e94Bf5T@JzVZD%r+dqq_!h3Ugd5Baxot;+*Mk~TLO8|~$R?zpyY;*Wi{qXN@W z+B1znB;SW#i?2diC*`bm9yrZ(lNDJMdb`)A%0jRStQ8)eg$!NPTv+z0ZfRfk9}t;e zQuJr9V`XYKzC0?jvSl^N%HI53RYjVb&IuJ`@~LkHKD&u#9j1a^>(R2ylD3o0Ixt+^ z!eRZB~2Co6gZD& zAho>aRaR}!thKq7FJ_kCl2$YSmi{|ANy>wz+K_KamqyEIj*`axq^ z_u}OWzw!d*ORP_!c@M;lhCMwTQeyvl5YN3ZuPnYeK-x;B?*H|qf^}=tawP{LQZ{MS z+`ccNS{bHteta~9XuFtHWv_CWjrCH1pzd1{us_V?i3E?puHMQ~ZvG>~_%LnYj#8dy z29Es-`u?vyhvmwxwPaD$*{Y~J%8 zHk=Y^u9{pvO8IcYf0!?fwb&np+c>G7*9R9jHf6HQ!rg4XrAFi_M=c5Z4_Lx=riz+M zcrc?=E=lgOui#ph2CTCO!ueC@J>Rk9UiCIvfcBDPK2Vnx498h!N|Jd(1KF7 zh9@32)i2`O3bwf}Sbxgn>}y@9AT;07`j^bt)LYNfPrkW=0s*iTn@jh8W8=&w_d|}TmEU4n4a^WONXo*=946cO)tAlUwE>T z-F#C;T|mtESF3I1&%Rdv7i1lqT{(-yR1kK%ShW(w4t-6W}B9ON=PZbsCqm^ZAeDce-qCl&iohz?N@p=7YSs z`w58i`$uPB*-7oP&GOTq9(;R$pu*#tjbgu^d_j?EZSJjxT9_3dk8u2ftCC(goi|}o z*POV{`k%)!D3) zhf9ya5%Pm0WM`c>-^V_vp%*K>W}{)X32sa(_OcdRnEm}H5KyM<+~OA1>dS=1IK)_GONDm z6pr~D2By~=vi|TO+1~li!#iem_fuw1Ndn|N-lML5LcRqRl@RpdRByGzhc_Q2ppA;8 z?L{iI#?wycleb-q>BBk5g2W^Dfy;(^|x|2k}f+u5|FtUbVp@Z;vs-V%ao)@<@!n5jM=r*{b~G zd8=FglyQ3{_x(Y;GDP|E(=aFO!xt}mH-|V??SxRpCT(GCZMB`cqJ;ObhMlPA-#Q4} z5o3?K{#a&-Q7;bj)lbv+gHwfqII_UG{B6Y=speI=X)yD4Oau)STMYm=|*TKFC@ zj~hDfjzpch4GMV8L07=FWzZb?ud?17>Hnjw*EeqF^8oghzYz7ZL+6zJKSE7;CAiOO z^5=txGMABN!+9y^+hXDfc``Jv_2R{k2UbCf{g%8abKm=kBuyslKN%?FYJT1q-W&V( zgTRXX4(q0W3U$hwwq@#W9j?iTD-kfc@$<|^v=W2f@qc(0Zza3G7P6=SYQns~6=Y`w z?s6@o8fOD0Ld~FmjCgP542H{o_ujI3STnbqbqLOI9Jv3^1%b*esB5OGhWr5a%C`;l zsq{_Y+XLX0dcdUh)(k*Q#@D9X=qeegM7z1UfkKpK-N1j<`_A&qbzaE-Cp4sh*b8RP zyh0BSfeZ;K+D6{W{NGf-jRU7ZVc*zlpaIH@^ivNHy zV$;iSW40Sng#KfYreDb`eXTLCiK8_rFBY?;%z`XntFHw$T?-2fg8jihm8+&CAd`g` zHVGGgFuG=+p}sdxpBx!pgGJo9Ru)uS`!W44;-J!zF9#1ZH0eWX02yh6QT5HAhmGbs zCn?M3q9vb7V3GEf|9DF2zk}heNNCNUKm14H{B7V!JMc+R%qZRelhi*$rSU;h`u{!^{J|=`cGJk7YTQp9tX&mgU0)tUJz{U8QnPl|5Un<3M%#;6Hy;q!dG?D z6%qh%ahn_mbQqdKAy4?f#n1^e(T_jxPPfLIZ8JLGqRG>p?rjSKa&B+61Lg^Tj{UnS zU3vj_e)#|J@eSUKSR9toD9QcT$2S-Pp~DQpm*zFD1vx-V{p*a*cHat+6mE|(zGZ}r zvkS;~F|WEc=mz{VK)G&wX$E?y5JP6TaVOnr4!-_h3sU`)U;F?4Z#0esg7Plqj~K4$ z`bTeb|68`sWB}FKeFS-Ve9wfH;hg{OrfZE$uP`kb#K_pc{d18+1Qa||!zfEN<3Ks5 z9s@KS`0l0;AXu<}%lbQl%i0GdA95B4{As}nh6^&t@Po|k{=CrOEE+WC7r^4suNu=2 z>8yxV=7^tkJpwR@; z-!jrkbWyuT5x!eFTHzA!?&%o_r;q{w&Nt}b;iIeZjGJ-bgQCwWy9@|0U+hojXld-* z(Vs?|zTkfT&9w;|ug6-f#|kL)(9?;G7o@|;%K`M+2U~MO%<$|gU6PKBy4$7xHue7w zsYE}JQzz-u9V`1_ec^NUShmBN;aDuT4k!`Z5fugWU!u8w71Yje#PHP7Ls850XoCGg zJ&+`O`&K-vM~!SNz8lHv;7Afu_Ww>7mO|c1Sp9-VPy=Y&z-#Nvp|Mwb@TCWs2lI!9 z%q@U`z+lF1F!*QGzr4-5t;Ms)s3&!PPV=T~5gOcyKwQ+Oi-o#dihvMEr&os6ghVU^ zeg>iaZ+5DlmD-4*ypr)RgK}>H2F=r2!M-7VLWJRzl~mpD*DoShn%SiN8D7&>)qg3A zB23upQxkNq*@|`)e23EfJfl9bW^dw8IE(zXStDpXKab4Jp!bflf|;yYFK9OUl7T+_ z(u1x+YI27FW}gapC^4L>qo+6D7^%-Q{5?Ard{0s7>G>SAR(qI?Q-DrO2^&G^TIx%# z+kK4Sl}g_C7ZvKL@wp9317Zyzm3QCH91>ZNBy!hd?%^c;HSF>&yQ)0PMynjfH}~=z z0j^flf<90+xl2jokBeO%=V84(e7!s;mrCmA!h-xWYCxz&zzXlq0xDY?geYd7{}TRxn~2Y`n6bYA8=g7dcDZ3En-Kss0mgC-Sk0b`bA zQ&BY)DN+-k;4(TCqUt?eRU)fw1jDtCRQL^Dzfd3OGgUw$FY!VHB4~v;HgIJa7&z(E zC}1N+vbN-r2#ZAWfWzbf3Z4E}2~xs#;0gv!^E>%4quSXaqgfG&bU-G*J4Qxjb`Rl5 z%{VT3>rC=2Dfb0VN;pV=*OE>gbS#|ZGFcGhDnPd72Q+%yU1w3Pwj<8L8rbdudn&eWjCg z7#Ye<&!vcuH%A&ie3PCckNy$?!+MA|l{~L}pcr8BPScp*G|T*IZT))lhAi4V(`Dar za{mQxh{bTNzI&(I<*jICx}G&T+6urSOILv3kf(cujh6~ zS2*AR0 zVXGE(kip61T-xpW2v_B^rurVk=)z3#qPM0@$&lfjmMk@HR2`A8NL0$fVwieSeGo}P zVXD!=Q%}6nB=ZwzXEjRGh*(e@OeK+i_CoC|LQ)#Ycq^B8Dgvx-;n!GjWqxeE+T0PO z-ITOL&TfSePUXt#rclo<0Rh=Z3NTy&=hhxL!TZN10lk&cemG9heDC6eO7}d}!5qPzTXsa%G+KQ1Qz(0Q!`sQFC7pw6|zcWi(L0{JU$HMg#Jiz37QY;g0*qmdkdQ zu4OSjD;)B=g;56pEane^J<8Hd!9HByky&=N>2M))A$*mMP~DTAKcDRPCmrffLv8GGsgK*74lBvEo+F^1@r0HXepTk|= zw4Z0-g87cev~N9wvQ=Fft!pitY3cZ;^=Ak=X%9!2SI`qSbjlAPjM!NKRbF$Sy;`_) zJ5&$0_mMNgd!p2TmCO96v&4xLo6inh7eE;nqv_By>9qV+(*`fgx|-SIN!>>^8?x0o zC&O1l7eqGLNx!bUaPbJeIccJBDzK^6-7iyaL(#lA9u@jRDx!32v9}&fLtmu|N05J5 zsxPI%G=2;jUho^_USuq8Im`u_E(Go{Gb=J^=89ImpA=}}6yMmX$Qp{8YPpyAjIAF} zzB7GLt#Dx=I6z*hE#XZM8R8-DnW6Q$t8DT9M=&oqlW(`~@Bhk9{3s@RCzCHNq&6>K zNFkBM>OjBZ%KiLIFv&6e0#7gr)p|D!a5S`(s94R_0O(kaljlChiBVHdG2;4t@4Q>( z-Y?WP?i+U}79W>PB;CB&^8{{QmOEr$x8D2=v8Y)^cmfG@aJC;7cAq}Tb3A?KgSavq zu37$9Uy2NOEN_OZj6DCwWg9+z)=TGF-bZUs1%NkZP;NOSG#7w|)kJ1`tta`7Ke|L5 zUvJReO%W#6g{y7dikTE+_$g6XFU#*IWqoI88&KMWa46X+^=6i95?u|UCKPJQmnhyT z<>SJM2dXa54Y+$PUqFzoA z8=a;0ekvVlGWR?;_k7KR{?p{LczD;iPn*!bJ43sUvq2B1SS9h$QX>Or*3bYkvD#wX^>!UGasM+N z(Z+FrJM_k-gj25CY%Ps3y=L1;$DjGPq&`~t#%f(dK2hco%05q=>rg}} zPhRdDkb98vKKNd=JLeC%AB!z?E<9~_RQiEHF`8Jhn1m9noXL2|!>6E_NZ2_-!kCF0k^o-M54TxSbXDYIOXud3d>x+#= z+xM8BB7y31@jcd>;#KK->0(-Jiq~AJ9WwmVGFr~j_h>9fEkf5pc0{~#fRs(ak|3`V zVG`;>6gJ-MFg7d};)6o;&-APlYS~ z6)3c5_ZL2K{x;oj`Q3fTz(8!Q(JPI54t(Tj&&3dGxJrrm7M&LY_UZM5#jP_$~PVmZC?vf@tr9a(7K5x5X9TowMGAn27akhT39IpTXb38^GJv_BVr@T6>Cskx@#fwDj`Opn5_w534C3c?6V|Dv$c0uDaUTKnIK5Y~b85>Ze zERNhtLWR#tDN}-D9%MfzA7O8HwR#OzT{QIg}}aJQ;zZ8&nxy$H+rB3k+Trs3W~PHB_!R z?lqm$2&Kz=gQhXd&iOwLv+nA3UK$RYqPZI&L&Z#b8&?hj&y&Ef`$olU*oSN)lf)WV z=r&z&V{MTzGr7QXta&qaZs*>?+~v$^h&Q+J8zJ|c24Lid->?@tpx9!WTZmeqiXtU@g7%&Cw;l1DbGqu4`08@oCyqC zSr!+&V&1^^ng9^9KJ5}Ir*MD4o$|4e?2)R$6uxsCowb0`3g4R+F|ug6(Sj}wFw44I zXM7_$j+m1O^`%F7BMj{?ovOfTv3>*W^l9JRh3kMKR8(MC={Q9Bhzmeu(Dn#)M-ttQ z378y!PTl0D>-6h|2iF9$Vp;sB>8gSvH_2619T|?S{M~^MVil+{`fm|4P*coGKG0H# zLMx*>G>Y9tKfJ3cE$MR{Dnnwu95i{@(z#1S3SNlcd`m6tJ5a}h4Ik{xfn!W|)JD>7yst%SDC%iKHvTLaso70qI?B|!~ zUR14HA8}zctwdUg##KFhQaL8ut2*sf*ZMFfEg-_8w}5QpKSuF4G-q;| zGT%-ec4YhD+XQ%LH7}6>d;&zREDIOP(;xLZ4i;logB#|~C($KCleOdP-38h6IPvAATQbULT6vr`9fh9-!HW z8WM7hdwYy%y~8A~zlu-MEn{EEO&$Azsw(mgoc&53+MKPFDNflC=@x2;n%~|` zjngHLQtlF?R|CQc6K<(zd{0FZ#H}Xn!T9U|R@G30ELi2Z?@^3~x$!VBkfUmrDUSUs2?oyQoB0RXXY=9N9@SH&OW0+}L)fP3!Zrtn{OM|xjz>|GvO;d0{Mo%H1&^ERkB_IE0>#>)pqcZ4A}d2ZkEZFvBv}wO!~pmL`BS zXro332Pp~g{*lNH`V3+<_{43>_D>M4aIhYjDZ)RUfC+W$WEuE}RZre)Mtd)+x_4sN zxX<8fANEJK_h?f%dRv++=PVzMRGZ$yqvCW|GA4N0e)%F%qAFr{8ep3tY~-s_*?0In zMlB-qsQBRUes2)0ut6M?2*fm)dyJ>&`Tt$ffjZc)GGFWPb$q3;>!B2d2RQWBwn8Xu;a+r zGR+&E> zKc7KXcDRJ9GQn@OYN;XRrkn(KqTtr%Q^u9YFPE@NiO7@e{)c>8EY)QZend=BMxK<` z{ZpW)B!#2O#m4!gfz<0*Bz%hRS*S=+F`jgCKcd2a{>Sk2z;B8EQfWa28JoGI^eg#E z9WL0%b{O}rmlg`PY<5`^#$}P;@PV;RepA<3b`IZiNU%`6s4FAc*xD?kQUbj1i>eY_ za)2G8$aRFL0XB-BIOrZyMRgUC@3H&-t{<^PEpOLfclfWtw3eZX(hnvIDi#eS(!>)< zOrYRy#CcV8?dPi=xT-!YQHLNi*q=LH9Do+)xZeouHgrn!^%093-?V*ydh=7}woegBcna!cN*<>ZmI5?ylw4UxKs?w)h z8RUmI59i=NWP$?2Ke&6Gc&In_`z(X;(=C<2hR3?2d((7O5gltQ&IXQLF1|~HzTH)r zt^>q?T+ck)d>B5Ud1)-M&Tgr}XX=Q>Q8wS({;5})v{@^-nlHS#Q|r`w)Aq76*Y+pm zz`Lqb`4!duJ#o0r>yQkv`&a$I?HQ=*km4q@sElMxDU%qp2_HBel_?Lu6zz*A;*pK+joHRmH>2KHPLOf}6sh~XJMmp#TP-!ng zzX`i7B)3KYop_8tI*O!M(vo# z>&Pi6fRR;w?%rXW`_oMIv%5JF1n9(i7;XEZ0BTL)tyoHI;`=y8f1Qk1B8Y7V@-7k8 zz$V?;r?xwneez8wqn2TdBO3=2?qwd4M z9k7mVzd;zQ&y!>KW8rk(Ip;k&2r3}wIcjiJ`gi^PQO}^Lcjq&vD|K6!6K8ptFPR^?ym zP2%>;mbv%jP}sC?yO_CYrS zm&TIMbAWVA?{N{{=PU)FUY@k<`DM_Y=G!tEP{vJ0;WBnI=UEHrNgA8C)?!C9xYEb> znkpPWsF$stuR&0R$w(1e#Uzd1YGcdyPJp#PHJUd6Z4ho6y%k_vFU9j@WM>Q%?X1Wr z)I@|ZJ=zfODKx;5A69^kJ)mu)xit*zK+SuN-f~RA6D{hPLPwp0_8+E0xPWl5BZH91 zm{7H8d~cfkw-qs|?Ezoqo;hV}QbA0Qks1dAQ&N8H~|@ z!vM;=e+si~z|b3zk{s7&IGp9PN4Mo4Y_!dq#22@PBY)=FwN)$=*4a!jFF|&cF~N{K zx?p*r={);LWgjsy=Km4(yrfqieryGkxV7C(DbbLBr9`HZwaJv_% z${LNyNROwBJKV@zmNaI445B+?4ctK)LN-^5wg;38u9!AFc&jDFWJqUt1M*ybOj~>) z@~I7`seH-f!pXF!T2s@Yqs?v`2MQrGo?bM4tdQ8eECr?no*U)u%FP@u;|#!Xt9z$yIeIpNV8WDgFx7;_1hN zE2E@cA%il9jDjQCj?6r#J*lmk)?N=_2GN@O(<@fPL7!`8tC?Rpq!hPyu;EO($3QQf zowA)-nuMP*V#p zb(#9z@FkRlsIpMG!VaqCn#cbF#j%;>(rixPsO$vCV0^&sOOxM@M&JX}s+)pl4|5rA zp15&AP?a-(Gv+XSCt1G4efnFPi0ofC_1fO|mfa{6fc(WLcXqa}gcU^|VUbnNBa4<4 zD~4mt*7B-GF_*)<+q;3&w22Qe9HySdxBP?n0CmwrK0Gfx+N+JrTxy|8*fDBQsBt=kf3)rm&=qJs_P^h%%!wU)n4!^u*d9jAG>tBgscyNCx34tLhw#?m6*;4MFW0kUxtSgRc#@?wODt_Yi8bXSIW5omA!*MBy#!sY|g>W5&u_ zZ*(7=<^a6`;eiqSjwN{)Hp?A(V{d$V?;il?sz+8Fa#t!01yRmT{|kA_Z|h@dmrQPfGAcvxTl-SttIM7? z4puP8hEki?wmtyjS`{vv_+-ja4+q5!zJn{=*MZ(KcEv#kIv2vjdu+ z_jI!Szkosy} z5%J>B9}*ZcRHbw4Dx`wCyWd-lW|Kw$X<_i_5N}`9qoR(dEG<&I#eV1^)jRa0F)y%CSkC9pS z%IaNIXTF>nmagulsmn9L)0m)B%7Id$hK|2aBEx(LmWx%q0A*h#Vr@e#xedcqY_$Yj zZ!08U!i7$q6=4>7T&*fU&zmg_dZ&37SBsT{Iv>B&g?vB9s@=ycy&}}`G51=L^l6-zAJ;K>rr9V zVY+7mi0~?0AnyG3?Y@k#24alyli=>ToZKgYYM>mPlet2denB){bnal}aTWi$mvrTx zO1A#{CC7u0ku?6B8^&3xXO6K(+oKvhZLAMVJMg&en-NO@D8bnoR59oZ{l{EX6%1t(*DE59r;DK&^6l zu0NYybH{|TOj;VHVys$QfWgmuZ|_j#54slzF+%8gVj^EM43nt$&1 zK=-i^U4b#?X}@}YMK&y>26vgsE^KQY>_SH_>G9r-L`@kT*g1F>v9fVuBC%IZi9F#) zJ6lH>YXe0JC30$S2ASaZnoTvNX<{YJZ2OBu0wyIz9_BW?pbw#M`yPKug?H6{T%9j8 zN_tt4wK*ycZLF2Bt@S>e#mtW0%P0dL9EAGuxk;ZtV`ogE|j$hwm8a!*9JKw#+btXznHx*D~gBE*W zVqtOb6@xJD5%J^8cBo0&&$s{JA_NaiQkR1|+tf*Avs>=ajpTBNmM7Heohgn8%ORBg zWFtKgXSKgBO)K9#?J&Bs*RygJ6|tcZQ4#+0pa@?Oh2E5;yY3eqDQlNom>yO{OuiYd zY`IsVL8(~Rpb=;uP=d8zH*9HT2Q)ms8?uoyY0JQV_75&Q`ZLjoY38{nG$S@HB1Lo<@8nKW?^GWutjwAIpPnv?o076!caY_cz_y#bG9*qF9b??5xoC zSIAcH9WUPqK9dYnY-2|}A9KnLfm1jM|)z4iV$h7xqLy0L z8$ow$X{>)g)9r(o#MFs|{H}N*mx0+T_7ckXF2dazM^KgwkoIwQkNd|8G21bi2kM=C zS6Wr^lP;-u_5q@|_O^MeKS*UR<9gVHp%0&Oh2SHa;SPc)(kHAMGP417bH()3Y zj>|S}VtnPv}fXnhDAUFJZnK7NIh`%LMuKwmk2``jx1GmeO5 zJp%ec(?Yxas%&oiO_+T?CrA$Y(=el)r2> zo7Drz-@TSur8ZQIFN2`RAG#KMR@5!I>-x@C&ACxG9Qm2)KVgvSA*FQe|C zv|rX2uA6-}+u|M{(Es7anc~(HH$M%#mb1Z}Y+ZQ`_1^nfrt$vkWGtb#82K z4M+vIExYEzLr}R?x9G=?uF;MxeRxrG@k3&-eLg8^7P8 z;HCKR^fl}%N=nCM^ksu5FcUzgSy2IdqdIu3xn4BsKJ^s}Tw zt-5;g{Oy8k_RZDMg5`3fgr5>^w_d(;`vSFoNVLRb-2#wf^})I|9kqH4mMCe-4i@(cw*zE**aft`>)hteZ z{_>ITg1gJ}skjlgRJZk^$2sw{gahPJd6Z*74`$72QV?a{c5Zb+bvgJrlp0T4(@5S~ zJ)Vi>_A4}-ip5!vrt_}$?l1Nx6FlrM9WFc+fB~)6lkb+;%~%qS-hOJKU3uu?7M}Qs z&y~?I$H{!KTde?>yy4VfeN!>b4Fjzj4Pj*Gp|5utDl`ui^kk^CR7B}k-IElxd{k5! zQ(ZXG`i44+eWZjSWqjJI_Dp#<)Z^9?`l2TRrsAB^<0qCxl+S=tR9SZLmrf8WlqUqw zWI-u>R)X1{qw0uar=n>!J_q|&rG7YLl4~^Zj1qZ~+RMugE1u~_Dod3IDzJSG8iT4U z_51OxT{?)w1AfSe^CH$2QyB_X$EChtEsHCrZ_Yso<0%XK`KyHqA*M<}(v+%R*?vo+ z+I-;H{0m;i?Y%JS<{zljob14{qT|U1=YFR=ql#6mI8_U+q~9ioGVVT;hk{dN;Nujh zM5eoP)3+WY2F`Ss)Bo^9^do&?^vCrIUo=`8#x|<24Lc??SG2upne2{_#$+#G#TqLG zE4)8}*J@&pga5m^pMr*>{U(i4a3YO!jk8}CUuCW|6Zh}^CK!m&BL3Wwn{t2VFow&g z{`TfxJ_Vi*c4|A#wvXSqx>NItjpTcErTG>@FsX$6H0d69#SuS)`x*JRC&1fm0zRwY z_4j9%7lu?3ECoGkJ0I7-#7ta0Zhh`+{d#MPE~#!YRrZMpYCbe|!DwQ4)_0dh8a7eL zX6S_RGlF6T3pc_e*56Go@(05SXy(o~G^u;a(c>gb>*=<6`MB?aBLvj`esnfzJ`e^I z*k2Bt8JOIj(0jmpa-a@ni?ubXf&1<)Ch8Kl7u4p?k48*|X^01@RXRI)yw_O!>X=Ah zS@4~0R#((J?&d7>G*B;rd|d0C6D68s@7jsLb59qJjw)+cOYhMl6vaOmidsBElPD{+ z4qTh+MHEboN=j4`E4YA;%8)X|D$K@kkBh1Y0yyzO#dhy{<7)!(;D>BpPwuPY#UP3xzM6ty|dZl0YSbG%CzR2Gc|x1xYhN@jpb%NfWgGR!m#N(l46bqc=w(w$%a;C1&b)Ox zxAO3_4*ErM!hXJVJa^ptn^!zO_lXP3M-mf)GB`BWgA0IyXF|?+Fri_l1fBpBld{2^ z;bvZG7THNAzC=}&mr|_~b`FeYjb${>bUP2Uq1=R(X1}Ye1jW|BJLDVGbh-C#NzU?{ zwthCAMFE$>1JdLfY;oPrl_7FE?cTZH@%BlHC|NE8CI<@CIm6SB6WoZJ8m8ca-K;TQ z-b{>z8lRpTbS5;`!jF+W4Tb~0p~<6PEL_gn+0^v|9%1VH^jZ_B3(cpO zKCjW#_rHE8z9<`iBxqE1;H#i4_d{CcR{ovQBDHJ^^%FMw&p?WTd%yIzu_MhfQDz4U zAL30_g5tv8byO%%+8!vX#GFs9Z<4d0bf$$bc2s&6E)Dq&m7?Hiv*DTWG)VZ8cd4m3 zV}oS!D<++FJ$K&{R1=?`_~P*^fl__1{05PlaVLeRnTOI9%7=9*dt1ZPA-;rVUVN+# zuI%S`YIOy_G&qLGpz9R#%?5Z?vC!M9mb@t6rH(oqL?!B5&0+iemnzh##CPp(7GJRP zBW5*N)`m~TGrMZ}|~9!L~%>l|lSAjG`eAZHxSq=Bfnw@eC4 z_$F_t;jn|?esyxxvbYn{tOedNDTaR5W9a!WuWnT>ltk-Td1uUgSYq662ebFj?f1N zrc9Gr@NCV|=zuhC4=^pQ=u*d^Z_nV_^qeM1d%nch_bBNrz4nA1Hydxl4*tts7p!gA z*4Ujk5p;Ud4;vA=>s|Y<*rxe$FM%qmsdV_n1c5CAvl4oIZ^pX9h@kqUTgHCp7ksC1 zDy+{+Es5th8;XKD6R+qx^5f3bTpmVd7fP5o`;xwWy7mEZpg&YrEfQa%`sd(87au?VDD|~$YK4S4ug`>MmJT(= zQIA8bwCi`FC;~-Gch0;wXrN(IeSHHzU?jwSA$Osq2^RJ$PMLf+E~EN4f2A`GoV+Wp z>}*mYBrwFTrn5}hVh9$GIqX+8L#EpA?0)BKSgP@Am=xSmib*}&Sd;~Q^tD0Qt=Ay< zM^Zuz7&(3Mm21t{UjHl@we>@(JM4VIx~UX{DHU;v7-)_)m<^}Q{uY3vqwb|`uvFK; z;f1k*EedFb<9p6ov4Jmf7gumFsOs#^nM*C#rh^lnZ8gG9P6tz*5iJqhpG98q>laXb zQ>*N((<|Tyu7kJZJNv&cCz|i-Cyb!mPRwj3N=|x-KJ&c7VOQKJ;KdkA3S=2x|6YgK z>pL^ko~9zEY9BUQNiwWlfF-O-OJbJlXyp+-a^{?T-Rc?<-J2U1aZ3-fqv;|a_iA`CuuEWE@^l5H1)cJ5k6NS!n)FgC zwJV|4!3`N+_iJGKebv%@s;(xKbKWVp=HwHoxuH_v1m*x+DJf^+5r0UDUr!aG3{=V( z=FToYwi3T)Z+El$_$Ix=GYxKm&1Vu9`e9#=fgdApIg50e5GVb6^v>CvC!{@Ke9q@S zMHe#fdUBFLiNPC{7)iG!Xa4vbzEsAUGkDNK9krB3jlZoN3F^E{zr~=K= z8N|JvCmKU$KpQVfUEvU?4SvO|0IOyixH#N@2w?DFZu`*ln;T@`Ww5R9inLj&&$A7g z?(Qa@h*!(?*xiPJ-^O`vF6`$+=Hy%G6NZXef)RUbOi6YionE%yr_CXUtpRObk8gL& z%+f1~nJ)Qr0Fh{+H1pQ<5d5-!&Ihlp1+2k^jGys!pzRH_6<&?zN_^A3;pCK|n(H?) z&*w$UhxYonU9~c;BL`&6kA;C-`PI);#SQs$osD-tFIIU^HJ9J}_I!55LwqkurE*P+ zBOPB?*f`URQC;82Xx!?a**pPNc1!s)HJ~QL_ECxS2l3VpeGRpaT%mfKJ@D^p&YD^> zlmv@E0|TNU!!KoJzT6LLTHhX&0LSAj+EU7}N;|&$ zg)%YJN?gtt8xbite+x4LzK5*<_7vBSXa9euYHy%lAvm}8ic;Dkg zrb~T7tIloT3?5vnWqIo<#9p@_u|lEV5ry!C)vnfKhEc4=%WrfaeGIe= zz-h<7cyY$TjFfTvhBb;J_PaCNw0fNPrJADP(f$2TpQSSbRG>YHRDD zbPRuf*R!>r36K0)kv)Z+L}HjvqXtat8yP*H%8QQgZ;S9H#H;|VF!EYC za4wVsJkNp6c!@#KZOG{DOlKnR>|t1=cjQtbXPC@UYYjopa||7R1)Ha*`Y7Q1zss}K zPOKB``61mk%P+9q*-KP|8zXNV(}R?Y^Bk8lILn2ioIO|sP1oc@_w0qM>`C)QZnyc8 z2#pyX==bJ@7Ykp=IKrY|vQY6j(@Q*shiZ1vCf&G+6)=bUnFaismlm)yNFw9Ohrqyg zDp6l*=(9J8P2mZjWlw;6N9Oz}whr1|@LjT*9BV``rkYH6uiu=J#I3M>Gm&|>dSS`} zTJyN<&wO{tAcTff-_J;aoj9J`T_ao}IXYv>!fmAC5VCXQeJW{RiQF%}r$3G@Homgr z;vrYrRRs;1j_`ttUDuCH44j2?M@T>M%>SjY?@cO%m5vvzfG3;coGECg4#%zY`U^ zx&}%H{p>7xAN**C9xS~ZiE;_(3Mi^W*LO>5;CV>_hePal6ubmRR_2(rySGmq?fLyk zXmaFg{Z@^iCz_)~&Fk!43C6oXj_1vT|{Er4PxtMbj$Y$KPe#Z~UCwC`mT&!@+1>^Eh(? zLBQR^b!TZzdZ{F>&EUb1Bv)!&1A_ERDgLB7qDE=kx7Y2n<)w=o@T#^uyj<wDBgjiZr>V7$O)Kj*1vQUL5VwfgKVScd04dZxAI(=qb z5YBnvJD9j7PNbV#l4|dY`cK6 znDof(M^$Xi0*opl3N;Ui78_^K%MTy7|iw$Ja$*$uxQYE^z#i$CCHj z-ChA4lx2IsfU~ZmNR4Wd;?@?Jb1%%JE`8BdyOTV*xs}^2O_pAP%^jiP4XvyF2YW5{ z!6s_yB>8smim6XxUnOFHNP}jwW6?6LCwH&lh%6}(>s;KYuV+bazty&5xIo5^JQ`;YEKT)cxELvfm zXjjJ)Y$SzeG}vb{FcWtXHoyxd^LA4U8EtFsu06Sg2>ZQN)7g=;!K$eN=+g|(4G@QKT-5C_r#!S0A*cj$o)}uZRx8G9n@_OUg^{$Sa zks+yGMR?e*WP8zZMnS!o~A^YJUJ1Ua9 zGB|R3S4{4f@P(42lL>Y>+MTJNDV?;&_Nt8FU(cLJ%AKA2&iFf*1DWiN&pW|C$` z7{g!~48QlK&wW0h`+I-y`*;8D$M28d z>|mpQASzS9RT5vg3tD-lfIcl{rBPn|rIl}>O6IfYG2TTgWiwRHYi$SXQI1<``=|VH z<7X1~Z|Vb@8~+q(y2PK?a*DksBy?l|@y>pN)Mb3koji>Jb-V1(?xVMg*_ zr3VSz8U1@Tezk9yDaaq*<)-_6K6^!uD~9Td2UzNSow~(gdUfdN8N2F^;7f|hZh!Xf z(*L^2dUe7aZo3~jO?qpVkjz%-qnob%HGgpeBTbj1qn(BIZQ{_4#gCH#jV% zhqRxmM~{Bt)(om@s9?IO8_pRyDnbeOp`Hyf!V4f`D+tTHJ*@@8Fe_zD7SeOx$bOXH zI8j7eaxS}}UyxzSMKWm}&QYVz>nm>={S1x${4jo>1+|1~WzWTen!rD=1G z{loV(>Ly--=jjBxG)7&AH&^rULZh2}X{wUcn%{CgC)wI0(8XZYJ=#QGXuT{fpm(&M zK@dpyPaMg0tyj~V=RT5Is4j7x`#t$HFDoKrtKkvE+?Tf(7hPW84_M`WNREdIx%0UU zC93ePt5CwWrkG&a%c(tCk2ca^vh>xKQGx8fS+t($pl`G7Vhw*q*Oc_esNoj;AZD`R zTEpkre6^*g8_VbRNJf1rX-gb_v+ec+nNAgpcuBdijbk-_Dsui2KK=Mm+J>(K!IQi3 zUeKyXDlhzO(Tiy;jSuG&?06*(m7X_N8+u0Tl891olx0>YIo&0PY`wwU z<*RsX?p+$Alyjv98@ zR5^uNkJ(WM+0wMS$7hv4;fTCp&$&mAT?6|?LVUz-z{;c^GCsko^0DzD`>iFWf2IW6 zN{e{sn4WT$SZOu%Z^a;r2h+w``uih@Vmf8M_R<6Q&R?BN-Fk+!kf-s;#?;dpRWDl= zLdBttQoEqi04H-~!OFQK;p0V*$0(;y#i@QgmO~bI&}-z5H+j3B0M+$salc^fs!1A5Dx%O0lV}I zWZymB*V(#sxRXg~u502IEG0M-R06(e*n7b(?Q_WmTW7<+I&>&GhCR`=FxI1p^|%0? z3G5iWzf4o=lLzIC{L#JW!Wk@;F;cBPTZF|8myQw!*>1Xfpuz^4xHlm)K1^;z_!2UY zK2n)iqjfZMbyqYI_1aJG>S!n@#cK&mlf$N$TAyzHpt8=(A8pULPZGVP6ITRAM!(e4 z!=3F7p=oe+>Vi~1#eh59hHbMfuvOXirU;2^5PiZf)41+lGv9Wb6=1)BI^b1&p*6gu z+NTUJ7+5;NlA1;trglNAb+1VAI*KH6PkQPowN<5cZpa>Nc>t?Q%lo6{w<6Ek2iYS`p zxDydC@+NV1Z5}}nMSb?0#kS8$PfYYnN>Cp}f0g|hoMA3;X3ulx6FkcqEMN%it^QT# znvS{FVM$Mb2|(b8yevXOd1Ve)P3FH0zzqfRD}pE6`CxqtrL2f2`40zdw7^YGe3}w1 zT>|>FrEPxo1TxLTV|J)7mx8qj(JE7IIoN0ahgy=y4^{ zX0_|D3k}4Ad5I&xS=_c`wPJG?WeXTlhk7j<9n4w^PTj0$6L7~f?-@x6F^$q#W#KJy zv|gJ<3R@d5UrG(pq;9qa09(`~diLdfyJ_U?u6CdnMR*8+;5B#%WDMijbR54lo6s5v;t?;~3d9LlY)b{l`HLK?tdM3xXw21gEjf*n! zE|OKMmQP-&U$ zD&=-hG=+5koz0dRr-E_*lb&N7deiompK}Lp6?Ns;Z`d6A&5+YDpFRltxVeb$WK$BX z028OZpH2Crtq<|SKrYrQRT+vF8-?0W%QZ|q3lQW5zt1tzt_YuD1#r;0_d?#fz8==N z4ws%gN9FKbBFs%XIjO4AUvYR327L5ltU!$PN;9a1;o?xh0 zN;--=aMV1x@b=?+2Q0IoRxL3GKb6!%^T{)B z^xHDEK6J*OE#t8B_2^8;vN{Ndn8KZ^8}$(2GZ=q5sIJUOV@8Iv@uSM(!GN}jF}n!u z=#80Aw;Fawy?x@5FWJ^I$Jg>wkC6i!w99^4wBni5ruv={)t zA4~{ai5dDU;1HN*%-3wp>`UUWTPKT}?L`3zN z$XyWcO|uM_jIXIT%xJW(MFO6Am_vj(!VbdG92@Z27_+uabYqm%umTXES!^pK-o8_i zirp#FZ1MuT7;xeZ%Wp87R0m!XO2{tTH8BZRp~VJvL=VS!AJ7VfB;~Iw_Sy~yN5IxD zMGskIZ0h2ld%@P@KIw6Q^uB5pC@(@{DP_C%S!=Kf&%BqQZX}Yb*A+GMU&-uzB*$bN zQv-%YWCv)=u%p*BJ9?epJOXY^Yc&XX+SaB)sP_xF9))>Uk4BHls;}@$TX&XWM{n=t z>oWi=jMq(P4nB964%rZE8Sb+OF$Od7utmyqFm$C~MElZ7MAd6$FEm3zal@dzuA0wp3xIyrliILJ%9X}l+G!eg~JnuYk??NB&cyS@qYN2 zT~Ztxf*-;{ZZj7OY9jgE3Xq|GWC7}Zs5&BCd9uhKqwX>+I_q8U1rhPa=XKzYVb+W{ zz%LSWuB$?ci3Y3q|$iU+kiH#6_*Ug2A*? z^19+N^;7gMyNr5mxLJYCFvjwDl1Ae+7sv+52?xRp3P~=YU1=lagE^U6nY15sp9E^N zC4=z%Os`m_jq-|Jsq1JQ7q$+reBaJy6HlAiyHzv!FE!?4g)0Zaz3u>zDVHYdrV^PwQwTYWx_ZmE*6m2UL7hw()fHz}EKTp5nT-5tI^}JWZHY&^+>_H$3G8g~;=E3P#0bRG= z4R&?O<#-=}3DyO5c^>b3uS3Um!%Oi#)T}S398EvyuMHN)%MdaThTy)!5@!ZjSB_H9 zgmaDViQ%UhW{kDI`1Yr{E#@W`_5O)LtS$8kIiV684PGPeqYXiu zl?o>iHR}_!;K3gJEy1)qe3e;{14lP=AuuK03o0NkS)^6_2@d`E{?3cAfQMc~wxB3wUjPy|c$b9*jCjLIk>9 zV}G%sJ1T6$p5zK98e)W<=%8t%ZphNvI$?TMeC4Y0?6B0k!>RT2cU%~2_G+qL#4qoD zRm*>J#*`Ga)Xmh7He4Ga%(fXjWvj_x?s=T(2Ak@Uh6^_ry8>o5qWf{Al}T<%02&*H z22Dwx?^Ut0yxj@4;AOaQ!tLi*Dsu$BVQd84kckJKiPV7thxiWN4(#!(31JU&fk(FX zp;uSBj(b$fWA(P%R4UCb{K@J(LnE3H1|V8{wTCKk1mhp<@?=#*ALtY~gK+)7oFc$! zAvJ4+J>WyXN7AX5`bGb*nW43jf*d_(Qn51tdd$V60bvbm!wFG#xZ3q{E}vS%squSL z#X0gz!%zIgLK5aOqUg?m zFOrU4O145zS}Wc8dOH|iF$&>wK`iN=fB;G_XSiQFlbE%8zHSPq0@f;-#jE9^Lk3>b zFH8%;(DkJgLdm+cx8l1390Nhf63b*oBy1tsY>ci66d2EHOolouF$QZ_7egoSE43>u znHm;_2hfe8&ALS7*&0 zRbI9-dFe0rByYU%%CoX060#?Sb!3Fuzjr>PEkga8w)Tc=Ga0eI!fF|#X{6hR+m{+u z6f3T;eW{eb=#xzreKfANru9Vhnztg`ZpfY*Iu&xo$#G8%<)G%BF*(|7e75pNMS#Q) zmFUuvD(hrq)t1h1B8219bM~w}(wPyxqqE(G6dBg{)S0nwe*{kHj$7ihh^GfN>qg&1 zrl5mK@`l&PAX|1M-n%cKsn2h~&ok#E#rUeLhXT8Z-K?RFcsc)@_zq&v>Xn|b{wwA> z!Z*IM!W9gnBvjhu;E@Zj6#cS$fU7p2O=w@jlvgK#K&dZisFa)^xxyh0E*?9jxS)4k z5zXpe4Yl$C2)e$o-y(t&AG*eUzNOxfL)R%O(~$bP+N@Sq7lofa;&y@R9b1C;#rP16 zS~Eh`Z3A^~6|MS>)RxQp!g`A0ZoBiFc13A&!;1-`dqOBhZMcPN9rkh?g8A_ z#G=;z@U0G|w)P;Ys%n+3h{M10-lMyho*dMq+aJ)GM%2i8bsE_5ux)kRc9o;@@Y7wQ zw?Wq%*X};a)ryOW7qs#GbN6 z-#GR3M51%cZOR|)%d^j|FMX@KC{ik~loWEtm57VG!(M%UP<=^%=^$sYOzVzMRCkb1 z>Hv)#|H!~!AzDD2TzbwaHZFCOKujUK9g^qy5eA7nR_f@^y~qT8k7peoG!K{Pe(I z{F)6rZJUgMbv5HNLw7*Ad1$32heNG_cXDgJ2dSi4!7)-1aFgBBqaXYvsi~zLv{szP%c|x84WB@3Gs4P<>pi`u zD+gc^&|-LGw&Owt@ut`%woly_g?*I!gq3r>*I20*?>_l${gS5dg;Qx7y1}uoQd#_{ z>!Miwv20sv8n*O;zSEM$1OKlP?IDW-$3HQ1l-=6n9lZT;uV02G4)^`MKIa@MczRvq`I0XdyRVrM<6=R*~ zCynm2Ia*^k6yRA$HS4+v*Y38Q7<8-Iy$?LY_PS%26kw}hzk4XMVCvVfknC5_OBwn+ z)|R7jEO(o}PVf0o{WwoV&0W0AtBEu9Ma9JSX&dHLhgLAnKj{+t!rQtEUzdkJcY_r~ zo0dw=buC)-$#ao7Q~!wU|7@}*JZBgwed)Dbmq$*B2NdsmV^~GRbLOo!ZB&B|cs&Cs z;p(ba=~H&-w7D8;wwXAv$%$R4Pu2r9wKuGX%;5&B46|buvNN}`7Vj%{SOQMA@ zqDC;HR1syeHY89lyQ+LZ_k&H!Vf}Wk{EFLW>$_^Lz1}*ARF=o$d8d`!&wIEuSKADu z4DBRZhR4sxq_C%m@4p;iAFQD24BpcXCXHY-k5cnS@%YIB!DMFS6&3!Zmrg3e{_t7D z%#QZv{qWXI&P!xuR>dFYGpCFbK;;1;$>#t(>HI|3YUy#jeOe(r%jac*NjOuEWn; zM?>kOMmZtF-g!BU6PJwU{(@ji@Czd#-9Qw!Toes(7GJg|U{qW~`vdpsM{S4rw+wVZ z}75eWE%YS%mi=bvzI`+eF$B?77RW z|1oB$%QV1sq4QYJ@r^!i;hSvb9#G#@Sh6HHH@CvADK>Z{s4ba4|E8wkYwp*jY2X#l z;~ct44ScJC=_rl9rT+&NV;evx)cDr=IS~M3Sg{VC3<%oWZO~A#zNf~>K=~_H@=UKx zUsh=eoE3rS2^xIx-kEi+jeXcAv&gm8eoMDwb=r=TK(6=X(1?r==8AsnZ^jzJ=Gy^U zbxJhizGLbH-kct)d^7#2{1xo8p5Ji)8qsos#bJynO~2C6DXEe<;9_DR-(Hc02Iu8!5*c>lEG z=7;__^)Jcbs1b7Na65H=pZQs}Pal50<9dKa_Mwv>Lt5>{lb`%tNq8GkpcYw(3kj8# z>dYS22>WxuWnxd^tOctVc$nhQ$aiB~SDfv>bj2z>NRZ43q}uQ)tUqH(@|??RP{G^E z4-hQ@z`A&^X~kvpW)mjBsat*$4{@G%ItEIbuQ$7kLM-^xe*uPRhH>bf4BadTtBXQ zu9FX&X$OM$UYNpG_nm`H$Ay4j8l9CSz*Pad?tB0C7~$Ma0mgxm2sR=RHo4fTXAP>p z5If2F&Nl6Uk1ksh=IW^(#Ecxduz(gnYWs?K%65TJ_-1O_=f^|%DH#Sf)WpSPWAsf& zilEfc2a;~b0dDv2$u{0Pq1a=(5h*OBf9;4I7gdx?Z_hJ- zZZV*$DpP83VM46;X8^0aa!koatJ9U>!-kT;KOk4@34rhKELkgYZfVlr8x343i`*B>6B+l3xd=;ju2ITsj$EQ>D89 zM6pn(ZGuedDcI`A)>S|o>~-UH&?z?K2SP`Jpz|z`J7wQ2;vCttkOhWXFn>yBm#Lz| z5v4ou*fTK%OAp0k%9K-}r=9OmLm1KkN=O8(fw-pOzi>i|;4ro0>!W-8D{oJfapm4X z&@HkcGkW;4gZ9GjE*FMT$cKiCpN!WU5X-DN)^;*jDf07V+;CDnt?{crLCeqch#A5g zZSsvB$EQQi3m99Zw zpG)_>d#OmTjqpNdk`sAz|31F`)_e^# zqnKaG;zWAQr{1ie(4|3;kmd6X{I;C?~M_B2I!c*{M;GSzyocR_p zab!s=ctbQ{!4PE4+Qi;VRmgJuS!y7M54GUZ5gu~w&7rTX$qXx zv#~4P7ja;$ibD(Az%dOdk!dW>)5=8UO;8KAh+^^_OT&NlnTtoAR6OPKuesN}cBd@; z%(2pOJF#1vCTh>tqLlOMYXC&Kcm}RVXa$`rt6*x@-}D?{#x=e}R|jw|)VTQGp6`>m zRx~inui=5r0TZd2x5Sp~Zn5MHGWk^`pt&=`c-jf@qV-EIL4O4nEKL_o64CQ(5<236 zRV==R(5Dbi3M+k*TxcU<7Z5ovXI?aRqJ^~PtkNO1qg%T0Tt_Vlpd?HUk?q$N!8Z_g z5EQHBUTZF23D>ni{VuVhJz#TmK#K)71p;s_aL^1;22@QGvsqp?HE78<%)i<1l8Y8O z3<^_}<~fJg>Y1g$A21_$Sx9pta^F=%EzdvbaXelKAocOYn%TDBq-H2F#g*DPJZFIY zGxhK-pPs{*##xDg+h$hD(L*)ye+-f0QO^{Rtpm6ygxHO&!6z5+kPo73N~N@+f_i@~)Qq=X`r9bs6vEhb#@I zfBcex@JXl~C1Em^R&V$&&cDfts^hDUcL!-RSBR83Mr8wrqm$#cb3au=Z=}~Z6i}>* z&R)h|{TG^ec!TIxtq;pzUMUJD-c{F73Dl+X1G_eD(~S=S7c}~8m_(fPS6+lTkBTt` zvJs7M+~VSpja^+@)B{n2EGYkj>g8hjLvw_N^MivJ$)-w zcEtG@Oz&*Lt3+8Hrs&PEeva-br-0GmFKTGE9Rbi2Q@I%yF;%-O@*I`I-SuyUfpBpz$VO38U<#lz?OU(!nPQ;*_SG@ z0^sI`mQ(nrGk10t1=GSM_^uy6W^gN@WHRTD?2LzNtMc_gVz=yP3Mcni zCU(5TST-P%U52+y9q2X4saCoC(?70iX8C=t-&n~^q+6&1(8JRb>y!gZX0Q}L_G9HS ztLAj&CQA{rtMYv7j_h!U{#O|xWdqrz0r@EWBmCX+@>}%-uEW5j`6mn{#O2%VV18nA z4hHX%>ZZ)+pVpu|4I_chr@w!~PIy3IlWny;iPy0$qy39TD0X{b)FAi*h@HLhQb&`NY|Ci!Lr z79bNz{6z+Li!p5iZ>FgU97rVOz-f0+d+Xc3ADX*y1I<2&{XzZH8VAJ;1NmT#k zsteog+n$^ZENa8G^@Kj&L6SYlj5ILMV&O{spUn?&u*BQ%fAgU@7flQ&qtkLUlQRmd z5J_4-d*Q@^aL!aH)t_H7{w^ntw_LY1pB*wPd*bLJqusU{3#Oa;eP=->+~l|tcI?ui zL#cj6XWVeRQ}vdN0$Uf@vd@&4VXd4M(--TP2YVv*_3J+3wyUH4bN&1kpEIBCJU@Bd z_7SWoSfaYCY8x7sk89wzYugqUThykEvp%u!T`a0Qc-9sxQRz41r@Yv@<2vG=2dPHX z-{J8q!RQTjVx8t$iSfzbRX>E~KwRJxt!k9|wyP|=%$t!|_Cyvf*}? z_@Ck2Z3eb1BX3wds4ft9e&4geLXymAY@zZUD@Xk)yw17w0>4`?=j_B@6=?)V2P

    ~m%&eC>-2C?>EpFZk*> zFBsUWU&PCK0O$lkWgp@8`Q{$p^5i6meZM*69F@f0e?Js$e2kXVcJI_n}%0Fnz-J5tmDiU4{H$r+d+TY4hS(wu;IE%@zJqO9bWwq0Y8 z=2OXe#4*7ED`q)%9xt)Mn*QJ8-eXRzNI$WNjiHz7KR?;=*15w{EU~&yJ;^oEG;P(9 zimG&ppgLQbU{%Juzb+k1o6Ear@RQr=W>>6v&A(yal`IB*3d%YHpaIBhRN%!WI7bOy zwVWCu$vy*~o0LskQ^3fT0eIPK=LXL!X+@>}k@=BdQjVJ6i=^akU-`Xm{*6TY8luoO zFwt}LqnXq~)1BuKNOddPIKg@pr%M(Fs7BxI-(gUZAO49!13JgQ zn^_;#&zduLG_0Y__wGAhsBejaXIBQkyHlL`8VGveJLL#QR zFy}imqhWl1+Hz+tOMi8**)jYJq-s^k(GnC0IMpt?<;|fK<0N|;#X-p71BRyTqtntK) z1PJc6ZC?>`{C)&6q`By;rLcF>goI(B;Y>kE-ds=~J(av)+ z_!}uZ3tfaKK&~gifj>QIymV7cvvSQ2lHC3Y2mcKg{+B;rc!7F5znEA#ZvjRO|u0m`|%z8NxfFZ7=d1UhhFOL52pw{1i2W1E)8uLC?gv~Q6 z+}jdGI$gc#=!x6}pu&1Lc|k%yfXdv1cx5>+Tm(z(6p~p%+UEjRaI7J^zz|N;5HgButh10~p zkqRB;vbm2*rf$88st3hhkHlC}jgdh626yk*^Z!98&pk=E{@x7g@0_^*HAn7${=1$9 zq>6{pD!r_P-MHBR4gvvOa}c)b`6u9_nEWT^2j&!ug`QP~a%fzD=5$Lj;0b^m!7NhR zQP~VTnt2&2_3|84zJ3`d1j@-PM%{J*at^qgsaP9cmlWixAahm7FMraHfg%*wNVU?D%5DRxd{J19Y+7f=YxKOSPEvGQ}nF>!jzX& zT@-JV)9(Q(pJ7mL{?-Z5oC16#RVjOffFxfoos8UwS5XIp5?Il}>&Uc=pK zN;CMytZxz?F$T;ExMF>sRj-&})4n5w>>NJUnq32uX*U{#1Qy>aw?v;BE*`rUvyS?Hqh9|z-gnb)kowdsJ1ifvx)?3?TQdl(Y?XyK zQ|d<8FpzIhFD~%Ad9wgA!N>!0!()Aoe~)k;I$h)I>HksQB{UI5(YuUhPg=hZ1w-ul zCM8kX;htn{cOZNsH-81FYPKR|gH{m*@C_DJ_oC}V*vcS|0{tjG3vGamPppG6_N-~u zY+nAv`Txv);r@?#|IB7P@#|rYD<8zrFT00oKuO!bR~3jGf^_tg8}CjlG?SpLO=um` zw$I_YOlTCgUKBTh>^xxVW;;;!taSWfE`KG}Y4aidOX-aN?041oU=}n28t2X^1IUk< zWD8dEgF#hgA>@GDn59eZG~ai^Dfn*y(U5jRN~Wh;W4KUZw5UB8NTlZ z3*)0yFbA%vJ5-iAH!yzz2LPEm;0|{>_DS$h9A2SV)Bx{( zHc7JK3qyushKXr#$%OxPGk?=EiT*ouUz7_Q5f%qAZZkl8OP+^UgUi0J^rkBHth4|!lV^;t zv1gI2W<|hG;GLbNQ@-g#d#_ ziBm3JQ$10O5=XpniiIms%x=wgVpUiG8?%C3j)Cpez`o z-u?haPL6^tu_hp!oa-r^$TNzDiBM-oxz5%Cz2u^%$wvW^?$+hfFx;^1ZICJ9tn(x2 zjFufz?RJ`=f&ON3(a;~Kk&GI@mkQ(iJjS>K9*Kic-hzaac-5skxz}A;0;d3Cwa~Mp z-)BXwR|j&BKXURuzY7qQs{7NTHOA;V(SrH0K#ok8G7)Qkz+qrlbkv-~gCjaU@YvQl z>Gjlepw>oG2zDCFu1D1usFlDPeRik*FTB#A-Ed*M!LYC=k(LzsRjI27CTNunjct^T zQ-_lpywBr;A3ii5d~#B=?Y;5&-TOvotW7#h4B&}bWwYPjH92 zFiJ?(GF@5o)6p#wddH~@8cR^XG6J-5x{x*(NlcU{$0v_J(lA;1kfhrK7IV)&o-<>$ zVd%%>tYGV$`y8~2Bmz#E-bxqR2xHaP(7eA3eNG@Qz zaI8;PXhh9D=<a>y8l{vbxM# z)Y@VMmTpa|e7g+ZZ&>h~T5QG1=Qji?4)7a^Zwrw7&gFD_*qFdv!oWTnX4@=`8 z?}y`imQR>{2s!AWVlpMT;Py#U<@$;5^p48N+%q$3vlF1}XDY(qu4yZvY-x_8_GVcj z`!GV9W0#YARZrPzB!{`%4lY&{wB5R;-uuJ;Pzn0Sk0~;Ub497B5@u&%yW{_FSLz>i69CvyUV&M_H=|;r~wl+uQ}lp z$%_jC{6_lvMnXznL!uQvDwL>At()&`0rS_-Sx^C7XQ;Fo6ZcedfR+ zj=z}az>-JnJUo#)%qEO`C!k@I!^nQh>cc zS#cNHKKKyBn-N;~U8}I|!`RMC9wd^y5{u27=*QUdNhfa3zfSWNWDP;E$JALZ3 zoB@2sw)+|Tqra0AYAOnKiBymrxmYRNS&fx?rO@r+G4@cyy*u=S0qK&%UrI|aAT!0W z?>uW|Gw`Zi?VgdU@}mdMDgzNhi(E|pJOOT*N&v;*=~3~{j2P8itL8${tBb^arQvGA z*BsAI;j6PkU+Pk}m_19O^OGT# zb>brP1hu5v4^$5E3NsZRwWO84f2g6>2}2%>cf}gK@qy&bCNafnEZqUgUz)ZASXIzHum_ISMqpJ(?3xHy7(Wd@s3O?8D-fb{e=qg$WisQK-s zCRRT#Fm5OKoRW;$@*Nu$r))LE@k`Q58l9rYv|>%%4sOD+)J63$_DjzXiD_=9B;6iw zzBVELuawNbn?5N3(N4(yM@lA4c-toUiy=LQD4E_YIyCnF8!+VG!IK5we@f`r{Wn?d z-e>%I7RDBpTfG%#)4q8zGR{~U?M_TpT5Ssnr~8bICmQ1Z{=1iF9&CC|pdv1y{?3({Ar*H0F5`vE^P#$G%bg0FpgcTf zN3N(CXyTQ$!!$LI8;XRqHD`32Vszwne}k9cEGLuxCkYK8bU1(hzmdcM?%rXTv>ndb zK`7O@KNz4jp~jfai0S_?KP{VqDJY!Xc+4~R6x-i;+Fy1Me)?Nh*jk~v}p zfoaY2ur)jonxR5ILaF;@fLF$84vec&%vQ+lHB$e#O8j~dZQp{KfEfj@Hl6A5(n6b^M!6+(4 zc4L?^mdG+=>@$P0+_(Dv?mhRMd;h!t+;i`o;~4Mv>%BeS&)0K#JRUFc7G}nR;A3DA z2qbv@+7&AhXdedz;wsqe>=+5J_ zz#scOE}32efvS@EH(j|wAou;(uUxVTj;B$6q1|Og82|Lj*Jkrq? z5uaf{a6LI=yyvmw>-3@Pk5g=47u^f5eQtFoot5^}>|{~uqtHuBJWn1R@_a?vlh=;; zI5!_X()9acR0#YY94-d;h+YZTlhpTsPlc>+NBujO%#I|C23SHMkP0r~j)0FRJ3;X8 zH-mErS^wF1{?Z`t-;H1Pxk~;0c2M{U;y(j#{{MmhFPf+7Y3@S?rH)eV-tOD}R>9WV z+U>7Hd{@#9U#*PV+HiP!Kte!D4h4KvPsz?iOlODeU;jI1`PTL8@e+Zbxb{VH$#Ja8 zZ+*M~-e_xUE05mUw!L-J+~d!%n8>_46_7Gp2X}Y(e(j*evCnZ@ryOJlFi?XZv?3ty!K(B*qCH`oGGRtDd^nm6nuT(_5g_ z1vIkN{D+Syq>lvrAoN_=xD||G4pum+Ymde3?L|)`9}e{F`SY;d1N%Af`~U>q$x^yN zd0r@b&9IRjwVZ++dpI2#y}jNu;rdkKo<3)&%Qxht{a<5#l%Dh1D}3hWH68@&n2&e2m@!!2qciKM zF7kqV0#+^7OY(hD#KJ>f$!B^OW5X*XaIb^W{9!*9!EVoUkH$Yg7MT7M@@q*^n;*qb7nMSak&z{D}> zxu>m53gKGZcT02M^CF)gR=6Rl?-V#gf70wT-HSNmUEHj@a3Kqy9eseX6HHCsii9Ov z?{$wJZRzNT|8cVzR-%7Hg~7uFxq2O6OZQZ{CO9|4`g4jLqZwrBnw0!d3@%}-`cAH0 zBr;4ir@1zmE8oR>Ew%KK*~08Qf)qx1W!mM{6!C#pk=@rYPDAtg^8Ni?BaIGz?Dv=| z94B1QEB@Q|%0$>&YLeaXI&L-;dl#=<`LUU0mZ2i+jj^MKNo)BIR)#w_A}$=nyb!3D zq6hVc(JxwxGw~zlg+7=qPlUeYe~bz^&%@>tWeYHJ0StbuQy?cNcf+=>^p0t6lHHgr z2rRSL^6Vtl8jI$=rl|VFy3VuGd>CcpE-m39kZA#Sl5>Ev9})`q8clb)8b(EREx z$TP5T9vR;S;sR4U9l(sFO1f~ile zTSxh0AKnU$6dGzau%6hC?X5_;9(n+{bk#ni6KQfsu+iKP^>E0yzFdxY9F_-5YSj^- zl=+m6VXIhiq^{QGAlJq8jiETC#9woW0X~*Dj|7J_95c=BFVH7StX^tW{4erj({k)k0lf?Y{YW z96i%kCZ~tB<8=0q+`?Gm>B5B8!N@$X`gj{Z31d0GV&6HTxd(2 zT^mt##CT*Tk_v4V?q%FIat^>2;Oyw~`+ma9D-%m=c8X5U?cKffdu8QI#`60gD{*T} zMuvsBKwC-HkTko9!c3ii3)m`rk3&cT^*_VYT#y1^NH8tdvqS&p%~y^8#MfWe*hbcw zH)x{|XFF+0-cEqZH%^h{unc?>0oqtJed5N>Sb92zyNw|3pwp$*8K(UY82x{+X7ld4! z=NrJkBb&J~r&i|E)8$%L3Am+n=j;V@5os?8?weXU1I!^ugjBsZe5}$L{7qz4R;6z} zuJuje&&#p4dQ({gkO-BfX9G*pCd3f$Xm5({Vy|X|`rx;uv>SdzIR2{ZY3MbQCFJqY zS(VlF@b7i?coyxr zs9G54_vg$yCEuDyACv zV%|yrbu$p?&ZEk|^#|w~U$frd-T(Ivyd(5y_7q^f`p!@)T_0CC)pg*M%6<} zuQ^+gQm#;v@bmHaew=K~Dl3*g8nMvWvw{X<+@9eVy(KCzYVE3|Tf&W)tyu*2^Qg5`u;8YykOs46 zAYDH?YPAN}!*R7JW)0tOmGEK7X|1cF{@zbRCRlD|iR)zQ5re+JeT%`*(81z^#?N^# zf#Ij-nj=1Qi>d4%tgYBn`&2Ugtj}1QR%Z@w#lJay<^wpZd8`LnMjg3Y{Hd))7PC(P zDjbbIcrMbs3lS~3T8MK9-u7-04`?{V?OWPh71iIkNt5_RR@aw%wFKiLNmW5 ziqo?*3!<))NA%s6URt--Z!Wj@Mdd{KyIRO;DJeWb7(^=H`vU}gxoPh_4u1;x3&VftlF|LeUCn4R3?5Au3AhfdnCuO9#12` zV(3aJ`K~bPMkTXrctgQMR*!Mtl3sP}b^|K{$-jv&@bje;hfxSE!T_l%_~+uqULV@! za=FG}x8t->0=ijSqDy{bb2v%k*Rv9ZPW=$j(j|8((B$nK>sH!f-2_1wDb)#4@#vpb zOcy6yRKD){9f|s1Gc5qf@m`^%tzEuJ#74H8uO(O5T<3haO-X^pwcOWFEy7J7zPpSH zcJ_9*e^^}kT^=MlSc*R@#owu>v&@@VM3JinIl$5N>{;b;YFc#`hu~#6L;rXGnI*Lj`bQ7QNg;@lAMRu*6o7 zbtvi+Q4E8-sjhu7W(^3mG3UI6+uuzWQ;HZAM$?X(>iWiOg-nL=%1A;^a@6{7PhDAP z-N<~DUlFl?fXp;EJr5*K+%M-a#FUeiiBkDoFCEObS(<{lmI~igfhgv_*PQC+Ti&u~bLv`lm$`uGZdmP^qVwDnEpPE=I#Q z5nZ6Ak1QPUK*2`lr+6Y}L+f0*BQuU0a#(2M$6mGZwKzp4UcNi%n08fRu0jm!IS|*r z-@g8<$ouE&(H}@iV@StjwEg{H zwC!H+a%Dq=UM6YLN+#(a;mlRA3b*CBedx!1u~9dd_|9iI4Ut4#v2L_;%~6RN7byN} zt{T%Rerr`3C+A$sedxj!1!kz+t}c1DN+&X87NXrR=pdS{zxG*3z+iLNzm5){rz2S| zZ5oJ_k*HR)XpbtrowdG_K0_(ZG^0} zRqQ)nf7F3?wY>q?gnc}<{T8S(%whSdW8!Qj0k()$VN!0L_SxVSZ)0u`y>>KjR=A#b z|5=J?uwImeP9(qK*IT8!-o-e((?xG@iqK{e*~vL&f_nGz7fhOIMzL`l$J1YlJrk1S zfTRFlY!+hpa%>6^5aI44qUeuP8I$)# zp3&?xGzWkGvstRUTUkEtS^|=wZzXz|1W-(Vs{g#{BI&kyKlp^;C>O?0pI;2OFRq^|| zFC)%0o`hS7L`=I8S@>xPj6UyRxS^DH~ELCH%{k~I@z z85Gr28_dCt)qs2~>qG3+@8~BbTYo4+C!@9^??E94ig2Tk^|&L`J3Cqx-wc$L4?BNQ zlJ%X`5bQ}516ggl&st?RL^=$>{L^)aQL9od3_6C8aX(x4MgpVPT+;oiR3*lFlkG7V zUp)`EZ)&VKofEwsRzF*mnKx~G{QeUvklh6b!X^^ceOG6CdV;8fx{IIozU8MriJCQm zCgdQ)rqb2mbA#pdWN~#xt+x%Uy(SJMqUoe_2vroTUw)ul5R(L(EleA5YLaDm#^VIK z&X{F+Hm!FA9J`eq5VevCZ|0Lxv4@fzNyCpVoW-1hv;>cRYnIe=EX8Ne8(io3@0j=O zeUX{8 z?E+HuZZwB!NAL_{54zgvaIzGjO+DZAI1Si0m!+FdtRz(0nCq?IU0y%xk>%=VI^O?P z40;?Zj}?D8Vm(%PuuP$0rBmCovczcI$)`tiG;BKC3)2cCIeYXKnVJx$E|u;X?ss4V zRorG+h*OV7WX9m+WQw`jh*)UaT~MG6i;FvNBO0Stc1u`S>6k`;f^m|nQ{6Yzf`pqb zwsZvl71=bL5SM)$i_vjcHP^R~Hg=D2_~9OZyQtQu5rNNhGq3wKF6O{^{n7T~co7fd z>^99_{+LR?w=k#T`kemqSGof91+=#NaKKN$$VQ}jx_=6~u|Fw#=eqo;qnAWN0%P(L zX9(MR+%;JddQYrr^|G_rX!e;dsAtzXxjJjM)ZLCkTFqV|9c9$ARd?|xbJ3_=_0hpIS{_CEZEa#-eYP*)=1p>20jx5tA%*I2xoN=$U?&=m%TQTOaaOPzwOQSA4>eHow<)bvFssyx7k4H z3%+9M5KzXvt$1kANDGF|>+Q4^e}XV7bpGd(OWIEk-_(2J3i)dCy2}j6hEFCLf8@?xDFOCDhUikp3|j@$f@*h=;;lQKb4Y%Av@d~ zbcM2j3a$9O+c$f~ezSn&Bw@JrKvX}^LUoxUA-!3T(Ncd#{*#TJ-L&f++BWeXHSNL*H5S7+K23}?+BR%~SAzZPh98(b4&rOEN4(u$ z_o5^uBuv6=DUB6cXmTODQ5>+`+2b^x@^~YVv=~sVJ+v@#-W$JIv4*O@;GZwo`1;H1 z`^X`j1mIE+sO(NI2*t7W*PTrGvPa%@t7&+%%Sf#zeS>;K+Y#d*?_+Osw|GJQ)4Uw? zu3cADzKbf7)BJMpT;0EM6!h3$sQf4X`iM5@&IV~RNGL()EPs8>#+9SsI+2%!w!Cp7 zx57?moE<)<`QWaZTi4lBL8TMR@q6%P7=qTsx#$xC(Rehbl_OTCaag@kevTty*u|yh3|&iCJB|Frgm9c2;lEjZ`X~vh z%u#S!+vdf|pS`UGbVd2o;5Q9z=FO<{La%MA4x7;ySNqIKnX4x$_CR_u6a5*cF_UYn z=9<>mf4jZZ3DaC2?0P$BCgTa!1x9depaCFfgGgSi=%WpX=_%5HOiOndovFVyYyN{i zB^q7Y-~_|{xTxm0QAxW9Q})A>VnttpKx2j*56mtOZ}`@LVm3+upEmk^%+TLINVyQuT448s81Yf9qd)`5 z`XX$u@~&gMx?QnM-7>cMQ%#qi_5>j~;Qjf9KN)q>V+gmzG)_E5l)JdL$G`-j2@S?d zQ{{chG>F$IMdtp$Yc)#9I{_F>ZHm--4Fq-B$Jq2vDNdEHPM#4?t}PW!f1EYi02B}U z+xFsF`+1#i0JS+RWBBqV+d+3VEb68xoVHwcesoob^hx$sm;A_=GJbKoEg9=W3g>ty ze(EyR24-7&46GvZryf)$v-0H9HfI52w{--*VwzeSe!c*wT&4&DndVE+FSje1bF^(R zTVuTX&m=`ReqV;Z^zMmTXk?FMk&r50uc=WS2E6yW%u&#!e6!wr0}(;ZHedP~L%4pr zdfjIq_iQb4$-hE1X3jSl)zi>xPa>W2Vw6@n>eGYMadQDr*)v`N{tnsjQB^D!PVb*( zwFh-pI$!#nYCiS;w*2uXC4p?K)?w@JLO;<1xB|L~A|-A#vh0Sk^Y@}p-2uZP5IYys z7r8+L=V5MW+{QbEx1q*}it;dRIw12#UEJ(kc;hD%xDm zv+rE3%Y96x*+MDJ{9<2Gr&$@Y<)8(dd)F=V{rW{ifmU0vSsTKa0~>Jo!Bm|>Khgto z79!k88U!F>yHAQ_D;UCe>>JyP(4|uS*_xjE+K8P?@aef|@-H??b^rQhl4;bpZ&@Kl z&Ny$_H&~SF7L0?m*7w_rsNI~hNQLS7XUTOnP`n0X?HV@BFuNtd5AnY77V!nE<0D^C zWQDBnZsX0diT+YJ%jAq7Y63&SDU6zSRK(4oWP3`LEnvUc5{g&piE)>7w}=9pF$A4%o$g= zB)w)em|RtvOVroHn1F@^zaPAG-=&7rtkRJPcjtv~GR1@FG3T(;hPkuus+XJo^_d%D z57;}jCc()u2)~Yj3N`Sy!qrAJhC+O3HDVN=q+zcK@c*m@BSf;3{EV_W@l zoR#58sV1}B-kF~KlvIDcDX1FRmeYp=H;6naoUa2i-HUht6mPjfc!{D^L&&mOD-)%! zyV$uFH%*S{gp*veGtr54J+0$?8zV-xq)(W~otDqL)XL$|5Gw4)$^cvo2d$ZcYYu$$ z>=ojE1<)?9D=hUQK6ErFdf8-W03llS{%LqNBEH0UK}H*Ch< zn{dB6^1|P_;ZqW0s6B4=Tur?E+o3lQ(ShUG_}|IaP;AP^>W>edcvJ;^=Xv7OyC3(< zbiC~Mug>dklOGg`^m=_D_WH*pK6RiT4ZoD-{{V{^B_M*xBdy=9?FRd+7W#P@`e|b~ zCl+HF-Go&~njUN$JQwL48!5TE?)#CDI3S2g#wg+6j&C=jdb;$TG=`2i^Jj;6Q?LON zDJTFG(-YzG8TvNdaV7O3t(xABCAo+*_gS27`o{5To5M$K2Ddx|84%6_NGCv;cl`Ip z;#mq!%H@de+sK_0?dlsr>VabhbZUJaHWkyT+U~-+UBMW1$^KwZgoz@Es;uoP1=c)X z5az}_?Lwzir7#&b-lBAM`>%NBkD*ZBV1{?2Fh(h&sduDo_;y`Z^jk#0{BiA)ATfFB zt2G}u-2Z;tgB@^e&N z;|k2mPtblvvDpQsZU} z;O7P_u@g(NZVb)Xz>F-z=TD=C&Ylxsr?(fl=cPwEd%xcgT7S~E8&ahr;)rj1Bnnk^ zwYE&_nJY-3=Le}EAE_c=nh5)yUF<8b2QyY{F6*g#_m^a`hU`xxrA$P4^w`5eKhR&i zO>lgdK<_I6c#u2KbIq>&dv}JMy4}!bf+{OMd45+s;YrwqMJ-8A$m{CPvB+y2~4o#bbR@sJ?yT$BNBG!)R7z z(#lvT^Z|p~hfU+{J;iY(FRF@+AngMntT5Ve^)a%?{IFTjtkbe!&;u9F?52 zZ}Ra6Ko|bqMVPLhCddxFrnSl-0Fl%#F!Jf$|4MkI?gCgfdi%j25(Bh! zb&yx&S)QxRuIdT|dZvzF+QXd(AE@>GD=b(t+I^V+hZ|We>sdwYk*7GB|did0d&bOLGqV`5CbTM zS|tF+KWGQ$1VgLCncjO}?yP!1h#vslx{j;F5V*I5Ui4ec?m+!N1D)&PSeM4|p#)KR z-<7Ej9_i@WsJpYhg*`}zt;{_J5@%*W;444uTJ0GFn+>ka`3s!+dJLDRRKN4p9ci8z z4XfDhBGXLY`QeW}TYRF12HTcK$jf1f^}$_oW$^@%#VuAPJdNHWb>{k%eEo|aZcbC( zd4wc=K?jXbpFZ6)dVhms1~DwNt*D--*6$J~d2CRvAgpQ>5A#_K;MKJ=LOvq=x}&AA zXZK_V{e3E&Db;!ISPus_PJS)Gv@{Z)dEe+Uz%g{3a|r! zY7zgP-I4iAjWBp!rD7TkL( z5aW<5@Uj!y!o`78SzJ@pnqNG-=!07Nx9dE}69c&99?MN))xE->51!lFl8Jy<15Q#K z`>?Ss58POf%$C%Z(qDdll(f|;g{*Zjk@pS0gQ(yKF+_pWo^4}Yc#lnuguNj8Q+43o^-z9+J3G(J`uJj&foIG-vBIA2sq3Q;Et!&QM= zFpvk@d*EPlTTZr#-_L2Yq@3i8#di>Yw0C7v2vZ_r;D-&9%ai@*UY+zv-X3Nb->VWk zGY;?SNBpi6!&_JkF$kNwGPfGOAUo4X2d}GqlLFO-0EUdA7ELL!ukr&rU{s{q&0Jja8rp&vB3)Jo6N3Q*$<~w+s zK2T8uXxhYMa1cjF?`-W598mvLw1Q`DgN^}k!^@BlrAe=pT%c?XkEGnKUq#0ZPM}Il zs{o1G5YTm06cl_3XVQRH0G5!m*Hat_DY&qeshLsm%5+!q_AT1>lfNXW!Naq9EP*lw z#+~&SncmVnf!2cW56*F_$f|vKWs^ zW+v@~Vcfx0uCN>GM8l^C5-*2QZT1=*pIy*kUg%Cs-iI)VqW2a)XD*EDZ(J->`j=~$ zS_NNWBHaFIXP=Y0Z!K6WHEgr@nKmN5r^?Nk5V?=cC*^W?YlF%2{s1-f;pJDY5CkxQ z@!TH;@QH`0HX#f$F(&e&k3+0((->6E$IGa;oKpSuZFxm`UFRnk_xQr%RG1=GI8LBC zS!l*X=D5oD7=`#9C_ZEXpr3^jWj8;1N=V1O9|mStk!gl1 z3CMn`ctW$j5J<}0_g^qbbj>+<_|U#+?wc(MtMgO}s8&kuxJAGT5bO^F3z&}eG}C)> zZ)`YQM_U)X-rUw$tymae=^rRED7bmeTzs(pCu{DOV*mx_g!26nk*el1bR)Czrf7_O zK0-$Waj*95nm8~mUO;4+?vj>HQutUUbaQlxx(~{O0wz zNbnkAIlhH4*Ah2%E0w*(h4B00DrK@gM|{|KcvGIdP{J3TlyqqZAZy9O^ZgI^Sn6z^ zECXr+vbxYX(8C zfICOY#&9~Nc8SV(4t=XXmUkU>PgoVG&V(wbvgn;GOW?bsagNw^JmbRK*Zm^_ZCL6FE38s9|u z)GH(qo*AY`R%P#UD5^U{D5@9ioJ8MVLZ$BRJdXQA>P}WD+gqzbo#45U!D0slF;zoA z3OLO&-=8e|-DF*4RTD;+0Ag%Uklg0()BGW|4MxHuryB0Qd>fE*2bk%ua7tR&vz)R- zZ~5-G19n7m*AAi6KgY(aUB5&PWZ;@Fu4HlcMtugv4@d;d*=Ihj0pa>ZPFd!hx|wF@ za-!Vkh-vN0yhky`U0AZll@rwnX+5;>%IBQR1pOw~xbDb8&gkvw<3u8Qb1nyG-u2I3 zkci}Nu6vUef+acvc73^EqX3|s;|?aRU&@AWxu@LgNMscosmzbOA8}_bac#{3(bFNQ z^jF|Ob;9Ji#*8m}Jq0fw4oJM*=rKZm4aoMQ9rtem`XnHh#@-qGdZb$ zgGtU;DU!P|Ku0G#nWSEp|iY#tz|5neR$AW)V z%hIj9|BXYOJ0zF$8hgQ-%jI%W@-ee&yn()t<_`JnmIW5&eZjRAhz zJ*Bcr2NS!iblu&_;(3k`oQoVddSNQbQ@@lL;TWyVH0I~r!oR+3Bh)kKBrzS>FoyiHp_V$z?xZHo|%PIH#fOr4U3hb%}DfyBPJ!?pvfT>O=eC)%Zu6u&>$r^BFVm zz^u5P)$O}>zixR7eCpAbIkePv<$d8*^U$uVXC8gL^_VbUXauL7$PRL}%N=D3k0vK^ zfu2bLYNYSCf5Zu@-P?FE*@arJzqhPk9@&1c-fu~pInd}g<;&S>SXaCMxj7sIJ%7KN zI52PwB&{9mt4A0aYKc>G?<>(p;~6c`sixDDtt8WkW+ zm&{d`HfvJ*x%f@E)kj#S^D5gze9mn=Vu3=nhMor*z}Y(1cB#epS27%l>b|21x4yKhr{OX`qa&P z`r28lk7%~rIgLtED^BkgE#kr_3V;H<10Q1E)RZc(ziI5%6t#8Ej^K<#6r(9`+)B2{ zX4CK8jt6&NQt&s9sJs37(NzpU8g6hgUf~xz9Ubj1O%w0?nLb2%&gpejXFeB>>&H4z zTYdb9`r#bUrLJy>&Av?Vmr7nnWRc~51)gFH$d=8t<9*u6&U7t)59FV$r@8;^xp6-zj7e}#W zAwYzm$#Xa5UT004f>csUk>Y3CYkJL++EwQ;*a0vnCwdyHcE^4NC1N=^RWa<}uJ5_# zo(I_L(rBE5YR?n#i~=`9h^b0dtGxd4mjauU{f64=`#H7QNyRq|=8lbSv+D9khwkt6 z{$sHHDoK}T)ri?_UuzDc&Q&>d;N=!$ zREVQqAHA(p&mNloiNa9^J&<)Wikq)h(=JO>RcKRyyqaJ3-~*4W`*B#+*k@p=mK&cI zb-7(cMMW(=iR2N0lDw;o`gC43c-T3()6r@+{1#w0c)LPfKmVr4n>b|Ij{X?QHdpDP z6j@tJ45LuCp;G!SEt(lP0DHi9QeW>qRD|VqV$Lw=?lH_lzhMo#+v4LQnqsCUOPeZ-5ZmgsQg;T3 z1-4OBU+u{HG!hAiMz6I<<&7e?IP5yh{HsREC#Ygx+3PFQ#`;1>FPvh850N}TBl6++n**Nk!19Qw|;5sVXP^A9Y)log~xK(KBYd9 zldp`)yHX>yUGSR)u$4yi0{@BWLZw4W^>fv=tyY<}*{s>%##I8VkhM|e-?Rna+s*o~ zHtZ(9E7W#EOriFxc#t@BVcNQgQsAS6ofwVoZL70&e42L$kRV0D8Rv}$^V`#gzA81| z#xYy`HBzRPYCR68Qc5{O)l(LgA!84DuZqI(vVDnu-rrZIG6T*ai*27_W0hyDow{_{ z!!!4+E@kdfYE%zfzPr2bV-DbzYd);RSO*(MuXLyzlYYN4mW;owYss8)OV&M%7}d8QPUx zR@wPjpBsh`SyZE6T&nCc)b*OP_qL{0)tWO*kX2Ir22p@CHzpfL>>pehRj9iZ|FZBw z%i*%&w+J0V`U1MvOxxRUM00xZ&2M?eOk)Hk#m9Dt8`D+E9tc3y`8#;Y$kTg?{-*n$ zbO>@LUz;diha(~TMdEbuhxi|>N|~6e`_R--%*JDjfL=0LZs@_$0CS4mtzH~hJgB1C zTDwtK%WRNg&#@G5Xh-AM?twWCk4!~EOUueul+VLoCI;dV^M~Owy9z}3IDqx-sMBV*ChViHv7cFfx@MDs{vg@bS z2V4L7>}*p(`lyld!tGlV&XKM7l|{>wb7Eb>O86NGvVv%zvjOJ(;$fWc>jTA$-|H)B zAvKpjz72LKE@*Jy1M}+M`iJ{&IC^63i?miwQpLn9!mo@^uNHw*ThkMDEUh-Bdn54} ztJ`mn4R~z@`?dYHFAYXqIWfK~nxyUp3Yme`k^~)wQbSSc^bz!QGwKEe;4f;0qRlsR ztTuJ}B-$}gC9RVSNiA+%--Q6!qSE?*%Sk(ze<=BGHX0B^g%G}@bGEKFdh4-cPw)-~ z7z@7g8JlBpQH^p}Fbas$;-WLvg-#b<0aNFxr4rx*EQXYi))lusO8Th|Jw z283P|w3>JJyz=n&HT{Ts-2#EVZ8lLaif%UVnXK0Za08bAZA?zj1pfA%zO)_cTV`FJ ztGbKOh6>lyGed*Z|DIM0SyvMei)2qmWE9$68vhQhNIEldWPR4375l|aj{8ZeirHmY3h{`3PGdp#4-aax9c*=q;|Bx~6>XVQ!U)#Hz)Wbz|D^{AoOFX-m)w%#VL_n(J)um52Q$t-C#b|W6^Yf%qkSVFR zzB#<4$nOdc1`mETKM5#kNAsZ2lD^v?6yk zVZmuwv{~~GsqYw2* z_ScBhmzx>zl>(u;vUt#9x~7va;-tn+F_s`Bji6n5`J1nBjLMnvBi4bn^7!B)_-Eo^ zpv(1XSL6yu2(F2=oGCm%t>T{(#p}U2c>x=)Akd%T=!fxZq*pXwr-saI z8=S~{`f}SSuYm49H+`g6&&sfM(S!TFR$TNw$^KY|T}kn2$e^TUCf`QP<}SGPEU$Vb zZg_ZeAgg=iBXPE1+6AHHQF14ew-{e z(;R4uiI^$%Yj83dB-+wvV9pT=rLNGTqpz(gDbIb8CiZ^m70W`P?(GKr*{x7StH8Vn zWXr2JF(`?4m>cmA?1ys$aeD!qh}+zfP^*nL=GZqS_25ym#B1@RO>f-w5Q`vE_B8d{`;(#s>|}@%Nuubw1mD-P?fFu$A2Q;_GZ{Cw=D?J{rg93rhCP zwzdsUx;nw3@{8w>nK?)3zumvF9SK8vHUe+qpV$~$Zv^dxpv;Jc^t)p$_Y7_gyNxXr zO>04~OtCoQ!wFS^8-gR%-1kc%cgGjHmCIiTw}O+$sWI6hZcMi)&X$e!K3b*F@3Fb| z-UkPcK=kDn`+l8(4w^cMhPuWAMgP@^K{4C8((nsZy$~aHUyxt%AP98*e~2PNlC;U& zD}Ba8?p;l{)d{O8h<`=&Farr3@`lv2YbfwFyuU;*n^ZeLkI3c+`-A+wx}@+naKfImEhnmQE;RcCCpK2ZV> zikwjkVNn1G^%Sx=E^55Xm6*$qNjU?y6g@Fo^sgd|qWR_0@q3l-hh1vF44-?LDYqOI zId7ad1ZxWQFjDD5<5wlOdd%Qk&n|F&o?x~%*ret(e~!4y@~*@PLR1Blvvc|Hqjy!g zGa&(kr~5s^6Uj|0A#b}5%exM~HCrP@AvyM8d2X?Wcb>HN2EiUPud4+6E;!CTcj1qo zE_)srI(&;F0+%wA$op5EVNAODJV*YSb=t4MXuJ^Lf@X72zgkq%5LtY=>s#x3%3?#y z^mtV;!BqEf4DJtYg#t*;nW{;Yw&3iR8&fV5e-GA3>O5YH%qHwe*9Wom{gycNJUPNm zbmr!ZM9qbp^}a;f3;L$_2A!o}97Wz>dpcapZ_|>>G`o}&qAggzm|!%BJKlGh%_+_eI^H-B` z8#${coM)o?`BhRQWBB5nc=2(MiVg}B07nG}A%yeex)F0uhhOw_-$_ld!-3er{9Dt{e0f>f~N7chp+95WtErXm256erMTPz zRyXu4_((~q_oY1xH>di-r1D4C2{~OE;&4+z8RVj}8O5D`%1S;Js z_DSiimrV`Sddtf7dGAKwc#?AOnR!<3OH+~!sZahukZ$WsXiebj15)DMqolAI4afe& z3#nrlSJh5;@9T#Dm2qX@xsOsC##&H>$H0R4^TtxHnOdoX5T&L&&q?YoKX8+eVYtwd ze>gS^jn(Loi4^Pd!UlQF69}U8#9O=PrB**lb~C9a?k-2d*RM#C&4}(FgN+2`$3#AO z9foo{Y7tnuia15e6$#gwk|3r-fa=Gqw6GaiqD+ah^@5KR_Jlx}PM|=*V#|Do-o*XT zkvuoAQAc3e^bMb+N|Y5>NimP`8V2%VnhDps*Nitp~ETmGTHPl|DjWN%$lbAPus3W%q3~hKg*H7vdpI*$r@V3 z28)Q$*bg+k;&7IO(?Flax_i6uV7sAmtfTAc+ggsTWz^biyP8;zdBt7p2w>&sk1kC+ zycz1(3g?i7@xz>_fm%vJLc|VrUk{q5T4Aq#!^kYUv9qOXv|hN(H0m6lwTEH&=O101 z_|ZC}u`Ad9U#lt@XAY%T!xOWYH*MriB6%N>M-aZd5*hdP_jcn)y8eq&;SEwLhN*RqE6%(omK;!vGP)*Biy<|xm|vGc(=U|CkD}Q$85L43Nxdh z&!^m&xo39b?b(;TKO6Jj%Tj;V>nY~!>Ym@mv&z)&^7BHdhiyL~fR+2c-ARi&S)<1} zp)tEl_45J-Mdjj76t8JSI+{<@N52)DspPSP{k1%@BSOm;DG^u`hIM8?E_nJ?yxv75 zw}u4FkX5NP9IZB__n7LwyGYN)MUp<6_F{+>UZilgu5bRsC=W}nW_<$v1CM@0IN>&b zZCmHgphf-G@Wo^0#Rx1n*3@s4qMA0y$18ZDR^JZ+eb6;ZGR}3@qBTcs4bAS1=F~l? z&t9nkYv0?ka@yX8(_I{Wqqhg1iWZ?(twAMY%0vJS=#f4$?A#wqk~z?>TCn^{cJs0# zHA**TCE-I+?T<2nix9M|MZZ?K&DvX&%m=?O^3(AJz_OGu;+>$*s?uh+S&em<9=rYQ z)8AhlFFvumBw&2tEC1YJPNVO&t_ztT?xdSK5E~x;VlsY66%)K=xZP?B9qq8h`RJ>tA$pics0j= zBNzB({^R+(x2R~&gu%M;?Pi0x|6gPEz{EVGOXf^2oqX{juUe`8f7S?T%QI0vb6Xuw zb5xl4YhnaK8(vMwzEN>!i>J)KPS2r7{k@MJJv$UJ#7Skj{N}0uy;(CC5i~t`DZAc& zHt7qrhVqX(i4xMU>tBYeey!`(#Q8z>4cLox< zuL)jrvy$h$gqF<7@2+4te~A~M{gZWDyzNrOdpZASltW%#*9w)r?IMGy84S-hJV5)F zb?RnMb<+61^b7$AF_?3vBP(s?%dw1ohE#XaHCfM;w>(kc0}$B~)aNRX?BN1GsVu#V z;SDn%S_C}#IvTXc6B_gVKZ^JE|F`bWG^&ZL&EruUu(1J`AT}b{V~Z>T(z2+?B8s*k z0s;vFAs_;>D;SU^gjWPwl%=%+Wfc$uVHXl4fq>8g%D#lK1w{6Q5D2m*0&^=m=k)1$ zXFklC`7m$3C3UNA)vbGP)pMWU{~y;|_2M-prN!#c=wkhW!?(PV0y+a!I;!a3_YOMT_x#Q}`&)O*( zQ>X)Lx_X|)ZN?8UqD=VVDQ1Qn{*qIU5+4qalUq0P6!lgnFg**@ckIz`3axmGS|8Bu zx!Rvq$LT0xmriv)kdYphfbBNx_1Xc14^;JslOa)kIk*$;B{t3=V{-2le!f(%%SZ`R zvV8Pq9Vby89e-cTyP#}IgOpj{aD@*IL)|*}dFC_kS^3rWpz6Ba*4TbVv7CkL$^F(YX{ASy(s&NJ zd>sdeeFE7lkN^!jzt2lXXI{$UXKc>DR*I|& za*5ao4K=7$cxfs1sc|LsDyq_%z$*>W)N;C{`Yd4wOcdZQu$vb4X<@ccv$J_6fkUVF zG|3)~?T8V9HD5`*Bg(W=2^@IPnYc7a6+ZLzeJV!6gP5DI_UEB+Lo#=YXFaBzs_M)ubTq#(%SKgSg=!M0F zM}-PyKv*Z6r&B^$a#gc?E)%GhnP=*edSB0U24sH|AQo)9#of7CM4AnN&m_)Xu>6Qu zU!*QI)!I_m+W)MTZ<^(g(^X&a0ioTj449!T8*adj=fF&+LW&t20W z$^@1WXZt-G7#&yR!w}13^E0vl5b4}20F5$Ev=ij28bBRp8kX~GzoV}p*4$q?#6G1D z-fiufU-Rx2CK{c~G=n^663n2)#WmspDD4Yh%Qq<@xAaB&tRACuk)lE}(q$tbj~&2% z2k5ZFXaNy(n3GQ_G$id4mzEIaZl08`HKPTTCn5S1)C2oLzHM;EGT!9Dod_?ad2=8DnD)kR#e^X$8R~B7UZbZb zPXVT_86tVW0g%++cdoSSdEJ6H=j(9B%cm|rs;}Gg@S_<=^XQr-Z3N(mD{HM)EBxfq zLhbLHXD-xfYwh{0xNv?fueewX#%=;S_a7h`I%xaQ5lz=z)NwRKbf^tm?BSRc_7DNxoc>;^ig+%4O#GB+D4U@HU+ zh@SMF{-$gr_zK9>IGK!W)qNN(cuZI~BybP*Qd)(>UbB(7f{+oQ^L7-{ul2xcaQg_~e=F#JCOkSZ~rB7e3$)#$%6gQ3osVc;BMgN0_RsG+^Om+z=!t{4Ct1_OtWucVvJ0B)mTMc$hEhTW0%yON*q zD7y`YuFol}!ixwLVyFlY`^lyUR2Y4xvOHhD==K%B#V3oqd+e9z0{c*2T@Nyc0-*%(F z(tY#l1=vZ&9k$kr;}kHkUpDJ45~+g%2X`}>=;xM_URG8S$}eJ zwGw>05eoqXw59|U^AMo!a(c<#nhv zFja#(0#LNr0>iXrCavWRh6&dd>C_?=6nFzv)B>iD+x#-qk!z^GX%Dp_WE$}o;Gg^Z zed@bMQkN1#{|Q!x)d5)9c73qdVF~DM3A9eHN|3Q67D!vQZZ_|}uXoriKihYvGs{Au zyQM2I8?6@?1e=-~P{fBHc< zC+NFtkY4aI%~jBSV2eioy{F-v6HL@_aas*%>A+{Vub{U{2i*U9ta}h`blAhq^wIvW z+rReu^_H5h`%}-aQ8n1C9M|gZk3<)sWh!yN_6SPd@&>)F^S9{H4BsR2o0&DWxr7mx zK2TtWrQ5thSoMZ%^d-CYCz^d>xE@D233jQFhggnmt+K~KVPx+?Dr1xHYx%T9ZQ%7l zm0Z9oP4ii(#?n>8`dw5e7jof=hg%37WuQ|M=E=Qew&IZr$3g*a6aQwn*0! z`VY0&)^;qVjS)g&MXFo-;|$ztmDJNAJ^s}y-Ezk=!8LZ;LXSd=K^g?k`c>X+5I%Sk zdy(sA%|V@9mqSop${D1!^kCMAmOp7DY$P=GjiXZyz2w=c0S`}4=w1UF*WlZHa(%Ii ze!wrVsSr09qB#E9G?;%Vgq!{j@yBbQ$v*FZuF*{I()dVDjc=eC_TAT}5`zYU!ca>g z$Kbrr2W_7U%5-)5O3kGV9D};l6>%J?eT5foJvS#R7_@cs717%ic0x*6Vxni^y)~n# z#@MhsWST8+zOrY(O4$}~VozUz^D#RL=8`idhP>E*ojS-{nekC6^PBuIu>{--b5U;K zc|%g)V`W_F!zc_{9gh3aC)s^eMK@}YGkqH*X2f+q(^m=w1!#NtYIOk6a-MDy=KeyDkS2SWc)t5T(5gTbJyHoMR2hEwGboelk zZ)3!Okj(Bwh5Ydt)gN-_M)h{4Rbyo%_>_<-JLee9E)hcFL*#L7q}qgo%(f;o|W>>Wt|P z%A)$KRUHF8X8MP$PsrXiXB*goauabuDI+4FQ z%{+?@+?52$-IwF0Q3=GjxGW|R#yv4YJ*G+8z~Q{pEX|r}{%W`--_mjF-1EkUp6t@r zN^4E@ffG!(8vI5yo4z-$AdqH_JQ{I&9r9${C8c_W)J7T717f`8K7ZL}rp;h7lIcFw zb5%zrXt>m~0$sU41Y%n{q|ctIsuXx#0ajeVd5aBTj;oT~kKyEl!-iiTo0~LEEiWD| zs>oSp_PvXF6f^gEL%1I``Dl(g;QP#*G2+Nj`{8t5n9hwi#6Rw9ak}$MTa>He_PSf4 zC~YU9%d%;TpGB45UD&5Pe7DEcA`c#AmtVarADOiN-Ja)$RSARRY^#uNp+_Des^e|5 zZ^qVw$JD=IfVtihB)RtQAOC7d;>t~_63l|q?MAlx*UD_qR+RL3>;ihO_r_T;l z^~&3GClzM=$CFjwzu9~+;5$&is$ZHU8j*Qo;rpiWr4Kqn7iDb}?XLw|sK|=Dr+SS~ zMxw4-YvRAxZ;U&XYI*efo6#$Y;SSz-7o-p(=;h z^voIZS}@b2!1ERM!8Q-_2{XF!boOPf?#O3jT4z?RL}YFoaMyuAM7p|!U=Ud%J-yJb z!+Gq`LNwe5PTyec1rYkdb5UYdRqI8kuaD|G&up%YcVHVcz96fBk&L=dsoQgg-{39*G zx^7|NRP_NaAC*-cm#C@%1XeKfenIT9L`mKI544oB-m3I@*S}`uUd*_m_1=v*pxuw@ zbKMGtE8ctkO%$wra-OeU((#%Vuiqzptp071d189BUP{_I8fuoj5L2&OgE!W(o>06k zx}(ginqVe*+sP51P*7H?_Ct3!<}Cx&t0lqG$jIC;S8m3cymoHJc|q}Zi-x5y+26x! zbWGD-JhFm-u%c)biqtzlMT;J8%+{&35V>e3b< zdJ7?VEE$)U8W!gJeZPyp%E=7P@R@S-%@pzXScS|Lv3VxN@;_U=nH~SZqpPfbapjlq zJJg6uT{xes#BBLfcV_GBOSx){3E4BR{Aj2#n=dlwUD`rx{xNg*$ATzZ~g z;9PX8)4afRu2Q~it68d~GISxHR^Y`<;hkeVk60=10hSPf?VEU&FdQl(LG3PM!p*BS z$ZgQ20O4jojqE{JZk=B4>8rgI=&5S`TO`Qz#gvtL=676Fc52SO!}j~04;NRuVhlW1 zlt=x%a|U0CUWmm>UHf&?DKkEq4u4KQ%rAWR>0GA#&wJ8CoZmicY+oww7?3~Vt|W9X z%#YySn(@2C>aj!;P$K$5H9VqX~5KO$Cw)Re5j4|aIMqn5*F(o92SU%L76CHb+w{xgB|Igy!bxFHw z>Y@kfs9a(ByQQRle6X8-<-yFf8!EZQ)$L6z6L$SUM0}(qZfq@V;GU%8sj|rX<@QZ1 z3ZROfbTq{tloCRUR@@D>mI2mC}d^hM%OKhaB@migAa&kzOtNjEl0FnIi?^sm5*RN3pHJMimP^n5+4rs89`~}hrU#oQU2Vb zRvyyKv$#~b#6+yMKAZ!{zIekdd)ICZLAbZIB>TmCV8$6!^|%4Qtf5oni@)8mLl3W| ziO|IZq)Ru_LAD~-GrC?^zY&_uH|7{YSoBy~di^EN_QFzAzWK9PB;^UqXH!kxOI~9) zwFpYR)S5vH6Ayj^^NOix_R_*UdGEN<5!xv3rOE^n1D zwsEyYOzQc2{7Q_&rSS;qy?C=mOrNzkk&pJ;d=~VHar3-eng#B-fyB_Cl!r=JK4{8x zlbL6vqizhk*_6=_971oi^{}&c!ke3LG_^LhUItJovf5U>nU%7-(|$%msVI~ ztf;rP{iy3~?rKGi2v&BdR&t=&)%5pB_~BRccGHV>J0xDBMu)nGKkflH#^9_Z2(@U^ zPp0MyPn`L?iBM5dD7)zT%Akm+chibTIg?3_p)#dIa7+6`0vS={GTz>jWp@92UVsuY zX8B;@4F+$*t9l1HfH?Ayo?L@==UDrc+O_MqP_+Z&4)s<&N}T`oizdZ8dSK-cCVq%e zRCrS&mCN3G-S=^veA!<MdMpbm-OzGqLzK5`;Wc0S|5uFl_msDErN(XLCWfm|u&9*)HwXHRQlaqZe(T?7&dbsX^F_N=gn#KiWj`Kw1mHwyULNo==u3DR?hE`qz}lx^_lc@cpKj=YxT6T@52Jvf+FfD6uF5aB2wgiO zC;&@9!?}>6TKI + +## Responsibility + +Vald Mirror Gateway is responsible for the followings: + +- Forward user requests ([Insert](https://vald.vdaas.org/docs/api/insert/) / [Upsert](https://vald.vdaas.org/docs/api/upsert/) / [Update](https://vald.vdaas.org/docs/api/update/) / [Remove](https://vald.vdaas.org/docs/api/remove/)) to the other Vald Mirror Gateways in the same group. +- Manages the state of indexes stored in all clusters to ensure they are consistent. + +## Features + +This chapter shows the main features to fulfill Vald Mirror Gateway’s role: + +- Full mesh connection +- Request forwarding +- Automatic rollback on failure + +### Full mesh connection + + + +The Vald Mirror Gateway is designed to interconnect with Vald Mirror Gateways in other Vald clusters. + +Vald Mirror Gateway uses a Custom Resource called the `ValdMirrorTarget` to manage the connection destination information between Vald Mirror Gateways. + +The `ValdMirrorTarget` is a Custom Resource related to the connection destination to other Vald Mirror Gateway. + +When two Vald clusters contain Vald Mirror Gateways, Vald Mirror Gateways can send the request to each other by applying `ValdMirrorTarget`. + +For more information about `ValdMirrorTarget` configuration, please refer to [Custom Resource Configuration](https://vald.vdaas.org/docs/user-guides/mirroring-configuration/). + +### Request forwarding + + + +The Vald Mirror Gateway forwards the incoming user request ([Insert](https://vald.vdaas.org/docs/api/insert/) / [Upsert](https://vald.vdaas.org/docs/api/upsert/) / [Update](https://vald.vdaas.org/docs/api/update/) / [Remove](https://vald.vdaas.org/docs/api/remove/)) to other Vald Mirror Gateways. +Then, while forwarding the user request, the Vald Mirror Gateway bypasses the incoming user request to Vald LB Gateway in its own cluster. + +On the other hand, if the incoming user request is an [Object API](https://vald.vdaas.org/docs/api/object/) or [Search API](https://vald.vdaas.org/docs/api/search/), it is bypassed to only a Vald LB Gateway in its own cluster without forwarding it to other Vald Mirror Gateways. + +### Automatic rollback on failure + +The request may fail at the forwarding destination or the bypass destination. + +If some requests fail, the vector data will not be consistent across Vald clusters. + +To keep index state consistency, the Vald Mirror Gateway will send the rollback request for the failed request. After the rollback request succeeds, the index state will be the same as before requesting. + +The following is the list of rollback types. + +- Insert Request + - Rollback Condition/Trigger + - Status code other than `ALREADY_EXISTS` exists + - Rollback request to the successful request + - REMOVE request +- Remove Request + - Rollback Condition/Trigger + - Status code other than `NOT_FOUND` exists + - Rollback request to the successful request + - UPSERT Request with old vector +- Update Request + - Rollback Condition/Trigger + - Status code other than `ALREADY_EXISTS` exists + - Rollback request to the successful request + - REMOVE Request if there is no old vector data + - UPDATE Request if there is old vector data +- Upsert Request + - Rollback Condition/Trigger + - Status code other than `ALREADY_EXISTS` exists + - Rollback request to the successful request + - REMOVE Request if there is no old vector data + - UPDATE Request if there is old vector data diff --git a/docs/tutorial/vald-multicluster-on-k8s.md b/docs/tutorial/vald-multicluster-on-k8s.md new file mode 100644 index 0000000000..110c75e43a --- /dev/null +++ b/docs/tutorial/vald-multicluster-on-k8s.md @@ -0,0 +1,303 @@ +# Multiple Vald Clusters using Vald Mirror Gateway + +This article shows how to deploy multiple Vald clusters on your Kubernetes cluster. + +## Overview + +Vald cluster consists of multiple micro-services. + +In [Get Started](https://vald.vdaas.org/docs/tutorial/get-started), you may use 4 kinds of components to deploy the Vald cluster. + +In this tutorial, you will deploy multiple Vald clusters with Vald Mirror Gateway, which connects another Vald cluster. + +The below image shows the architecture image of this case. + + + +## Requirements + +- Vald: v1.8 ~ +- Kubernetes: v1.27 ~ +- Go: v1.20 ~ +- Helm: v3 ~ +- libhdf5 (_only required to get started_) + +Helm is used to deploy Vald cluster on your Kubernetes and HDF5 is used to decode the sample data file to run the example code. + +If Helm or HDF5 is not installed, please install [Helm](https://helm.sh/docs/intro/install) and [HDF5](https://www.hdfgroup.org/). + +
    Installation command for Helm
    + +```bash +curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash +``` + +
    + +
    Installation command for HDF5
    + +```bash +# yum +yum install -y hdf5-devel + +# apt +apt-get install libhdf5-serial-dev + +# homebrew +brew install hdf5 +``` + +
    + +## Prepare the Kubernetes Cluster + +This tutorial requires the Kubernetes cluster. + +Vald cluster runs on public Cloud Kubernetes Services such as GKE, EKS. +In the sense of trying to `Get Started`, [k3d](https://k3d.io/) or [kind](https://kind.sigs.k8s.io/) are easy Kubernetes tools to use. + +This tutorial uses [Kubernetes Metrics Server](https://github.com/kubernetes-sigs/metrics-server) for running the Vald cluster. + +Please make sure these functions are available. + +The way to deploy Kubernetes Metrics Service is here: + +```bash +kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml && \ +kubectl wait -n kube-system --for=condition=ready pod -l k8s-app=metrics-server --timeout=600s +``` + +Please prepare three Namespaces on the Kubernetes cluster. + +```bash +kubectl create namespace vald-01 && \ +kubectl create namespace vald-02 && \ +kubectl create namespace vald-03 +``` + +## Deploy Vald Clusters on each Kubernetes Namespace + +This chapter shows how to deploy the multiple Vald clusters using Helm and run it on your Kubernetes cluster. +In this section, you will deploy three Vald clusters consisting of `vald-agent-ngt`, `vald-lb-gateway`, `vald-discoverer`, `vald-manager-index`, and `vald-mirror-gateway` using the basic configuration. + +1. Clone the repository + + To use the `deployment` YAML for deployment, let’s clone `[vdaas/vald](https://github.com/vdaas/vald.git)` repository. + + ```bash + git clone https://github.com/vdaas/vald.git && cd vald + ``` + +2. Deploy on the `vald-01` Namespace using [dev-vald-01.yaml](https://github.com/vdaas/vald/blob/feature/mirror-gateway-definition/charts/vald/values/multi-vald/dev-vald-01.yaml) and [values.yaml](https://github.com/vdaas/vald/blob/main/example/helm/values.yaml) + + ```bash + helm install vald-cluster-01 charts/vald \ + -f ./example/helm/values.yaml \ + -f ./charts/vald/values/multi-vald/dev-vald-01.yaml \ + -n vald-01 + ``` + +3. Deploy on the `vald-02` Namespace using [dev-vald-02.yaml](https://github.com/vdaas/vald/blob/feature/mirror-gateway-definition/charts/vald/values/multi-vald/dev-vald-02.yaml) and [values.yaml](https://github.com/vdaas/vald/blob/main/example/helm/values.yaml) + + ```bash + helm install vald-cluster-02 charts/vald \ + -f ./example/helm/values.yaml \ + -f ./charts/vald/values/multi-vald/dev-vald-02.yaml \ + -n vald-02 + ``` + +4. Deploy on the `vald-03` Namespace using [dev-vald-03.yaml](https://github.com/vdaas/vald/blob/feature/mirror-gateway-definition/charts/vald/values/multi-vald/dev-vald-03.yaml) and [values.yaml](https://github.com/vdaas/vald/blob/main/example/helm/values.yaml) + + ```bash + helm install vald-cluster-03 charts/vald \ + -f ./example/helm/values.yaml \ + -f ./charts/vald/values/multi-vald/dev-vald-03.yaml \ + -n vald-03 + ``` + +5. Verify + + If success deployment, the Vald cluster’s components should run on each Kubernetes Namespace. + +
    vald-01 Namespace
    + + ```bash + kubectl get pods -n vald-01 + NAME READY STATUS RESTARTS AGE + vald-agent-ngt-0 1/1 Running 0 2m41s + vald-agent-ngt-2 1/1 Running 0 2m41s + vald-agent-ngt-3 1/1 Running 0 2m41s + vald-agent-ngt-4 1/1 Running 0 2m41s + vald-agent-ngt-5 1/1 Running 0 2m41s + vald-agent-ngt-1 1/1 Running 0 2m41s + vald-discoverer-77967c9697-brbsp 1/1 Running 0 2m41s + vald-lb-gateway-587879d598-xmws7 1/1 Running 0 2m41s + vald-lb-gateway-587879d598-dzn9c 1/1 Running 0 2m41s + vald-manager-index-56d474c848-wkh6b 1/1 Running 0 2m41s + vald-lb-gateway-587879d598-9wb5q 1/1 Running 0 2m41s + vald-mirror-gateway-6df75cf7cf-gzcr4 1/1 Running 0 2m26s + vald-mirror-gateway-6df75cf7cf-vjbqx 1/1 Running 0 2m26s + vald-mirror-gateway-6df75cf7cf-c2g7t 1/1 Running 0 2m41s + ``` + +
    + +
    vald-02 Namespace
    + + ```bash + kubectl get pods -n vald-02 + NAME READY STATUS RESTARTS AGE + vald-agent-ngt-0 1/1 Running 0 2m52s + vald-agent-ngt-1 1/1 Running 0 2m52s + vald-agent-ngt-2 1/1 Running 0 2m52s + vald-agent-ngt-4 1/1 Running 0 2m52s + vald-agent-ngt-5 1/1 Running 0 2m52s + vald-agent-ngt-3 1/1 Running 0 2m52s + vald-discoverer-8cfcff76-vlmpg 1/1 Running 0 2m52s + vald-lb-gateway-54896f9f49-wtlcv 1/1 Running 0 2m52s + vald-lb-gateway-54896f9f49-hbklj 1/1 Running 0 2m52s + vald-manager-index-676855f8d7-bb4wb 1/1 Running 0 2m52s + vald-lb-gateway-54896f9f49-kgrdf 1/1 Running 0 2m52s + vald-mirror-gateway-6598cf957-t2nz4 1/1 Running 0 2m37s + vald-mirror-gateway-6598cf957-wr448 1/1 Running 0 2m52s + vald-mirror-gateway-6598cf957-jdd6q 1/1 Running 0 2m37s + ``` + +
    + +
    vald-03 Namespace
    + + ```bash + kubectl get pods -n vald-03 + NAME READY STATUS RESTARTS AGE + vald-agent-ngt-0 1/1 Running 0 2m46s + vald-agent-ngt-1 1/1 Running 0 2m46s + vald-agent-ngt-2 1/1 Running 0 2m46s + vald-agent-ngt-3 1/1 Running 0 2m46s + vald-agent-ngt-4 1/1 Running 0 2m46s + vald-agent-ngt-5 1/1 Running 0 2m46s + vald-discoverer-879867b44-8m59h 1/1 Running 0 2m46s + vald-lb-gateway-6c8c6b468d-ghlpx 1/1 Running 0 2m46s + vald-lb-gateway-6c8c6b468d-rt688 1/1 Running 0 2m46s + vald-lb-gateway-6c8c6b468d-jq7pl 1/1 Running 0 2m46s + vald-manager-index-5596f89644-xfv4t 1/1 Running 0 2m46s + vald-mirror-gateway-7b95956f8b-l57jz 1/1 Running 0 2m31s + vald-mirror-gateway-7b95956f8b-xd9n5 1/1 Running 0 2m46s + vald-mirror-gateway-7b95956f8b-dnxbb 1/1 Running 0 2m31s + ``` + +
    + +## Deploy ValdMirrorTarget Resource (Custom Resource) + +It requires applying the `ValdMirrorTarget` Custom Resource to the one Namespace. + +When applied successfully, the destination information is automatically created on other Namespaces when interconnected with each `vald-mirror-gateway`. + +This tutorial will deploy the [ValdMirrorTarger](https://github.com/vdaas/vald/tree/main/charts/vald/values/mirror-target.yaml) Custom Resource to the `vald-03` Namespace with the following command. + +```bash +kubectl apply -f ./charts/vald/values/multi-vald/mirror-target.yaml -n vald-03 +``` + +The current connection status can be checked with the following command. + +
    Example output
    + +```bash +kubectl get vmt -A -o wide +NAMESPACE NAME HOST PORT STATUS LAST TRANSITION TIME AGE +vald-03 mirror-target-01 vald-mirror-gateway.vald-01.svc.cluster.local 8081 Connected 2023-05-22T02:07:51Z 19m +vald-03 mirror-target-02 vald-mirror-gateway.vald-02.svc.cluster.local 8081 Connected 2023-05-22T02:07:51Z 19m +vald-02 mirror-target-3296010438411762394 vald-mirror-gateway.vald-01.svc.cluster.local 8081 Connected 2023-05-22T02:07:53Z 19m +vald-02 mirror-target-12697587923462644654 vald-mirror-gateway.vald-03.svc.cluster.local 8081 Connected 2023-05-22T02:07:53Z 19m +vald-01 mirror-target-13698925675968803691 vald-mirror-gateway.vald-02.svc.cluster.local 8081 Connected 2023-05-22T02:07:53Z 19m +vald-01 mirror-target-17825710563723389324 vald-mirror-gateway.vald-03.svc.cluster.local 8081 Connected 2023-05-22T02:07:53Z 19m +``` + +
    + +## Run Example Code + +In this chapter, you will execute insert, search, get, and delete vectors to your Vald clusters using the example code. + +The [Fashion-MNIST](https://github.com/zalandoresearch/fashion-mnist) is used as a dataset for indexing and search query. + +The example code is implemented in Go and uses [vald-client-go](https://github.com/vdaas/vald-client-go), one of the official Vald client libraries, for requesting to Vald cluster. + +Vald provides multiple language client libraries such as Go, Java, Node.js, Python, etc. + +If you are interested, please refer to [SDKs](https://vald.vdaas.org/docs/user-guides/sdks). + +1. Port Forward(option) + + If you do NOT use Kubernetes Ingress, port forwarding is required to make requests from your local environment. + + ```bash + kubectl port-forward svc/vald-mirror-gateway 8080:8081 -n vald-01 & \ + kubectl port-forward svc/vald-mirror-gateway 8081:8081 -n vald-02 & \ + kubectl port-forward svc/vald-mirror-gateway 8082:8081 -n vald-03 + ``` + +2. Download dataset + + Move to the working directory. + + ```bash + cd example/client/mirror + ``` + + Download [Fashion-MNIST](https://github.com/zalandoresearch/fashion-mnist), which is used as a dataset for indexing and search query. + + ```bash + wget https://ann-benchmarks.com/fashion-mnist-784-euclidean.hdf5 + ``` + +3. Run Example + + We use [example/client/mirror/main.go](https://github.com/vdaas/vald/blob/feature/mirror-gateway-example/example/client/mirror/main.go) to run the example. + + This example will insert and index 400 vectors into the Vald cluster from the Fashion-MNIST dataset via [gRPC](https://grpc.io/). + And then, after waiting for indexing, it will request to search the nearest vector 10 times to all Vald clusters. You will get the 10 nearest neighbor vectors for each search query. + And it will request to get vectors using inserted vector ID. + + Run example codes by executing the below command. + + ```bash + go run main.go + ``` + + See [GetStarted](https://vald.vdaas.org/docs/tutorial/get-started/) for an explanation of the example code. + +## Cleanup + +Last, you can remove the deployed Vald cluster by executing the below command. + +```bash +helm uninstall vald-cluster-01 -n vald-01 && \ +helm uninstall vald-cluster-02 -n vald-02 && \ +helm uninstall vald-cluster-03 -n vald-03 +``` + +You can remove all `ValdMirrorTarget` resources (Custom Resource) with the below command. + +```bash +kubectl delete --all ValdMirrorTargets -A +``` + +You can remove all created Namespaces with the below command. + +```bash +kubectl delete namespaces vald-01 vald-02 vald-03 +``` + +## Next Steps + +Congratulation! +You completely entered the World of multiple Vald clusters! + +For more information, we recommend you check the following: + +- [Configuration](https://vald.vdaas.org/docs/user-guides/configuration/) +- [Mirror Configuration](https://vald.vdaas.org/docs/user-guides/mirroring-configuration/) +- [Network Policy](https://vald.vdaas.org/docs/user-guides/network-policy/) diff --git a/docs/user-guides/cluster-role-binding.md b/docs/user-guides/cluster-role-binding.md index 3ade19d6d6..36404ec157 100644 --- a/docs/user-guides/cluster-role-binding.md +++ b/docs/user-guides/cluster-role-binding.md @@ -133,6 +133,105 @@ If you disable these configurations, the Vald Discoverer will not work, and the If you want to modify or disable these configurations, you need to grant the [cluster role configuration](https://github.com/vdaas/vald/blob/main/k8s/discoverer/clusterrole.yaml) and bind it to the Vald Discoverer to retrieve required information to operate the Vald cluster. +## Configuration for Vald Mirror Gateway + +The Vald Mirror Gateway requires configuration on cluster role and cluster role binding to create/update/retrive [ValdMirrorTarget](https://vald.vdaas.org/docs/user-guides/mirroring-configuration/) resource from the Kubernetes Cluster. + +In this section, we will describe how to configure it and how to customize these configurations. + +### Cluster role configuration for Vald Mirror Gateway + +By looking at the [cluster role configuration](https://github.com/vdaas/vald/blob/main/k8s/gatewat/mirror/clusterrole.yaml), the access right of the following resources are granted to the cluster role `gateway-mirror`. + +```yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: gateway-mirror +--- +rules: + - apiGroups: + - vald.vdaas.org + resources: + - valdmirrortargets + verbs: + - create + - update + - delete + - get + - list + - watch + - patch + - apiGroups: + - vald.vdaas.org + resources: + - valdmirrortargets/status + verbs: + - create + - update + - get + - list + - patch + - apiGroups: + - vald.vdaas.org + resources: + - valdmirrortargets/finalizers + verbs: + - update +``` + +### Cluster role binding configuration for Vald Mirror Gateway + +The cluster role binding configuration binds the cluster role `gateway-mirror` described in the previous section to the service account `gateway-mirror` according to the [configuration file](https://github.com/vdaas/vald/blob/main/k8s/gateway/mirror/clusterrolebinding.yaml). + +```yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: gateway-mirror + ... +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: gateway-mirror +subjects: + - kind: ServiceAccount + name: gateway-mirror + namespace: default +``` + +When the role binds to the service account, the access right of the role will be granted to the service account. +In this case, all the access rights of the role `gateway-mirror` will be granted to the service account `gateway-mirror`. + +### Customize cluster role and cluster role binding configuration on Helm chart for Vald Mirror Gateway + +To customize the cluster role configuration on the Helm chart for Vald Mirror Gateway, you may need to change the `gateway.mirror.clusterRole` configuration on the Helm chart file. The cluster role configurations are enabled by default. + +```yaml +gateway: + mirror: + --- + clusterRole: + # gateway.mirror.clusterRole.enabled -- creates clusterRole resource + enabled: true + # gateway.mirror.clusterRole.name -- name of clusterRole + name: gateway-mirror + clusterRoleBinding: + # gateway.mirror.clusterRoleBinding.enabled -- creates clusterRoleBinding resource + enabled: true + # gateway.mirror..clusterRoleBinding.name -- name of clusterRoleBinding + name: gateway-mirror + serviceAccount: + # gateway.mirror.serviceAccount.enabled -- creates service account + enabled: true + # gateway.mirror.serviceAccount.name -- name of service account + name: gateway-mirror +``` + +
    +If you disable these configurations, the Vald Mirror Gateway will not work properly. +
    + ## Customize cluster role configuration on Cloud Providers Please refer to the official guidelines to configure cluster role configuration for your cloud provider, and configure the service account name for Vald Discoverer. diff --git a/docs/user-guides/mirroring-configuration.md b/docs/user-guides/mirroring-configuration.md new file mode 100644 index 0000000000..4b30e04b2c --- /dev/null +++ b/docs/user-guides/mirroring-configuration.md @@ -0,0 +1,89 @@ +# Mirror Configuration + +This page describes how to enable mirroring features on the Vald cluster. + +Before you use the mirroring functions, please look at [the Vald Mirror Gateway document](../../docs/overview/component/mirror-gateway.md) for what you can do. + +## Requirement + +- Vald version: v1.8 +- The number of Vald clusters: 2~ + +## Configuration + +This chapter shows how to configure values.yaml to enable Vald Mirror Gateway and how to interconnect Vald Mirror Gateways. + +The setting points are the followings: + +1. Enable the Vald Mirror Gateway using Helm values configuration +2. Interconnect Vald Mirror Gateways using the Custom Resource configuration + +### Helm Values Configuration + +The Helm values configuration is required for each Vald cluster to be deployed. + +It is easy to enable the mirroring feature. + +```yaml +--- +gateway: + mirror: + enabled: true +``` + +If you want to make more detailed settings, please set the following parameters. + +```yaml +gateway: + mirror: + ... + gateway_config: + ... + # gRPC client configuration (overrides defaults.grpc.client) + client: {} + # The interval to advertise addresses of Mirror Gateway to other Mirror Gateway. + advertise_interval: "1s" + # The target namespace to discover ValdMirrorTarget (CR) resource. + # The default value is its own namespace. + namespace: "vald" + # The group name of the Mirror Gateways (optional). + # It is used to discover ValdMirrorTarget resources (CR) with the same group name. + # The default value is empty. + group: "group1" + # The duration to discover other mirror gateways in the same group. + discovery_duration: 1s + # The colocation name of the data center (optional). + colocation: "dc1" +``` + +The cluster role configuration is required when you deploy Vald clusters with Vald Mirror Gateway on multiple Namespaces in the Kubernetes cluster. + +Please refer to [Cluster Role Configuration](https://vald.vdaas.org/docs/user-guides/cluster-role-binding/) about cluster role settings for Mirror Gateway. + +### Custom Resource Configuration + +The Mirror Gateway is not connected to other mirror gateways when deployed. + +The Vald Mirror Gateway connects to another Mirror Gateway component specified in the `ValdMirrorTarget` resource (Custom Resource). + +Based on this resource, if the connection succeeds, the Mirror Gateway will interconnect with another. + +```yaml +apiVersion: vald.vdaas.org/v1 +kind: ValdMirrorTarget +metadata: + name: mirror-target-01 + namespace: vald-03 + labels: + # The group name of the Mirror Gateways. + group: mirror-group-01 +spec: + # Colocation name. (optional) + colocation: dc1 + # The connection target to another mirror gateway. + target: + # The hostname. + host: vald-mirror-gateway.vald-01.svc.cluster.local + # The port number + port: 8081 +``` From 9d408248ee35f998a58705eea2285dde46d8ba87 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 15 Aug 2023 15:45:41 +0900 Subject: [PATCH 11/93] merge ingress configuration for lb and filter Signed-off-by: hlts2 --- charts/vald/templates/gateway/filter/ing.yaml | 3 +-- charts/vald/templates/gateway/lb/ing.yaml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/charts/vald/templates/gateway/filter/ing.yaml b/charts/vald/templates/gateway/filter/ing.yaml index f540bc50bd..41cd8f7742 100644 --- a/charts/vald/templates/gateway/filter/ing.yaml +++ b/charts/vald/templates/gateway/filter/ing.yaml @@ -14,10 +14,9 @@ # limitations under the License. # {{- $gateway := .Values.gateway.filter -}} -{{- if and $gateway.enabled $gateway.ingress.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} {{- $mgateway := .Values.gateway.mirror -}} {{- if and $gateway.enabled $gateway.ingress.enabled (not $mgateway.enabled) }} +{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} apiVersion: networking.k8s.io/v1 {{- else }} apiVersion: networking.k8s.io/v1alpha1 diff --git a/charts/vald/templates/gateway/lb/ing.yaml b/charts/vald/templates/gateway/lb/ing.yaml index 6f213f1cb9..63869d77a5 100644 --- a/charts/vald/templates/gateway/lb/ing.yaml +++ b/charts/vald/templates/gateway/lb/ing.yaml @@ -14,10 +14,9 @@ # limitations under the License. # {{- $gateway := .Values.gateway.lb -}} -{{- if and $gateway.enabled $gateway.ingress.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} {{- $mgateway := .Values.gateway.mirror -}} {{- if and $gateway.enabled $gateway.ingress.enabled (not $mgateway.enabled) }} +{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} apiVersion: networking.k8s.io/v1 {{- else }} apiVersion: networking.k8s.io/v1alpha1 From 7e4c2c7913b09f666b63fa3bf09bac4bbb2e4265 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 15 Aug 2023 16:01:03 +0900 Subject: [PATCH 12/93] fix duplicate definition error Signed-off-by: hlts2 --- apis/grpc/v1/vald/vald.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/apis/grpc/v1/vald/vald.go b/apis/grpc/v1/vald/vald.go index e93a49560c..77e88a1544 100644 --- a/apis/grpc/v1/vald/vald.go +++ b/apis/grpc/v1/vald/vald.go @@ -142,9 +142,6 @@ const ( GetObjectRPCName = "GetObject" StreamGetObjectRPCName = "StreamGetObject" StreamListObjectRPCName = "StreamListObject" - ExistsRPCName = "Exists" - GetObjectRPCName = "GetObject" - StreamGetObjectRPCName = "StreamGetObject" RegisterRPCName = "Register" AdvertiseRPCName = "Advertise" From bd35400c79b5e8267a6e6c21c9dd6dba23b9b164 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 15 Aug 2023 16:03:12 +0900 Subject: [PATCH 13/93] make proto/all & make schema update & make format Signed-off-by: hlts2 --- apis/grpc/v1/mirror/mirror.pb.go | 4 +- .../vald-helm-operator/crds/valdrelease.yaml | 1056 ++++++++++ charts/vald/crds/valdmirrortarget.yaml | 3 - charts/vald/values.schema.json | 1779 +++++++++++++++++ 4 files changed, 2837 insertions(+), 5 deletions(-) diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index a8f248d289..459c51a219 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -16,8 +16,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.3 +// protoc-gen-go v1.31.0 +// protoc v4.23.4 // source: apis/proto/v1/mirror/mirror.proto package mirror diff --git a/charts/vald-helm-operator/crds/valdrelease.yaml b/charts/vald-helm-operator/crds/valdrelease.yaml index 46c151ab94..ec63d9b334 100644 --- a/charts/vald-helm-operator/crds/valdrelease.yaml +++ b/charts/vald-helm-operator/crds/valdrelease.yaml @@ -6014,6 +6014,1062 @@ spec: items: type: object x-kubernetes-preserve-unknown-fields: true + mirror: + type: object + properties: + affinity: + type: object + properties: + nodeAffinity: + type: object + properties: + preferredDuringSchedulingIgnoredDuringExecution: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + requiredDuringSchedulingIgnoredDuringExecution: + type: object + properties: + nodeSelectorTerms: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + podAffinity: + type: object + properties: + preferredDuringSchedulingIgnoredDuringExecution: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + requiredDuringSchedulingIgnoredDuringExecution: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + podAntiAffinity: + type: object + properties: + preferredDuringSchedulingIgnoredDuringExecution: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + requiredDuringSchedulingIgnoredDuringExecution: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + annotations: + type: object + x-kubernetes-preserve-unknown-fields: true + clusterRole: + type: object + properties: + enabled: + type: boolean + name: + type: string + clusterRoleBinding: + type: object + properties: + enabled: + type: boolean + name: + type: string + enabled: + type: boolean + env: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + externalTrafficPolicy: + type: string + gateway_config: + type: object + properties: + advertise_interval: + type: string + client: + type: object + properties: + addrs: + type: array + items: + type: string + backoff: + type: object + properties: + backoff_factor: + type: number + backoff_time_limit: + type: string + enable_error_log: + type: boolean + initial_duration: + type: string + jitter_limit: + type: string + maximum_duration: + type: string + retry_count: + type: integer + call_option: + type: object + x-kubernetes-preserve-unknown-fields: true + circuit_breaker: + type: object + properties: + closed_error_rate: + type: number + closed_refresh_timeout: + type: string + half_open_error_rate: + type: number + min_samples: + type: integer + open_timeout: + type: string + connection_pool: + type: object + properties: + enable_dns_resolver: + type: boolean + enable_rebalance: + type: boolean + old_conn_close_duration: + type: string + rebalance_duration: + type: string + size: + type: integer + dial_option: + type: object + properties: + backoff_base_delay: + type: string + backoff_jitter: + type: number + backoff_max_delay: + type: string + backoff_multiplier: + type: number + enable_backoff: + type: boolean + initial_connection_window_size: + type: integer + initial_window_size: + type: integer + insecure: + type: boolean + interceptors: + type: array + items: + type: string + enum: + - TraceInterceptor + keepalive: + type: object + properties: + permit_without_stream: + type: boolean + time: + type: string + timeout: + type: string + max_msg_size: + type: integer + min_connection_timeout: + type: string + net: + type: object + properties: + dialer: + type: object + properties: + dual_stack_enabled: + type: boolean + keepalive: + type: string + timeout: + type: string + dns: + type: object + properties: + cache_enabled: + type: boolean + cache_expiration: + type: string + refresh_duration: + type: string + socket_option: + type: object + properties: + ip_recover_destination_addr: + type: boolean + ip_transparent: + type: boolean + reuse_addr: + type: boolean + reuse_port: + type: boolean + tcp_cork: + type: boolean + tcp_defer_accept: + type: boolean + tcp_fast_open: + type: boolean + tcp_no_delay: + type: boolean + tcp_quick_ack: + type: boolean + tls: + type: object + properties: + ca: + type: string + cert: + type: string + enabled: + type: boolean + insecure_skip_verify: + type: boolean + key: + type: string + read_buffer_size: + type: integer + timeout: + type: string + write_buffer_size: + type: integer + health_check_duration: + type: string + max_recv_msg_size: + type: integer + max_retry_rpc_buffer_size: + type: integer + max_send_msg_size: + type: integer + tls: + type: object + properties: + ca: + type: string + cert: + type: string + enabled: + type: boolean + insecure_skip_verify: + type: boolean + key: + type: string + wait_for_ready: + type: boolean + colocation: + type: string + discovery_duration: + type: string + gateway_addr: + type: string + group: + type: string + namespace: + type: string + net: + type: object + properties: + dialer: + type: object + properties: + dual_stack_enabled: + type: boolean + keepalive: + type: string + timeout: + type: string + dns: + type: object + properties: + cache_enabled: + type: boolean + cache_expiration: + type: string + refresh_duration: + type: string + socket_option: + type: object + properties: + ip_recover_destination_addr: + type: boolean + ip_transparent: + type: boolean + reuse_addr: + type: boolean + reuse_port: + type: boolean + tcp_cork: + type: boolean + tcp_defer_accept: + type: boolean + tcp_fast_open: + type: boolean + tcp_no_delay: + type: boolean + tcp_quick_ack: + type: boolean + tls: + type: object + properties: + ca: + type: string + cert: + type: string + enabled: + type: boolean + insecure_skip_verify: + type: boolean + key: + type: string + pod_name: + type: string + self_mirror_addr: + type: string + hpa: + type: object + properties: + enabled: + type: boolean + targetCPUUtilizationPercentage: + type: integer + image: + type: object + properties: + pullPolicy: + type: string + enum: + - Always + - Never + - IfNotPresent + repository: + type: string + tag: + type: string + ingress: + type: object + properties: + annotations: + type: object + x-kubernetes-preserve-unknown-fields: true + enabled: + type: boolean + host: + type: string + pathType: + type: string + servicePort: + type: string + initContainers: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + internalTrafficPolicy: + type: string + kind: + type: string + enum: + - Deployment + - DaemonSet + logging: + type: object + properties: + format: + type: string + enum: + - raw + - json + level: + type: string + enum: + - debug + - info + - warn + - error + - fatal + logger: + type: string + enum: + - glg + - zap + maxReplicas: + type: integer + minimum: 0 + maxUnavailable: + type: string + minReplicas: + type: integer + minimum: 0 + name: + type: string + nodeName: + type: string + nodeSelector: + type: object + x-kubernetes-preserve-unknown-fields: true + observability: + type: object + properties: + enabled: + type: boolean + metrics: + type: object + properties: + enable_cgo: + type: boolean + enable_goroutine: + type: boolean + enable_memory: + type: boolean + enable_version_info: + type: boolean + version_info_labels: + type: array + items: + type: string + enum: + - vald_version + - server_name + - git_commit + - build_time + - go_version + - go_os + - go_arch + - cgo_enabled + - ngt_version + - build_cpu_info_flags + otlp: + type: object + properties: + attribute: + type: object + properties: + namespace: + type: string + node_name: + type: string + pod_name: + type: string + service_name: + type: string + collector_endpoint: + type: string + metrics_export_interval: + type: string + metrics_export_timeout: + type: string + trace_batch_timeout: + type: string + trace_export_timeout: + type: string + trace_max_export_batch_size: + type: integer + trace_max_queue_size: + type: integer + trace: + type: object + properties: + enabled: + type: boolean + podAnnotations: + type: object + x-kubernetes-preserve-unknown-fields: true + podPriority: + type: object + properties: + enabled: + type: boolean + value: + type: integer + podSecurityContext: + type: object + x-kubernetes-preserve-unknown-fields: true + progressDeadlineSeconds: + type: integer + resources: + type: object + properties: + limits: + type: object + x-kubernetes-preserve-unknown-fields: true + requests: + type: object + x-kubernetes-preserve-unknown-fields: true + revisionHistoryLimit: + type: integer + minimum: 0 + rollingUpdate: + type: object + properties: + maxSurge: + type: string + maxUnavailable: + type: string + securityContext: + type: object + x-kubernetes-preserve-unknown-fields: true + server_config: + type: object + properties: + full_shutdown_duration: + type: string + healths: + type: object + properties: + liveness: + type: object + properties: + enabled: + type: boolean + host: + type: string + livenessProbe: + type: object + properties: + failureThreshold: + type: integer + httpGet: + type: object + properties: + path: + type: string + port: + type: string + scheme: + type: string + initialDelaySeconds: + type: integer + periodSeconds: + type: integer + successThreshold: + type: integer + timeoutSeconds: + type: integer + port: + type: integer + maximum: 65535 + minimum: 0 + server: + type: object + properties: + http: + type: object + properties: + handler_timeout: + type: string + idle_timeout: + type: string + read_header_timeout: + type: string + read_timeout: + type: string + shutdown_duration: + type: string + write_timeout: + type: string + mode: + type: string + network: + type: string + enum: + - tcp + - tcp4 + - tcp6 + - udp + - udp4 + - udp6 + - unix + - unixgram + - unixpacket + probe_wait_time: + type: string + socket_option: + type: object + properties: + ip_recover_destination_addr: + type: boolean + ip_transparent: + type: boolean + reuse_addr: + type: boolean + reuse_port: + type: boolean + tcp_cork: + type: boolean + tcp_defer_accept: + type: boolean + tcp_fast_open: + type: boolean + tcp_no_delay: + type: boolean + tcp_quick_ack: + type: boolean + socket_path: + type: string + servicePort: + type: integer + maximum: 65535 + minimum: 0 + readiness: + type: object + properties: + enabled: + type: boolean + host: + type: string + port: + type: integer + maximum: 65535 + minimum: 0 + readinessProbe: + type: object + properties: + failureThreshold: + type: integer + httpGet: + type: object + properties: + path: + type: string + port: + type: string + scheme: + type: string + initialDelaySeconds: + type: integer + periodSeconds: + type: integer + successThreshold: + type: integer + timeoutSeconds: + type: integer + server: + type: object + properties: + http: + type: object + properties: + handler_timeout: + type: string + idle_timeout: + type: string + read_header_timeout: + type: string + read_timeout: + type: string + shutdown_duration: + type: string + write_timeout: + type: string + mode: + type: string + network: + type: string + enum: + - tcp + - tcp4 + - tcp6 + - udp + - udp4 + - udp6 + - unix + - unixgram + - unixpacket + probe_wait_time: + type: string + socket_option: + type: object + properties: + ip_recover_destination_addr: + type: boolean + ip_transparent: + type: boolean + reuse_addr: + type: boolean + reuse_port: + type: boolean + tcp_cork: + type: boolean + tcp_defer_accept: + type: boolean + tcp_fast_open: + type: boolean + tcp_no_delay: + type: boolean + tcp_quick_ack: + type: boolean + socket_path: + type: string + servicePort: + type: integer + maximum: 65535 + minimum: 0 + startup: + type: object + properties: + enabled: + type: boolean + port: + type: integer + maximum: 65535 + minimum: 0 + startupProbe: + type: object + properties: + failureThreshold: + type: integer + httpGet: + type: object + properties: + path: + type: string + port: + type: string + scheme: + type: string + initialDelaySeconds: + type: integer + periodSeconds: + type: integer + successThreshold: + type: integer + timeoutSeconds: + type: integer + metrics: + type: object + properties: + pprof: + type: object + properties: + enabled: + type: boolean + host: + type: string + port: + type: integer + maximum: 65535 + minimum: 0 + server: + type: object + properties: + http: + type: object + properties: + handler_timeout: + type: string + idle_timeout: + type: string + read_header_timeout: + type: string + read_timeout: + type: string + shutdown_duration: + type: string + write_timeout: + type: string + mode: + type: string + network: + type: string + enum: + - tcp + - tcp4 + - tcp6 + - udp + - udp4 + - udp6 + - unix + - unixgram + - unixpacket + probe_wait_time: + type: string + socket_option: + type: object + properties: + ip_recover_destination_addr: + type: boolean + ip_transparent: + type: boolean + reuse_addr: + type: boolean + reuse_port: + type: boolean + tcp_cork: + type: boolean + tcp_defer_accept: + type: boolean + tcp_fast_open: + type: boolean + tcp_no_delay: + type: boolean + tcp_quick_ack: + type: boolean + socket_path: + type: string + servicePort: + type: integer + maximum: 65535 + minimum: 0 + servers: + type: object + properties: + grpc: + type: object + properties: + enabled: + type: boolean + host: + type: string + port: + type: integer + maximum: 65535 + minimum: 0 + server: + type: object + properties: + grpc: + type: object + properties: + bidirectional_stream_concurrency: + type: integer + connection_timeout: + type: string + enable_reflection: + type: boolean + header_table_size: + type: integer + initial_conn_window_size: + type: integer + initial_window_size: + type: integer + interceptors: + type: array + items: + type: string + enum: + - RecoverInterceptor + - AccessLogInterceptor + - TraceInterceptor + - MetricInterceptor + keepalive: + type: object + properties: + max_conn_age: + type: string + max_conn_age_grace: + type: string + max_conn_idle: + type: string + min_time: + type: string + permit_without_stream: + type: boolean + time: + type: string + timeout: + type: string + max_header_list_size: + type: integer + max_receive_message_size: + type: integer + max_send_message_size: + type: integer + read_buffer_size: + type: integer + write_buffer_size: + type: integer + mode: + type: string + network: + type: string + enum: + - tcp + - tcp4 + - tcp6 + - udp + - udp4 + - udp6 + - unix + - unixgram + - unixpacket + probe_wait_time: + type: string + restart: + type: boolean + socket_option: + type: object + properties: + ip_recover_destination_addr: + type: boolean + ip_transparent: + type: boolean + reuse_addr: + type: boolean + reuse_port: + type: boolean + tcp_cork: + type: boolean + tcp_defer_accept: + type: boolean + tcp_fast_open: + type: boolean + tcp_no_delay: + type: boolean + tcp_quick_ack: + type: boolean + socket_path: + type: string + servicePort: + type: integer + maximum: 65535 + minimum: 0 + rest: + type: object + properties: + enabled: + type: boolean + host: + type: string + port: + type: integer + maximum: 65535 + minimum: 0 + server: + type: object + properties: + http: + type: object + properties: + handler_timeout: + type: string + idle_timeout: + type: string + read_header_timeout: + type: string + read_timeout: + type: string + shutdown_duration: + type: string + write_timeout: + type: string + mode: + type: string + network: + type: string + enum: + - tcp + - tcp4 + - tcp6 + - udp + - udp4 + - udp6 + - unix + - unixgram + - unixpacket + probe_wait_time: + type: string + socket_option: + type: object + properties: + ip_recover_destination_addr: + type: boolean + ip_transparent: + type: boolean + reuse_addr: + type: boolean + reuse_port: + type: boolean + tcp_cork: + type: boolean + tcp_defer_accept: + type: boolean + tcp_fast_open: + type: boolean + tcp_no_delay: + type: boolean + tcp_quick_ack: + type: boolean + socket_path: + type: string + servicePort: + type: integer + maximum: 65535 + minimum: 0 + tls: + type: object + properties: + ca: + type: string + cert: + type: string + enabled: + type: boolean + insecure_skip_verify: + type: boolean + key: + type: string + service: + type: object + properties: + annotations: + type: object + x-kubernetes-preserve-unknown-fields: true + labels: + type: object + x-kubernetes-preserve-unknown-fields: true + serviceAccount: + type: object + properties: + enabled: + type: boolean + name: + type: string + serviceType: + type: string + enum: + - ClusterIP + - LoadBalancer + - NodePort + terminationGracePeriodSeconds: + type: integer + minimum: 0 + time_zone: + type: string + tolerations: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + topologySpreadConstraints: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + version: + type: string + pattern: ^v[0-9]+\.[0-9]+\.[0-9]$ + volumeMounts: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true + volumes: + type: array + items: + type: object + x-kubernetes-preserve-unknown-fields: true manager: type: object properties: diff --git a/charts/vald/crds/valdmirrortarget.yaml b/charts/vald/crds/valdmirrortarget.yaml index a32a7731a7..5dfbb8ebcf 100644 --- a/charts/vald/crds/valdmirrortarget.yaml +++ b/charts/vald/crds/valdmirrortarget.yaml @@ -83,9 +83,6 @@ spec: spec: type: object properties: - colocation: - type: string - minLength: 1 target: type: object properties: diff --git a/charts/vald/values.schema.json b/charts/vald/values.schema.json index 6afe895d45..e987b81837 100644 --- a/charts/vald/values.schema.json +++ b/charts/vald/values.schema.json @@ -9991,6 +9991,1785 @@ "items": { "type": "object" } } } + }, + "mirror": { + "type": "object", + "properties": { + "affinity": { + "type": "object", + "properties": { + "nodeAffinity": { + "type": "object", + "properties": { + "preferredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "node affinity preferred scheduling terms", + "items": { "type": "object" } + }, + "requiredDuringSchedulingIgnoredDuringExecution": { + "type": "object", + "properties": { + "nodeSelectorTerms": { + "type": "array", + "description": "node affinity required node selectors", + "items": { "type": "object" } + } + } + } + } + }, + "podAffinity": { + "type": "object", + "properties": { + "preferredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "pod affinity preferred scheduling terms", + "items": { "type": "object" } + }, + "requiredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "pod affinity required scheduling terms", + "items": { "type": "object" } + } + } + }, + "podAntiAffinity": { + "type": "object", + "properties": { + "preferredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "pod anti-affinity preferred scheduling terms", + "items": { "type": "object" } + }, + "requiredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "pod anti-affinity required scheduling terms", + "items": { "type": "object" } + } + } + } + } + }, + "annotations": { + "type": "object", + "description": "deployment annotations" + }, + "clusterRole": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "creates clusterRole resource" + }, + "name": { + "type": "string", + "description": "name of clusterRole" + } + } + }, + "clusterRoleBinding": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "creates clusterRoleBinding resource" + }, + "name": { + "type": "string", + "description": "name of clusterRoleBinding" + } + } + }, + "enabled": { "type": "boolean", "description": "gateway enabled" }, + "env": { + "type": "array", + "description": "environment variables", + "items": { "type": "object" } + }, + "externalTrafficPolicy": { + "type": "string", + "description": "external traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local" + }, + "gateway_config": { + "type": "object", + "properties": { + "advertise_interval": { + "type": "string", + "description": "interval to advertise mirror-gateway information to other mirror-gateway." + }, + "client": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "description": "gRPC client addresses", + "items": { "type": "string" } + }, + "backoff": { + "type": "object", + "properties": { + "backoff_factor": { + "type": "number", + "description": "gRPC client backoff factor" + }, + "backoff_time_limit": { + "type": "string", + "description": "gRPC client backoff time limit" + }, + "enable_error_log": { + "type": "boolean", + "description": "gRPC client backoff log enabled" + }, + "initial_duration": { + "type": "string", + "description": "gRPC client backoff initial duration" + }, + "jitter_limit": { + "type": "string", + "description": "gRPC client backoff jitter limit" + }, + "maximum_duration": { + "type": "string", + "description": "gRPC client backoff maximum duration" + }, + "retry_count": { + "type": "integer", + "description": "gRPC client backoff retry count" + } + } + }, + "call_option": { "type": "object" }, + "circuit_breaker": { + "type": "object", + "properties": { + "closed_error_rate": { + "type": "number", + "description": "gRPC client circuitbreaker closed error rate" + }, + "closed_refresh_timeout": { + "type": "string", + "description": "gRPC client circuitbreaker closed refresh timeout" + }, + "half_open_error_rate": { + "type": "number", + "description": "gRPC client circuitbreaker half-open error rate" + }, + "min_samples": { + "type": "integer", + "description": "gRPC client circuitbreaker minimum sampling count" + }, + "open_timeout": { + "type": "string", + "description": "gRPC client circuitbreaker open timeout" + } + } + }, + "connection_pool": { + "type": "object", + "properties": { + "enable_dns_resolver": { + "type": "boolean", + "description": "enables gRPC client connection pool dns resolver, when enabled vald uses ip handshake exclude dns discovery which improves network performance" + }, + "enable_rebalance": { + "type": "boolean", + "description": "enables gRPC client connection pool rebalance" + }, + "old_conn_close_duration": { + "type": "string", + "description": "makes delay before gRPC client connection closing during connection pool rebalance" + }, + "rebalance_duration": { + "type": "string", + "description": "gRPC client connection pool rebalance duration" + }, + "size": { + "type": "integer", + "description": "gRPC client connection pool size" + } + } + }, + "dial_option": { + "type": "object", + "properties": { + "backoff_base_delay": { + "type": "string", + "description": "gRPC client dial option base backoff delay" + }, + "backoff_jitter": { + "type": "number", + "description": "gRPC client dial option base backoff delay" + }, + "backoff_max_delay": { + "type": "string", + "description": "gRPC client dial option max backoff delay" + }, + "backoff_multiplier": { + "type": "number", + "description": "gRPC client dial option base backoff delay" + }, + "enable_backoff": { + "type": "boolean", + "description": "gRPC client dial option backoff enabled" + }, + "initial_connection_window_size": { + "type": "integer", + "description": "gRPC client dial option initial connection window size" + }, + "initial_window_size": { + "type": "integer", + "description": "gRPC client dial option initial window size" + }, + "insecure": { + "type": "boolean", + "description": "gRPC client dial option insecure enabled" + }, + "interceptors": { + "type": "array", + "description": "gRPC client interceptors", + "items": { + "type": "string", + "enum": ["TraceInterceptor"] + } + }, + "keepalive": { + "type": "object", + "properties": { + "permit_without_stream": { + "type": "boolean", + "description": "gRPC client keep alive permit without stream" + }, + "time": { + "type": "string", + "description": "gRPC client keep alive time" + }, + "timeout": { + "type": "string", + "description": "gRPC client keep alive timeout" + } + } + }, + "max_msg_size": { + "type": "integer", + "description": "gRPC client dial option max message size" + }, + "min_connection_timeout": { + "type": "string", + "description": "gRPC client dial option minimum connection timeout" + }, + "net": { + "type": "object", + "properties": { + "dialer": { + "type": "object", + "properties": { + "dual_stack_enabled": { + "type": "boolean", + "description": "gRPC client TCP dialer dual stack enabled" + }, + "keepalive": { + "type": "string", + "description": "gRPC client TCP dialer keep alive" + }, + "timeout": { + "type": "string", + "description": "gRPC client TCP dialer timeout" + } + } + }, + "dns": { + "type": "object", + "properties": { + "cache_enabled": { + "type": "boolean", + "description": "gRPC client TCP DNS cache enabled" + }, + "cache_expiration": { + "type": "string", + "description": "gRPC client TCP DNS cache expiration" + }, + "refresh_duration": { + "type": "string", + "description": "gRPC client TCP DNS cache refresh duration" + } + } + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "tls": { + "type": "object", + "properties": { + "ca": { + "type": "string", + "description": "TLS ca path" + }, + "cert": { + "type": "string", + "description": "TLS cert path" + }, + "enabled": { + "type": "boolean", + "description": "TLS enabled" + }, + "insecure_skip_verify": { + "type": "boolean", + "description": "enable/disable skip SSL certificate verification" + }, + "key": { + "type": "string", + "description": "TLS key path" + } + } + } + } + }, + "read_buffer_size": { + "type": "integer", + "description": "gRPC client dial option read buffer size" + }, + "timeout": { + "type": "string", + "description": "gRPC client dial option timeout" + }, + "write_buffer_size": { + "type": "integer", + "description": "gRPC client dial option write buffer size" + } + } + }, + "health_check_duration": { + "type": "string", + "description": "gRPC client health check duration" + }, + "max_recv_msg_size": { "type": "integer" }, + "max_retry_rpc_buffer_size": { "type": "integer" }, + "max_send_msg_size": { "type": "integer" }, + "tls": { + "type": "object", + "properties": { + "ca": { + "type": "string", + "description": "TLS ca path" + }, + "cert": { + "type": "string", + "description": "TLS cert path" + }, + "enabled": { + "type": "boolean", + "description": "TLS enabled" + }, + "insecure_skip_verify": { + "type": "boolean", + "description": "enable/disable skip SSL certificate verification" + }, + "key": { + "type": "string", + "description": "TLS key path" + } + } + }, + "wait_for_ready": { "type": "boolean" } + } + }, + "colocation": { + "type": "string", + "description": "colocation name" + }, + "discovery_duration": { + "type": "string", + "description": "duration to discovery" + }, + "gateway_addr": { + "type": "string", + "description": "address for lb-gateway" + }, + "group": { + "type": "string", + "description": "mirror group name" + }, + "namespace": { + "type": "string", + "description": "namespace to discovery" + }, + "net": { + "type": "object", + "properties": { + "dialer": { + "type": "object", + "properties": { + "dual_stack_enabled": { + "type": "boolean", + "description": "gRPC client TCP dialer dual stack enabled" + }, + "keepalive": { + "type": "string", + "description": "gRPC client TCP dialer keep alive" + }, + "timeout": { + "type": "string", + "description": "gRPC client TCP dialer timeout" + } + } + }, + "dns": { + "type": "object", + "properties": { + "cache_enabled": { + "type": "boolean", + "description": "gRPC client TCP DNS cache enabled" + }, + "cache_expiration": { + "type": "string", + "description": "gRPC client TCP DNS cache expiration" + }, + "refresh_duration": { + "type": "string", + "description": "gRPC client TCP DNS cache refresh duration" + } + } + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "tls": { + "type": "object", + "properties": { + "ca": { + "type": "string", + "description": "TLS ca path" + }, + "cert": { + "type": "string", + "description": "TLS cert path" + }, + "enabled": { + "type": "boolean", + "description": "TLS enabled" + }, + "insecure_skip_verify": { + "type": "boolean", + "description": "enable/disable skip SSL certificate verification" + }, + "key": { + "type": "string", + "description": "TLS key path" + } + } + } + } + }, + "pod_name": { + "type": "string", + "description": "self mirror gateway pod name" + }, + "self_mirror_addr": { + "type": "string", + "description": "address for self mirror-gateway" + } + } + }, + "hpa": { + "type": "object", + "properties": { + "enabled": { "type": "boolean", "description": "HPA enabled" }, + "targetCPUUtilizationPercentage": { + "type": "integer", + "description": "HPA CPU utilization percentage" + } + } + }, + "image": { + "type": "object", + "properties": { + "pullPolicy": { + "type": "string", + "description": "image pull policy", + "enum": ["Always", "Never", "IfNotPresent"] + }, + "repository": { + "type": "string", + "description": "image repository" + }, + "tag": { + "type": "string", + "description": "image tag (overrides defaults.image.tag)" + } + } + }, + "ingress": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "description": "annotations for ingress" + }, + "enabled": { + "type": "boolean", + "description": "gateway ingress enabled" + }, + "host": { "type": "string", "description": "ingress hostname" }, + "pathType": { + "type": "string", + "description": "gateway ingress pathType" + }, + "servicePort": { + "type": "string", + "description": "service port to be exposed by ingress" + } + } + }, + "initContainers": { + "type": "array", + "description": "init containers", + "items": { "type": "object" } + }, + "internalTrafficPolicy": { + "type": "string", + "description": "internal traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local" + }, + "kind": { + "type": "string", + "description": "deployment kind: Deployment or DaemonSet", + "enum": ["Deployment", "DaemonSet"] + }, + "logging": { + "type": "object", + "properties": { + "format": { + "type": "string", + "description": "logging format. logging format must be `raw` or `json`", + "enum": ["raw", "json"] + }, + "level": { + "type": "string", + "description": "logging level. logging level must be `debug`, `info`, `warn`, `error` or `fatal`.", + "enum": ["debug", "info", "warn", "error", "fatal"] + }, + "logger": { + "type": "string", + "description": "logger name. currently logger must be `glg` or `zap`.", + "enum": ["glg", "zap"] + } + } + }, + "maxReplicas": { + "type": "integer", + "description": "maximum number of replicas. if HPA is disabled, this value will be ignored.", + "minimum": 0 + }, + "maxUnavailable": { + "type": "string", + "description": "maximum number of unavailable replicas" + }, + "minReplicas": { + "type": "integer", + "description": "minimum number of replicas. if HPA is disabled, the replicas will be set to this value", + "minimum": 0 + }, + "name": { + "type": "string", + "description": "name of gateway deployment" + }, + "nodeName": { "type": "string", "description": "node name" }, + "nodeSelector": { + "type": "object", + "description": "node selector" + }, + "observability": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "observability features enabled" + }, + "metrics": { + "type": "object", + "properties": { + "enable_cgo": { + "type": "boolean", + "description": "CGO metrics enabled" + }, + "enable_goroutine": { + "type": "boolean", + "description": "goroutine metrics enabled" + }, + "enable_memory": { + "type": "boolean", + "description": "memory metrics enabled" + }, + "enable_version_info": { + "type": "boolean", + "description": "version info metrics enabled" + }, + "version_info_labels": { + "type": "array", + "description": "enabled label names of version info", + "items": { + "type": "string", + "enum": [ + "vald_version", + "server_name", + "git_commit", + "build_time", + "go_version", + "go_os", + "go_arch", + "cgo_enabled", + "ngt_version", + "build_cpu_info_flags" + ] + } + } + } + }, + "otlp": { + "type": "object", + "properties": { + "attribute": { + "type": "object", + "description": "default resource attribute", + "properties": { + "namespace": { + "type": "string", + "description": "namespace" + }, + "node_name": { + "type": "string", + "description": "node name" + }, + "pod_name": { + "type": "string", + "description": "pod name" + }, + "service_name": { + "type": "string", + "description": "service name" + } + } + }, + "collector_endpoint": { + "type": "string", + "description": "OpenTelemetry Collector endpoint" + }, + "metrics_export_interval": { + "type": "string", + "description": "metrics export interval" + }, + "metrics_export_timeout": { + "type": "string", + "description": "metrics export timeout" + }, + "trace_batch_timeout": { + "type": "string", + "description": "trace batch timeout" + }, + "trace_export_timeout": { + "type": "string", + "description": "trace export timeout" + }, + "trace_max_export_batch_size": { + "type": "integer", + "description": "trace maximum export batch size" + }, + "trace_max_queue_size": { + "type": "integer", + "description": "trace maximum queue size" + } + } + }, + "trace": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "trace enabled" + } + } + } + } + }, + "podAnnotations": { + "type": "object", + "description": "pod annotations" + }, + "podPriority": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "gateway pod PriorityClass enabled" + }, + "value": { + "type": "integer", + "description": "gateway pod PriorityClass value" + } + } + }, + "podSecurityContext": { + "type": "object", + "description": "security context for pod" + }, + "progressDeadlineSeconds": { + "type": "integer", + "description": "progress deadline seconds" + }, + "resources": { + "type": "object", + "description": "compute resources", + "properties": { + "limits": { "type": "object" }, + "requests": { "type": "object" } + } + }, + "revisionHistoryLimit": { + "type": "integer", + "description": "number of old history to retain to allow rollback", + "minimum": 0 + }, + "rollingUpdate": { + "type": "object", + "properties": { + "maxSurge": { + "type": "string", + "description": "max surge of rolling update" + }, + "maxUnavailable": { + "type": "string", + "description": "max unavailable of rolling update" + } + } + }, + "securityContext": { + "type": "object", + "description": "security context for container" + }, + "server_config": { + "type": "object", + "properties": { + "full_shutdown_duration": { + "type": "string", + "description": "server full shutdown duration" + }, + "healths": { + "type": "object", + "properties": { + "liveness": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "liveness server enabled" + }, + "host": { + "type": "string", + "description": "liveness server host" + }, + "livenessProbe": { + "type": "object", + "properties": { + "failureThreshold": { + "type": "integer", + "description": "liveness probe failure threshold" + }, + "httpGet": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "liveness probe path" + }, + "port": { + "type": "string", + "description": "liveness probe port" + }, + "scheme": { + "type": "string", + "description": "liveness probe scheme" + } + } + }, + "initialDelaySeconds": { + "type": "integer", + "description": "liveness probe initial delay seconds" + }, + "periodSeconds": { + "type": "integer", + "description": "liveness probe period seconds" + }, + "successThreshold": { + "type": "integer", + "description": "liveness probe success threshold" + }, + "timeoutSeconds": { + "type": "integer", + "description": "liveness probe timeout seconds" + } + } + }, + "port": { + "type": "integer", + "description": "liveness server port", + "maximum": 65535, + "minimum": 0 + }, + "server": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } + }, + "mode": { + "type": "string", + "description": "REST server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "liveness server service port", + "maximum": 65535, + "minimum": 0 + } + } + }, + "readiness": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "readiness server enabled" + }, + "host": { + "type": "string", + "description": "readiness server host" + }, + "port": { + "type": "integer", + "description": "readiness server port", + "maximum": 65535, + "minimum": 0 + }, + "readinessProbe": { + "type": "object", + "properties": { + "failureThreshold": { + "type": "integer", + "description": "readiness probe failure threshold" + }, + "httpGet": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "readiness probe path" + }, + "port": { + "type": "string", + "description": "readiness probe port" + }, + "scheme": { + "type": "string", + "description": "readiness probe scheme" + } + } + }, + "initialDelaySeconds": { + "type": "integer", + "description": "readiness probe initial delay seconds" + }, + "periodSeconds": { + "type": "integer", + "description": "readiness probe period seconds" + }, + "successThreshold": { + "type": "integer", + "description": "readiness probe success threshold" + }, + "timeoutSeconds": { + "type": "integer", + "description": "readiness probe timeout seconds" + } + } + }, + "server": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } + }, + "mode": { + "type": "string", + "description": "REST server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "readiness server service port", + "maximum": 65535, + "minimum": 0 + } + } + }, + "startup": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "startup server enabled" + }, + "port": { + "type": "integer", + "description": "startup server port", + "maximum": 65535, + "minimum": 0 + }, + "startupProbe": { + "type": "object", + "properties": { + "failureThreshold": { + "type": "integer", + "description": "startup probe failure threshold" + }, + "httpGet": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "startup probe path" + }, + "port": { + "type": "string", + "description": "startup probe port" + }, + "scheme": { + "type": "string", + "description": "startup probe scheme" + } + } + }, + "initialDelaySeconds": { + "type": "integer", + "description": "startup probe initial delay seconds" + }, + "periodSeconds": { + "type": "integer", + "description": "startup probe period seconds" + }, + "successThreshold": { + "type": "integer", + "description": "startup probe success threshold" + }, + "timeoutSeconds": { + "type": "integer", + "description": "startup probe timeout seconds" + } + } + } + } + } + } + }, + "metrics": { + "type": "object", + "properties": { + "pprof": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "pprof server enabled" + }, + "host": { + "type": "string", + "description": "pprof server host" + }, + "port": { + "type": "integer", + "description": "pprof server port", + "maximum": 65535, + "minimum": 0 + }, + "server": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } + }, + "mode": { + "type": "string", + "description": "REST server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "pprof server service port", + "maximum": 65535, + "minimum": 0 + } + } + } + } + }, + "servers": { + "type": "object", + "properties": { + "grpc": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "gRPC server enabled" + }, + "host": { + "type": "string", + "description": "gRPC server host" + }, + "port": { + "type": "integer", + "description": "gRPC server port", + "maximum": 65535, + "minimum": 0 + }, + "server": { + "type": "object", + "properties": { + "grpc": { + "type": "object", + "properties": { + "bidirectional_stream_concurrency": { + "type": "integer", + "description": "gRPC server bidirectional stream concurrency" + }, + "connection_timeout": { + "type": "string", + "description": "gRPC server connection timeout" + }, + "enable_reflection": { + "type": "boolean", + "description": "gRPC server reflection option" + }, + "header_table_size": { + "type": "integer", + "description": "gRPC server header table size" + }, + "initial_conn_window_size": { + "type": "integer", + "description": "gRPC server initial connection window size" + }, + "initial_window_size": { + "type": "integer", + "description": "gRPC server initial window size" + }, + "interceptors": { + "type": "array", + "description": "gRPC server interceptors", + "items": { + "type": "string", + "enum": [ + "RecoverInterceptor", + "AccessLogInterceptor", + "TraceInterceptor", + "MetricInterceptor" + ] + } + }, + "keepalive": { + "type": "object", + "properties": { + "max_conn_age": { + "type": "string", + "description": "gRPC server keep alive max connection age" + }, + "max_conn_age_grace": { + "type": "string", + "description": "gRPC server keep alive max connection age grace" + }, + "max_conn_idle": { + "type": "string", + "description": "gRPC server keep alive max connection idle" + }, + "min_time": { + "type": "string", + "description": "gRPC server keep alive min_time" + }, + "permit_without_stream": { + "type": "boolean", + "description": "gRPC server keep alive permit_without_stream" + }, + "time": { + "type": "string", + "description": "gRPC server keep alive time" + }, + "timeout": { + "type": "string", + "description": "gRPC server keep alive timeout" + } + } + }, + "max_header_list_size": { + "type": "integer", + "description": "gRPC server max header list size" + }, + "max_receive_message_size": { + "type": "integer", + "description": "gRPC server max receive message size" + }, + "max_send_message_size": { + "type": "integer", + "description": "gRPC server max send message size" + }, + "read_buffer_size": { + "type": "integer", + "description": "gRPC server read buffer size" + }, + "write_buffer_size": { + "type": "integer", + "description": "gRPC server write buffer size" + } + } + }, + "mode": { + "type": "string", + "description": "gRPC server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "gRPC server probe wait time" + }, + "restart": { + "type": "boolean", + "description": "gRPC server restart" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "gRPC server service port", + "maximum": 65535, + "minimum": 0 + } + } + }, + "rest": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "REST server enabled" + }, + "host": { + "type": "string", + "description": "REST server host" + }, + "port": { + "type": "integer", + "description": "REST server port", + "maximum": 65535, + "minimum": 0 + }, + "server": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } + }, + "mode": { + "type": "string", + "description": "REST server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "REST server service port", + "maximum": 65535, + "minimum": 0 + } + } + } + } + }, + "tls": { + "type": "object", + "properties": { + "ca": { "type": "string", "description": "TLS ca path" }, + "cert": { + "type": "string", + "description": "TLS cert path" + }, + "enabled": { + "type": "boolean", + "description": "TLS enabled" + }, + "insecure_skip_verify": { + "type": "boolean", + "description": "enable/disable skip SSL certificate verification" + }, + "key": { "type": "string", "description": "TLS key path" } + } + } + } + }, + "service": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "description": "service annotations" + }, + "labels": { "type": "object", "description": "service labels" } + } + }, + "serviceAccount": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "creates service account" + }, + "name": { + "type": "string", + "description": "name of service account" + } + } + }, + "serviceType": { + "type": "string", + "description": "service type: ClusterIP, LoadBalancer or NodePort", + "enum": ["ClusterIP", "LoadBalancer", "NodePort"] + }, + "terminationGracePeriodSeconds": { + "type": "integer", + "description": "duration in seconds pod needs to terminate gracefully", + "minimum": 0 + }, + "time_zone": { "type": "string", "description": "Time zone" }, + "tolerations": { + "type": "array", + "description": "tolerations", + "items": { "type": "object" } + }, + "topologySpreadConstraints": { + "type": "array", + "description": "topology spread constraints of gateway pods", + "items": { "type": "object" } + }, + "version": { + "type": "string", + "description": "version of gateway config", + "pattern": "^v[0-9]+\\.[0-9]+\\.[0-9]$" + }, + "volumeMounts": { + "type": "array", + "description": "volume mounts", + "items": { "type": "object" } + }, + "volumes": { + "type": "array", + "description": "volumes", + "items": { "type": "object" } + } + } } } }, From 9fd7fa24a236c5bfde8c5d24ab9f10a6c81ff6a1 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 15 Aug 2023 17:48:53 +0900 Subject: [PATCH 14/93] fix test execution error for mirror handler Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/mock_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/mock_test.go b/pkg/gateway/mirror/handler/grpc/mock_test.go index 74175c0f3a..f37efea6db 100644 --- a/pkg/gateway/mirror/handler/grpc/mock_test.go +++ b/pkg/gateway/mirror/handler/grpc/mock_test.go @@ -52,9 +52,10 @@ type mockClient struct { StreamRemoveFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Remove_StreamRemoveClient, error) MultiRemoveFunc func(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) - ExistsFunc func(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (*payload.Object_ID, error) - GetObjectFunc func(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) - StreamGetObjectFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Object_StreamGetObjectClient, error) + ExistsFunc func(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (*payload.Object_ID, error) + GetObjectFunc func(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) + StreamGetObjectFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Object_StreamGetObjectClient, error) + StreamListObjectFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Object_StreamListObjectClient, error) RegisterFunc func(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) AdvertiseFunc func(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) @@ -168,6 +169,10 @@ func (m *mockClient) StreamGetObject(ctx context.Context, opts ...grpc.CallOptio return m.StreamGetObjectFunc(ctx, opts...) } +func (m *mockClient) StreamListObject(ctx context.Context, in *payload.Object_List_Request, opts ...grpc.CallOption) (vald.Object_StreamListObjectClient, error) { + return m.StreamListObjectFunc(ctx, opts...) +} + func (m *mockClient) Register(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) { return m.RegisterFunc(ctx, in) } From 91ea27584ba6d7aa76a8fac3722a0052c12aea6a Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 21 Sep 2023 11:49:58 +0900 Subject: [PATCH 15/93] make proto/all format and update schema and fails build error Signed-off-by: hlts2 --- .../dockers-gateway-mirror-image.yaml | 2 +- apis/docs/v1/docs.md | 64 ++ apis/grpc/v1/agent/core/agent.pb.go | 2 +- apis/grpc/v1/agent/sidecar/sidecar.pb.go | 2 +- apis/grpc/v1/discoverer/discoverer.pb.go | 2 +- .../grpc/v1/filter/egress/egress_filter.pb.go | 2 +- .../v1/filter/ingress/ingress_filter.pb.go | 2 +- .../grpc/v1/manager/index/index_manager.pb.go | 2 +- apis/grpc/v1/mirror/mirror.pb.go | 2 +- apis/grpc/v1/mirror/mirror_vtproto.pb.go | 2 +- apis/grpc/v1/payload/payload.pb.go | 880 +++++++++++------- .../v1/rpc/errdetails/error_details.pb.go | 2 +- apis/grpc/v1/vald/filter.pb.go | 2 +- apis/grpc/v1/vald/insert.pb.go | 2 +- apis/grpc/v1/vald/object.pb.go | 2 +- apis/grpc/v1/vald/remove.pb.go | 2 +- apis/grpc/v1/vald/search.pb.go | 2 +- apis/grpc/v1/vald/update.pb.go | 2 +- apis/grpc/v1/vald/upsert.pb.go | 2 +- apis/proto/v1/mirror/mirror.proto | 2 +- .../proto/v1/agent/core/agent.swagger.json | 2 +- .../v1/discoverer/discoverer.swagger.json | 2 +- .../filter/egress/egress_filter.swagger.json | 2 +- .../ingress/ingress_filter.swagger.json | 2 +- .../manager/index/index_manager.swagger.json | 2 +- .../proto/v1/payload/payload.swagger.json | 2 +- .../apis/proto/v1/vald/filter.swagger.json | 2 +- .../apis/proto/v1/vald/insert.swagger.json | 2 +- .../apis/proto/v1/vald/object.swagger.json | 2 +- .../apis/proto/v1/vald/remove.swagger.json | 2 +- .../apis/proto/v1/vald/search.swagger.json | 2 +- .../apis/proto/v1/vald/update.swagger.json | 2 +- .../apis/proto/v1/vald/upsert.swagger.json | 2 +- charts/vald/crds/valdmirrortarget.yaml | 2 +- charts/vald/schemas/mirror-target-values.yaml | 2 +- .../templates/gateway/mirror/clusterrole.yaml | 2 +- .../gateway/mirror/clusterrolebinding.yaml | 2 +- .../templates/gateway/mirror/configmap.yaml | 2 +- .../templates/gateway/mirror/daemonset.yaml | 2 +- .../templates/gateway/mirror/deployment.yaml | 2 +- charts/vald/templates/gateway/mirror/hpa.yaml | 2 +- charts/vald/templates/gateway/mirror/ing.yaml | 2 +- charts/vald/templates/gateway/mirror/pdb.yaml | 2 +- .../gateway/mirror/priorityclass.yaml | 2 +- .../gateway/mirror/serviceaccount.yaml | 2 +- charts/vald/templates/gateway/mirror/svc.yaml | 2 +- .../vald/values/multi-vald/dev-vald-01.yaml | 2 +- .../vald/values/multi-vald/dev-vald-02.yaml | 2 +- .../vald/values/multi-vald/dev-vald-03.yaml | 2 +- .../multi-vald/dev-vald-with-mirror.yaml | 2 +- .../vald/values/multi-vald/mirror-target.yaml | 2 +- cmd/gateway/mirror/main.go | 2 +- cmd/gateway/mirror/sample.yaml | 2 +- dockers/gateway/mirror/Dockerfile | 2 +- example/client/mirror/main.go | 2 +- internal/client/v1/client/mirror/mirror.go | 2 +- internal/client/v1/client/mirror/option.go | 2 +- internal/config/mirror.go | 2 +- .../k8s/vald/mirror/api/v1/target_types.go | 2 +- internal/k8s/vald/mirror/target/option.go | 2 +- internal/k8s/vald/mirror/target/target.go | 2 +- .../k8s/vald/mirror/target/target_template.go | 2 +- .../mirror/target/target_template_option.go | 2 +- internal/net/grpc/metadata.go | 2 +- .../metrics/gateway/mirror/mirror.go | 2 +- pkg/gateway/mirror/config/config.go | 2 +- pkg/gateway/mirror/handler/doc.go | 2 +- pkg/gateway/mirror/handler/grpc/handler.go | 4 +- .../mirror/handler/grpc/handler_test.go | 4 +- pkg/gateway/mirror/handler/grpc/mock_test.go | 13 +- pkg/gateway/mirror/handler/grpc/option.go | 4 +- pkg/gateway/mirror/handler/rest/handler.go | 2 +- pkg/gateway/mirror/handler/rest/option.go | 2 +- pkg/gateway/mirror/router/option.go | 2 +- pkg/gateway/mirror/router/router.go | 2 +- pkg/gateway/mirror/service/discovery.go | 4 +- .../mirror/service/discovery_option.go | 4 +- pkg/gateway/mirror/service/doc.go | 2 +- pkg/gateway/mirror/service/gateway.go | 4 +- pkg/gateway/mirror/service/mirror.go | 4 +- pkg/gateway/mirror/service/mirror_option.go | 4 +- pkg/gateway/mirror/service/option.go | 4 +- pkg/gateway/mirror/usecase/vald.go | 4 +- 83 files changed, 700 insertions(+), 437 deletions(-) diff --git a/.github/workflows/dockers-gateway-mirror-image.yaml b/.github/workflows/dockers-gateway-mirror-image.yaml index b95c98b86b..bf11d33a0f 100644 --- a/.github/workflows/dockers-gateway-mirror-image.yaml +++ b/.github/workflows/dockers-gateway-mirror-image.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index f918850f3a..165c28eb5f 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -45,6 +45,9 @@ - [Insert.MultiRequest](#payload-v1-Insert-MultiRequest) - [Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) - [Insert.Request](#payload-v1-Insert-Request) + - [Mirror](#payload-v1-Mirror) + - [Mirror.Target](#payload-v1-Mirror-Target) + - [Mirror.Targets](#payload-v1-Mirror-Targets) - [Object](#payload-v1-Object) - [Object.Blob](#payload-v1-Object-Blob) - [Object.Distance](#payload-v1-Object-Distance) @@ -92,6 +95,7 @@ - [Upsert.MultiRequest](#payload-v1-Upsert-MultiRequest) - [Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) - [Upsert.Request](#payload-v1-Upsert-Request) + - [Remove.Timestamp.Operator](#payload-v1-Remove-Timestamp-Operator) - [Search.AggregationAlgorithm](#payload-v1-Search-AggregationAlgorithm) @@ -125,6 +129,8 @@ - [RequestInfo](#rpc-v1-RequestInfo) - [ResourceInfo](#rpc-v1-ResourceInfo) - [RetryInfo](#rpc-v1-RetryInfo) +- [apis/proto/v1/mirror/mirror.proto](#apis_proto_v1_mirror_mirror-proto) + - [Mirror](#mirror-v1-Mirror) - [Scalar Value Types](#scalar-value-types)
    @@ -498,6 +504,33 @@ Represent the insert request. | vector | [Object.Vector](#payload-v1-Object-Vector) | | The vector to be inserted. | | config | [Insert.Config](#payload-v1-Insert-Config) | | The configuration of the insert request. | + + +### Mirror + +Mirror related messages. + + + +### Mirror.Target + +Represent server information. + +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | -------------------- | +| host | [string](#string) | | The target hostname. | +| port | [uint32](#uint32) | | The target port. | + + + +### Mirror.Targets + +Represent the multiple Target message. + +| Field | Type | Label | Description | +| ------- | ------------------------------------------ | -------- | -------------------------------- | +| targets | [Mirror.Target](#payload-v1-Mirror-Target) | repeated | The multiple target information. | + ### Object @@ -1398,6 +1431,37 @@ reached. | ----------- | ----------------------------------------------------- | ----- | ------------------------------------------------------------------------- | | retry_delay | [google.protobuf.Duration](#google-protobuf-Duration) | | Clients should wait at least this long between retrying the same request. | + + +

    Top

    + +## apis/proto/v1/mirror/mirror.proto + +Copyright (C) 2019-2023 vdaas.org vald team <vald@vdaas.org> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + + +### Mirror + +Represent the mirror service. + +| Method Name | Request Type | Response Type | Description | +| ----------- | -------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------- | +| Register | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Register is the RPC to register other mirror servers. | +| Advertise | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Advertise is the RPC to advertise other mirror servers. | + ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/apis/grpc/v1/agent/core/agent.pb.go b/apis/grpc/v1/agent/core/agent.pb.go index 32c9b8bdde..9774d6fc08 100644 --- a/apis/grpc/v1/agent/core/agent.pb.go +++ b/apis/grpc/v1/agent/core/agent.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/agent/core/agent.proto package core diff --git a/apis/grpc/v1/agent/sidecar/sidecar.pb.go b/apis/grpc/v1/agent/sidecar/sidecar.pb.go index b57c953493..1be4b3adee 100644 --- a/apis/grpc/v1/agent/sidecar/sidecar.pb.go +++ b/apis/grpc/v1/agent/sidecar/sidecar.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/agent/sidecar/sidecar.proto package sidecar diff --git a/apis/grpc/v1/discoverer/discoverer.pb.go b/apis/grpc/v1/discoverer/discoverer.pb.go index 418840fd98..5e39492195 100644 --- a/apis/grpc/v1/discoverer/discoverer.pb.go +++ b/apis/grpc/v1/discoverer/discoverer.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/discoverer/discoverer.proto 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 79f6e822d1..79ac61a5c7 100644 --- a/apis/grpc/v1/filter/egress/egress_filter.pb.go +++ b/apis/grpc/v1/filter/egress/egress_filter.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/filter/egress/egress_filter.proto 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 18526b743b..1a94009065 100644 --- a/apis/grpc/v1/filter/ingress/ingress_filter.pb.go +++ b/apis/grpc/v1/filter/ingress/ingress_filter.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/filter/ingress/ingress_filter.proto 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 d7305ab0b7..785a6d43b4 100644 --- a/apis/grpc/v1/manager/index/index_manager.pb.go +++ b/apis/grpc/v1/manager/index/index_manager.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/manager/index/index_manager.proto package index diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index 459c51a219..05a460667c 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -2,7 +2,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/apis/grpc/v1/mirror/mirror_vtproto.pb.go b/apis/grpc/v1/mirror/mirror_vtproto.pb.go index d07e0eab6d..50c5f167c2 100644 --- a/apis/grpc/v1/mirror/mirror_vtproto.pb.go +++ b/apis/grpc/v1/mirror/mirror_vtproto.pb.go @@ -2,7 +2,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index 785d4402be..53e0060064 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/payload/payload.proto package payload @@ -545,6 +545,45 @@ func (*Info) Descriptor() ([]byte, []int) { return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{9} } +// Mirror related messages. +type Mirror struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Mirror) Reset() { + *x = Mirror{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror) ProtoMessage() {} + +func (x *Mirror) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + 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 Mirror.ProtoReflect.Descriptor instead. +func (*Mirror) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10} +} + // Represent an empty message. type Empty struct { state protoimpl.MessageState @@ -555,7 +594,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -568,7 +607,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -581,7 +620,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10} + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{11} } // Represent a search request. @@ -599,7 +638,7 @@ type Search_Request struct { func (x *Search_Request) Reset() { *x = Search_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -612,7 +651,7 @@ func (x *Search_Request) String() string { func (*Search_Request) ProtoMessage() {} func (x *Search_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -655,7 +694,7 @@ type Search_MultiRequest struct { func (x *Search_MultiRequest) Reset() { *x = Search_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -668,7 +707,7 @@ func (x *Search_MultiRequest) String() string { func (*Search_MultiRequest) ProtoMessage() {} func (x *Search_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -706,7 +745,7 @@ type Search_IDRequest struct { func (x *Search_IDRequest) Reset() { *x = Search_IDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -719,7 +758,7 @@ func (x *Search_IDRequest) String() string { func (*Search_IDRequest) ProtoMessage() {} func (x *Search_IDRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -762,7 +801,7 @@ type Search_MultiIDRequest struct { func (x *Search_MultiIDRequest) Reset() { *x = Search_MultiIDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -775,7 +814,7 @@ func (x *Search_MultiIDRequest) String() string { func (*Search_MultiIDRequest) ProtoMessage() {} func (x *Search_MultiIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -815,7 +854,7 @@ type Search_ObjectRequest struct { func (x *Search_ObjectRequest) Reset() { *x = Search_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -828,7 +867,7 @@ func (x *Search_ObjectRequest) String() string { func (*Search_ObjectRequest) ProtoMessage() {} func (x *Search_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -878,7 +917,7 @@ type Search_MultiObjectRequest struct { func (x *Search_MultiObjectRequest) Reset() { *x = Search_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -891,7 +930,7 @@ func (x *Search_MultiObjectRequest) String() string { func (*Search_MultiObjectRequest) ProtoMessage() {} func (x *Search_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -943,7 +982,7 @@ type Search_Config struct { func (x *Search_Config) Reset() { *x = Search_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -956,7 +995,7 @@ func (x *Search_Config) String() string { func (*Search_Config) ProtoMessage() {} func (x *Search_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1050,7 +1089,7 @@ type Search_Response struct { func (x *Search_Response) Reset() { *x = Search_Response{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1063,7 +1102,7 @@ func (x *Search_Response) String() string { func (*Search_Response) ProtoMessage() {} func (x *Search_Response) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1106,7 +1145,7 @@ type Search_Responses struct { func (x *Search_Responses) Reset() { *x = Search_Responses{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1119,7 +1158,7 @@ func (x *Search_Responses) String() string { func (*Search_Responses) ProtoMessage() {} func (x *Search_Responses) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1158,7 +1197,7 @@ type Search_StreamResponse struct { func (x *Search_StreamResponse) Reset() { *x = Search_StreamResponse{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1171,7 +1210,7 @@ func (x *Search_StreamResponse) String() string { func (*Search_StreamResponse) ProtoMessage() {} func (x *Search_StreamResponse) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1241,7 +1280,7 @@ type Filter_Target struct { func (x *Filter_Target) Reset() { *x = Filter_Target{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1254,7 +1293,7 @@ func (x *Filter_Target) String() string { func (*Filter_Target) ProtoMessage() {} func (x *Filter_Target) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1297,7 +1336,7 @@ type Filter_Config struct { func (x *Filter_Config) Reset() { *x = Filter_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1310,7 +1349,7 @@ func (x *Filter_Config) String() string { func (*Filter_Config) ProtoMessage() {} func (x *Filter_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1348,7 +1387,7 @@ type Insert_Request struct { func (x *Insert_Request) Reset() { *x = Insert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1361,7 +1400,7 @@ func (x *Insert_Request) String() string { func (*Insert_Request) ProtoMessage() {} func (x *Insert_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1404,7 +1443,7 @@ type Insert_MultiRequest struct { func (x *Insert_MultiRequest) Reset() { *x = Insert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1417,7 +1456,7 @@ func (x *Insert_MultiRequest) String() string { func (*Insert_MultiRequest) ProtoMessage() {} func (x *Insert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1457,7 +1496,7 @@ type Insert_ObjectRequest struct { func (x *Insert_ObjectRequest) Reset() { *x = Insert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1470,7 +1509,7 @@ func (x *Insert_ObjectRequest) String() string { func (*Insert_ObjectRequest) ProtoMessage() {} func (x *Insert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1520,7 +1559,7 @@ type Insert_MultiObjectRequest struct { func (x *Insert_MultiObjectRequest) Reset() { *x = Insert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1533,7 +1572,7 @@ func (x *Insert_MultiObjectRequest) String() string { func (*Insert_MultiObjectRequest) ProtoMessage() {} func (x *Insert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1573,7 +1612,7 @@ type Insert_Config struct { func (x *Insert_Config) Reset() { *x = Insert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1586,7 +1625,7 @@ func (x *Insert_Config) String() string { func (*Insert_Config) ProtoMessage() {} func (x *Insert_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1638,7 +1677,7 @@ type Update_Request struct { func (x *Update_Request) Reset() { *x = Update_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1651,7 +1690,7 @@ func (x *Update_Request) String() string { func (*Update_Request) ProtoMessage() {} func (x *Update_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1694,7 +1733,7 @@ type Update_MultiRequest struct { func (x *Update_MultiRequest) Reset() { *x = Update_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1707,7 +1746,7 @@ func (x *Update_MultiRequest) String() string { func (*Update_MultiRequest) ProtoMessage() {} func (x *Update_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1747,7 +1786,7 @@ type Update_ObjectRequest struct { func (x *Update_ObjectRequest) Reset() { *x = Update_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1760,7 +1799,7 @@ func (x *Update_ObjectRequest) String() string { func (*Update_ObjectRequest) ProtoMessage() {} func (x *Update_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1810,7 +1849,7 @@ type Update_MultiObjectRequest struct { func (x *Update_MultiObjectRequest) Reset() { *x = Update_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1823,7 +1862,7 @@ func (x *Update_MultiObjectRequest) String() string { func (*Update_MultiObjectRequest) ProtoMessage() {} func (x *Update_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1866,7 +1905,7 @@ type Update_Config struct { func (x *Update_Config) Reset() { *x = Update_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1879,7 +1918,7 @@ func (x *Update_Config) String() string { func (*Update_Config) ProtoMessage() {} func (x *Update_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1938,7 +1977,7 @@ type Upsert_Request struct { func (x *Upsert_Request) Reset() { *x = Upsert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1951,7 +1990,7 @@ func (x *Upsert_Request) String() string { func (*Upsert_Request) ProtoMessage() {} func (x *Upsert_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1994,7 +2033,7 @@ type Upsert_MultiRequest struct { func (x *Upsert_MultiRequest) Reset() { *x = Upsert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2007,7 +2046,7 @@ func (x *Upsert_MultiRequest) String() string { func (*Upsert_MultiRequest) ProtoMessage() {} func (x *Upsert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2047,7 +2086,7 @@ type Upsert_ObjectRequest struct { func (x *Upsert_ObjectRequest) Reset() { *x = Upsert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2060,7 +2099,7 @@ func (x *Upsert_ObjectRequest) String() string { func (*Upsert_ObjectRequest) ProtoMessage() {} func (x *Upsert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2110,7 +2149,7 @@ type Upsert_MultiObjectRequest struct { func (x *Upsert_MultiObjectRequest) Reset() { *x = Upsert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2123,7 +2162,7 @@ func (x *Upsert_MultiObjectRequest) String() string { func (*Upsert_MultiObjectRequest) ProtoMessage() {} func (x *Upsert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2166,7 +2205,7 @@ type Upsert_Config struct { func (x *Upsert_Config) Reset() { *x = Upsert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2179,7 +2218,7 @@ func (x *Upsert_Config) String() string { func (*Upsert_Config) ProtoMessage() {} func (x *Upsert_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2238,7 +2277,7 @@ type Remove_Request struct { func (x *Remove_Request) Reset() { *x = Remove_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2251,7 +2290,7 @@ func (x *Remove_Request) String() string { func (*Remove_Request) ProtoMessage() {} func (x *Remove_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2294,7 +2333,7 @@ type Remove_MultiRequest struct { func (x *Remove_MultiRequest) Reset() { *x = Remove_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2307,7 +2346,7 @@ func (x *Remove_MultiRequest) String() string { func (*Remove_MultiRequest) ProtoMessage() {} func (x *Remove_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2343,7 +2382,7 @@ type Remove_TimestampRequest struct { func (x *Remove_TimestampRequest) Reset() { *x = Remove_TimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2356,7 +2395,7 @@ func (x *Remove_TimestampRequest) String() string { func (*Remove_TimestampRequest) ProtoMessage() {} func (x *Remove_TimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2393,7 +2432,7 @@ type Remove_Timestamp struct { func (x *Remove_Timestamp) Reset() { *x = Remove_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2406,7 +2445,7 @@ func (x *Remove_Timestamp) String() string { func (*Remove_Timestamp) ProtoMessage() {} func (x *Remove_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2451,7 +2490,7 @@ type Remove_Config struct { func (x *Remove_Config) Reset() { *x = Remove_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2464,7 +2503,7 @@ func (x *Remove_Config) String() string { func (*Remove_Config) ProtoMessage() {} func (x *Remove_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2509,7 +2548,7 @@ type Object_VectorRequest struct { func (x *Object_VectorRequest) Reset() { *x = Object_VectorRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2522,7 +2561,7 @@ func (x *Object_VectorRequest) String() string { func (*Object_VectorRequest) ProtoMessage() {} func (x *Object_VectorRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2567,7 +2606,7 @@ type Object_Distance struct { func (x *Object_Distance) Reset() { *x = Object_Distance{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2580,7 +2619,7 @@ func (x *Object_Distance) String() string { func (*Object_Distance) ProtoMessage() {} func (x *Object_Distance) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2626,7 +2665,7 @@ type Object_StreamDistance struct { func (x *Object_StreamDistance) Reset() { *x = Object_StreamDistance{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2639,7 +2678,7 @@ func (x *Object_StreamDistance) String() string { func (*Object_StreamDistance) ProtoMessage() {} func (x *Object_StreamDistance) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2706,7 +2745,7 @@ type Object_ID struct { func (x *Object_ID) Reset() { *x = Object_ID{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2719,7 +2758,7 @@ func (x *Object_ID) String() string { func (*Object_ID) ProtoMessage() {} func (x *Object_ID) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2754,7 +2793,7 @@ type Object_IDs struct { func (x *Object_IDs) Reset() { *x = Object_IDs{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2767,7 +2806,7 @@ func (x *Object_IDs) String() string { func (*Object_IDs) ProtoMessage() {} func (x *Object_IDs) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2807,7 +2846,7 @@ type Object_Vector struct { func (x *Object_Vector) Reset() { *x = Object_Vector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2820,7 +2859,7 @@ func (x *Object_Vector) String() string { func (*Object_Vector) ProtoMessage() {} func (x *Object_Vector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2869,7 +2908,7 @@ type Object_Vectors struct { func (x *Object_Vectors) Reset() { *x = Object_Vectors{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2882,7 +2921,7 @@ func (x *Object_Vectors) String() string { func (*Object_Vectors) ProtoMessage() {} func (x *Object_Vectors) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2921,7 +2960,7 @@ type Object_StreamVector struct { func (x *Object_StreamVector) Reset() { *x = Object_StreamVector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2934,7 +2973,7 @@ func (x *Object_StreamVector) String() string { func (*Object_StreamVector) ProtoMessage() {} func (x *Object_StreamVector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3004,7 +3043,7 @@ type Object_ReshapeVector struct { func (x *Object_ReshapeVector) Reset() { *x = Object_ReshapeVector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3017,7 +3056,7 @@ func (x *Object_ReshapeVector) String() string { func (*Object_ReshapeVector) ProtoMessage() {} func (x *Object_ReshapeVector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3062,7 +3101,7 @@ type Object_Blob struct { func (x *Object_Blob) Reset() { *x = Object_Blob{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3075,7 +3114,7 @@ func (x *Object_Blob) String() string { func (*Object_Blob) ProtoMessage() {} func (x *Object_Blob) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3121,7 +3160,7 @@ type Object_StreamBlob struct { func (x *Object_StreamBlob) Reset() { *x = Object_StreamBlob{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3134,7 +3173,7 @@ func (x *Object_StreamBlob) String() string { func (*Object_StreamBlob) ProtoMessage() {} func (x *Object_StreamBlob) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3206,7 +3245,7 @@ type Object_Location struct { func (x *Object_Location) Reset() { *x = Object_Location{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3219,7 +3258,7 @@ func (x *Object_Location) String() string { func (*Object_Location) ProtoMessage() {} func (x *Object_Location) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3272,7 +3311,7 @@ type Object_StreamLocation struct { func (x *Object_StreamLocation) Reset() { *x = Object_StreamLocation{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3285,7 +3324,7 @@ func (x *Object_StreamLocation) String() string { func (*Object_StreamLocation) ProtoMessage() {} func (x *Object_StreamLocation) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3352,7 +3391,7 @@ type Object_Locations struct { func (x *Object_Locations) Reset() { *x = Object_Locations{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3365,7 +3404,7 @@ func (x *Object_Locations) String() string { func (*Object_Locations) ProtoMessage() {} func (x *Object_Locations) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3398,7 +3437,7 @@ type Object_List struct { func (x *Object_List) Reset() { *x = Object_List{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3411,7 +3450,7 @@ func (x *Object_List) String() string { func (*Object_List) ProtoMessage() {} func (x *Object_List) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3436,7 +3475,7 @@ type Object_List_Request struct { func (x *Object_List_Request) Reset() { *x = Object_List_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3449,7 +3488,7 @@ func (x *Object_List_Request) String() string { func (*Object_List_Request) ProtoMessage() {} func (x *Object_List_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3480,7 +3519,7 @@ type Object_List_Response struct { func (x *Object_List_Response) Reset() { *x = Object_List_Response{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3493,7 +3532,7 @@ func (x *Object_List_Response) String() string { func (*Object_List_Response) ProtoMessage() {} func (x *Object_List_Response) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3561,7 +3600,7 @@ type Control_CreateIndexRequest struct { func (x *Control_CreateIndexRequest) Reset() { *x = Control_CreateIndexRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3574,7 +3613,7 @@ func (x *Control_CreateIndexRequest) String() string { func (*Control_CreateIndexRequest) ProtoMessage() {} func (x *Control_CreateIndexRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3614,7 +3653,7 @@ type Discoverer_Request struct { func (x *Discoverer_Request) Reset() { *x = Discoverer_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3627,7 +3666,7 @@ func (x *Discoverer_Request) String() string { func (*Discoverer_Request) ProtoMessage() {} func (x *Discoverer_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3674,7 +3713,7 @@ type Info_Index struct { func (x *Info_Index) Reset() { *x = Info_Index{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3687,7 +3726,7 @@ func (x *Info_Index) String() string { func (*Info_Index) ProtoMessage() {} func (x *Info_Index) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3728,7 +3767,7 @@ type Info_Pod struct { func (x *Info_Pod) Reset() { *x = Info_Pod{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3741,7 +3780,7 @@ func (x *Info_Pod) String() string { func (*Info_Pod) ProtoMessage() {} func (x *Info_Pod) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3829,7 +3868,7 @@ type Info_Node struct { func (x *Info_Node) Reset() { *x = Info_Node{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3842,7 +3881,7 @@ func (x *Info_Node) String() string { func (*Info_Node) ProtoMessage() {} func (x *Info_Node) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3917,7 +3956,7 @@ type Info_CPU struct { func (x *Info_CPU) Reset() { *x = Info_CPU{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3930,7 +3969,7 @@ func (x *Info_CPU) String() string { func (*Info_CPU) ProtoMessage() {} func (x *Info_CPU) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3984,7 +4023,7 @@ type Info_Memory struct { func (x *Info_Memory) Reset() { *x = Info_Memory{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3997,7 +4036,7 @@ func (x *Info_Memory) String() string { func (*Info_Memory) ProtoMessage() {} func (x *Info_Memory) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4047,7 +4086,7 @@ type Info_Pods struct { func (x *Info_Pods) Reset() { *x = Info_Pods{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4060,7 +4099,7 @@ func (x *Info_Pods) String() string { func (*Info_Pods) ProtoMessage() {} func (x *Info_Pods) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4096,7 +4135,7 @@ type Info_Nodes struct { func (x *Info_Nodes) Reset() { *x = Info_Nodes{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4109,7 +4148,7 @@ func (x *Info_Nodes) String() string { func (*Info_Nodes) ProtoMessage() {} func (x *Info_Nodes) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4144,7 +4183,7 @@ type Info_IPs struct { func (x *Info_IPs) Reset() { *x = Info_IPs{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4157,7 +4196,7 @@ func (x *Info_IPs) String() string { func (*Info_IPs) ProtoMessage() {} func (x *Info_IPs) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4199,7 +4238,7 @@ type Info_Index_Count struct { func (x *Info_Index_Count) Reset() { *x = Info_Index_Count{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4212,7 +4251,7 @@ func (x *Info_Index_Count) String() string { func (*Info_Index_Count) ProtoMessage() {} func (x *Info_Index_Count) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] + 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 { @@ -4266,7 +4305,7 @@ type Info_Index_UUID struct { func (x *Info_Index_UUID) Reset() { *x = Info_Index_UUID{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4279,7 +4318,7 @@ func (x *Info_Index_UUID) String() string { func (*Info_Index_UUID) ProtoMessage() {} func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4307,7 +4346,7 @@ type Info_Index_UUID_Committed struct { func (x *Info_Index_UUID_Committed) Reset() { *x = Info_Index_UUID_Committed{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4320,7 +4359,7 @@ func (x *Info_Index_UUID_Committed) String() string { func (*Info_Index_UUID_Committed) ProtoMessage() {} func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4355,7 +4394,7 @@ type Info_Index_UUID_Uncommitted struct { func (x *Info_Index_UUID_Uncommitted) Reset() { *x = Info_Index_UUID_Uncommitted{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4368,7 +4407,7 @@ func (x *Info_Index_UUID_Uncommitted) String() string { func (*Info_Index_UUID_Uncommitted) ProtoMessage() {} func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4391,6 +4430,113 @@ func (x *Info_Index_UUID_Uncommitted) GetUuid() string { return "" } +// Represent server information. +type Mirror_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The target hostname. + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + // The target port. + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *Mirror_Target) Reset() { + *x = Mirror_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Target) ProtoMessage() {} + +func (x *Mirror_Target) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] + 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 Mirror_Target.ProtoReflect.Descriptor instead. +func (*Mirror_Target) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *Mirror_Target) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Mirror_Target) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +// Represent the multiple Target message. +type Mirror_Targets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The multiple target information. + Targets []*Mirror_Target `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *Mirror_Targets) Reset() { + *x = Mirror_Targets{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[76] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Targets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Targets) ProtoMessage() {} + +func (x *Mirror_Targets) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[76] + 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 Mirror_Targets.ProtoReflect.Descriptor instead. +func (*Mirror_Targets) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10, 1} +} + +func (x *Mirror_Targets) GetTargets() []*Mirror_Target { + if x != nil { + return x.Targets + } + return nil +} + var File_apis_proto_v1_payload_payload_proto protoreflect.FileDescriptor var file_apis_proto_v1_payload_payload_proto_rawDesc = []byte{ @@ -4817,14 +4963,22 @@ var file_apis_proto_v1_payload_payload_proto_rawDesc = []byte{ 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, + 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x7a, 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, + 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, + 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, + 0x6f, 0x72, 0x74, 0x1a, 0x3e, 0x0a, 0x07, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x33, + 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, + 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 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, } var ( @@ -4840,7 +4994,7 @@ func file_apis_proto_v1_payload_payload_proto_rawDescGZIP() []byte { } 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, 74) +var file_apis_proto_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 77) var file_apis_proto_v1_payload_payload_proto_goTypes = []interface{}{ (Search_AggregationAlgorithm)(0), // 0: payload.v1.Search.AggregationAlgorithm (Remove_Timestamp_Operator)(0), // 1: payload.v1.Remove.Timestamp.Operator @@ -4854,144 +5008,148 @@ var file_apis_proto_v1_payload_payload_proto_goTypes = []interface{}{ (*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_UUID)(nil), // 73: payload.v1.Info.Index.UUID - (*Info_Index_UUID_Committed)(nil), // 74: payload.v1.Info.Index.UUID.Committed - (*Info_Index_UUID_Uncommitted)(nil), // 75: payload.v1.Info.Index.UUID.Uncommitted - (*status.Status)(nil), // 76: google.rpc.Status + (*Mirror)(nil), // 12: payload.v1.Mirror + (*Empty)(nil), // 13: payload.v1.Empty + (*Search_Request)(nil), // 14: payload.v1.Search.Request + (*Search_MultiRequest)(nil), // 15: payload.v1.Search.MultiRequest + (*Search_IDRequest)(nil), // 16: payload.v1.Search.IDRequest + (*Search_MultiIDRequest)(nil), // 17: payload.v1.Search.MultiIDRequest + (*Search_ObjectRequest)(nil), // 18: payload.v1.Search.ObjectRequest + (*Search_MultiObjectRequest)(nil), // 19: payload.v1.Search.MultiObjectRequest + (*Search_Config)(nil), // 20: payload.v1.Search.Config + (*Search_Response)(nil), // 21: payload.v1.Search.Response + (*Search_Responses)(nil), // 22: payload.v1.Search.Responses + (*Search_StreamResponse)(nil), // 23: payload.v1.Search.StreamResponse + (*Filter_Target)(nil), // 24: payload.v1.Filter.Target + (*Filter_Config)(nil), // 25: payload.v1.Filter.Config + (*Insert_Request)(nil), // 26: payload.v1.Insert.Request + (*Insert_MultiRequest)(nil), // 27: payload.v1.Insert.MultiRequest + (*Insert_ObjectRequest)(nil), // 28: payload.v1.Insert.ObjectRequest + (*Insert_MultiObjectRequest)(nil), // 29: payload.v1.Insert.MultiObjectRequest + (*Insert_Config)(nil), // 30: payload.v1.Insert.Config + (*Update_Request)(nil), // 31: payload.v1.Update.Request + (*Update_MultiRequest)(nil), // 32: payload.v1.Update.MultiRequest + (*Update_ObjectRequest)(nil), // 33: payload.v1.Update.ObjectRequest + (*Update_MultiObjectRequest)(nil), // 34: payload.v1.Update.MultiObjectRequest + (*Update_Config)(nil), // 35: payload.v1.Update.Config + (*Upsert_Request)(nil), // 36: payload.v1.Upsert.Request + (*Upsert_MultiRequest)(nil), // 37: payload.v1.Upsert.MultiRequest + (*Upsert_ObjectRequest)(nil), // 38: payload.v1.Upsert.ObjectRequest + (*Upsert_MultiObjectRequest)(nil), // 39: payload.v1.Upsert.MultiObjectRequest + (*Upsert_Config)(nil), // 40: payload.v1.Upsert.Config + (*Remove_Request)(nil), // 41: payload.v1.Remove.Request + (*Remove_MultiRequest)(nil), // 42: payload.v1.Remove.MultiRequest + (*Remove_TimestampRequest)(nil), // 43: payload.v1.Remove.TimestampRequest + (*Remove_Timestamp)(nil), // 44: payload.v1.Remove.Timestamp + (*Remove_Config)(nil), // 45: payload.v1.Remove.Config + (*Object_VectorRequest)(nil), // 46: payload.v1.Object.VectorRequest + (*Object_Distance)(nil), // 47: payload.v1.Object.Distance + (*Object_StreamDistance)(nil), // 48: payload.v1.Object.StreamDistance + (*Object_ID)(nil), // 49: payload.v1.Object.ID + (*Object_IDs)(nil), // 50: payload.v1.Object.IDs + (*Object_Vector)(nil), // 51: payload.v1.Object.Vector + (*Object_Vectors)(nil), // 52: payload.v1.Object.Vectors + (*Object_StreamVector)(nil), // 53: payload.v1.Object.StreamVector + (*Object_ReshapeVector)(nil), // 54: payload.v1.Object.ReshapeVector + (*Object_Blob)(nil), // 55: payload.v1.Object.Blob + (*Object_StreamBlob)(nil), // 56: payload.v1.Object.StreamBlob + (*Object_Location)(nil), // 57: payload.v1.Object.Location + (*Object_StreamLocation)(nil), // 58: payload.v1.Object.StreamLocation + (*Object_Locations)(nil), // 59: payload.v1.Object.Locations + (*Object_List)(nil), // 60: payload.v1.Object.List + (*Object_List_Request)(nil), // 61: payload.v1.Object.List.Request + (*Object_List_Response)(nil), // 62: payload.v1.Object.List.Response + (*Control_CreateIndexRequest)(nil), // 63: payload.v1.Control.CreateIndexRequest + (*Discoverer_Request)(nil), // 64: payload.v1.Discoverer.Request + (*Info_Index)(nil), // 65: payload.v1.Info.Index + (*Info_Pod)(nil), // 66: payload.v1.Info.Pod + (*Info_Node)(nil), // 67: payload.v1.Info.Node + (*Info_CPU)(nil), // 68: payload.v1.Info.CPU + (*Info_Memory)(nil), // 69: payload.v1.Info.Memory + (*Info_Pods)(nil), // 70: payload.v1.Info.Pods + (*Info_Nodes)(nil), // 71: payload.v1.Info.Nodes + (*Info_IPs)(nil), // 72: payload.v1.Info.IPs + (*Info_Index_Count)(nil), // 73: payload.v1.Info.Index.Count + (*Info_Index_UUID)(nil), // 74: payload.v1.Info.Index.UUID + (*Info_Index_UUID_Committed)(nil), // 75: payload.v1.Info.Index.UUID.Committed + (*Info_Index_UUID_Uncommitted)(nil), // 76: payload.v1.Info.Index.UUID.Uncommitted + (*Mirror_Target)(nil), // 77: payload.v1.Mirror.Target + (*Mirror_Targets)(nil), // 78: payload.v1.Mirror.Targets + (*status.Status)(nil), // 79: google.rpc.Status } var file_apis_proto_v1_payload_payload_proto_depIdxs = []int32{ - 19, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config - 13, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request - 19, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config - 15, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest - 19, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config - 23, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target - 17, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest - 24, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config - 24, // 8: payload.v1.Search.Config.egress_filters:type_name -> payload.v1.Filter.Config + 20, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config + 14, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request + 20, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config + 16, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest + 20, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config + 24, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 18, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest + 25, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config + 25, // 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 - 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 - 76, // 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 + 47, // 10: payload.v1.Search.Response.results:type_name -> payload.v1.Object.Distance + 21, // 11: payload.v1.Search.Responses.responses:type_name -> payload.v1.Search.Response + 21, // 12: payload.v1.Search.StreamResponse.response:type_name -> payload.v1.Search.Response + 79, // 13: payload.v1.Search.StreamResponse.status:type_name -> google.rpc.Status + 24, // 14: payload.v1.Filter.Config.targets:type_name -> payload.v1.Filter.Target + 51, // 15: payload.v1.Insert.Request.vector:type_name -> payload.v1.Object.Vector + 30, // 16: payload.v1.Insert.Request.config:type_name -> payload.v1.Insert.Config + 26, // 17: payload.v1.Insert.MultiRequest.requests:type_name -> payload.v1.Insert.Request + 55, // 18: payload.v1.Insert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 30, // 19: payload.v1.Insert.ObjectRequest.config:type_name -> payload.v1.Insert.Config + 24, // 20: payload.v1.Insert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 28, // 21: payload.v1.Insert.MultiObjectRequest.requests:type_name -> payload.v1.Insert.ObjectRequest + 25, // 22: payload.v1.Insert.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 23: payload.v1.Update.Request.vector:type_name -> payload.v1.Object.Vector + 35, // 24: payload.v1.Update.Request.config:type_name -> payload.v1.Update.Config + 31, // 25: payload.v1.Update.MultiRequest.requests:type_name -> payload.v1.Update.Request + 55, // 26: payload.v1.Update.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 35, // 27: payload.v1.Update.ObjectRequest.config:type_name -> payload.v1.Update.Config + 24, // 28: payload.v1.Update.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 33, // 29: payload.v1.Update.MultiObjectRequest.requests:type_name -> payload.v1.Update.ObjectRequest + 25, // 30: payload.v1.Update.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 31: payload.v1.Upsert.Request.vector:type_name -> payload.v1.Object.Vector + 40, // 32: payload.v1.Upsert.Request.config:type_name -> payload.v1.Upsert.Config + 36, // 33: payload.v1.Upsert.MultiRequest.requests:type_name -> payload.v1.Upsert.Request + 55, // 34: payload.v1.Upsert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 40, // 35: payload.v1.Upsert.ObjectRequest.config:type_name -> payload.v1.Upsert.Config + 24, // 36: payload.v1.Upsert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 38, // 37: payload.v1.Upsert.MultiObjectRequest.requests:type_name -> payload.v1.Upsert.ObjectRequest + 25, // 38: payload.v1.Upsert.Config.filters:type_name -> payload.v1.Filter.Config + 49, // 39: payload.v1.Remove.Request.id:type_name -> payload.v1.Object.ID + 45, // 40: payload.v1.Remove.Request.config:type_name -> payload.v1.Remove.Config + 41, // 41: payload.v1.Remove.MultiRequest.requests:type_name -> payload.v1.Remove.Request + 44, // 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 - 76, // 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 - 76, // 50: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status - 54, // 51: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob - 76, // 52: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status - 56, // 53: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location - 76, // 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 - 76, // 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 - 66, // [66:66] is the sub-list for method output_type - 66, // [66:66] is the sub-list for method input_type - 66, // [66:66] is the sub-list for extension type_name - 66, // [66:66] is the sub-list for extension extendee - 0, // [0:66] is the sub-list for field type_name + 49, // 44: payload.v1.Object.VectorRequest.id:type_name -> payload.v1.Object.ID + 25, // 45: payload.v1.Object.VectorRequest.filters:type_name -> payload.v1.Filter.Config + 47, // 46: payload.v1.Object.StreamDistance.distance:type_name -> payload.v1.Object.Distance + 79, // 47: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status + 51, // 48: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector + 51, // 49: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector + 79, // 50: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status + 55, // 51: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob + 79, // 52: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status + 57, // 53: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location + 79, // 54: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status + 57, // 55: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location + 51, // 56: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector + 79, // 57: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status + 68, // 58: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU + 69, // 59: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory + 67, // 60: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node + 68, // 61: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU + 69, // 62: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory + 70, // 63: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods + 66, // 64: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod + 67, // 65: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node + 77, // 66: payload.v1.Mirror.Targets.targets:type_name -> payload.v1.Mirror.Target + 67, // [67:67] is the sub-list for method output_type + 67, // [67:67] is the sub-list for method input_type + 67, // [67:67] is the sub-list for extension type_name + 67, // [67:67] is the sub-list for extension extendee + 0, // [0:67] is the sub-list for field type_name } func init() { file_apis_proto_v1_payload_payload_proto_init() } @@ -5121,7 +5279,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { + switch v := v.(*Mirror); i { case 0: return &v.state case 1: @@ -5133,7 +5291,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Request); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -5145,7 +5303,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiRequest); i { + switch v := v.(*Search_Request); i { case 0: return &v.state case 1: @@ -5157,7 +5315,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_IDRequest); i { + switch v := v.(*Search_MultiRequest); i { case 0: return &v.state case 1: @@ -5169,7 +5327,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiIDRequest); i { + switch v := v.(*Search_IDRequest); i { case 0: return &v.state case 1: @@ -5181,7 +5339,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_ObjectRequest); i { + switch v := v.(*Search_MultiIDRequest); i { case 0: return &v.state case 1: @@ -5193,7 +5351,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiObjectRequest); i { + switch v := v.(*Search_ObjectRequest); i { case 0: return &v.state case 1: @@ -5205,7 +5363,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Config); i { + switch v := v.(*Search_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5217,7 +5375,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Response); i { + switch v := v.(*Search_Config); i { case 0: return &v.state case 1: @@ -5229,7 +5387,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Responses); i { + switch v := v.(*Search_Response); i { case 0: return &v.state case 1: @@ -5241,7 +5399,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_StreamResponse); i { + switch v := v.(*Search_Responses); i { case 0: return &v.state case 1: @@ -5253,7 +5411,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Target); i { + switch v := v.(*Search_StreamResponse); i { case 0: return &v.state case 1: @@ -5265,7 +5423,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Config); i { + switch v := v.(*Filter_Target); i { case 0: return &v.state case 1: @@ -5277,7 +5435,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Request); i { + switch v := v.(*Filter_Config); i { case 0: return &v.state case 1: @@ -5289,7 +5447,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiRequest); i { + switch v := v.(*Insert_Request); i { case 0: return &v.state case 1: @@ -5301,7 +5459,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_ObjectRequest); i { + switch v := v.(*Insert_MultiRequest); i { case 0: return &v.state case 1: @@ -5313,7 +5471,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiObjectRequest); i { + switch v := v.(*Insert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5325,7 +5483,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Config); i { + switch v := v.(*Insert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5337,7 +5495,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Request); i { + switch v := v.(*Insert_Config); i { case 0: return &v.state case 1: @@ -5349,7 +5507,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiRequest); i { + switch v := v.(*Update_Request); i { case 0: return &v.state case 1: @@ -5361,7 +5519,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_ObjectRequest); i { + switch v := v.(*Update_MultiRequest); i { case 0: return &v.state case 1: @@ -5373,7 +5531,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiObjectRequest); i { + switch v := v.(*Update_ObjectRequest); i { case 0: return &v.state case 1: @@ -5385,7 +5543,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Config); i { + switch v := v.(*Update_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5397,7 +5555,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Request); i { + switch v := v.(*Update_Config); i { case 0: return &v.state case 1: @@ -5409,7 +5567,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiRequest); i { + switch v := v.(*Upsert_Request); i { case 0: return &v.state case 1: @@ -5421,7 +5579,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_ObjectRequest); i { + switch v := v.(*Upsert_MultiRequest); i { case 0: return &v.state case 1: @@ -5433,7 +5591,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiObjectRequest); i { + switch v := v.(*Upsert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5445,7 +5603,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Config); i { + switch v := v.(*Upsert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5457,7 +5615,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Request); i { + switch v := v.(*Upsert_Config); i { case 0: return &v.state case 1: @@ -5469,7 +5627,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_MultiRequest); i { + switch v := v.(*Remove_Request); i { case 0: return &v.state case 1: @@ -5481,7 +5639,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_TimestampRequest); i { + switch v := v.(*Remove_MultiRequest); i { case 0: return &v.state case 1: @@ -5493,7 +5651,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Timestamp); i { + switch v := v.(*Remove_TimestampRequest); i { case 0: return &v.state case 1: @@ -5505,7 +5663,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Config); i { + switch v := v.(*Remove_Timestamp); i { case 0: return &v.state case 1: @@ -5517,7 +5675,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_VectorRequest); i { + switch v := v.(*Remove_Config); i { case 0: return &v.state case 1: @@ -5529,7 +5687,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Distance); i { + switch v := v.(*Object_VectorRequest); i { case 0: return &v.state case 1: @@ -5541,7 +5699,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamDistance); i { + switch v := v.(*Object_Distance); i { case 0: return &v.state case 1: @@ -5553,7 +5711,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ID); i { + switch v := v.(*Object_StreamDistance); i { case 0: return &v.state case 1: @@ -5565,7 +5723,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_IDs); i { + switch v := v.(*Object_ID); i { case 0: return &v.state case 1: @@ -5577,7 +5735,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vector); i { + switch v := v.(*Object_IDs); i { case 0: return &v.state case 1: @@ -5589,7 +5747,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vectors); i { + switch v := v.(*Object_Vector); i { case 0: return &v.state case 1: @@ -5601,7 +5759,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamVector); i { + switch v := v.(*Object_Vectors); i { case 0: return &v.state case 1: @@ -5613,7 +5771,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ReshapeVector); i { + switch v := v.(*Object_StreamVector); i { case 0: return &v.state case 1: @@ -5625,7 +5783,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Blob); i { + switch v := v.(*Object_ReshapeVector); i { case 0: return &v.state case 1: @@ -5637,7 +5795,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamBlob); i { + switch v := v.(*Object_Blob); i { case 0: return &v.state case 1: @@ -5649,7 +5807,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Location); i { + switch v := v.(*Object_StreamBlob); i { case 0: return &v.state case 1: @@ -5661,7 +5819,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamLocation); i { + switch v := v.(*Object_Location); i { case 0: return &v.state case 1: @@ -5673,7 +5831,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Locations); i { + switch v := v.(*Object_StreamLocation); i { case 0: return &v.state case 1: @@ -5685,7 +5843,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List); i { + switch v := v.(*Object_Locations); i { case 0: return &v.state case 1: @@ -5697,7 +5855,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Request); i { + switch v := v.(*Object_List); i { case 0: return &v.state case 1: @@ -5709,7 +5867,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Response); i { + switch v := v.(*Object_List_Request); i { case 0: return &v.state case 1: @@ -5721,7 +5879,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Control_CreateIndexRequest); i { + switch v := v.(*Object_List_Response); i { case 0: return &v.state case 1: @@ -5733,7 +5891,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Discoverer_Request); i { + switch v := v.(*Control_CreateIndexRequest); i { case 0: return &v.state case 1: @@ -5745,7 +5903,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index); i { + switch v := v.(*Discoverer_Request); i { case 0: return &v.state case 1: @@ -5757,7 +5915,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pod); i { + switch v := v.(*Info_Index); i { case 0: return &v.state case 1: @@ -5769,7 +5927,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Node); i { + switch v := v.(*Info_Pod); i { case 0: return &v.state case 1: @@ -5781,7 +5939,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_CPU); i { + switch v := v.(*Info_Node); i { case 0: return &v.state case 1: @@ -5793,7 +5951,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Memory); i { + switch v := v.(*Info_CPU); i { case 0: return &v.state case 1: @@ -5805,7 +5963,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pods); i { + switch v := v.(*Info_Memory); i { case 0: return &v.state case 1: @@ -5817,7 +5975,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Nodes); i { + switch v := v.(*Info_Pods); i { case 0: return &v.state case 1: @@ -5829,7 +5987,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_IPs); i { + switch v := v.(*Info_Nodes); i { case 0: return &v.state case 1: @@ -5841,7 +5999,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_Count); i { + switch v := v.(*Info_IPs); i { case 0: return &v.state case 1: @@ -5853,7 +6011,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID); i { + switch v := v.(*Info_Index_Count); i { case 0: return &v.state case 1: @@ -5865,7 +6023,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID_Committed); i { + switch v := v.(*Info_Index_UUID); i { case 0: return &v.state case 1: @@ -5877,6 +6035,18 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info_Index_UUID_Committed); 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{} { switch v := v.(*Info_Index_UUID_Uncommitted); i { case 0: return &v.state @@ -5888,28 +6058,52 @@ func file_apis_proto_v1_payload_payload_proto_init() { return nil } } + file_apis_proto_v1_payload_payload_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Target); 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[76].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Targets); 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[20].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[21].OneofWrappers = []interface{}{ (*Search_StreamResponse_Response)(nil), (*Search_StreamResponse_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[45].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[46].OneofWrappers = []interface{}{ (*Object_StreamDistance_Distance)(nil), (*Object_StreamDistance_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[50].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[51].OneofWrappers = []interface{}{ (*Object_StreamVector_Vector)(nil), (*Object_StreamVector_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[53].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[54].OneofWrappers = []interface{}{ (*Object_StreamBlob_Blob)(nil), (*Object_StreamBlob_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[55].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[56].OneofWrappers = []interface{}{ (*Object_StreamLocation_Location)(nil), (*Object_StreamLocation_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[59].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[60].OneofWrappers = []interface{}{ (*Object_List_Response_Vector)(nil), (*Object_List_Response_Status)(nil), } @@ -5919,7 +6113,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_apis_proto_v1_payload_payload_proto_rawDesc, NumEnums: 2, - NumMessages: 74, + NumMessages: 77, NumExtensions: 0, NumServices: 0, }, diff --git a/apis/grpc/v1/rpc/errdetails/error_details.pb.go b/apis/grpc/v1/rpc/errdetails/error_details.pb.go index 2132a9d71c..35dbdbc7cb 100644 --- a/apis/grpc/v1/rpc/errdetails/error_details.pb.go +++ b/apis/grpc/v1/rpc/errdetails/error_details.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/rpc/error_details.proto package errdetails diff --git a/apis/grpc/v1/vald/filter.pb.go b/apis/grpc/v1/vald/filter.pb.go index d5ceb204b9..6941e5957e 100644 --- a/apis/grpc/v1/vald/filter.pb.go +++ b/apis/grpc/v1/vald/filter.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/vald/filter.proto package vald diff --git a/apis/grpc/v1/vald/insert.pb.go b/apis/grpc/v1/vald/insert.pb.go index 29ab376781..97c175a8ed 100644 --- a/apis/grpc/v1/vald/insert.pb.go +++ b/apis/grpc/v1/vald/insert.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/vald/insert.proto package vald diff --git a/apis/grpc/v1/vald/object.pb.go b/apis/grpc/v1/vald/object.pb.go index b386af2cc1..86fba70815 100644 --- a/apis/grpc/v1/vald/object.pb.go +++ b/apis/grpc/v1/vald/object.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/vald/object.proto package vald diff --git a/apis/grpc/v1/vald/remove.pb.go b/apis/grpc/v1/vald/remove.pb.go index 65f3476166..77a04d56f2 100644 --- a/apis/grpc/v1/vald/remove.pb.go +++ b/apis/grpc/v1/vald/remove.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/vald/remove.proto package vald diff --git a/apis/grpc/v1/vald/search.pb.go b/apis/grpc/v1/vald/search.pb.go index d91e380271..317502f6ad 100644 --- a/apis/grpc/v1/vald/search.pb.go +++ b/apis/grpc/v1/vald/search.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/vald/search.proto package vald diff --git a/apis/grpc/v1/vald/update.pb.go b/apis/grpc/v1/vald/update.pb.go index 968c0bfaf4..4de4679e6e 100644 --- a/apis/grpc/v1/vald/update.pb.go +++ b/apis/grpc/v1/vald/update.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/vald/update.proto package vald diff --git a/apis/grpc/v1/vald/upsert.pb.go b/apis/grpc/v1/vald/upsert.pb.go index e401ba143d..0305d2a0a2 100644 --- a/apis/grpc/v1/vald/upsert.pb.go +++ b/apis/grpc/v1/vald/upsert.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.3 +// protoc v4.23.4 // source: apis/proto/v1/vald/upsert.proto package vald diff --git a/apis/proto/v1/mirror/mirror.proto b/apis/proto/v1/mirror/mirror.proto index cbebfbf352..aa0ddcc747 100644 --- a/apis/proto/v1/mirror/mirror.proto +++ b/apis/proto/v1/mirror/mirror.proto @@ -2,7 +2,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json b/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json index 4910719033..a802b1512b 100644 --- a/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json +++ b/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json @@ -142,7 +142,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json b/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json index 51bee365c1..17c90f4c72 100644 --- a/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json +++ b/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json @@ -208,7 +208,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json b/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json index b1bd9992a6..6859db29e3 100644 --- a/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json +++ b/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json @@ -114,7 +114,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json b/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json index 7e88c9e8b5..6899db4647 100644 --- a/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json +++ b/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json @@ -114,7 +114,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json b/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json index 835e1aa5b9..76548a29ca 100644 --- a/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json +++ b/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json @@ -59,7 +59,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json b/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json index dd665c6995..a63839f548 100644 --- a/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json +++ b/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json @@ -13,7 +13,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json index 056169fcb7..45920b0eed 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json @@ -357,7 +357,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json index 85ef4f072a..097a01ab1f 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json @@ -125,7 +125,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json index 2c185ac5c5..0386cf3403 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json @@ -161,7 +161,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json index 350b138215..48abddde3b 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json @@ -161,7 +161,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json index 5ead82c2d1..8ffd27b0c5 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json @@ -343,7 +343,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json index 7b355f6d23..fad9af1b58 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json @@ -125,7 +125,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json index 64ae13be12..c61a1cf9ad 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json @@ -125,7 +125,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/charts/vald/crds/valdmirrortarget.yaml b/charts/vald/crds/valdmirrortarget.yaml index 5dfbb8ebcf..d7ce64148a 100644 --- a/charts/vald/crds/valdmirrortarget.yaml +++ b/charts/vald/crds/valdmirrortarget.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/schemas/mirror-target-values.yaml b/charts/vald/schemas/mirror-target-values.yaml index c47d200d39..6d341b25e4 100644 --- a/charts/vald/schemas/mirror-target-values.yaml +++ b/charts/vald/schemas/mirror-target-values.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/clusterrole.yaml b/charts/vald/templates/gateway/mirror/clusterrole.yaml index 5965647c7f..287e47752f 100644 --- a/charts/vald/templates/gateway/mirror/clusterrole.yaml +++ b/charts/vald/templates/gateway/mirror/clusterrole.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml b/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml index 0f2e8a93f8..9129355c72 100644 --- a/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml +++ b/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/configmap.yaml b/charts/vald/templates/gateway/mirror/configmap.yaml index 45a15e1bb1..f20647ce53 100644 --- a/charts/vald/templates/gateway/mirror/configmap.yaml +++ b/charts/vald/templates/gateway/mirror/configmap.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/daemonset.yaml b/charts/vald/templates/gateway/mirror/daemonset.yaml index 0abf21be4f..db8d032f4a 100644 --- a/charts/vald/templates/gateway/mirror/daemonset.yaml +++ b/charts/vald/templates/gateway/mirror/daemonset.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/deployment.yaml b/charts/vald/templates/gateway/mirror/deployment.yaml index 4cac47128b..10b137b22f 100644 --- a/charts/vald/templates/gateway/mirror/deployment.yaml +++ b/charts/vald/templates/gateway/mirror/deployment.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/hpa.yaml b/charts/vald/templates/gateway/mirror/hpa.yaml index c4227170fa..41e339d981 100644 --- a/charts/vald/templates/gateway/mirror/hpa.yaml +++ b/charts/vald/templates/gateway/mirror/hpa.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/ing.yaml b/charts/vald/templates/gateway/mirror/ing.yaml index 05022fd515..32ce915750 100644 --- a/charts/vald/templates/gateway/mirror/ing.yaml +++ b/charts/vald/templates/gateway/mirror/ing.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/pdb.yaml b/charts/vald/templates/gateway/mirror/pdb.yaml index d516368ae5..3c31028b63 100644 --- a/charts/vald/templates/gateway/mirror/pdb.yaml +++ b/charts/vald/templates/gateway/mirror/pdb.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/priorityclass.yaml b/charts/vald/templates/gateway/mirror/priorityclass.yaml index cb9b3bfa7e..7cc208c236 100644 --- a/charts/vald/templates/gateway/mirror/priorityclass.yaml +++ b/charts/vald/templates/gateway/mirror/priorityclass.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/serviceaccount.yaml b/charts/vald/templates/gateway/mirror/serviceaccount.yaml index c9b6ff4508..9288e0ac9d 100644 --- a/charts/vald/templates/gateway/mirror/serviceaccount.yaml +++ b/charts/vald/templates/gateway/mirror/serviceaccount.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/templates/gateway/mirror/svc.yaml b/charts/vald/templates/gateway/mirror/svc.yaml index 68191b2c62..cee5cd1609 100644 --- a/charts/vald/templates/gateway/mirror/svc.yaml +++ b/charts/vald/templates/gateway/mirror/svc.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/values/multi-vald/dev-vald-01.yaml b/charts/vald/values/multi-vald/dev-vald-01.yaml index 6b30c0c9b3..03fc608003 100644 --- a/charts/vald/values/multi-vald/dev-vald-01.yaml +++ b/charts/vald/values/multi-vald/dev-vald-01.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/values/multi-vald/dev-vald-02.yaml b/charts/vald/values/multi-vald/dev-vald-02.yaml index 64d026e949..4e5f11e2a4 100644 --- a/charts/vald/values/multi-vald/dev-vald-02.yaml +++ b/charts/vald/values/multi-vald/dev-vald-02.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/values/multi-vald/dev-vald-03.yaml b/charts/vald/values/multi-vald/dev-vald-03.yaml index 4b90cdc27a..0723a6486b 100644 --- a/charts/vald/values/multi-vald/dev-vald-03.yaml +++ b/charts/vald/values/multi-vald/dev-vald-03.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml index d0d0ff8ad2..bc0f1adf48 100644 --- a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml +++ b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/charts/vald/values/multi-vald/mirror-target.yaml b/charts/vald/values/multi-vald/mirror-target.yaml index 75d3cf4161..8a0ab15a01 100644 --- a/charts/vald/values/multi-vald/mirror-target.yaml +++ b/charts/vald/values/multi-vald/mirror-target.yaml @@ -3,7 +3,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/cmd/gateway/mirror/main.go b/cmd/gateway/mirror/main.go index 8eb77f8ebd..a8bdbad9c5 100644 --- a/cmd/gateway/mirror/main.go +++ b/cmd/gateway/mirror/main.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/cmd/gateway/mirror/sample.yaml b/cmd/gateway/mirror/sample.yaml index d9d32c8a59..bac898cdca 100644 --- a/cmd/gateway/mirror/sample.yaml +++ b/cmd/gateway/mirror/sample.yaml @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index 729406bf49..6d118fb69f 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -2,7 +2,7 @@ # Copyright (C) 2019-2023 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. +# You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 diff --git a/example/client/mirror/main.go b/example/client/mirror/main.go index 3fca226305..e4bb45fc9c 100644 --- a/example/client/mirror/main.go +++ b/example/client/mirror/main.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/client/v1/client/mirror/mirror.go b/internal/client/v1/client/mirror/mirror.go index 4c100024fb..ad3f337f3f 100644 --- a/internal/client/v1/client/mirror/mirror.go +++ b/internal/client/v1/client/mirror/mirror.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/client/v1/client/mirror/option.go b/internal/client/v1/client/mirror/option.go index fb8deb2ccf..16a43ddb6f 100644 --- a/internal/client/v1/client/mirror/option.go +++ b/internal/client/v1/client/mirror/option.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/config/mirror.go b/internal/config/mirror.go index 01fabf9c05..a9d069f946 100644 --- a/internal/config/mirror.go +++ b/internal/config/mirror.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/k8s/vald/mirror/api/v1/target_types.go b/internal/k8s/vald/mirror/api/v1/target_types.go index f3f57e2f05..d1edb34156 100644 --- a/internal/k8s/vald/mirror/api/v1/target_types.go +++ b/internal/k8s/vald/mirror/api/v1/target_types.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/k8s/vald/mirror/target/option.go b/internal/k8s/vald/mirror/target/option.go index b2a2014801..e83a7edbca 100644 --- a/internal/k8s/vald/mirror/target/option.go +++ b/internal/k8s/vald/mirror/target/option.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/k8s/vald/mirror/target/target.go b/internal/k8s/vald/mirror/target/target.go index b279401c58..f4f4edc7b9 100644 --- a/internal/k8s/vald/mirror/target/target.go +++ b/internal/k8s/vald/mirror/target/target.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/k8s/vald/mirror/target/target_template.go b/internal/k8s/vald/mirror/target/target_template.go index 6d205986dd..4e52774fd1 100644 --- a/internal/k8s/vald/mirror/target/target_template.go +++ b/internal/k8s/vald/mirror/target/target_template.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/k8s/vald/mirror/target/target_template_option.go b/internal/k8s/vald/mirror/target/target_template_option.go index a5db4da9e6..43d5e4f8b3 100644 --- a/internal/k8s/vald/mirror/target/target_template_option.go +++ b/internal/k8s/vald/mirror/target/target_template_option.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/net/grpc/metadata.go b/internal/net/grpc/metadata.go index afc51d6e96..e32a0bb3e1 100644 --- a/internal/net/grpc/metadata.go +++ b/internal/net/grpc/metadata.go @@ -2,7 +2,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/internal/observability/metrics/gateway/mirror/mirror.go b/internal/observability/metrics/gateway/mirror/mirror.go index 0ccb40bff4..1635e928b5 100644 --- a/internal/observability/metrics/gateway/mirror/mirror.go +++ b/internal/observability/metrics/gateway/mirror/mirror.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/pkg/gateway/mirror/config/config.go b/pkg/gateway/mirror/config/config.go index d70f98ba2b..ff440c1b0d 100644 --- a/pkg/gateway/mirror/config/config.go +++ b/pkg/gateway/mirror/config/config.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/pkg/gateway/mirror/handler/doc.go b/pkg/gateway/mirror/handler/doc.go index fc21413970..79092b1747 100644 --- a/pkg/gateway/mirror/handler/doc.go +++ b/pkg/gateway/mirror/handler/doc.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 514b9ef3e8..03ea5b0e8f 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -21,7 +21,6 @@ import ( "github.com/vdaas/vald/apis/grpc/v1/payload" "github.com/vdaas/vald/apis/grpc/v1/vald" - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net/grpc" @@ -30,6 +29,7 @@ import ( "github.com/vdaas/vald/internal/net/grpc/status" "github.com/vdaas/vald/internal/observability/trace" "github.com/vdaas/vald/internal/safety" + "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/pkg/gateway/mirror/service" ) diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index f49ea0da94..a4746106b4 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -22,11 +22,11 @@ import ( "github.com/vdaas/vald/apis/grpc/v1/payload" "github.com/vdaas/vald/apis/grpc/v1/vald" - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/net/grpc/codes" "github.com/vdaas/vald/internal/net/grpc/status" + "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/internal/test/data/vector" "github.com/vdaas/vald/internal/test/goleak" "github.com/vdaas/vald/pkg/gateway/mirror/service" diff --git a/pkg/gateway/mirror/handler/grpc/mock_test.go b/pkg/gateway/mirror/handler/grpc/mock_test.go index f37efea6db..4a5d93b336 100644 --- a/pkg/gateway/mirror/handler/grpc/mock_test.go +++ b/pkg/gateway/mirror/handler/grpc/mock_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -48,9 +48,10 @@ type mockClient struct { MultiLinearSearchFunc func(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) MultiLinearSearchByIDFunc func(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) - RemoveFunc func(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) - StreamRemoveFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Remove_StreamRemoveClient, error) - MultiRemoveFunc func(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) + RemoveFunc func(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + RemoveByTimestampFunc func(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) + StreamRemoveFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Remove_StreamRemoveClient, error) + MultiRemoveFunc func(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) ExistsFunc func(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (*payload.Object_ID, error) GetObjectFunc func(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) @@ -149,6 +150,10 @@ func (m *mockClient) Remove(ctx context.Context, in *payload.Remove_Request, opt return m.RemoveFunc(ctx, in, opts...) } +func (m *mockClient) RemoveByTimestamp(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { + return m.RemoveByTimestamp(ctx, in, opts...) +} + func (m *mockClient) StreamRemove(ctx context.Context, opts ...grpc.CallOption) (vald.Remove_StreamRemoveClient, error) { return m.StreamRemoveFunc(ctx, opts...) } diff --git a/pkg/gateway/mirror/handler/grpc/option.go b/pkg/gateway/mirror/handler/grpc/option.go index 465aacffce..13a09cad25 100644 --- a/pkg/gateway/mirror/handler/grpc/option.go +++ b/pkg/gateway/mirror/handler/grpc/option.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -17,10 +17,10 @@ import ( "os" "runtime" - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net" + "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/pkg/gateway/mirror/service" ) diff --git a/pkg/gateway/mirror/handler/rest/handler.go b/pkg/gateway/mirror/handler/rest/handler.go index e5cb5fe064..5f1666fbf9 100644 --- a/pkg/gateway/mirror/handler/rest/handler.go +++ b/pkg/gateway/mirror/handler/rest/handler.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/pkg/gateway/mirror/handler/rest/option.go b/pkg/gateway/mirror/handler/rest/option.go index 7ff96a2433..d983d16ab9 100644 --- a/pkg/gateway/mirror/handler/rest/option.go +++ b/pkg/gateway/mirror/handler/rest/option.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/pkg/gateway/mirror/router/option.go b/pkg/gateway/mirror/router/option.go index d9f6d4d1f0..0ee345d62a 100644 --- a/pkg/gateway/mirror/router/option.go +++ b/pkg/gateway/mirror/router/option.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/pkg/gateway/mirror/router/router.go b/pkg/gateway/mirror/router/router.go index 73e330dcdb..f2452b44b1 100644 --- a/pkg/gateway/mirror/router/router.go +++ b/pkg/gateway/mirror/router/router.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index c4d5e43f87..033f69ef25 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -21,13 +21,13 @@ import ( "time" "github.com/vdaas/vald/apis/grpc/v1/payload" - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/k8s" "github.com/vdaas/vald/internal/k8s/vald/mirror/target" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/strings" + "github.com/vdaas/vald/internal/sync/errgroup" "github.com/zeebo/xxh3" ) diff --git a/pkg/gateway/mirror/service/discovery_option.go b/pkg/gateway/mirror/service/discovery_option.go index 345adaa047..acf91fa7b8 100644 --- a/pkg/gateway/mirror/service/discovery_option.go +++ b/pkg/gateway/mirror/service/discovery_option.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -14,9 +14,9 @@ package service import ( - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/net" + "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/internal/timeutil" ) diff --git a/pkg/gateway/mirror/service/doc.go b/pkg/gateway/mirror/service/doc.go index 41c6b0a25b..4c81def1e7 100644 --- a/pkg/gateway/mirror/service/doc.go +++ b/pkg/gateway/mirror/service/doc.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index 2c1489d27b..6b00b6fe48 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -19,11 +19,11 @@ import ( "github.com/vdaas/vald/apis/grpc/v1/vald" "github.com/vdaas/vald/internal/client/v1/client/mirror" - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/observability/trace" + "github.com/vdaas/vald/internal/sync/errgroup" ) const ( diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index 67ed8257d9..7b7ab5718e 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -21,7 +21,6 @@ import ( "github.com/vdaas/vald/apis/grpc/v1/payload" "github.com/vdaas/vald/apis/grpc/v1/vald" - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net" @@ -30,6 +29,7 @@ import ( "github.com/vdaas/vald/internal/net/grpc/errdetails" "github.com/vdaas/vald/internal/net/grpc/status" "github.com/vdaas/vald/internal/observability/trace" + "github.com/vdaas/vald/internal/sync/errgroup" ) // Mirror manages other mirror gateway connection. diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go index bf95c33f09..fe0b67c83a 100644 --- a/pkg/gateway/mirror/service/mirror_option.go +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -16,8 +16,8 @@ package service import ( "time" - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/sync/errgroup" ) type MirrorOption func(m *mirr) error diff --git a/pkg/gateway/mirror/service/option.go b/pkg/gateway/mirror/service/option.go index c16a5f95b5..7235258c88 100644 --- a/pkg/gateway/mirror/service/option.go +++ b/pkg/gateway/mirror/service/option.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -15,8 +15,8 @@ package service import ( "github.com/vdaas/vald/internal/client/v1/client/mirror" - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/sync/errgroup" ) type Option func(g *gateway) error diff --git a/pkg/gateway/mirror/usecase/vald.go b/pkg/gateway/mirror/usecase/vald.go index 8b8f253bff..844accf600 100644 --- a/pkg/gateway/mirror/usecase/vald.go +++ b/pkg/gateway/mirror/usecase/vald.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2023 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 @@ -18,7 +18,6 @@ import ( "github.com/vdaas/vald/apis/grpc/v1/vald" mclient "github.com/vdaas/vald/internal/client/v1/client/mirror" - "github.com/vdaas/vald/internal/errgroup" "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/observability" @@ -29,6 +28,7 @@ import ( "github.com/vdaas/vald/internal/safety" "github.com/vdaas/vald/internal/servers/server" "github.com/vdaas/vald/internal/servers/starter" + "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/pkg/gateway/mirror/config" handler "github.com/vdaas/vald/pkg/gateway/mirror/handler/grpc" "github.com/vdaas/vald/pkg/gateway/mirror/handler/rest" From c26ac88614bd03d42b66d46ac4b66456d7eb79ad Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 21 Sep 2023 11:55:11 +0900 Subject: [PATCH 16/93] use resuable workflow to build mirror image Signed-off-by: hlts2 --- .../dockers-gateway-mirror-image.yaml | 82 +------------------ 1 file changed, 4 insertions(+), 78 deletions(-) diff --git a/.github/workflows/dockers-gateway-mirror-image.yaml b/.github/workflows/dockers-gateway-mirror-image.yaml index bf11d33a0f..dbb6743b27 100644 --- a/.github/workflows/dockers-gateway-mirror-image.yaml +++ b/.github/workflows/dockers-gateway-mirror-image.yaml @@ -74,83 +74,9 @@ on: - "dockers/gateway/mirror/Dockerfile" - "versions/GO_VERSION" -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }} - cancel-in-progress: true - jobs: build: - strategy: - max-parallel: 4 - runs-on: ubuntu-latest - if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} - steps: - - uses: actions/checkout@v3 - - name: set git config - run: | - git config --global --add safe.directory ${GITHUB_WORKSPACE} - - name: Setup QEMU - uses: docker/setup-qemu-action@v2 - with: - platforms: all - - name: Setup Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - buildkitd-flags: "--debug" - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PASS }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ secrets.PACKAGE_USER }} - password: ${{ secrets.PACKAGE_TOKEN }} - - name: Build and Publish - id: build_and_publish - uses: ./.github/actions/docker-build - with: - target: gateway-mirror - builder: ${{ steps.buildx.outputs.name }} - - name: Initialize CodeQL - if: startsWith( github.ref, 'refs/tags/') - uses: github/codeql-action/init@v2 - - name: Run vulnerability scanner (table) - if: startsWith( github.ref, 'refs/tags/') - uses: aquasecurity/trivy-action@master - with: - image-ref: "${{ steps.build_and_publish.outputs.IMAGE_NAME }}:${{ steps.build_and_publish.outputs.PRIMARY_TAG }}" - format: "table" - - name: Run vulnerability scanner (sarif) - if: startsWith( github.ref, 'refs/tags/') - uses: aquasecurity/trivy-action@master - with: - image-ref: "${{ steps.build_and_publish.outputs.IMAGE_NAME }}:${{ steps.build_and_publish.outputs.PRIMARY_TAG }}" - format: "template" - template: "@/contrib/sarif.tpl" - output: "trivy-results.sarif" - - name: Upload Trivy scan results to Security tab - if: startsWith( github.ref, 'refs/tags/') - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: "trivy-results.sarif" - slack: - name: Slack notification - needs: build - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' || startsWith( github.ref, 'refs/tags/') - steps: - - uses: technote-space/workflow-conclusion-action@v2 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: 8398a7/action-slack@v3 - with: - author_name: vald-mirror-gateway image build - status: ${{ env.WORKFLOW_CONCLUSION }} - only_mention_fail: channel - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WEBHOOK_URL }} + uses: ./.github/workflows/_docker-image.yaml + with: + target: gateway-mirror + secrets: inherit From 8a172d9928f1615aeeb1a0161902f19e8d18ee89 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 21 Sep 2023 13:56:13 +0900 Subject: [PATCH 17/93] use internal sync package and refactor Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 68 ++++++------------- .../mirror/handler/grpc/handler_test.go | 8 +-- pkg/gateway/mirror/service/mirror.go | 17 +++-- 3 files changed, 34 insertions(+), 59 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 03ea5b0e8f..e3b9f7aa0b 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -17,7 +17,6 @@ import ( "context" "fmt" "reflect" - "sync" "github.com/vdaas/vald/apis/grpc/v1/payload" "github.com/vdaas/vald/apis/grpc/v1/vald" @@ -29,6 +28,7 @@ import ( "github.com/vdaas/vald/internal/net/grpc/status" "github.com/vdaas/vald/internal/observability/trace" "github.com/vdaas/vald/internal/safety" + "github.com/vdaas/vald/internal/sync" "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/pkg/gateway/mirror/service" ) @@ -1043,7 +1043,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * } var mu sync.Mutex - var result sync.Map + var result sync.Map[string, error] loc = &payload.Object_Location{ Uuid: req.GetVector().GetId(), Ips: make([]string, 0), @@ -1120,17 +1120,11 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * var errs error targets := make([]string, 0, 10) - result.Range(func(target, err any) bool { + result.Range(func(target string, err error) bool { if err == nil { - targets = append(targets, target.(string)) + targets = append(targets, target) } else { - if err, ok := err.(error); ok && err != nil { - if errs != nil { - errs = errors.Join(errs, err) - } else { - errs = err - } - } + errs = errors.Join(errs, err) } return true }) @@ -1540,7 +1534,7 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * } var mu sync.Mutex - var result sync.Map + var result sync.Map[string, error] loc = &payload.Object_Location{ Uuid: req.GetVector().GetId(), Ips: make([]string, 0), @@ -1620,17 +1614,11 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * var errs error targets := make([]string, 0, 10) - result.Range(func(target, err any) bool { + result.Range(func(target string, err error) bool { if err == nil { - targets = append(targets, target.(string)) + targets = append(targets, target) } else { - if err, ok := err.(error); ok && err != nil { - if errs != nil { - errs = errors.Join(errs, err) - } else { - errs = err - } - } + errs = errors.Join(errs, err) } return true }) @@ -1708,7 +1696,7 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * } req := &payload.Update_Request{ - Vector: oldVec.(*payload.Object_Vector), + Vector: oldVec, Config: &payload.Update_Config{ SkipStrictExistCheck: true, }, @@ -2075,7 +2063,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * } var mu sync.Mutex - var result sync.Map + var result sync.Map[string, error] loc = &payload.Object_Location{ Uuid: req.GetVector().GetId(), Ips: make([]string, 0), @@ -2152,17 +2140,11 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * var errs error targets := make([]string, 0, 10) - result.Range(func(target, err any) bool { + result.Range(func(target string, err error) bool { if err == nil { - targets = append(targets, target.(string)) + targets = append(targets, target) } else { - if err, ok := err.(error); ok && err != nil { - if errs != nil { - errs = errors.Join(errs, err) - } else { - errs = err - } - } + errs = errors.Join(errs, err) } return true }) @@ -2239,7 +2221,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * } req := &payload.Update_Request{ - Vector: oldVec.(*payload.Object_Vector), + Vector: oldVec, Config: &payload.Update_Config{ SkipStrictExistCheck: true, }, @@ -2606,7 +2588,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * } var mu sync.Mutex - var result sync.Map + var result sync.Map[string, error] loc = &payload.Object_Location{ Uuid: req.GetId().GetId(), Ips: make([]string, 0), @@ -2684,17 +2666,11 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * var errs error targets := make([]string, 0, 10) - result.Range(func(target, err any) bool { + result.Range(func(target string, err error) bool { if err == nil { - targets = append(targets, target.(string)) + targets = append(targets, target) } else { - if err, ok := err.(error); ok && err != nil { - if errs != nil { - errs = errors.Join(errs, err) - } else { - errs = err - } - } + errs = errors.Join(errs, err) } return true }) @@ -2741,7 +2717,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * return nil } req := &payload.Upsert_Request{ - Vector: objv.(*payload.Object_Vector), + Vector: objv, Config: &payload.Upsert_Config{ SkipStrictExistCheck: true, }, @@ -3091,7 +3067,7 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques return vec, nil } -func (s *server) getObjects(ctx context.Context, req *payload.Object_VectorRequest) (vecs *sync.Map, err error) { +func (s *server) getObjects(ctx context.Context, req *payload.Object_VectorRequest) (vecs *sync.Map[string, *payload.Object_Vector], err error) { ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "getObjects"), apiName+"/"+vald.GetObjectRPCName+"/getObjects") defer func() { if span != nil { @@ -3101,7 +3077,7 @@ func (s *server) getObjects(ctx context.Context, req *payload.Object_VectorReque var errs error var emu sync.Mutex - vecs = new(sync.Map) + vecs = new(sync.Map[string, *payload.Object_Vector]) err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.GetObjectRPCName+"/getObjects/"+target) defer func() { diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index a4746106b4..84968025c4 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -16,7 +16,6 @@ package grpc import ( "context" "reflect" - "sync" "sync/atomic" "testing" @@ -26,6 +25,7 @@ import ( "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/net/grpc/codes" "github.com/vdaas/vald/internal/net/grpc/status" + "github.com/vdaas/vald/internal/sync" "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/internal/test/data/vector" "github.com/vdaas/vald/internal/test/goleak" @@ -5288,7 +5288,7 @@ func Test_server_getObjects(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantVecs *sync.Map + wantVecs *sync.Map[string, *payload.Object_Vector] err error } type test struct { @@ -5296,11 +5296,11 @@ func Test_server_getObjects(t *testing.T) { args args fields fields want want - checkFunc func(want, *sync.Map, error) error + checkFunc func(want, *sync.Map[string, *payload.Object_Vector], error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotVecs *sync.Map, err error) error { + defaultCheckFunc := func(w want, gotVecs *sync.Map[string, *payload.Object_Vector], err error) error { if !errors.Is(err, w.err) { return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) } diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index 7b7ab5718e..03e9b6fc1f 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -16,7 +16,6 @@ package service import ( "context" "reflect" - "sync" "time" "github.com/vdaas/vald/apis/grpc/v1/payload" @@ -29,6 +28,7 @@ import ( "github.com/vdaas/vald/internal/net/grpc/errdetails" "github.com/vdaas/vald/internal/net/grpc/status" "github.com/vdaas/vald/internal/observability/trace" + "github.com/vdaas/vald/internal/sync" "github.com/vdaas/vald/internal/sync/errgroup" ) @@ -45,10 +45,10 @@ type Mirror interface { } type mirr struct { - addrl sync.Map // List of all connected addresses + addrl sync.Map[string, any] // List of all connected addresses selfMirrTgts []*payload.Mirror_Target // Targets of self mirror gateway - selfMirrAddrl sync.Map // List of self Mirror gateway addresses - gwAddrl sync.Map // List of Vald Gateway addresses + selfMirrAddrl sync.Map[string, any] // List of self Mirror gateway addresses + gwAddrl sync.Map[string, any] // List of Vald Gateway addresses eg errgroup.Group advertiseDur time.Duration gateway Gateway @@ -69,12 +69,12 @@ func NewMirror(opts ...MirrorOption) (_ Mirror, err error) { } m.selfMirrTgts = make([]*payload.Mirror_Target, 0) - m.selfMirrAddrl.Range(func(addr, _ any) bool { + m.selfMirrAddrl.Range(func(addr string, _ any) bool { var ( host string port uint16 ) - host, port, err = net.SplitHostPort(addr.(string)) + host, port, err = net.SplitHostPort(addr) if err != nil { return false } @@ -473,10 +473,9 @@ func (m *mirr) connectedMirrorAddrs() []string { } func (m *mirr) RangeAllMirrorAddr(f func(addr string, _ any) bool) { - m.addrl.Range(func(key, value any) bool { - addr := key.(string) + m.addrl.Range(func(addr string, value any) bool { if !m.isGatewayAddr(addr) { - if !f(key.(string), value) { + if !f(addr, value) { return false } } From 65af96595a39e55ad389aa4b653f74a1c9f2302d Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 21 Sep 2023 14:02:12 +0900 Subject: [PATCH 18/93] fix error handling Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 66 ++++------------------ 1 file changed, 11 insertions(+), 55 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index e3b9f7aa0b..363bf49d51 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -1187,11 +1187,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * return nil } emu.Lock() - if rerrs != nil { - rerrs = errors.Join(rerrs, err) - } else { - rerrs = err - } + rerrs = errors.Join(rerrs, err) emu.Unlock() return err } @@ -1418,11 +1414,7 @@ func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequ span.SetStatus(trace.StatusError, err.Error()) } emu.Lock() - if errs != nil { - errs = errors.Join(errs, err) - } else { - errs = err - } + errs = errors.Join(errs, err) emu.Unlock() return nil } @@ -1684,11 +1676,7 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * return nil } emu.Lock() - if rerrs != nil { - rerrs = errors.Join(rerrs, err) - } else { - rerrs = err - } + rerrs = errors.Join(rerrs, err) emu.Unlock() return err } @@ -1718,11 +1706,7 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * return nil } emu.Lock() - if rerrs != nil { - rerrs = errors.Join(rerrs, err) - } else { - rerrs = err - } + rerrs = errors.Join(rerrs, err) emu.Unlock() return err } @@ -1947,11 +1931,7 @@ func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequ span.SetStatus(trace.StatusError, err.Error()) } emu.Lock() - if errs != nil { - errs = errors.Join(errs, err) - } else { - errs = err - } + errs = errors.Join(errs, err) emu.Unlock() return nil } @@ -2209,11 +2189,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * return nil } emu.Lock() - if rerrs != nil { - rerrs = errors.Join(rerrs, err) - } else { - rerrs = err - } + rerrs = errors.Join(rerrs, err) emu.Unlock() return err } @@ -2243,11 +2219,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * return nil } emu.Lock() - if rerrs != nil { - rerrs = errors.Join(rerrs, err) - } else { - rerrs = err - } + rerrs = errors.Join(rerrs, err) emu.Unlock() return err } @@ -2472,11 +2444,7 @@ func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequ span.SetStatus(trace.StatusError, err.Error()) } emu.Lock() - if errs != nil { - errs = errors.Join(errs, err) - } else { - errs = err - } + errs = errors.Join(errs, err) emu.Unlock() return nil } @@ -2739,11 +2707,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * return nil } emu.Lock() - if rerrs != nil { - rerrs = errors.Join(rerrs, err) - } else { - rerrs = err - } + rerrs = errors.Join(rerrs, err) emu.Unlock() return err } @@ -2968,11 +2932,7 @@ func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequ span.SetStatus(trace.StatusError, err.Error()) } emu.Lock() - if errs != nil { - errs = errors.Join(errs, err) - } else { - errs = err - } + errs = errors.Join(errs, err) emu.Unlock() return nil } @@ -3145,11 +3105,7 @@ func (s *server) getObjects(ctx context.Context, req *payload.Object_VectorReque return nil } emu.Lock() - if errs == nil { - errs = err - } else { - errs = errors.Join(errs, err) - } + errs = errors.Join(errs, err) emu.Unlock() return err } From 19558ab5e6e6cc4677b1b04dda65ea6d52519f37 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 21 Sep 2023 16:46:59 +0900 Subject: [PATCH 19/93] add network policy settings and update deploy command Signed-off-by: hlts2 --- .../detect-docker-image-tags/action.yaml | 1 + Makefile.d/k8s.mk | 4 ++ .../templates/gateway/lb/networkpolicy.yaml | 7 +++ .../templates/gateway/mirror/configmap.yaml | 4 +- .../gateway/mirror/networkpolicy.yaml | 53 +++++++++++++++++++ 5 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 charts/vald/templates/gateway/mirror/networkpolicy.yaml diff --git a/.github/actions/detect-docker-image-tags/action.yaml b/.github/actions/detect-docker-image-tags/action.yaml index 42c254a5d2..5119cb00f5 100644 --- a/.github/actions/detect-docker-image-tags/action.yaml +++ b/.github/actions/detect-docker-image-tags/action.yaml @@ -48,6 +48,7 @@ runs: ["vdaas/vald-agent-sidecar"]="agent.sidecar.image.tag" ["vdaas/vald-discoverer-k8s"]="discoverer.image.tag" ["vdaas/vald-lb-gateway"]="gateway.lb.image.tag" + ["vdaas/vald-mirror-gateway"]="gateway.mirror.image.tag" ["vdaas/vald-manager-index"]="manager.index.image.tag" ["vdaas/vald-helm-operator"]="image.tag" ) diff --git a/Makefile.d/k8s.mk b/Makefile.d/k8s.mk index e4b42c75ff..b1b47b8936 100644 --- a/Makefile.d/k8s.mk +++ b/Makefile.d/k8s.mk @@ -75,6 +75,7 @@ k8s/vald/deploy: --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ + --set gateway.mirror.image.repository=$(CRORG)/$(MIRROR_GATEWAY_IMAGE) \ --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ $(HELM_EXTRA_OPTIONS) \ --output-dir $(TEMP_DIR) \ @@ -84,6 +85,7 @@ k8s/vald/deploy: kubectl apply -f $(TEMP_DIR)/vald/templates/agent || true kubectl apply -f $(TEMP_DIR)/vald/templates/discoverer || true kubectl apply -f $(TEMP_DIR)/vald/templates/gateway/lb || true + kubectl apply -f $(TEMP_DIR)/vald/templates/gateway/mirror || true rm -rf $(TEMP_DIR) kubectl get pods -o jsonpath="{.items[*].spec.containers[*].image}" | tr " " "\n" @@ -98,9 +100,11 @@ k8s/vald/delete: --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ + --set gateway.mirror.image.repository=$(CRORG)/$(MIRROR_GATEWAY_IMAGE) \ --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ --output-dir $(TEMP_DIR) \ charts/vald + kubectl delete -f $(TEMP_DIR)/vald/templates/gateway/mirror kubectl delete -f $(TEMP_DIR)/vald/templates/gateway/lb kubectl delete -f $(TEMP_DIR)/vald/templates/manager/index kubectl delete -f $(TEMP_DIR)/vald/templates/discoverer diff --git a/charts/vald/templates/gateway/lb/networkpolicy.yaml b/charts/vald/templates/gateway/lb/networkpolicy.yaml index 05f838ad98..40201d98d7 100644 --- a/charts/vald/templates/gateway/lb/networkpolicy.yaml +++ b/charts/vald/templates/gateway/lb/networkpolicy.yaml @@ -17,6 +17,7 @@ {{- $agent := .Values.agent -}} {{- $lb := .Values.gateway.lb -}} {{- $filter := .Values.gateway.filter -}} +{{- $mirror := .Values.gateway.mirror -}} {{- $discoverer := .Values.discoverer -}} {{- if .Values.defaults.networkPolicy.enabled }} apiVersion: networking.k8s.io/v1 @@ -41,6 +42,12 @@ spec: podSelector: matchLabels: app: {{ $filter.name }} + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: {{ .Release.Namespace }} + podSelector: + matchLabels: + app: {{ $mirror.name }} {{- if .Values.defaults.networkPolicy.custom.ingress }} {{- toYaml .Values.defaults.networkPolicy.custom.ingress | nindent 4 }} {{- end }} diff --git a/charts/vald/templates/gateway/mirror/configmap.yaml b/charts/vald/templates/gateway/mirror/configmap.yaml index f20647ce53..b8f776996d 100644 --- a/charts/vald/templates/gateway/mirror/configmap.yaml +++ b/charts/vald/templates/gateway/mirror/configmap.yaml @@ -48,7 +48,7 @@ data: discovery_duration: {{ $gateway.gateway_config.discovery_duration }} colocation: {{ $gateway.gateway_config.colocation }} group: {{ $gateway.gateway_config.group }} - net: + net: {{- toYaml $gateway.gateway_config.net | nindent 8 }} client: {{- $client := $gateway.gateway_config.client }} @@ -69,7 +69,7 @@ data: {{- include "vald.grpc.client" $GRPCClient | nindent 8 }} self_mirror_addr: {{- if $gateway.ingress.enabled -}} - {{- $gateway.gateway_config.self_mirror_addr | indent 1 }} + {{- printf "%s:%d" $gateway.ingress.host 80 | indent 1 }} {{- else -}} {{- $defaultHost := printf "%s.%s.svc.cluster.local" $gateway.name .Release.Namespace }} {{- $defaultPort := default .Values.defaults.server_config.servers.grpc.port $gateway.server_config.servers.grpc.port }} diff --git a/charts/vald/templates/gateway/mirror/networkpolicy.yaml b/charts/vald/templates/gateway/mirror/networkpolicy.yaml new file mode 100644 index 0000000000..bab43b69fb --- /dev/null +++ b/charts/vald/templates/gateway/mirror/networkpolicy.yaml @@ -0,0 +1,53 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +{{- $lb := .Values.gateway.lb -}} +{{- $mirror := .Values.gateway.mirror -}} +{{- if .Values.defaults.networkPolicy.enabled }} +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: mirror-allow +spec: + podSelector: + matchLabels: + app: {{ $mirror.name }} + policyTypes: + - Ingress + - Egress + ingress: + - from: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: kube-system + {{- if .Values.defaults.networkPolicy.custom.ingress }} + {{- toYaml .Values.defaults.networkPolicy.custom.ingress | nindent 4 }} + {{- end }} + egress: + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: {{ .Release.Namespace }} + podSelector: + matchLabels: + app: {{ $lb.name }} + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: kube-system + {{- if .Values.defaults.networkPolicy.custom.egress }} + {{- toYaml .Values.defaults.networkPolicy.custom.egress | nindent 4 }} + {{- end }} +{{- end }} From 3924e8fccd3a1602f30c1358c6888654bc84ff59 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 21 Sep 2023 19:07:39 +0900 Subject: [PATCH 20/93] add default setting logic Signed-off-by: hlts2 --- charts/vald/templates/gateway/mirror/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/vald/templates/gateway/mirror/configmap.yaml b/charts/vald/templates/gateway/mirror/configmap.yaml index b8f776996d..a8641c4f42 100644 --- a/charts/vald/templates/gateway/mirror/configmap.yaml +++ b/charts/vald/templates/gateway/mirror/configmap.yaml @@ -69,7 +69,7 @@ data: {{- include "vald.grpc.client" $GRPCClient | nindent 8 }} self_mirror_addr: {{- if $gateway.ingress.enabled -}} - {{- printf "%s:%d" $gateway.ingress.host 80 | indent 1 }} + {{- $gateway.gateway_config.self_mirror_addr | default (printf "%s:%d" $gateway.ingress.host 80) | indent 1 }} {{- else -}} {{- $defaultHost := printf "%s.%s.svc.cluster.local" $gateway.name .Release.Namespace }} {{- $defaultPort := default .Values.defaults.server_config.servers.grpc.port $gateway.server_config.servers.grpc.port }} From 8fabca90e88e81fb53062af7bfe1aab51c014590 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Mon, 25 Sep 2023 14:24:17 +0900 Subject: [PATCH 21/93] add new fileld to crd schema and update crd Signed-off-by: hlts2 --- charts/vald/crds/valdmirrortarget.yaml | 2 ++ charts/vald/schemas/mirror-target-values.yaml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/charts/vald/crds/valdmirrortarget.yaml b/charts/vald/crds/valdmirrortarget.yaml index d7ce64148a..b6f47e9091 100644 --- a/charts/vald/crds/valdmirrortarget.yaml +++ b/charts/vald/crds/valdmirrortarget.yaml @@ -83,6 +83,8 @@ spec: spec: type: object properties: + colocation: + type: string target: type: object properties: diff --git a/charts/vald/schemas/mirror-target-values.yaml b/charts/vald/schemas/mirror-target-values.yaml index 6d341b25e4..7885ac85bf 100644 --- a/charts/vald/schemas/mirror-target-values.yaml +++ b/charts/vald/schemas/mirror-target-values.yaml @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +# @schema {"name": "colocation", "type": "string"} +# colocation -- The colocation name colocation: dc1 # @schema {"name": "target", "type": "object", "required": ["host", "port"]} # target -- Mirror target information From 00b9e017b21fc10ce2ff7cb08b46917eec30fcaf Mon Sep 17 00:00:00 2001 From: hlts2 Date: Mon, 25 Sep 2023 16:26:55 +0900 Subject: [PATCH 22/93] fix make command to deploy vald with mirror components Signed-off-by: hlts2 --- Makefile.d/k8s.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.d/k8s.mk b/Makefile.d/k8s.mk index b1b47b8936..eb4f62d56d 100644 --- a/Makefile.d/k8s.mk +++ b/Makefile.d/k8s.mk @@ -78,6 +78,7 @@ k8s/vald/deploy: --set gateway.mirror.image.repository=$(CRORG)/$(MIRROR_GATEWAY_IMAGE) \ --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ $(HELM_EXTRA_OPTIONS) \ + --include-crds \ --output-dir $(TEMP_DIR) \ charts/vald @echo "Permitting error because there's some cases nothing to apply" @@ -85,6 +86,7 @@ k8s/vald/deploy: kubectl apply -f $(TEMP_DIR)/vald/templates/agent || true kubectl apply -f $(TEMP_DIR)/vald/templates/discoverer || true kubectl apply -f $(TEMP_DIR)/vald/templates/gateway/lb || true + kubectl apply -f $(TEMP_DIR)/vald/crds || true kubectl apply -f $(TEMP_DIR)/vald/templates/gateway/mirror || true rm -rf $(TEMP_DIR) kubectl get pods -o jsonpath="{.items[*].spec.containers[*].image}" | tr " " "\n" @@ -102,6 +104,7 @@ k8s/vald/delete: --set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \ --set gateway.mirror.image.repository=$(CRORG)/$(MIRROR_GATEWAY_IMAGE) \ --set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \ + --include-crds \ --output-dir $(TEMP_DIR) \ charts/vald kubectl delete -f $(TEMP_DIR)/vald/templates/gateway/mirror @@ -109,6 +112,7 @@ k8s/vald/delete: kubectl delete -f $(TEMP_DIR)/vald/templates/manager/index kubectl delete -f $(TEMP_DIR)/vald/templates/discoverer kubectl delete -f $(TEMP_DIR)/vald/templates/agent + kubectl delete -f $(TEMP_DIR)/vald/crds rm -rf $(TEMP_DIR) .PHONY: k8s/multi/vald/deploy From 6eaba0362aae976a188ed1a895c69b0d99d91639 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Sep 2023 17:33:47 +0900 Subject: [PATCH 23/93] add e2e test for mirror Signed-off-by: hlts2 --- .github/actions/e2e-deploy-vald/action.yaml | 11 +++ .github/helm/values/vald-mirror-target.yaml | 24 ++++++ .github/helm/values/values-mirror-01.yaml | 81 ++++++++++++++++++++ .github/helm/values/values-mirror-02.yaml | 85 +++++++++++++++++++++ .github/workflows/e2e.yml | 62 +++++++++++++++ 5 files changed, 263 insertions(+) create mode 100644 .github/helm/values/vald-mirror-target.yaml create mode 100644 .github/helm/values/values-mirror-01.yaml create mode 100644 .github/helm/values/values-mirror-02.yaml diff --git a/.github/actions/e2e-deploy-vald/action.yaml b/.github/actions/e2e-deploy-vald/action.yaml index d90ae83dc6..be004dd45c 100644 --- a/.github/actions/e2e-deploy-vald/action.yaml +++ b/.github/actions/e2e-deploy-vald/action.yaml @@ -29,6 +29,9 @@ inputs: description: "Path to the values.yaml that passed to Helm command." required: false default: "false" + namespace: + description: "Namespace to deploy." + required: false wait_for_selector: description: "Label selector used for specifying a pod waited for" required: false @@ -61,6 +64,14 @@ runs: run: | cat ${{ inputs.values }} + - name: Change namespace + if: ${{ inputs.namespace != '' }} + shell: bash + run: | + kubectl create ns ${NAMESPACE} || kubectl config set-context --current --namespace=${NAMESPACE} + env: + NAMESPACE: ${{ inputs.namespace }} + - name: Deploy vald from remote charts shell: bash id: deploy_vald_remote diff --git a/.github/helm/values/vald-mirror-target.yaml b/.github/helm/values/vald-mirror-target.yaml new file mode 100644 index 0000000000..fdd2ef9c0e --- /dev/null +++ b/.github/helm/values/vald-mirror-target.yaml @@ -0,0 +1,24 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +apiVersion: vald.vdaas.org/v1 +kind: ValdMirrorTarget +metadata: + name: mirror-target-02 +spec: + colocation: dc1 + target: + host: vald-mirror-gateway.vald-02.svc.cluster.local + port: 8081 diff --git a/.github/helm/values/values-mirror-01.yaml b/.github/helm/values/values-mirror-01.yaml new file mode 100644 index 0000000000..75eb71f435 --- /dev/null +++ b/.github/helm/values/values-mirror-01.yaml @@ -0,0 +1,81 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +defaults: + logging: + level: info + networkPolicy: + enabled: false + +gateway: + mirror: + enabled: true + clusterRoleBinding: + name: vald-mirror-01 + serviceAccount: + name: vald-mirror-01 + lb: + enabled: true + minReplicas: 1 + hpa: + enabled: false + resources: + requests: + cpu: 100m + memory: 50Mi + gateway_config: + index_replica: 3 + +agent: + minReplicas: 3 + maxReplicas: 10 + podManagementPolicy: Parallel + hpa: + enabled: false + resources: + requests: + cpu: 100m + memory: 50Mi + ngt: + auto_index_duration_limit: 2m + auto_index_check_duration: 30s + auto_index_length: 1000 + dimension: 784 + +discoverer: + minReplicas: 1 + hpa: + enabled: false + resources: + requests: + cpu: 100m + memory: 50Mi + clusterRoleBinding: + name: vald-01 + serviceAccount: + name: vald-01 + +manager: + index: + replicas: 1 + resources: + requests: + cpu: 100m + memory: 30Mi + indexer: + auto_index_duration_limit: 2m + auto_index_check_duration: 30s + auto_index_length: 1000 diff --git a/.github/helm/values/values-mirror-02.yaml b/.github/helm/values/values-mirror-02.yaml new file mode 100644 index 0000000000..79dc479e88 --- /dev/null +++ b/.github/helm/values/values-mirror-02.yaml @@ -0,0 +1,85 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +defaults: + logging: + level: info + networkPolicy: + enabled: false + +gateway: + mirror: + enabled: true + clusterRole: + enabled: false + clusterRoleBinding: + name: vald-mirror-02 + serviceAccount: + name: vald-mirror-02 + lb: + enabled: true + minReplicas: 1 + hpa: + enabled: false + resources: + requests: + cpu: 100m + memory: 50Mi + gateway_config: + index_replica: 3 + +agent: + minReplicas: 3 + maxReplicas: 10 + podManagementPolicy: Parallel + hpa: + enabled: false + resources: + requests: + cpu: 100m + memory: 50Mi + ngt: + auto_index_duration_limit: 2m + auto_index_check_duration: 30s + auto_index_length: 1000 + dimension: 784 + +discoverer: + minReplicas: 1 + hpa: + enabled: false + resources: + requests: + cpu: 100m + memory: 50Mi + clusterRole: + enabled: false + clusterRoleBinding: + name: vald-02 + serviceAccount: + name: vald-02 + +manager: + index: + replicas: 1 + resources: + requests: + cpu: 100m + memory: 30Mi + indexer: + auto_index_duration_limit: 2m + auto_index_check_duration: 30s + auto_index_length: 1000 diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 924865531f..cf68e0da5d 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -269,6 +269,67 @@ jobs: env: POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }} + e2e-stream-crud-with-mirror: + name: "E2E test (Stream CRUD) with mirror" + needs: [dump-contexts-to-log] + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v3 + + - name: Set Git config + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} + + - name: Setup E2E environment + id: setup_e2e + uses: ./.github/actions/setup-e2e + with: + target_images: "vdaas/vald-agent-ngt vdaas/vald-discoverer-k8s vdaas/vald-lb-gateway vdaas/vald-manager-index vdaas/vald-mirror-gateway" + + - name: Deploy Vald-01 + id: deploy_vald_01 + uses: ./.github/actions/e2e-deploy-vald + with: + namespace: vald-01 + helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }} + values: .github/helm/values/values-mirror-01.yaml + wait_for_selector: app=vald-mirror-gateway + + - name: Deploy Vald-02 + id: deploy_vald_02 + uses: ./.github/actions/e2e-deploy-vald + with: + namespace: vald-02 + helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }} + values: .github/helm/values/values-mirror-02.yaml + wait_for_selector: app=vald-mirror-gateway + + - name: Deploy Mirror Target + run: | + kubectl apply -f .github/helm/values/vald-mirror-target.yaml -n vald-01 + sleep 30s + kubectl get vmt -o wide -A + + # - name: Run E2E CRUD + # run: | + # make hack/benchmark/assets/dataset/${{ env.DATASET }} + # make E2E_BIND_PORT=8081 \ + # E2E_DATASET_NAME=${{ env.DATASET }} \ + # E2E_INSERT_COUNT=10000\ + # E2E_SEARCH_COUNT=10000 \ + # E2E_SEARCH_BY_ID_COUNT=10000 \ + # E2E_GET_OBJECT_COUNT=100 \ + # E2E_UPDATE_COUNT=100 \ + # E2E_UPSERT_COUNT=100 \ + # E2E_REMOVE_COUNT=100 \ + # E2E_WAIT_FOR_CREATE_INDEX_DURATION=3m \ + # E2E_TARGET_POD_NAME=${POD_NAME} \ + # E2E_TARGET_NAMESPACE=vald-01 \ + # e2e + # env: + # POD_NAME: ${{ steps.deploy_vald_01.outputs.POD_NAME }} + slack-notification: name: "Slack notification" if: startsWith( github.ref, 'refs/tags/') @@ -278,6 +339,7 @@ jobs: - e2e-stream-crud - e2e-stream-crud-for-operator - e2e-stream-crud-skip-exist-check + - e2e-stream-crud-with-mirror runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 4fea2732e058c1b5de486ea7247ec495ab9ccda7 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Sep 2023 17:50:44 +0900 Subject: [PATCH 24/93] add debug command to get pod status Signed-off-by: hlts2 --- .github/workflows/e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index cf68e0da5d..ef631489ac 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -309,6 +309,7 @@ jobs: run: | kubectl apply -f .github/helm/values/vald-mirror-target.yaml -n vald-01 sleep 30s + kubectl get pods -A kubectl get vmt -o wide -A # - name: Run E2E CRUD From b32c7057f3ebe8d3692f566f6ac64bd2ea26610f Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Sep 2023 18:06:17 +0900 Subject: [PATCH 25/93] bugfix command Signed-off-by: hlts2 --- .github/actions/e2e-deploy-vald/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/e2e-deploy-vald/action.yaml b/.github/actions/e2e-deploy-vald/action.yaml index be004dd45c..05c94523c0 100644 --- a/.github/actions/e2e-deploy-vald/action.yaml +++ b/.github/actions/e2e-deploy-vald/action.yaml @@ -68,7 +68,7 @@ runs: if: ${{ inputs.namespace != '' }} shell: bash run: | - kubectl create ns ${NAMESPACE} || kubectl config set-context --current --namespace=${NAMESPACE} + kubectl create ns ${NAMESPACE} ; kubectl config set-context --current --namespace=${NAMESPACE} env: NAMESPACE: ${{ inputs.namespace }} From 37923f3bf09f68f4db1d8c56e7472ecf2e2a0ec9 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Sep 2023 18:17:23 +0900 Subject: [PATCH 26/93] disable sidecar e2e and add mirror e2e command Signed-off-by: hlts2 --- .github/workflows/e2e.yml | 127 +++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 64 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ef631489ac..d458ba9944 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -227,47 +227,47 @@ jobs: env: POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }} - e2e-agent-and-sidecar: - name: "E2E Agent & Sidecar test" - needs: [dump-contexts-to-log] - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v3 - - - name: Set Git config - run: | - git config --global --add safe.directory ${GITHUB_WORKSPACE} - - - name: Setup E2E environment - id: setup_e2e - uses: ./.github/actions/setup-e2e - with: - target_images: vdaas/vald-agent-ngt vdaas/vald-agent-sidecar - - - name: Deploy Vald - id: deploy_vald - uses: ./.github/actions/e2e-deploy-vald - with: - require_minio: "true" - helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }} - values: .github/helm/values/values-agent-sidecar.yaml - wait_for_selector: app=vald-agent-ngt - wait_for_timeout: 29m - - - name: Run E2E Agent & Sidecar - run: | - make hack/benchmark/assets/dataset/${{ env.DATASET }} - make E2E_BIND_PORT=8081 \ - E2E_DATASET_NAME=${{ env.DATASET }} \ - E2E_INSERT_COUNT=10000 \ - E2E_SEARCH_COUNT=4000 \ - E2E_WAIT_FOR_CREATE_INDEX_DURATION=8m \ - E2E_TARGET_POD_NAME=${POD_NAME} \ - E2E_TARGET_NAMESPACE=default \ - e2e/sidecar - env: - POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }} + # e2e-agent-and-sidecar: + # name: "E2E Agent & Sidecar test" + # needs: [dump-contexts-to-log] + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # steps: + # - uses: actions/checkout@v3 + # + # - name: Set Git config + # run: | + # git config --global --add safe.directory ${GITHUB_WORKSPACE} + # + # - name: Setup E2E environment + # id: setup_e2e + # uses: ./.github/actions/setup-e2e + # with: + # target_images: vdaas/vald-agent-ngt vdaas/vald-agent-sidecar + # + # - name: Deploy Vald + # id: deploy_vald + # uses: ./.github/actions/e2e-deploy-vald + # with: + # require_minio: "true" + # helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }} + # values: .github/helm/values/values-agent-sidecar.yaml + # wait_for_selector: app=vald-agent-ngt + # wait_for_timeout: 29m + # + # - name: Run E2E Agent & Sidecar + # run: | + # make hack/benchmark/assets/dataset/${{ env.DATASET }} + # make E2E_BIND_PORT=8081 \ + # E2E_DATASET_NAME=${{ env.DATASET }} \ + # E2E_INSERT_COUNT=10000 \ + # E2E_SEARCH_COUNT=4000 \ + # E2E_WAIT_FOR_CREATE_INDEX_DURATION=8m \ + # E2E_TARGET_POD_NAME=${POD_NAME} \ + # E2E_TARGET_NAMESPACE=default \ + # e2e/sidecar + # env: + # POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }} e2e-stream-crud-with-mirror: name: "E2E test (Stream CRUD) with mirror" @@ -308,34 +308,33 @@ jobs: - name: Deploy Mirror Target run: | kubectl apply -f .github/helm/values/vald-mirror-target.yaml -n vald-01 - sleep 30s - kubectl get pods -A - kubectl get vmt -o wide -A - - # - name: Run E2E CRUD - # run: | - # make hack/benchmark/assets/dataset/${{ env.DATASET }} - # make E2E_BIND_PORT=8081 \ - # E2E_DATASET_NAME=${{ env.DATASET }} \ - # E2E_INSERT_COUNT=10000\ - # E2E_SEARCH_COUNT=10000 \ - # E2E_SEARCH_BY_ID_COUNT=10000 \ - # E2E_GET_OBJECT_COUNT=100 \ - # E2E_UPDATE_COUNT=100 \ - # E2E_UPSERT_COUNT=100 \ - # E2E_REMOVE_COUNT=100 \ - # E2E_WAIT_FOR_CREATE_INDEX_DURATION=3m \ - # E2E_TARGET_POD_NAME=${POD_NAME} \ - # E2E_TARGET_NAMESPACE=vald-01 \ - # e2e - # env: - # POD_NAME: ${{ steps.deploy_vald_01.outputs.POD_NAME }} + sleep 10s + kubectl get pods -A && kubectl get vmt -o wide -A + + - name: Run E2E CRUD + run: | + make hack/benchmark/assets/dataset/${{ env.DATASET }} + make E2E_BIND_PORT=8081 \ + E2E_DATASET_NAME=${{ env.DATASET }} \ + E2E_INSERT_COUNT=10000\ + E2E_SEARCH_COUNT=10000 \ + E2E_SEARCH_BY_ID_COUNT=10000 \ + E2E_GET_OBJECT_COUNT=100 \ + E2E_UPDATE_COUNT=100 \ + E2E_UPSERT_COUNT=100 \ + E2E_REMOVE_COUNT=100 \ + E2E_WAIT_FOR_CREATE_INDEX_DURATION=3m \ + E2E_TARGET_POD_NAME=${POD_NAME} \ + E2E_TARGET_NAMESPACE=vald-01 \ + e2e + env: + POD_NAME: ${{ steps.deploy_vald_01.outputs.POD_NAME }} slack-notification: name: "Slack notification" if: startsWith( github.ref, 'refs/tags/') needs: - - e2e-agent-and-sidecar + # - e2e-agent-and-sidecar - e2e-multiapis-crud - e2e-stream-crud - e2e-stream-crud-for-operator From b4103640ed6e3c4cf2ab08dad4a79285033ae067 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Sep 2023 18:50:29 +0900 Subject: [PATCH 27/93] update cluster role Signed-off-by: hlts2 --- charts/vald-helm-operator/templates/clusterrole.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/charts/vald-helm-operator/templates/clusterrole.yaml b/charts/vald-helm-operator/templates/clusterrole.yaml index c0403124b5..50af049435 100644 --- a/charts/vald-helm-operator/templates/clusterrole.yaml +++ b/charts/vald-helm-operator/templates/clusterrole.yaml @@ -35,6 +35,18 @@ rules: verbs: - create - patch + - apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - rbac.authorization.k8s.io resources: From 7ece16ff8663a9e10ded8e448af5457dec8c3073 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Sep 2023 19:24:29 +0900 Subject: [PATCH 28/93] add cluster-info dump command Signed-off-by: hlts2 --- .github/actions/e2e-deploy-vald-helm-operator/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml index 215a7c0f95..4c47bfc56c 100644 --- a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml +++ b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml @@ -92,6 +92,7 @@ runs: kubectl apply -f ${VALDRELEASE} sleep 3 + kubectl cluster-info dump kubectl wait --for=condition=ready pod -l ${WAIT_FOR_SELECTOR} --timeout=${WAIT_FOR_TIMEOUT} From 2ed49cae8cdac38b2ffb2a7dce38ea8e115c0030 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Sep 2023 19:44:43 +0900 Subject: [PATCH 29/93] Revert "add cluster-info dump command" This reverts commit 7ece16ff8663a9e10ded8e448af5457dec8c3073. --- .github/actions/e2e-deploy-vald-helm-operator/action.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml index 4c47bfc56c..215a7c0f95 100644 --- a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml +++ b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml @@ -92,7 +92,6 @@ runs: kubectl apply -f ${VALDRELEASE} sleep 3 - kubectl cluster-info dump kubectl wait --for=condition=ready pod -l ${WAIT_FOR_SELECTOR} --timeout=${WAIT_FOR_TIMEOUT} From 454eaf3a071f903e4a6fad6068b65d8aa10a5c6d Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 27 Sep 2023 10:54:44 +0900 Subject: [PATCH 30/93] debug: add logs command Signed-off-by: hlts2 --- .github/actions/e2e-deploy-vald-helm-operator/action.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml index 215a7c0f95..7902f3ca6b 100644 --- a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml +++ b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml @@ -91,7 +91,10 @@ runs: run: | kubectl apply -f ${VALDRELEASE} - sleep 3 + sleep 10s + kubectl logs -l name=vald-helm-operator + echo "WAIT_FOR_TIMEOUT = ${WAIT_FOR_TIMEOUT}" + echo "WAIT_FOR_TIMEOUT = ${WAIT_FOR_TIMEOUT}" kubectl wait --for=condition=ready pod -l ${WAIT_FOR_SELECTOR} --timeout=${WAIT_FOR_TIMEOUT} From 388f8ef5e14d5e7d0abf48c44fd81526496969d9 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 27 Sep 2023 11:06:34 +0900 Subject: [PATCH 31/93] Revert "debug: add logs command" This reverts commit 454eaf3a071f903e4a6fad6068b65d8aa10a5c6d. --- .github/actions/e2e-deploy-vald-helm-operator/action.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml index 7902f3ca6b..215a7c0f95 100644 --- a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml +++ b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml @@ -91,10 +91,7 @@ runs: run: | kubectl apply -f ${VALDRELEASE} - sleep 10s - kubectl logs -l name=vald-helm-operator - echo "WAIT_FOR_TIMEOUT = ${WAIT_FOR_TIMEOUT}" - echo "WAIT_FOR_TIMEOUT = ${WAIT_FOR_TIMEOUT}" + sleep 3 kubectl wait --for=condition=ready pod -l ${WAIT_FOR_SELECTOR} --timeout=${WAIT_FOR_TIMEOUT} From 91deb873ac79ba016f9c94be90f1876f71984a8e Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 27 Sep 2023 20:07:51 +0900 Subject: [PATCH 32/93] add RemoveByTimestamp for mirror Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 242 +++++++++++++++++---- 1 file changed, 202 insertions(+), 40 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 363bf49d51..228b3fc0c0 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -168,10 +168,7 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { id, err = vc.Exists(ctx, meta, copts...) - if err != nil { - return nil, err - } - return id, nil + return id, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -235,10 +232,7 @@ func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res * _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.Search(ctx, req, copts...) - if err != nil { - return nil, err - } - return res, nil + return res, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -305,10 +299,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.SearchByID(ctx, req, copts...) - if err != nil { - return nil, err - } - return res, nil + return res, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -471,10 +462,7 @@ func (s *server) MultiSearch(ctx context.Context, req *payload.Search_MultiReque _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.MultiSearch(ctx, req, copts...) - if err != nil { - return nil, err - } - return res, nil + return res, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -538,10 +526,7 @@ func (s *server) MultiSearchByID(ctx context.Context, req *payload.Search_MultiI _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.MultiSearchByID(ctx, req, copts...) - if err != nil { - return nil, err - } - return res, nil + return res, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -605,10 +590,7 @@ func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.LinearSearch(ctx, req, copts...) - if err != nil { - return nil, err - } - return res, nil + return res, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -675,10 +657,7 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.LinearSearchByID(ctx, req, copts...) - if err != nil { - return nil, err - } - return res, nil + return res, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -844,10 +823,7 @@ func (s *server) MultiLinearSearch(ctx context.Context, req *payload.Search_Mult _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.MultiLinearSearch(ctx, req, copts...) - if err != nil { - return nil, err - } - return res, nil + return res, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -911,10 +887,7 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, req *payload.Search_ _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.MultiLinearSearchByID(ctx, req, copts...) - if err != nil { - return nil, err - } - return res, nil + return res, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -983,10 +956,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * if len(reqSrcPodName) != 0 { _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { loc, err = vc.Insert(ctx, req, copts...) - if err != nil { - return nil, err - } - return loc, nil + return loc, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -2959,6 +2929,198 @@ func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequ return res, nil } +func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.RemoveByTimestampRPCName), apiName+"/"+vald.RemoveByTimestampRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + reqSrcPodName := s.gateway.FromForwardedContext(ctx) + + // When this condition is matched, the request is proxied to another Mirror gateway. + // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. + if len(reqSrcPodName) != 0 { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, opts ...grpc.CallOption) (interface{}, error) { + locs, err = vc.RemoveByTimestamp(ctx, req, opts...) + return locs, err + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveByTimestampRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.RemoveByTimestampRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.RemoveByTimestampRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.RemoveByTimestampRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.RemoveByTimestampRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return locs, nil + } + + var mu sync.Mutex + var result sync.Map[string, error] + locs = new(payload.Object_Locations) + + err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, opts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.RemoveByTimestampRPCName+"/"+target) + defer func() { + if span != nil { + span.End() + } + }() + + res, err := vc.RemoveByTimestamp(ctx, req, opts...) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveByTimestampRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + var attrs trace.Attributes + var code codes.Code + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.RemoveByTimestampRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.RemoveByTimestampRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.RemoveByTimestampRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) + code = st.Code() + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attrs...) + span.SetStatus(trace.StatusError, err.Error()) + } + if code == codes.NotFound { + return nil + } + result.Store(target, err) + return err + } + mu.Lock() + locs.Locations = append(locs.Locations, res.GetLocations()...) + mu.Unlock() + return nil + }) + if err != nil { + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveByTimestampRPCName + ".BroadCast", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.RemoveByTimestampRPCName+" API connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if err != nil { + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + } + return nil, err + } + + result.Range(func(_ string, rerr error) bool { + if rerr != nil { + err = errors.Join(err, rerr) + } + return true + }) + if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response") + if err != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + return locs, nil +} + func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName) defer func() { From 0b96823c680dd7e5b83106b436a47f34411d915b Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 28 Sep 2023 11:33:34 +0900 Subject: [PATCH 33/93] fix: update sleep time for operator deploy Signed-off-by: hlts2 --- .github/actions/e2e-deploy-vald-helm-operator/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml index 215a7c0f95..46424149df 100644 --- a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml +++ b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml @@ -71,7 +71,7 @@ runs: ${HELM_EXTRA_OPTIONS} \ charts/vald-helm-operator/. - sleep 3 + sleep 6 env: HELM_EXTRA_OPTIONS: ${{ inputs.helm_extra_options }} @@ -91,7 +91,7 @@ runs: run: | kubectl apply -f ${VALDRELEASE} - sleep 3 + sleep 6 kubectl wait --for=condition=ready pod -l ${WAIT_FOR_SELECTOR} --timeout=${WAIT_FOR_TIMEOUT} From 86f42119c40ffde72a7f6dc220d671ea6776168d Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 28 Sep 2023 11:50:55 +0900 Subject: [PATCH 34/93] update wait time for vmt Signed-off-by: hlts2 --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index d458ba9944..0f233d8f1b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -308,7 +308,7 @@ jobs: - name: Deploy Mirror Target run: | kubectl apply -f .github/helm/values/vald-mirror-target.yaml -n vald-01 - sleep 10s + sleep 5s kubectl get pods -A && kubectl get vmt -o wide -A - name: Run E2E CRUD From 5ea8d4f631466552ae9ff0f67750c029bf9d00d4 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Mon, 2 Oct 2023 15:15:59 +0900 Subject: [PATCH 35/93] Returns all connection information in the registration rpc (#2199) * fix: returns all connection information in the registration rpc Signed-off-by: hlts2 * fix: lint warnning Signed-off-by: hlts2 * refactor: deleted unnecessary parameter Signed-off-by: hlts2 --------- Signed-off-by: hlts2 --- .../templates/gateway/mirror/configmap.yaml | 2 +- charts/vald/values.yaml | 6 +- internal/config/mirror.go | 6 +- pkg/gateway/mirror/handler/grpc/handler.go | 14 +- pkg/gateway/mirror/service/mirror.go | 200 +++--------------- pkg/gateway/mirror/service/mirror_option.go | 10 +- pkg/gateway/mirror/usecase/vald.go | 8 +- 7 files changed, 52 insertions(+), 194 deletions(-) diff --git a/charts/vald/templates/gateway/mirror/configmap.yaml b/charts/vald/templates/gateway/mirror/configmap.yaml index a8641c4f42..ca7ccedff5 100644 --- a/charts/vald/templates/gateway/mirror/configmap.yaml +++ b/charts/vald/templates/gateway/mirror/configmap.yaml @@ -43,7 +43,7 @@ data: {{- include "vald.observability" $observability | nindent 6 }} gateway: pod_name: {{ $gateway.gateway_config.pod_name }} - advertise_interval: {{ $gateway.gateway_config.advertise_interval }} + register_duration: {{ $gateway.gateway_config.register_duration }} namespace: {{ $gateway.gateway_config.namespace }} discovery_duration: {{ $gateway.gateway_config.discovery_duration }} colocation: {{ $gateway.gateway_config.colocation }} diff --git a/charts/vald/values.yaml b/charts/vald/values.yaml index 2b27c8e7f4..5149940109 100644 --- a/charts/vald/values.yaml +++ b/charts/vald/values.yaml @@ -1716,9 +1716,9 @@ gateway: # @schema {"name": "gateway.mirror.gateway_config.pod_name", "type": "string"} # gateway.mirror.gateway_config.pod_name -- self mirror gateway pod name pod_name: _MY_POD_NAME_ - # @schema {"name": "gateway.mirror.gateway_config.advertise_interval", "type": "string"} - # gateway.mirror.gateway_config.advertise_interval -- interval to advertise mirror-gateway information to other mirror-gateway. - advertise_interval: "1s" + # @schema {"name": "gateway.mirror.gateway_config.register_duration", "type": "string"} + # gateway.mirror.gateway_config.register_duration -- duration to register mirror-gateway. + register_duration: "1s" # @schema {"name": "gateway.mirror.gateway_config.namespace", "type": "string"} # gateway.mirror.gateway_config.namespace -- namespace to discovery namespace: _MY_POD_NAMESPACE_ diff --git a/internal/config/mirror.go b/internal/config/mirror.go index a9d069f946..3d816480fe 100644 --- a/internal/config/mirror.go +++ b/internal/config/mirror.go @@ -25,8 +25,8 @@ type Mirror struct { GatewayAddr string `json:"gateway_addr" yaml:"gateway_addr"` // PodName represents the mirror gateway pod name. PodName string `json:"pod_name" yaml:"pod_name"` - // AdvertiseInterval represents the interval to advertise addresses of Mirror Gateway to other Mirror Gateway. - AdvertiseInterval string `json:"advertise_interval" yaml:"advertise_interval"` + // RegisterDuration represents the duration to register Mirror Gateway. + RegisterDuration string `json:"register_duration" yaml:"register_duration"` // Namespace represents the target namespace to discover ValdMirrorTarget resource. Namespace string `json:"namespace" yaml:"namespace"` // DiscoveryDuration represents the duration to discover. @@ -43,7 +43,7 @@ func (m *Mirror) Bind() *Mirror { m.SelfMirrorAddr = GetActualValue(m.SelfMirrorAddr) m.GatewayAddr = GetActualValue(m.GatewayAddr) m.PodName = GetActualValue(m.PodName) - m.AdvertiseInterval = GetActualValue(m.AdvertiseInterval) + m.RegisterDuration = GetActualValue(m.RegisterDuration) m.Namespace = GetActualValue(m.Namespace) m.DiscoveryDuration = GetActualValue(m.DiscoveryDuration) m.Colocation = GetActualValue(m.Colocation) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 228b3fc0c0..014b0fa551 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -119,19 +119,11 @@ func (s *server) Register(ctx context.Context, req *payload.Mirror_Targets) (*pa } return nil, err } - return req, nil -} -func (s *server) Advertise(ctx context.Context, req *payload.Mirror_Targets) (res *payload.Mirror_Targets, err error) { - ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.MirrorRPCServiceName+"/"+vald.AdvertiseRPCName), apiName+"/"+vald.AdvertiseRPCName) - defer func() { - if span != nil { - span.End() - } - }() + // Get own address and the addresses of other mirror gateways to which this gateway is currently connected. tgts, err := s.mirror.MirrorTargets() if err != nil { - err = status.WrapWithInternal(vald.AdvertiseRPCName+" API failed to get connected vald gateway targets", err, + err = status.WrapWithInternal(vald.RegisterRPCName+" API failed to get connected vald gateway targets", err, &errdetails.BadRequest{ FieldViolations: []*errdetails.BadRequestFieldViolation{ { @@ -141,7 +133,7 @@ func (s *server) Advertise(ctx context.Context, req *payload.Mirror_Targets) (re }, }, &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.AdvertiseRPCName, + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RegisterRPCName, ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }, ) diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index 03e9b6fc1f..97d4a81c66 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -35,7 +35,7 @@ import ( // Mirror manages other mirror gateway connection. // If there is a new Mirror Gateway components, registers new connection. type Mirror interface { - Start(ctx context.Context) (<-chan error, error) + Start(ctx context.Context) <-chan error Connect(ctx context.Context, targets ...*payload.Mirror_Target) error Disconnect(ctx context.Context, targets ...*payload.Mirror_Target) error IsConnected(ctx context.Context, addr string) bool @@ -50,7 +50,7 @@ type mirr struct { selfMirrAddrl sync.Map[string, any] // List of self Mirror gateway addresses gwAddrl sync.Map[string, any] // List of Vald Gateway addresses eg errgroup.Group - advertiseDur time.Duration + registerDur time.Duration gateway Gateway } @@ -87,37 +87,8 @@ func NewMirror(opts ...MirrorOption) (_ Mirror, err error) { return m, err } -func (m *mirr) Start(ctx context.Context) (<-chan error, error) { - ech := make(chan error, 100) - - aech, err := m.startAdvertise(ctx) - if err != nil { - close(ech) - return nil, err - } - - m.eg.Go(func() (err error) { - defer close(ech) - for { - select { - case <-ctx.Done(): - return ctx.Err() - case err = <-aech: - } - if err != nil { - select { - case <-ctx.Done(): - case ech <- err: - } - err = nil - } - } - }) - return ech, nil -} - -func (m *mirr) startAdvertise(ctx context.Context) (<-chan error, error) { - ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.startAdvertise") +func (m *mirr) Start(ctx context.Context) <-chan error { + ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.Start") defer func() { if span != nil { span.End() @@ -125,96 +96,55 @@ func (m *mirr) startAdvertise(ctx context.Context) (<-chan error, error) { }() ech := make(chan error, 100) - err := m.registers(ctx, &payload.Mirror_Targets{ - Targets: m.selfMirrTgts, - }) - if err != nil && - !errors.Is(err, errors.ErrTargetNotFound) && - !errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { - var attrs trace.Attributes - - switch { - case errors.Is(err, context.Canceled): - err = status.WrapWithCanceled( - vald.InsertRPCName+" API canceld", err, - ) - attrs = trace.StatusCodeCancelled(err.Error()) - case errors.Is(err, context.DeadlineExceeded): - err = status.WrapWithDeadlineExceeded( - vald.InsertRPCName+" API deadline exceeded", err, - ) - attrs = trace.StatusCodeDeadlineExceeded(err.Error()) - default: - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.Internal, "failed to parse "+vald.RegisterRPCName+" gRPC error response") - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) - } - } - log.Warn(err) - if span != nil { - span.RecordError(err) - span.SetAttributes(attrs...) - span.SetStatus(trace.StatusError, err.Error()) - } - close(ech) - return nil, err - } - - m.eg.Go(func() (err error) { - tic := time.NewTicker(m.advertiseDur) + m.eg.Go(func() error { + tic := time.NewTicker(m.registerDur) defer close(ech) defer tic.Stop() for { select { case <-ctx.Done(): - return err case <-tic.C: - resTgts, err := m.advertises(ctx, new(payload.Mirror_Targets)) - if err != nil || len(resTgts) == 0 { - if err == nil { - err = errors.ErrTargetNotFound - } + tgt, err := m.MirrorTargets() + if err != nil { select { case <-ctx.Done(): - return ctx.Err() case ech <- err: break } } - if err = m.Connect(ctx, resTgts...); err != nil { + + resTgts, err := m.registers(ctx, &payload.Mirror_Targets{Targets: tgt}) + if err != nil || len(resTgts) == 0 { + if !errors.Is(err, errors.ErrTargetNotFound) && len(resTgts) == 0 { + err = errors.Join(err, errors.ErrTargetNotFound) + } else if len(resTgts) == 0 { + err = errors.ErrTargetNotFound + } select { case <-ctx.Done(): return ctx.Err() case ech <- err: - break } } - - if err := m.registers(ctx, &payload.Mirror_Targets{ - Targets: append(resTgts, m.selfMirrTgts...), - }); err != nil { - select { - case <-ctx.Done(): - return ctx.Err() - case ech <- err: - break + if len(resTgts) > 0 { + if err := m.Connect(ctx, resTgts...); err != nil { + select { + case <-ctx.Done(): + return ctx.Err() + case ech <- err: + break + } } } log.Debugf("[mirror]: connected mirror gateway targets: %v", m.gateway.GRPCClient().ConnectedAddrs()) } } }) - return ech, nil + return ech } -func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) error { +func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]*payload.Mirror_Target, error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.MirrorRPCServiceName+"/"+vald.RegisterRPCName), "vald/gateway/mirror/service/Mirror.registers") defer func() { if span != nil { @@ -227,8 +157,11 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) erro resInfo := &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RegisterRPCName, } + resTgts := make([]*payload.Mirror_Target, 0, len(tgts.GetTargets())) + exists := make(map[string]struct{}) + var mu sync.Mutex - return m.gateway.DoMulti(ctx, m.connectedMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + err := m.gateway.DoMulti(ctx, m.connectedMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.registers/"+target) defer func() { if span != nil { @@ -236,7 +169,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) erro } }() - _, err := vc.Register(ctx, tgts, copts...) + res, err := vc.Register(ctx, tgts, copts...) if err != nil { var attrs trace.Attributes switch { @@ -264,71 +197,6 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) erro "failed to parse "+vald.RegisterRPCName+" gRPC error response", reqInfo, resInfo, ) attrs = trace.FromGRPCStatus(st.Code(), msg) - } - log.Error("failed to send Register API to %s\t: %v", target, err) - if span != nil { - span.RecordError(err) - span.SetAttributes(attrs...) - span.SetStatus(trace.StatusError, err.Error()) - } - return err - } - return nil - }) -} - -func (m *mirr) advertises(ctx context.Context, tgts *payload.Mirror_Targets) ([]*payload.Mirror_Target, error) { - ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.MirrorRPCServiceName+"/"+vald.AdvertiseRPCName), "vald/gateway/vald/service/Mirror.advertises") - defer func() { - if span != nil { - span.End() - } - }() - reqInfo := &errdetails.RequestInfo{ - ServingData: errdetails.Serialize(tgts), - } - resInfo := &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.AdvertiseRPCName, - } - resTgts := make([]*payload.Mirror_Target, 0, len(tgts.GetTargets())) - exists := make(map[string]struct{}) - var mu sync.Mutex - - err := m.gateway.DoMulti(ctx, m.connectedMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { - ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.advertises/"+target) - defer func() { - if span != nil { - span.End() - } - }() - res, err := vc.Advertise(ctx, tgts) - if err != nil { - var attrs trace.Attributes - switch { - case errors.Is(err, context.Canceled): - err = status.WrapWithCanceled( - vald.AdvertiseRPCName+" API canceld", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeCancelled(err.Error()) - case errors.Is(err, context.DeadlineExceeded): - err = status.WrapWithCanceled( - vald.AdvertiseRPCName+" API deadline exceeded", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeDeadlineExceeded(err.Error()) - case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): - err = status.WrapWithInternal( - vald.AdvertiseRPCName+" API connection not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - default: - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.Internal, - "failed to parse "+vald.AdvertiseRPCName+" gRPC error response", reqInfo, resInfo, - ) - attrs = trace.FromGRPCStatus(st.Code(), msg) // When ingress is deleted, the controller's default backend results(Unimplemented error) are returned so that the connection should be disconnected. // If it is a different namespace on the same cluster, the connection is automatically disconnected because the net.grpc health check fails. @@ -346,7 +214,7 @@ func (m *mirr) advertises(ctx context.Context, tgts *payload.Mirror_Targets) ([] } } } - log.Errorf("failed to process advertise requst to %s\terror: %s", target, err.Error()) + log.Error("failed to send Register API to %s\t: %v", target, err) if span != nil { span.RecordError(err) span.SetAttributes(attrs...) @@ -356,8 +224,8 @@ func (m *mirr) advertises(ctx context.Context, tgts *payload.Mirror_Targets) ([] } if res != nil && len(res.GetTargets()) > 0 { for _, tgt := range res.GetTargets() { - mu.Lock() addr := net.JoinHostPort(tgt.Host, uint16(tgt.Port)) + mu.Lock() if _, ok := exists[addr]; !ok { exists[addr] = struct{}{} resTgts = append(resTgts, res.GetTargets()...) @@ -431,6 +299,7 @@ func (m *mirr) Exist(_ context.Context, addr string) bool { return ok } +// MirrorTargets returns own address and the addresses of other mirror gateways to which this gateway is currently connected. func (m *mirr) MirrorTargets() ([]*payload.Mirror_Target, error) { addrs := m.gateway.GRPCClient().ConnectedAddrs() tgts := make([]*payload.Mirror_Target, 0, len(addrs)+1) @@ -460,6 +329,7 @@ func (m *mirr) isGatewayAddr(addr string) bool { return ok } +// connected returns the addresses of other mirror gateways to which this gateway is currently connected. func (m *mirr) connectedMirrorAddrs() []string { connectedAddrs := m.gateway.GRPCClient().ConnectedAddrs() addrs := make([]string, 0, len(connectedAddrs)) diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go index fe0b67c83a..3a43016925 100644 --- a/pkg/gateway/mirror/service/mirror_option.go +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -23,7 +23,7 @@ import ( type MirrorOption func(m *mirr) error var defaultMirrOpts = []MirrorOption{ - WithAdvertiseInterval("1s"), + WithRegisterDuration("1s"), } func WithErrorGroup(eg errgroup.Group) MirrorOption { @@ -68,16 +68,16 @@ func WithGateway(g Gateway) MirrorOption { } } -func WithAdvertiseInterval(s string) MirrorOption { +func WithRegisterDuration(s string) MirrorOption { return func(m *mirr) error { if len(s) == 0 { - return errors.NewErrInvalidOption("advertiseInterval", s) + return errors.NewErrInvalidOption("registerDuration", s) } dur, err := time.ParseDuration(s) if err != nil { - return errors.NewErrInvalidOption("advertiseInterval", s, err) + return errors.NewErrInvalidOption("registerDuration", s, err) } - m.advertiseDur = dur + m.registerDur = dur return nil } } diff --git a/pkg/gateway/mirror/usecase/vald.go b/pkg/gateway/mirror/usecase/vald.go index 844accf600..5e4fb5d342 100644 --- a/pkg/gateway/mirror/usecase/vald.go +++ b/pkg/gateway/mirror/usecase/vald.go @@ -83,7 +83,7 @@ func New(cfg *config.Data) (r runner.Runner, err error) { } mirr, err := service.NewMirror( service.WithErrorGroup(eg), - service.WithAdvertiseInterval(cfg.Mirror.AdvertiseInterval), + service.WithRegisterDuration(cfg.Mirror.RegisterDuration), service.WithValdAddrs(cfg.Mirror.GatewayAddr), service.WithSelfMirrorAddrs(cfg.Mirror.SelfMirrorAddr), service.WithGateway(gw), @@ -198,11 +198,7 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { } } if r.mirr != nil { - mech, err = r.mirr.Start(ctx) - if err != nil { - close(ech) - return nil, err - } + mech = r.mirr.Start(ctx) } if r.dsc != nil { dech, err = r.dsc.Start(ctx) From 192ae245826b23f7932499fa2d2dab8ef8a21838 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Wed, 11 Oct 2023 15:19:01 +0900 Subject: [PATCH 36/93] Add handler logic to continue processing (#2204) * feat: add new crud logic Signed-off-by: hlts2 * refactor code Signed-off-by: hlts2 * refactor: error handling logic Signed-off-by: hlts2 * fix: bugfix error handling for rpc Signed-off-by: hlts2 * feat: add test for RemoveByTimestamp Signed-off-by: hlts2 * fix: fails error test Signed-off-by: hlts2 * refactor: test logic Signed-off-by: hlts2 * fix: add new condition and add test case Signed-off-by: hlts2 * refactor code Signed-off-by: hlts2 * fix: error handling and comment Signed-off-by: hlts2 * fix: test case name and test case order Signed-off-by: hlts2 * fix: execute format Signed-off-by: hlts2 * fix: add new comment Signed-off-by: hlts2 --------- Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 1785 +++++------- .../mirror/handler/grpc/handler_test.go | 2562 +++++++++-------- pkg/gateway/mirror/handler/grpc/mock_test.go | 2 +- 3 files changed, 2083 insertions(+), 2266 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 014b0fa551..cd3a43cf7c 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -943,59 +943,31 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // When this condition is matched, the request is proxied to another Mirror gateway. + // If this condition is matched, it means that the request was proxied from another Mirror Gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { - loc, err = vc.Insert(ctx, req, copts...) - return loc, err + loc, err = s.doInsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + loc, err = vc.Insert(ctx, req, copts...) + return loc, err + }) + return loc, errors.Join(derr, err) }) if err != nil { reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), + RequestId: req.GetVector().GetId(), } resInfo := &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), } - var attrs trace.Attributes - - switch { - case errors.Is(err, context.Canceled): - err = status.WrapWithCanceled( - vald.InsertRPCName+" API canceld", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeCancelled(err.Error()) - case errors.Is(err, context.DeadlineExceeded): - err = status.WrapWithDeadlineExceeded( - vald.InsertRPCName+" API deadline exceeded", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeDeadlineExceeded(err.Error()) - case errors.Is(err, errors.ErrTargetNotFound): - err = status.WrapWithInternal( - vald.InsertRPCName+" API target not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): - err = status.WrapWithInternal( - vald.InsertRPCName+" API connection not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - default: - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.Internal, - "failed to parse "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, - ) - attrs = trace.FromGRPCStatus(st.Code(), msg) - } + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, + ) log.Warn(err) if span != nil { span.RecordError(err) - span.SetAttributes(attrs...) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err @@ -1004,8 +976,11 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * return loc, nil } + // If this condition is matched, it means the request from user. + // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. + var mu sync.Mutex - var result sync.Map[string, error] + var result sync.Map[string, *errorState] // map[target host: error state] loc = &payload.Object_Location{ Uuid: req.GetVector().GetId(), Ips: make([]string, 0), @@ -1018,23 +993,32 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * } }() - ce, err := s.insert(ctx, vc, req, copts...) + code := codes.OK + ce, err := s.doInsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + return vc.Insert(ctx, req, copts...) + }) if err != nil { - st, _, _ := status.ParseError(err, codes.Internal, + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, "failed to parse "+vald.InsertRPCName+" gRPC error response", &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), + RequestId: req.GetVector().GetId(), }, &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + ".BroadCast/" + target, ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), }, ) - if st.Code() == codes.AlreadyExists { - // NOTE: If it is strictly necessary to check, fix this logic. - return nil + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) } + code = st.Code() } if err == nil && ce != nil { mu.Lock() @@ -1042,13 +1026,12 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * loc.Ips = append(loc.Ips, ce.GetIps()...) mu.Unlock() } - result.Store(target, err) + result.Store(target, &errorState{err, code}) return err }) if err != nil { reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), + RequestId: req.GetVector().GetId(), } resInfo := &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + ".BroadCast", @@ -1080,33 +1063,47 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * return nil, err } - var errs error - targets := make([]string, 0, 10) - result.Range(func(target string, err error) bool { - if err == nil { - targets = append(targets, target) - } else { - errs = errors.Join(errs, err) + alreadyExistsTgts := make([]string, 0, result.Len()/2) + successTgts := make([]string, 0, result.Len()/2) + result.Range(func(target string, es *errorState) bool { + switch { + case es.err == nil: + successTgts = append(successTgts, target) + case es.code == codes.AlreadyExists: + alreadyExistsTgts = append(alreadyExistsTgts, target) + err = errors.Join(err, es.err) + default: + err = errors.Join(es.err, err) } return true }) - switch { - case errs == nil: - log.Debugf("Insert API mirror request succeeded to %#v", loc) + if err == nil { + log.Debugf(vald.InsertRPCName+" API request succeeded to %#v", loc) return loc, nil - case len(targets) == 0 && errs != nil: - log.Error("failed to Insert API mirror request: %v and can not rollback because success target length is 0", errs) - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.InsertRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, + } + + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + + switch { + case result.Len() == len(alreadyExistsTgts): + err = status.WrapWithAlreadyExists(vald.InsertRPCName+" API target same vector already exists", err, reqInfo, resInfo) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeAlreadyExists(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + case result.Len() > len(successTgts)+len(alreadyExistsTgts): // Contains errors except for ALREADY_EXIST. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, ) + log.Warn(err) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -1114,60 +1111,72 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * } return nil, err } - log.Error("failed to Insert API mirror request: %v, so starts the rollback request", errs) - var emu sync.Mutex - var rerrs error - rmReq := &payload.Remove_Request{ - Id: &payload.Object_ID{ - Id: req.GetVector().GetId(), + // In this case, the status code in the result object contains only OK or ALREADY_EXIST. + // And send Update API requst to ALREADY_EXIST cluster using the query requested by the user. + log.Warnf("failed to "+vald.InsertRPCName+" API: %#v", err) + + updateReq := &payload.Update_Request{ + Vector: req.GetVector(), + Config: &payload.Update_Config{ + Timestamp: req.GetConfig().GetTimestamp(), }, } - err = s.gateway.DoMulti(ctx, targets, - func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "rollback/BroadCast/"+target), apiName+"/"+vald.InsertRPCName+"/rollback/"+target) - defer func() { - if span != nil { - span.End() - } - }() + err = s.gateway.DoMulti(ctx, alreadyExistsTgts, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "DoMulti/"+target), apiName+"/"+vald.UpdateRPCName+"/"+target) + defer func() { + if span != nil { + span.End() + } + }() - _, err := s.remove(ctx, vc, rmReq, copts...) - if err != nil { - st, _, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" for "+vald.InsertRPCName+" error response for "+target, - &errdetails.RequestInfo{ - RequestId: rmReq.GetId().GetId(), - ServingData: errdetails.Serialize(rmReq), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + "." + vald.RemoveRPCName + ".BroadCast/" + target, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }, - ) - if st.Code() == codes.NotFound { - return nil - } - emu.Lock() - rerrs = errors.Join(rerrs, err) - emu.Unlock() - return err + code := codes.OK + ce, err := s.doUpdate(ctx, updateReq, func(ctx context.Context) (*payload.Object_Location, error) { + return vc.Update(ctx, updateReq, copts...) + }) + if err != nil { + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + ".DoMulti/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) } - return nil - }, - ) + code = st.Code() + } + if err == nil && ce != nil { + mu.Lock() + loc.Name = ce.GetName() + loc.Ips = append(loc.Ips, ce.GetIps()...) + mu.Unlock() + } + result.Store(target, &errorState{err, code}) + return err + }) if err != nil { reqInfo := &errdetails.RequestInfo{ - RequestId: rmReq.GetId().GetId(), - ServingData: errdetails.Serialize(rmReq), + RequestId: updateReq.GetVector().GetId(), } resInfo := &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + "." + vald.RemoveRPCName + ".BroadCast", + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.InsertRPCName + ".DoMulti", ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), } if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { err = status.WrapWithInternal( - vald.RemoveRPCName+" for "+vald.InsertRPCName+" API connection not found", err, reqInfo, resInfo, + vald.UpdateRPCName+" for "+vald.InsertRPCName+" API connection not found", err, reqInfo, resInfo, ) log.Warn(err) if span != nil { @@ -1180,7 +1189,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * // There is no possibility to reach this part, but we add error handling just in case. st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" for "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, + "failed to parse "+vald.UpdateRPCName+" for "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, ) log.Warn(err) if span != nil { @@ -1190,19 +1199,49 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * } return nil, err } - if rerrs == nil { - log.Debugf("rollback for Insert API mirror request succeeded to %v", targets) - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.InsertRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, + + alreadyExistsTgts = alreadyExistsTgts[0:0] + successTgts = successTgts[0:0] + result.Range(func(target string, es *errorState) bool { + switch { + case es.err == nil: + successTgts = append(successTgts, target) + case es.code == codes.AlreadyExists: + alreadyExistsTgts = append(alreadyExistsTgts, target) + err = errors.Join(err, es.err) + default: + err = errors.Join(es.err, err) + } + return true + }) + if err == nil || (len(successTgts) > 0 && result.Len() == len(successTgts)+len(alreadyExistsTgts)) { + log.Debugf(vald.UpdateRPCName+"for "+vald.InsertRPCName+" API request succeeded to %#v", loc) + return loc, nil + } + + reqInfo = &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + } + resInfo = &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + "." + vald.UpdateRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + + switch { + case result.Len() == len(alreadyExistsTgts): + err = status.WrapWithAlreadyExists(vald.UpdateRPCName+" for "+vald.InsertRPCName+" API target same vector already exists", err, reqInfo, resInfo) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeAlreadyExists(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + case result.Len() > len(successTgts)+len(alreadyExistsTgts): // Contains errors except for ALREADY_EXIST. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" for "+vald.InsertRPCName+" gRPC error response", reqInfo, resInfo, ) + log.Warn(err) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -1210,35 +1249,19 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * } return nil, err } - log.Debugf("failed to rollback for Insert API mirror request succeeded to %v: %v", targets, rerrs) - st, msg, err := status.ParseError(rerrs, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" for "+vald.InsertRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: rmReq.GetId().GetId(), - ServingData: errdetails.Serialize(rmReq), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + "." + vald.RemoveRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) %v", apiName, s.name, s.ip, targets), - }, - ) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err + log.Debugf(vald.UpdateRPCName+"for "+vald.InsertRPCName+" API request succeeded to %#v, err: %v", loc, err) + return loc, nil } -func (s *server) insert(ctx context.Context, client vald.InsertClient, req *payload.Insert_Request, opts ...grpc.CallOption) (loc *payload.Object_Location, err error) { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "insert"), apiName+"/insert") +func (s *server) doInsert(ctx context.Context, req *payload.Insert_Request, f func(ctx context.Context) (*payload.Object_Location, error)) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doInsert"), apiName+"/doInsert") defer func() { if span != nil { span.End() } }() - loc, err = client.Insert(ctx, req, opts...) + loc, err = f(ctx) if err != nil { reqInfo := &errdetails.RequestInfo{ RequestId: req.GetVector().GetId(), @@ -1261,6 +1284,11 @@ func (s *server) insert(ctx context.Context, client vald.InsertClient, req *payl vald.InsertRPCName+" API deadline exceeded", err, reqInfo, resInfo, ) attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.InsertRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): err = status.WrapWithInternal( vald.InsertRPCName+" API connection not found", err, reqInfo, resInfo, @@ -1413,62 +1441,31 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // When this condition is matched, the request is proxied to another Mirror gateway. + // If this condition is matched, it means that the request was proxied from another Mirror Gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { - loc, err = vc.Update(ctx, req, copts...) - if err != nil { - return nil, err - } - return loc, nil + loc, err = s.doUpdate(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + loc, err = vc.Update(ctx, req, copts...) + return loc, err + }) + return loc, errors.Join(derr, err) }) if err != nil { reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), + RequestId: req.GetVector().GetId(), } resInfo := &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName, ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), } - var attrs trace.Attributes - - switch { - case errors.Is(err, context.Canceled): - err = status.WrapWithCanceled( - vald.UpdateRPCName+" API canceld", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeCancelled(err.Error()) - case errors.Is(err, context.DeadlineExceeded): - err = status.WrapWithDeadlineExceeded( - vald.UpdateRPCName+" API deadline exceeded", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeDeadlineExceeded(err.Error()) - case errors.Is(err, errors.ErrTargetNotFound): - err = status.WrapWithInternal( - vald.UpdateRPCName+" API target not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): - err = status.WrapWithInternal( - vald.UpdateRPCName+" API connection not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - default: - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.Internal, - "failed to parse "+vald.UpdateRPCName+" gRPC error response", reqInfo, resInfo, - ) - attrs = trace.FromGRPCStatus(st.Code(), msg) - } + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" gRPC error response", reqInfo, resInfo, + ) log.Warn(err) if span != nil { span.RecordError(err) - span.SetAttributes(attrs...) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err @@ -1477,60 +1474,60 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * return loc, nil } - objReq := &payload.Object_VectorRequest{ - Id: &payload.Object_ID{ - Id: req.GetVector().GetId(), - }, - } - oldVecs, err := s.getObjects(ctx, objReq) - if err != nil { - return nil, err - } + // If this condition is matched, it means the request from user. + // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. var mu sync.Mutex - var result sync.Map[string, error] + var result sync.Map[string, *errorState] // map[target host: error state] loc = &payload.Object_Location{ Uuid: req.GetVector().GetId(), Ips: make([]string, 0), } - - err = s.gateway.BroadCast(ctx, - func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.UpdateRPCName+"/"+target) - defer func() { - if span != nil { - span.End() - } - }() - - ce, err := s.update(ctx, vc, req, copts...) - if err != nil { - st, _, _ := status.ParseError(err, codes.Internal, - "failed to parse "+vald.UpdateRPCName+" API error response for "+target, - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + ".BroadCast/" + target, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }, - ) - if st.Code() == codes.AlreadyExists { - // NOTE: If it is strictly necessary to check, fix this logic. - return nil - } + err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.UpdateRPCName+"/"+target) + defer func() { + if span != nil { + span.End() } - if err == nil && ce != nil { - mu.Lock() - loc.Name = ce.GetName() - loc.Ips = append(loc.Ips, ce.GetIps()...) - mu.Unlock() + }() + + code := codes.OK + ce, err := s.doUpdate(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + return vc.Update(ctx, req, copts...) + }) + if err != nil { + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) } - result.Store(target, err) - return err - }, - ) + code = st.Code() + } + if err == nil && ce != nil { + mu.Lock() + loc.Name = ce.GetName() + loc.Ips = append(loc.Ips, ce.GetIps()...) + mu.Unlock() + } + result.Store(target, &errorState{err, code}) + return err + }) if err != nil { reqInfo := &errdetails.RequestInfo{ RequestId: req.GetVector().GetId(), @@ -1566,33 +1563,60 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * return nil, err } - var errs error - targets := make([]string, 0, 10) - result.Range(func(target string, err error) bool { - if err == nil { - targets = append(targets, target) - } else { - errs = errors.Join(errs, err) + var alreadyExistsCnt int + notFoundTgts := make([]string, 0, result.Len()/2) + successTgts := make([]string, 0, result.Len()/2) + result.Range(func(target string, es *errorState) bool { + switch { + case es.err == nil: + successTgts = append(successTgts, target) + case es.code == codes.AlreadyExists: + alreadyExistsCnt++ + err = errors.Join(err, es.err) + case es.code == codes.NotFound: + notFoundTgts = append(notFoundTgts, target) + err = errors.Join(err, es.err) + default: + err = errors.Join(es.err, err) } return true }) - switch { - case errs == nil: - log.Debugf("Update API mirror request succeeded to %#v", loc) + if err == nil || (len(successTgts) > 0 && result.Len() == len(successTgts)+alreadyExistsCnt) { + log.Debugf(vald.UpdateRPCName+" API request succeeded to %#v", loc) return loc, nil - case len(targets) == 0 && errs != nil: - log.Error("failed to Update API mirror request: %v and can not rollback because success target length is 0", errs) - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.UpdateRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, - ) + } + + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + + switch { + case result.Len() == len(notFoundTgts): + err = status.WrapWithNotFound(vald.UpdateRPCName+" API target not found", err, reqInfo, resInfo) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeAlreadyExists(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + case result.Len() == alreadyExistsCnt: + err = status.WrapWithAlreadyExists(vald.UpdateRPCName+" API target same vector already exists", err, reqInfo, resInfo) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeNotFound(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + case result.Len() > len(successTgts)+len(notFoundTgts)+alreadyExistsCnt: // Contains errors except for NOT_FOUND and ALREADY_EXIST. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpdateRPCName+" gRPC error response", reqInfo, resInfo) + log.Warn(err) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -1600,92 +1624,74 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * } return nil, err } - log.Error("failed to Update API mirror request: %v, so starts the rollback request", errs) - var emu sync.Mutex - var rerrs error - rmReq := &payload.Remove_Request{ - Id: &payload.Object_ID{ - Id: req.GetVector().GetId(), + // In this case, the status code in the result object contains only OK or ALREADY_EXIST or NOT_FOUND. + // And send Insert API requst to NOT_FOUND cluster using query requested by the user. + log.Warnf("failed to "+vald.UpdateRPCName+" API: %#v", err) + + insReq := &payload.Insert_Request{ + Vector: req.GetVector(), + Config: &payload.Insert_Config{ + Timestamp: req.GetConfig().GetTimestamp(), }, } - - err = s.gateway.DoMulti(ctx, targets, - func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "rollback/BroadCast/"+target), apiName+"/"+vald.RemoveRPCName+"/rollback/"+target) - defer func() { - if span != nil { - span.End() - } - }() - - oldVec, ok := oldVecs.Load(target) - if !ok || oldVec == nil { - _, err := s.remove(ctx, vc, rmReq, copts...) - if err != nil { - st, _, _ := status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" for "+vald.UpdateRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: rmReq.GetId().GetId(), - ServingData: errdetails.Serialize(rmReq), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.RemoveRPCName + ".BroadCast/" + target, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }, - ) - if st.Code() == codes.NotFound { - return nil - } - emu.Lock() - rerrs = errors.Join(rerrs, err) - emu.Unlock() - return err - } - return nil + err = s.gateway.DoMulti(ctx, notFoundTgts, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.InsertRPCName+"/"+target) + defer func() { + if span != nil { + span.End() } + }() - req := &payload.Update_Request{ - Vector: oldVec, - Config: &payload.Update_Config{ - SkipStrictExistCheck: true, + code := codes.OK + ce, err := s.doInsert(ctx, insReq, func(ctx context.Context) (*payload.Object_Location, error) { + return vc.Insert(ctx, insReq, copts...) + }) + if err != nil { + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.InsertRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) } - _, err := s.update(ctx, vc, req, copts...) - if err != nil { - st, _, _ := status.ParseError(err, codes.Internal, - "failed to parse "+vald.UpdateRPCName+" for "+vald.UpdateRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.UpdateRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }, - ) - if st.Code() == codes.AlreadyExists { - return nil - } - emu.Lock() - rerrs = errors.Join(rerrs, err) - emu.Unlock() - return err - } - return nil - }, - ) + code = st.Code() + } + if err == nil && ce != nil { + mu.Lock() + loc.Name = ce.GetName() + loc.Ips = append(loc.Ips, ce.GetIps()...) + mu.Unlock() + } + result.Store(target, &errorState{err, code}) + return err + }) if err != nil { reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), } resInfo := &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + ".Rollback.BroadCast", + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.InsertRPCName + ".BroadCast", ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), } if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { err = status.WrapWithInternal( - vald.UpdateRPCName+" for Rollback connection not found", err, reqInfo, resInfo, + vald.InsertRPCName+" for "+vald.UpdateRPCName+" API connection not found", err, reqInfo, resInfo, ) log.Warn(err) if span != nil { @@ -1696,31 +1702,74 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * return nil, err } - // There is no possibility to reach this part, but we add error handling just in case. - st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.UpdateRPCName+" for Rollback gRPC error response", reqInfo, resInfo, - ) + // There is no possibility to reach this part, but we add error handling just in case. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.InsertRPCName+" for "+vald.UpdateRPCName+" gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + alreadyExistsCnt = 0 + notFoundTgts = notFoundTgts[0:0] + successTgts = successTgts[0:0] + result.Range(func(target string, em *errorState) bool { + switch { + case em.err == nil: + successTgts = append(successTgts, target) + case em.code == codes.AlreadyExists: + alreadyExistsCnt++ + err = errors.Join(err, em.err) + case em.code == codes.NotFound: + notFoundTgts = append(notFoundTgts, target) + err = errors.Join(err, em.err) + default: + err = errors.Join(em.err, err) + } + return true + }) + if err == nil || (len(successTgts) > 0 && result.Len() == len(successTgts)+alreadyExistsCnt) { + log.Debugf(vald.InsertRPCName+" for "+vald.UpdateRPCName+" API request succeeded to %#v", loc) + return loc, nil + } + + reqInfo = &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo = &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.InsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + + switch { + case result.Len() == len(notFoundTgts): + err = status.WrapWithNotFound(vald.InsertRPCName+" for "+vald.UpdateRPCName+" API target not found", err, reqInfo, resInfo) log.Warn(err) if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(trace.StatusCodeAlreadyExists(err.Error())...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err - } - if rerrs == nil { - log.Debugf("rollback for Update API mirror request succeeded to %v", targets) - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.UpdateRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, - ) + case result.Len() == alreadyExistsCnt: + err = status.WrapWithAlreadyExists(vald.InsertRPCName+" for "+vald.UpdateRPCName+" API target same vector already exists", err, reqInfo, resInfo) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeNotFound(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + case result.Len() > len(successTgts)+len(notFoundTgts)+alreadyExistsCnt: // Contains errors except for NOT_FOUND and ALREADY_EXIST. + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.InsertRPCName+" for "+vald.UpdateRPCName+" gRPC error response", reqInfo, resInfo) + log.Warn(err) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -1728,34 +1777,19 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * } return nil, err } - log.Debugf("failed to rollback for Update API mirror request succeeded to %v: %v", targets, rerrs) - st, msg, err := status.ParseError(rerrs, codes.Internal, - "failed to parse "+vald.UpdateRPCName+" for Rollback gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + ".Rollback", - ResourceName: fmt.Sprintf("%s: %s(%s) %v", apiName, s.name, s.ip, targets), - }, - ) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err + log.Debugf(vald.InsertRPCName+" for "+vald.UpdateRPCName+" API request succeeded to %#v, err: %v", loc, err) + return loc, nil } -func (s *server) update(ctx context.Context, client vald.UpdateClient, req *payload.Update_Request, opts ...grpc.CallOption) (loc *payload.Object_Location, err error) { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "update"), apiName+"/update") +func (s *server) doUpdate(ctx context.Context, req *payload.Update_Request, f func(ctx context.Context) (*payload.Object_Location, error)) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doUpdate"), apiName+"/doUpdate") defer func() { if span != nil { span.End() } }() - loc, err = client.Update(ctx, req, opts...) + loc, err = f(ctx) if err != nil { reqInfo := &errdetails.RequestInfo{ RequestId: req.GetVector().GetId(), @@ -1778,6 +1812,11 @@ func (s *server) update(ctx context.Context, client vald.UpdateClient, req *payl vald.UpdateRPCName+" API deadline exceeded", err, reqInfo, resInfo, ) attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.UpdateRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): err = status.WrapWithInternal( vald.UpdateRPCName+" API connection not found", err, reqInfo, resInfo, @@ -1930,15 +1969,15 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // When this condition is matched, the request is proxied to another Mirror gateway. + // If this condition is matched, it means that the request was proxied from another Mirror Gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { - loc, err = vc.Upsert(ctx, req, copts...) - if err != nil { - return nil, err - } - return loc, nil + loc, err = s.doUpsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + loc, err = vc.Upsert(ctx, req, copts...) + return loc, err + }) + return loc, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -1949,43 +1988,13 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), } - var attrs trace.Attributes - - switch { - case errors.Is(err, context.Canceled): - err = status.WrapWithCanceled( - vald.UpsertRPCName+" API canceld", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeCancelled(err.Error()) - case errors.Is(err, context.DeadlineExceeded): - err = status.WrapWithDeadlineExceeded( - vald.UpsertRPCName+" API deadline exceeded", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeDeadlineExceeded(err.Error()) - case errors.Is(err, errors.ErrTargetNotFound): - err = status.WrapWithInternal( - vald.UpsertRPCName+" API target not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): - err = status.WrapWithInternal( - vald.UpsertRPCName+" API connection not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - default: - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.Internal, - "failed to parse "+vald.UpsertRPCName+" gRPC error response", reqInfo, resInfo, - ) - attrs = trace.FromGRPCStatus(st.Code(), msg) - } + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" gRPC error response", reqInfo, resInfo, + ) log.Warn(err) if span != nil { span.RecordError(err) - span.SetAttributes(attrs...) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err @@ -1994,18 +2003,11 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * return loc, nil } - objReq := &payload.Object_VectorRequest{ - Id: &payload.Object_ID{ - Id: req.GetVector().GetId(), - }, - } - oldVecs, err := s.getObjects(ctx, objReq) - if err != nil { - return nil, err - } + // If this condition is matched, it means the request from user. + // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. var mu sync.Mutex - var result sync.Map[string, error] + var result sync.Map[string, *errorState] // map[target host: error state] loc = &payload.Object_Location{ Uuid: req.GetVector().GetId(), Ips: make([]string, 0), @@ -2018,9 +2020,16 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * } }() - ce, err := s.upsert(ctx, vc, req, copts...) + code := codes.OK + ce, err := s.doUpsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + return vc.Upsert(ctx, req, copts...) + }) if err != nil { - st, _, _ := status.ParseError(err, codes.Internal, + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, "failed to parse "+vald.UpsertRPCName+" gRPC error response", &errdetails.RequestInfo{ RequestId: req.GetVector().GetId(), @@ -2031,10 +2040,13 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), }, ) - if st.Code() == codes.AlreadyExists { - // NOTE: If it is strictly necessary to check, fix this logic. - return nil + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) } + code = st.Code() } if err == nil && ce != nil { mu.Lock() @@ -2042,7 +2054,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * loc.Ips = append(loc.Ips, ce.GetIps()...) mu.Unlock() } - result.Store(target, err) + result.Store(target, &errorState{err, code}) return err }) if err != nil { @@ -2080,160 +2092,47 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * return nil, err } - var errs error - targets := make([]string, 0, 10) - result.Range(func(target string, err error) bool { - if err == nil { - targets = append(targets, target) - } else { - errs = errors.Join(errs, err) + var alreadyExistsCnt int + successTgts := make([]string, 0, result.Len()/2) + result.Range(func(target string, es *errorState) bool { + switch { + case es.err == nil: + successTgts = append(successTgts, target) + case es.code == codes.AlreadyExists: + alreadyExistsCnt++ + err = errors.Join(err, es.err) + default: + err = errors.Join(es.err, err) } return true }) - switch { - case errs == nil: - log.Debugf("Upsert API mirror request succeeded to %#v", loc) + if err == nil || (len(successTgts) > 0 && result.Len() == len(successTgts)+alreadyExistsCnt) { + log.Debugf(vald.UpsertRPCName+" API request succeeded to %#v", loc) return loc, nil - case len(targets) == 0 && errs != nil: - log.Error("failed to Upsert API mirror request: %v and can not rollback because success target length is 0", errs) - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.UpsertRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, - ) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err } - log.Error("failed to Upsert API mirror request: %v, so starts the rollback request", errs) - - var emu sync.Mutex - var rerrs error - rmReq := &payload.Remove_Request{ - Id: &payload.Object_ID{ - Id: req.GetVector().GetId(), - }, + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetVector().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), } - err = s.gateway.DoMulti(ctx, targets, - func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "rollback/BroadCast/"+target), apiName+"/"+vald.UpsertRPCName+"/rollback/"+target) - defer func() { - if span != nil { - span.End() - } - }() - - oldVec, ok := oldVecs.Load(target) - if !ok || oldVec == nil { - _, err := s.remove(ctx, vc, rmReq, copts...) - if err != nil { - st, _, _ := status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" for "+vald.UpsertRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: rmReq.GetId().GetId(), - ServingData: errdetails.Serialize(rmReq), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + "." + vald.RemoveRPCName + ".BroadCast/" + target, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }, - ) - if st.Code() == codes.NotFound { - return nil - } - emu.Lock() - rerrs = errors.Join(rerrs, err) - emu.Unlock() - return err - } - return nil - } - - req := &payload.Update_Request{ - Vector: oldVec, - Config: &payload.Update_Config{ - SkipStrictExistCheck: true, - }, - } - _, err := s.update(ctx, vc, req, copts...) - if err != nil { - st, _, _ := status.ParseError(err, codes.Internal, - "failed to parse "+vald.UpdateRPCName+" for "+vald.UpsertRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + "." + vald.UpdateRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }, - ) - if st.Code() == codes.AlreadyExists { - return nil - } - emu.Lock() - rerrs = errors.Join(rerrs, err) - emu.Unlock() - return err - } - return nil - }, - ) - if err != nil { - reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - } - resInfo := &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + ".Rollback.BroadCast", - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - } - if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { - err = status.WrapWithInternal( - vald.UpsertRPCName+" for Rollback connection not found", err, reqInfo, resInfo, - ) - log.Warn(err) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.StatusCodeInternal(err.Error())...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err - } - // There is no possibility to reach this part, but we add error handling just in case. - st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.UpsertRPCName+" for Rollback gRPC error response", reqInfo, resInfo, - ) + switch { + case result.Len() == alreadyExistsCnt: + err = status.WrapWithAlreadyExists(vald.UpsertRPCName+" API target same vector already exists", err, reqInfo, resInfo) log.Warn(err) if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(trace.StatusCodeAlreadyExists(err.Error())...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err - } - if rerrs == nil { - log.Debugf("rollback for Upsert API mirror request succeeded to %v", targets) - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.UpsertRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, - ) + default: + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.UpsertRPCName+" gRPC error response", reqInfo, resInfo) + log.Warn(err) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -2241,34 +2140,17 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * } return nil, err } - log.Debugf("failed to rollback for Upsert API mirror request succeeded to %v: %v", targets, rerrs) - st, msg, err := status.ParseError(rerrs, codes.Internal, - "failed to parse "+vald.UpsertRPCName+" for Rollback gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpsertRPCName + ".Rollback", - ResourceName: fmt.Sprintf("%s: %s(%s) %v", apiName, s.name, s.ip, targets), - }, - ) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err } -func (s *server) upsert(ctx context.Context, client vald.UpsertClient, req *payload.Upsert_Request, opts ...grpc.CallOption) (loc *payload.Object_Location, err error) { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "upsert"), apiName+"/upsert") +func (s *server) doUpsert(ctx context.Context, req *payload.Upsert_Request, f func(ctx context.Context) (*payload.Object_Location, error)) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doUpsert"), apiName+"/doUpsert") defer func() { if span != nil { span.End() } }() - loc, err = client.Upsert(ctx, req, opts...) + loc, err = f(ctx) if err != nil { reqInfo := &errdetails.RequestInfo{ RequestId: req.GetVector().GetId(), @@ -2291,6 +2173,11 @@ func (s *server) upsert(ctx context.Context, client vald.UpsertClient, req *payl vald.UpsertRPCName+" API deadline exceeded", err, reqInfo, resInfo, ) attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.UpsertRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): err = status.WrapWithInternal( vald.UpsertRPCName+" API connection not found", err, reqInfo, resInfo, @@ -2306,7 +2193,7 @@ func (s *server) upsert(ctx context.Context, client vald.UpsertClient, req *payl ) attrs = trace.FromGRPCStatus(st.Code(), msg) } - log.Warn("failed to process Upsert request\terror: %s", err.Error()) + log.Warn(err) if span != nil { span.RecordError(err) span.SetAttributes(attrs...) @@ -2443,62 +2330,31 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // When this condition is matched, the request is proxied to another Mirror gateway. - // So this component sends the request only to the Vald gateway (LB gateway) of own cluster. + // If this condition is matched, it means that the request was proxied from another Mirror Gateway. + // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { - loc, err = vc.Remove(ctx, req, copts...) - if err != nil { - return nil, err - } - return loc, nil + loc, err = s.doRemove(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + loc, err = vc.Remove(ctx, req, copts...) + return loc, err + }) + return loc, err }) if err != nil { reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), + RequestId: req.GetId().GetId(), } resInfo := &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), } - var attrs trace.Attributes - - switch { - case errors.Is(err, context.Canceled): - err = status.WrapWithCanceled( - vald.RemoveRPCName+" API canceld", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeCancelled(err.Error()) - case errors.Is(err, context.DeadlineExceeded): - err = status.WrapWithDeadlineExceeded( - vald.RemoveRPCName+" API deadline exceeded", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeDeadlineExceeded(err.Error()) - case errors.Is(err, errors.ErrTargetNotFound): - err = status.WrapWithInternal( - vald.RemoveRPCName+" API target not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): - err = status.WrapWithInternal( - vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - default: - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, - ) - attrs = trace.FromGRPCStatus(st.Code(), msg) - } + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, + ) log.Warn(err) if span != nil { span.RecordError(err) - span.SetAttributes(attrs...) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err @@ -2507,186 +2363,70 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * return loc, nil } - objReq := &payload.Object_VectorRequest{ - Id: &payload.Object_ID{ - Id: req.GetId().GetId(), - }, - } - oldVecs, err := s.getObjects(ctx, objReq) - if err != nil { - return nil, err - } + // If this condition is matched, it means the request from user. + // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. var mu sync.Mutex - var result sync.Map[string, error] + var result sync.Map[string, *errorState] // map[target host: error state] loc = &payload.Object_Location{ Uuid: req.GetId().GetId(), Ips: make([]string, 0), } - err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.RemoveRPCName+"/"+target) defer func() { if span != nil { span.End() } - }() - - ce, err := s.remove(ctx, vc, req, copts...) - if err != nil { - st, _, _ := status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" gRPC error response for "+target, - &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + ".BroadCast/" + target, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }, - ) - if st.Code() == codes.NotFound { - // NOTE: If it is strictly necessary to check, fix this logic. - return nil - } - } - if err == nil && ce != nil { - mu.Lock() - loc.Name = ce.GetName() - loc.Ips = append(loc.Ips, ce.GetIps()...) - mu.Unlock() - } - result.Store(target, err) - return err - }) - if err != nil { - reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), - } - resInfo := &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + ".BroadCast", - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - } - if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { - err = status.WrapWithInternal( - vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo, - ) - log.Warn(err) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.StatusCodeInternal(err.Error())...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err - } - - // There is no possibility to reach this part, but we add error handling just in case. - st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, - ) - log.Warn(err) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err - } - - var errs error - targets := make([]string, 0, 10) - result.Range(func(target string, err error) bool { - if err == nil { - targets = append(targets, target) - } else { - errs = errors.Join(errs, err) - } - return true - }) - switch { - case errs == nil: - log.Debugf("Remove API mirror request succeeded to %#v", loc) - return loc, nil - case len(targets) == 0 && errs != nil: - log.Error("failed to Remove API mirror request: %v and can not rollback because success target length is 0", errs) - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, - ) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err - } - log.Error("failed to Remove API mirror request: %v, so starts the rollback request", errs) - - var emu sync.Mutex - var rerrs error - err = s.gateway.DoMulti(ctx, targets, - func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "rollback/BroadCast/"+target), apiName+"/"+vald.RemoveRPCName+"/rollback/"+target) - defer func() { - if span != nil { - span.End() - } - }() - - objv, ok := oldVecs.Load(target) - if !ok || objv == nil { - log.Debug("failed to load old vector from %s", target) - return nil - } - req := &payload.Upsert_Request{ - Vector: objv, - Config: &payload.Upsert_Config{ - SkipStrictExistCheck: true, + }() + + code := codes.OK + ce, err := s.doRemove(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + return vc.Remove(ctx, req, copts...) + }) + if err != nil { + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", + &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) } - _, err := s.upsert(ctx, vc, req, copts...) - if err != nil { - st, _, _ := status.ParseError(err, codes.Internal, - "failed to parse "+vald.UpsertRPCName+" for "+vald.RemoveRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetVector().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + "." + vald.UpsertRPCName + ".BroadCast/" + target, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - }, - ) - if st.Code() == codes.AlreadyExists { - return nil - } - emu.Lock() - rerrs = errors.Join(rerrs, err) - emu.Unlock() - return err - } - return nil - }, - ) + code = st.Code() + } + if err == nil && ce != nil { + mu.Lock() + loc.Name = ce.GetName() + loc.Ips = append(loc.Ips, ce.GetIps()...) + mu.Unlock() + } + result.Store(target, &errorState{err, code}) + return err + }) if err != nil { reqInfo := &errdetails.RequestInfo{ RequestId: req.GetId().GetId(), } resInfo := &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + "." + vald.UpsertRPCName + ".BroadCast", + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + ".BroadCast", ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), } if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { err = status.WrapWithInternal( - vald.UpsertRPCName+" for "+vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo, + vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo, ) log.Warn(err) if span != nil { @@ -2699,7 +2439,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * // There is no possibility to reach this part, but we add error handling just in case. st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.UpsertRPCName+" for "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, ) log.Warn(err) if span != nil { @@ -2709,19 +2449,47 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * } return nil, err } - if rerrs == nil { - log.Debugf("rollback for Remove API mirror request succeeded to %v", targets) - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.RemoveRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, - ) + + var notFoundCnt int + successTgts := make([]string, 0, result.Len()/2) + result.Range(func(target string, es *errorState) bool { + switch { + case es.err == nil: + successTgts = append(successTgts, target) + case es.code == codes.NotFound: + notFoundCnt++ + err = errors.Join(err, es.err) + default: + err = errors.Join(es.err, err) + } + return true + }) + if err == nil || (len(successTgts) > 0 && result.Len() == len(successTgts)+notFoundCnt) { + log.Debugf(vald.RemoveRPCName+" API request succeeded to %#v", loc) + return loc, nil + } + + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + + switch { + case result.Len() == notFoundCnt: + err = status.WrapWithNotFound(vald.RemoveRPCName+" API id "+req.GetId().GetId()+" not found", err, reqInfo, resInfo) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeAlreadyExists(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + default: + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo) + log.Warn(err) if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) @@ -2729,38 +2497,20 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * } return nil, err } - log.Debugf("failed to rollback for Remove API mirror request succeeded to %v: %v", targets, rerrs) - st, msg, err := status.ParseError(rerrs, codes.Internal, - "failed to parse "+vald.UpsertRPCName+" for "+vald.RemoveRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName + "." + vald.UpsertRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) %v", apiName, s.name, s.ip, targets), - }, - ) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err } -func (s *server) remove(ctx context.Context, client vald.RemoveClient, req *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "remove"), apiName+"/remove") +func (s *server) doRemove(ctx context.Context, req *payload.Remove_Request, f func(ctx context.Context) (*payload.Object_Location, error)) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doRemove"), apiName+"/doRemove") defer func() { if span != nil { span.End() } }() - loc, err := client.Remove(ctx, req, opts...) + loc, err = f(ctx) if err != nil { reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), + RequestId: req.GetId().GetId(), } resInfo := &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveRPCName, @@ -2779,6 +2529,11 @@ func (s *server) remove(ctx context.Context, client vald.RemoveClient, req *payl vald.RemoveRPCName+" API deadline exceeded", err, reqInfo, resInfo, ) attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInternal( + vald.RemoveRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): err = status.WrapWithInternal( vald.RemoveRPCName+" API connection not found", err, reqInfo, resInfo, @@ -2931,12 +2686,15 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // When this condition is matched, the request is proxied to another Mirror gateway. + // If this condition is matched, it means that the request was proxied from another Mirror Gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, opts ...grpc.CallOption) (interface{}, error) { - locs, err = vc.RemoveByTimestamp(ctx, req, opts...) - return locs, err + locs, err = s.doRemoveByTimestamp(ctx, req, func(ctx context.Context) (*payload.Object_Locations, error) { + _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + locs, err = vc.RemoveByTimestamp(ctx, req, copts...) + return locs, err + }) + return locs, errors.Join(derr, err) }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -2946,55 +2704,29 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveByTimestampRPCName, ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), } - var attrs trace.Attributes - - switch { - case errors.Is(err, context.Canceled): - err = status.WrapWithCanceled( - vald.RemoveByTimestampRPCName+" API canceld", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeCancelled(err.Error()) - case errors.Is(err, context.DeadlineExceeded): - err = status.WrapWithDeadlineExceeded( - vald.RemoveByTimestampRPCName+" API deadline exceeded", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeDeadlineExceeded(err.Error()) - case errors.Is(err, errors.ErrTargetNotFound): - err = status.WrapWithInternal( - vald.RemoveByTimestampRPCName+" API target not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): - err = status.WrapWithInternal( - vald.RemoveByTimestampRPCName+" API connection not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - default: - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response", reqInfo, resInfo, - ) - attrs = trace.FromGRPCStatus(st.Code(), msg) - } + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveRPCName+" gRPC error response", reqInfo, resInfo, + ) log.Warn(err) if span != nil { span.RecordError(err) - span.SetAttributes(attrs...) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err } + log.Debugf("RemoveByTimestamp API remove succeeded to %#v", locs) return locs, nil } + // If this condition is matched, it means the request from user. + // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. + var mu sync.Mutex - var result sync.Map[string, error] + var result sync.Map[string, *errorState] // map[target host: error state] locs = new(payload.Object_Locations) - err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, opts ...grpc.CallOption) error { + err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.RemoveByTimestampRPCName+"/"+target) defer func() { if span != nil { @@ -3002,61 +2734,37 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time } }() - res, err := vc.RemoveByTimestamp(ctx, req, opts...) + code := codes.OK + res, err := s.doRemoveByTimestamp(ctx, req, func(ctx context.Context) (*payload.Object_Locations, error) { + return vc.RemoveByTimestamp(ctx, req, copts...) + }) if err != nil { - reqInfo := &errdetails.RequestInfo{ - ServingData: errdetails.Serialize(req), - } - resInfo := &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveByTimestampRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - } - var attrs trace.Attributes - var code codes.Code - - switch { - case errors.Is(err, context.Canceled): - err = status.WrapWithCanceled( - vald.RemoveByTimestampRPCName+" API canceld", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeCancelled(err.Error()) - case errors.Is(err, context.DeadlineExceeded): - err = status.WrapWithDeadlineExceeded( - vald.RemoveByTimestampRPCName+" API deadline exceeded", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeDeadlineExceeded(err.Error()) - case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): - err = status.WrapWithInternal( - vald.RemoveByTimestampRPCName+" API connection not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - default: - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response", reqInfo, resInfo, - ) - attrs = trace.FromGRPCStatus(st.Code(), msg) - code = st.Code() - } + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response", + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveByTimestampRPCName + ".BroadCast/" + target, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), + }, + ) log.Warn(err) if span != nil { span.RecordError(err) - span.SetAttributes(attrs...) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } - if code == codes.NotFound { - return nil - } - result.Store(target, err) - return err + code = st.Code() } - mu.Lock() - locs.Locations = append(locs.Locations, res.GetLocations()...) - mu.Unlock() - return nil + if err == nil && res != nil { + mu.Lock() + locs.Locations = append(locs.Locations, res.GetLocations()...) + mu.Unlock() + } + result.Store(target, &errorState{err, code}) + return err }) if err != nil { reqInfo := &errdetails.RequestInfo{ @@ -3084,80 +2792,106 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response", reqInfo, resInfo, ) log.Warn(err) - if err != nil { - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) - span.SetStatus(trace.StatusError, err.Error()) - } + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) } return nil, err } - result.Range(func(_ string, rerr error) bool { - if rerr != nil { - err = errors.Join(err, rerr) + var notFoundCnt int + successTgts := make([]string, 0, result.Len()/2) + result.Range(func(target string, es *errorState) bool { + switch { + case es.err == nil: + successTgts = append(successTgts, target) + case es.code == codes.NotFound: + notFoundCnt++ + err = errors.Join(err, es.err) + default: + err = errors.Join(es.err, err) } return true }) - if err != nil { + if err == nil || (len(successTgts) > 0 && result.Len() == len(successTgts)+notFoundCnt) { + log.Debugf(vald.RemoveByTimestampRPCName+" API request succeeded to %#v", locs) + return locs, nil + } + + reqInfo := &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveByTimestampRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + } + + switch { + case result.Len() == notFoundCnt: + err = status.WrapWithNotFound(vald.RemoveByTimestampRPCName+" API target not found", err, reqInfo, resInfo) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeAlreadyExists(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + default: st, msg, err := status.ParseError(err, codes.Internal, - "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response") - if err != nil { + "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response", reqInfo, resInfo) + log.Warn(err) + if span != nil { span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err } - return locs, nil } -func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) { - ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName) +func (s *server) doRemoveByTimestamp( + ctx context.Context, + req *payload.Remove_TimestampRequest, + f func(ctx context.Context) (*payload.Object_Locations, error), +) (locs *payload.Object_Locations, err error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "doRemoveByTimestamp"), apiName+"/doRemoveByTimestamp") defer func() { if span != nil { span.End() } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { - vec, err = vc.GetObject(ctx, req, copts...) - if err != nil { - return nil, err - } - return vec, nil - }) + locs, err = f(ctx) if err != nil { reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), ServingData: errdetails.Serialize(req), } resInfo := &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RemoveByTimestampRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), } var attrs trace.Attributes switch { case errors.Is(err, context.Canceled): err = status.WrapWithCanceled( - vald.GetObjectRPCName+" API canceld", err, reqInfo, resInfo, + vald.RemoveByTimestampRPCName+" API canceld", err, reqInfo, resInfo, ) attrs = trace.StatusCodeCancelled(err.Error()) case errors.Is(err, context.DeadlineExceeded): err = status.WrapWithDeadlineExceeded( - vald.GetObjectRPCName+" API deadline exceeded", err, reqInfo, resInfo, + vald.RemoveByTimestampRPCName+" API deadline exceeded", err, reqInfo, resInfo, ) attrs = trace.StatusCodeDeadlineExceeded(err.Error()) case errors.Is(err, errors.ErrTargetNotFound): err = status.WrapWithInternal( - vald.GetObjectRPCName+" API target not found", err, reqInfo, resInfo, + vald.RemoveByTimestampRPCName+" API target not found", err, reqInfo, resInfo, ) attrs = trace.StatusCodeInternal(err.Error()) case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): err = status.WrapWithInternal( - vald.GetObjectRPCName+" API connection not found", err, reqInfo, resInfo, + vald.RemoveByTimestampRPCName+" API connection not found", err, reqInfo, resInfo, ) attrs = trace.StatusCodeInternal(err.Error()) default: @@ -3166,7 +2900,7 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques msg string ) st, msg, err = status.ParseError(err, codes.Internal, - "failed to parse "+vald.GetObjectRPCName+" gRPC error response", reqInfo, resInfo, + "failed to parse "+vald.RemoveByTimestampRPCName+" gRPC error response", reqInfo, resInfo, ) attrs = trace.FromGRPCStatus(st.Code(), msg) } @@ -3178,138 +2912,72 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques } return nil, err } - return vec, nil + return locs, nil } -func (s *server) getObjects(ctx context.Context, req *payload.Object_VectorRequest) (vecs *sync.Map[string, *payload.Object_Vector], err error) { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "getObjects"), apiName+"/"+vald.GetObjectRPCName+"/getObjects") +func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName) defer func() { if span != nil { span.End() } }() - var errs error - var emu sync.Mutex - vecs = new(sync.Map[string, *payload.Object_Vector]) - err = s.gateway.BroadCast(ctx, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.GetObjectRPCName+"/getObjects/"+target) - defer func() { - if span != nil { - span.End() - } - }() - - vec, err := vc.GetObject(ctx, req, copts...) - if err != nil { - reqInfo := &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), - } - resInfo := &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName, - ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, target), - } - var attrs trace.Attributes - var code codes.Code - - switch { - case errors.Is(err, context.Canceled): - err = status.WrapWithCanceled( - vald.GetObjectRPCName+" API canceld", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeCancelled(err.Error()) - code = codes.Canceled - case errors.Is(err, context.DeadlineExceeded): - err = status.WrapWithDeadlineExceeded( - vald.GetObjectRPCName+" API deadline exceeded", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeDeadlineExceeded(err.Error()) - code = codes.DeadlineExceeded - case errors.Is(err, errors.ErrTargetNotFound): - err = status.WrapWithInternal( - vald.GetObjectRPCName+" API target not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - code = codes.Internal - case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): - err = status.WrapWithInternal( - vald.GetObjectRPCName+" API connection not found", err, reqInfo, resInfo, - ) - attrs = trace.StatusCodeInternal(err.Error()) - code = codes.Internal - default: - var ( - st *status.Status - msg string - ) - st, msg, err = status.ParseError(err, codes.Internal, - "failed to parse "+vald.GetObjectRPCName+" gRPC error response", reqInfo, resInfo, - ) - attrs = trace.FromGRPCStatus(st.Code(), msg) - code = st.Code() - } - log.Warn(err) - if span != nil { - span.RecordError(err) - span.SetAttributes(attrs...) - span.SetStatus(trace.StatusError, err.Error()) - } - if code == codes.NotFound { - return nil - } - emu.Lock() - errs = errors.Join(errs, err) - emu.Unlock() - return err - } - vecs.Store(target, vec) - return nil + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + vec, err = vc.GetObject(ctx, req, copts...) + return vec, err }) if err != nil { - if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + reqInfo := &errdetails.RequestInfo{ + RequestId: req.GetId().GetId(), + ServingData: errdetails.Serialize(req), + } + resInfo := &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName, + ResourceName: fmt.Sprintf("%s: %s(%s) to %s", apiName, s.name, s.ip, s.vAddr), + } + var attrs trace.Attributes + + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled( + vald.GetObjectRPCName+" API canceld", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded( + vald.GetObjectRPCName+" API deadline exceeded", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeDeadlineExceeded(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): err = status.WrapWithInternal( - vald.GetObjectRPCName+" API connection not found", err, - &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName + ".BroadCast", - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, + vald.GetObjectRPCName+" API target not found", err, reqInfo, resInfo, ) - log.Warn(err) - if span != nil { - span.RecordError(err) - span.SetAttributes(trace.StatusCodeInternal(err.Error())...) - span.SetStatus(trace.StatusError, err.Error()) - } - return nil, err + attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrGRPCClientConnNotFound("*")): + err = status.WrapWithInternal( + vald.GetObjectRPCName+" API connection not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInternal(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, + "failed to parse "+vald.GetObjectRPCName+" gRPC error response", reqInfo, resInfo, + ) + attrs = trace.FromGRPCStatus(st.Code(), msg) } - errs = errors.Join(errs, err) - } - if errs != nil { - st, msg, err := status.ParseError(errs, codes.Internal, - "failed to parse "+vald.GetObjectRPCName+" gRPC error response", - &errdetails.RequestInfo{ - RequestId: req.GetId().GetId(), - ServingData: errdetails.Serialize(req), - }, - &errdetails.ResourceInfo{ - ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.GetObjectRPCName + "." + "BroadCast", - ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), - }, - ) log.Warn(err) if span != nil { span.RecordError(err) - span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetAttributes(attrs...) span.SetStatus(trace.StatusError, err.Error()) } return nil, err } - return vecs, nil + return vec, nil } func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err error) { @@ -3359,3 +3027,8 @@ func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err } return nil } + +type errorState struct { + err error + code codes.Code +} diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index 84968025c4..29d97f9664 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -16,7 +16,6 @@ package grpc import ( "context" "reflect" - "sync/atomic" "testing" "github.com/vdaas/vald/apis/grpc/v1/payload" @@ -25,7 +24,6 @@ import ( "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/net/grpc/codes" "github.com/vdaas/vald/internal/net/grpc/status" - "github.com/vdaas/vald/internal/sync" "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/internal/test/data/vector" "github.com/vdaas/vald/internal/test/goleak" @@ -66,7 +64,11 @@ func Test_server_Insert(t *testing.T) { } defaultCheckFunc := func(w want, gotCe *payload.Object_Location, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + gotSt, gotOk := status.FromError(err) + wantSt, wantOk := status.FromError(w.err) + if gotOk != wantOk || gotSt.Code() != wantSt.Code() { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } } if !reflect.DeepEqual(gotCe, w.wantCe) { return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotCe, w.wantCe) @@ -83,24 +85,23 @@ func Test_server_Insert(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } + targets := []string{ + "vald-01", "vald-02", + } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ + targets[0]: &mockClient{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - "vald-lb-gateway-01": &mockClient{ + targets[1]: &mockClient{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, } - wantLoc := &payload.Object_Location{ - Uuid: uuid, - Ips: []string{"127.0.0.1", "127.0.0.1"}, - } return test{ - name: "success insert with new ID", + name: "Success: insert with new ID", args: args{ ctx: egctx, req: &payload.Insert_Request{ @@ -118,15 +119,18 @@ func Test_server_Insert(t *testing.T) { return "" }, BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - wantCe: wantLoc, + wantCe: &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1", "127.0.0.1"}, + }, }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -143,23 +147,103 @@ func Test_server_Insert(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } + targets := []string{ + "vald-01", "vald-02", + } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ + targets[0]: &mockClient{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return loc, nil + return &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + }, nil }, - RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + }, + targets[1]: &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - "vald-lb-gateway-01": &mockClient{ + } + return test{ + name: "Success: when the last status codes are (OK, OK) after updating the target that returned AlreadyExists", + args: args{ + ctx: egctx, + req: &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultInsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, target := range targets { + if c, ok := cmap[target]; !ok { + return errors.ErrTargetNotFound + } else { + f(ctx, target, c) + } + } + return nil + }, + }, + }, + want: want{ + wantCe: &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1", "127.0.0.1"}, + }, + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + targets := []string{ + "vald-01", "vald-02", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + }, nil + }, + }, + targets[1]: &mockClient{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, } return test{ - name: "fail insert with new ID but remove rollback success", + name: "Success: when the last status codes are (OK, AlreadyExists) after updating the target that returned AlreadyExists", args: args{ ctx: egctx, req: &payload.Insert_Request{ @@ -176,25 +260,84 @@ func Test_server_Insert(t *testing.T) { FromForwardedContextFunc: func(_ context.Context) string { return "" }, - BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") + for _, target := range targets { + if c, ok := cmap[target]; !ok { + return errors.New("target not found") + } else { + f(ctx, target, c) + } } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + return nil + }, + }, + }, + want: want{ + wantCe: &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + }, + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + targets := []string{ + "vald-01", "vald-02", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) + }, + }, + targets[1]: &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) + }, + }, + } + return test{ + name: "Fail: when the status codes are (AlreadyExists, AlreadyExists)", + args: args{ + ctx: egctx, + req: &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultInsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + err: status.Error(codes.AlreadyExists, vald.InsertRPCName+" API target same vector already exists"), }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -211,23 +354,78 @@ func Test_server_Insert(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } + targets := []string{ + "vald-01", "vald-02", + } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ + targets[0]: &mockClient{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, - RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + }, + targets[1]: &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + } + return test{ + name: "Fail: when the status codes are (OK, Internal)", + args: args{ + ctx: egctx, + req: &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultInsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + targets := []string{ + "vald-01", "vald-02", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - "vald-lb-gateway-01": &mockClient{ + targets[1]: &mockClient{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) }, }, } return test{ - name: "fail insert with new ID and fail remove rollback", + name: "Fail: when the status codes are (Internal, Internal)", args: args{ ctx: egctx, req: &payload.Insert_Request{ @@ -244,18 +442,83 @@ func Test_server_Insert(t *testing.T) { FromForwardedContextFunc: func(_ context.Context) string { return "" }, - BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, - DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.Join( + status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()), + status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + ).Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + targets := []string{ + "vald-01", "vald-02", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + }, nil + }, + }, + targets[1]: &mockClient{ + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) + }, + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + } + return test{ + name: "Fail: when the last status codes are (OK, Internal) after updating the target that returned AlreadyExists", + args: args{ + ctx: egctx, + req: &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultInsertConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, target := range targets { + if c, ok := cmap[target]; !ok { + return errors.New("target not found") + } else { + f(ctx, target, c) + } } return nil }, @@ -340,7 +603,11 @@ func Test_server_Update(t *testing.T) { } defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + gotSt, gotOk := status.FromError(err) + wantSt, wantOk := status.FromError(w.err) + if gotOk != wantOk || gotSt.Code() != wantSt.Code() { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } } if !reflect.DeepEqual(gotLoc, w.wantLoc) { return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) @@ -357,30 +624,23 @@ func Test_server_Update(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } + targets := []string{ + "vald-01", "vald-02", + } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[0]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[1]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, } - wantLoc := &payload.Object_Location{ - Uuid: uuid, - Ips: []string{"127.0.0.1", "127.0.0.1"}, - } return test{ - name: "success update with new ID", + name: "Success: update with new ID", args: args{ ctx: egctx, req: &payload.Update_Request{ @@ -398,15 +658,18 @@ func Test_server_Update(t *testing.T) { return "" }, BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - wantLoc: wantLoc, + wantLoc: &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1", "127.0.0.1"}, + }, }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -423,29 +686,23 @@ func Test_server_Update(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } + targets := []string{ + "vald-01", "vald-02", + } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[0]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, - RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return loc, nil - }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[1]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, } return test{ - name: "fail update with new ID but remove rollback success", + name: "Success: when the status codes are (AlreadyExists, OK)", args: args{ ctx: egctx, req: &payload.Update_Request{ @@ -462,25 +719,19 @@ func Test_server_Update(t *testing.T) { FromForwardedContextFunc: func(_ context.Context) string { return "" }, - BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) - } - return nil - }, - DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") - } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + wantLoc: &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + }, }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -497,34 +748,38 @@ func Test_server_Update(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } - ovec := &payload.Object_Vector{ - Id: uuid, - Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + targets := []string{ + "vald-01", "vald-02", "vald-03", } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return ovec, nil - }, + targets[0]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + targets[1]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + targets[2]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + return loc, nil }, }, } return test{ - name: "fail update with new ID but update rollback success", + name: "Success: when the last status codes are (OK, OK, OK) after inserting the target that returned NotFound", args: args{ ctx: egctx, req: &payload.Update_Request{ - Vector: ovec, + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, Config: defaultUpdateConfig, }, }, @@ -535,24 +790,30 @@ func Test_server_Update(t *testing.T) { return "" }, BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") - } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + for _, target := range targets { + if c, ok := cmap[target]; !ok { + return errors.ErrTargetNotFound + } else { + f(ctx, target, c) + } } return nil }, }, }, want: want{ - err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + wantLoc: &payload.Object_Location{ + Uuid: uuid, + Ips: []string{ + "127.0.0.1", "127.0.0.1", "127.0.0.1", + }, + }, }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -569,29 +830,31 @@ func Test_server_Update(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } + targets := []string{ + "vald-01", "vald-02", "vald-03", + } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[0]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, - RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) - }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) { + targets[1]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + targets[2]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, } return test{ - name: "fail update with new ID and fail remove rollback", + name: "Success: when the last status codes are (OK, OK, AlreadyExists) after inserting the target that returned NotFound", args: args{ ctx: egctx, req: &payload.Update_Request{ @@ -608,25 +871,86 @@ func Test_server_Update(t *testing.T) { FromForwardedContextFunc: func(_ context.Context) string { return "" }, - BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") + for _, target := range targets { + if c, ok := cmap[target]; !ok { + return errors.ErrTargetNotFound + } else { + f(ctx, target, c) + } } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + return nil + }, + }, + }, + want: want{ + wantLoc: &payload.Object_Location{ + Uuid: uuid, + Ips: []string{ + "127.0.0.1", "127.0.0.1", + }, + }, + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + targets := []string{ + "vald-01", "vald-02", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + }, + targets[1]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + }, + } + return test{ + name: "Fail: when the status codes are (NotFound, NotFound)", + args: args{ + ctx: egctx, + req: &payload.Update_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpdateConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + err: status.Error(codes.NotFound, vald.UpdateRPCName+" API id "+uuid+" not found"), }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -643,38 +967,151 @@ func Test_server_Update(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } - ovec := &payload.Object_Vector{ - Id: uuid, - Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + targets := []string{ + "vald-01", "vald-02", } - var cnt uint32 cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return ovec, nil + targets[0]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + targets[1]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + } + return test{ + name: "Fail: when the status codes are (Internal, OK)", + args: args{ + ctx: egctx, + req: &payload.Update_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpdateConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + targets := []string{ + "vald-01", "vald-02", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - if atomic.AddUint32(&cnt, 1) == 1 { - return loc, nil - } return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { + targets[1]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) + }, + }, + } + return test{ + name: "Fail: when the status codes are (Internal, AlreadyExists)", + args: args{ + ctx: egctx, + req: &payload.Update_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpdateConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.Join( + status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()), + ).Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + targets := []string{ + "vald-01", "vald-02", "vald-03", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) + }, + }, + targets[1]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) + }, + }, + targets[2]: &mockClient{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, } return test{ - name: "fail update with new ID and fail update rollback", + name: "Fail: when the last status codes are (AlreadyExists, AlreadyExists, AlreadyExists) after inserting the target that returned NotFound", args: args{ ctx: egctx, req: &payload.Update_Request{ - Vector: ovec, + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, Config: defaultUpdateConfig, }, }, @@ -685,17 +1122,95 @@ func Test_server_Update(t *testing.T) { return "" }, BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, target := range targets { + if c, ok := cmap[target]; !ok { + return errors.ErrTargetNotFound + } else { + f(ctx, target, c) + } } return nil }, - DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") + }, + }, + want: want{ + err: status.Error(codes.AlreadyExists, vald.InsertRPCName+" for "+vald.UpdateRPCName+" API target same vector already exists"), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + loc := &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1"}, + } + targets := []string{ + "vald-01", "vald-02", "vald-03", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + targets[1]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + }, + InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + targets[2]: &mockClient{ + UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return loc, nil + }, + }, + } + return test{ + name: "Fail: when the last status codes are (OK, OK, Internal) after inserting the target that returned NotFound", + args: args{ + ctx: egctx, + req: &payload.Update_Request{ + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, + Config: defaultUpdateConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + return nil + }, + DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, target := range targets { + if c, ok := cmap[target]; !ok { + return errors.New("target not found") + } else { + f(ctx, target, c) + } } return nil }, @@ -780,7 +1295,11 @@ func Test_server_Upsert(t *testing.T) { } defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + gotSt, gotOk := status.FromError(err) + wantSt, wantOk := status.FromError(w.err) + if gotOk != wantOk || gotSt.Code() != wantSt.Code() { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } } if !reflect.DeepEqual(gotLoc, w.wantLoc) { return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) @@ -797,30 +1316,23 @@ func Test_server_Upsert(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } + targets := []string{ + "vald-01", "vald-02", + } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[0]: &mockClient{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[1]: &mockClient{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, } - wantLoc := &payload.Object_Location{ - Uuid: uuid, - Ips: []string{"127.0.0.1", "127.0.0.1"}, - } return test{ - name: "success upsert with new ID", + name: "Success: upsert with new ID", args: args{ ctx: egctx, req: &payload.Upsert_Request{ @@ -838,15 +1350,18 @@ func Test_server_Upsert(t *testing.T) { return "" }, BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - wantLoc: wantLoc, + wantLoc: &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1", "127.0.0.1"}, + }, }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -863,29 +1378,23 @@ func Test_server_Upsert(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } + targets := []string{ + "vald-01", "vald-02", + } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[0]: &mockClient{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, - RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return loc, nil - }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[1]: &mockClient{ UpsertFunc: func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, } return test{ - name: "fail upsert with new ID but remove rollback success", + name: "Success: when the status codes are (AlreadyExists, OK)", args: args{ ctx: egctx, req: &payload.Upsert_Request{ @@ -903,24 +1412,15 @@ func Test_server_Upsert(t *testing.T) { return "" }, BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) - } - return nil - }, - DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") - } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + wantLoc: loc, }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -933,41 +1433,30 @@ func Test_server_Upsert(t *testing.T) { eg, egctx := errgroup.New(ctx) uuid := "test" - loc := &payload.Object_Location{ - Uuid: uuid, - Ips: []string{"127.0.0.1"}, - } - ovec := &payload.Object_Vector{ - Id: uuid, - Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + targets := []string{ + "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return ovec, nil - }, + targets[0]: &mockClient{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return loc, nil - }, - UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return loc, nil + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, - UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + targets[1]: &mockClient{ + UpsertFunc: func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, } return test{ - name: "fail upsert with new ID but update rollback success", + name: "Fail: when the status codes are (AlreadyExists, AlreadyExists)", args: args{ ctx: egctx, req: &payload.Upsert_Request{ - Vector: ovec, + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, Config: defaultUpsertConfig, }, }, @@ -977,25 +1466,16 @@ func Test_server_Upsert(t *testing.T) { FromForwardedContextFunc: func(_ context.Context) string { return "" }, - BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) - } - return nil - }, - DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") - } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + err: status.Error(codes.AlreadyExists, vald.UpsertRPCName+" API target same vector already exists"), }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -1012,29 +1492,23 @@ func Test_server_Upsert(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } + targets := []string{ + "vald-01", "vald-02", + } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[0]: &mockClient{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, - RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) - }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, - UpsertFunc: func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + targets[1]: &mockClient{ + UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, } return test{ - name: "fail upsert with new ID and fail remove rollback", + name: "Fail: when the status codes are (Internal, OK)", args: args{ ctx: egctx, req: &payload.Upsert_Request{ @@ -1051,18 +1525,9 @@ func Test_server_Upsert(t *testing.T) { FromForwardedContextFunc: func(_ context.Context) string { return "" }, - BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) - } - return nil - }, - DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") - } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, @@ -1082,41 +1547,30 @@ func Test_server_Upsert(t *testing.T) { eg, egctx := errgroup.New(ctx) uuid := "test" - loc := &payload.Object_Location{ - Uuid: uuid, - Ips: []string{"127.0.0.1"}, - } - ovec := &payload.Object_Vector{ - Id: uuid, - Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + targets := []string{ + "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return ovec, nil - }, + targets[0]: &mockClient{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return loc, nil - }, - UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[1]: &mockClient{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) }, }, } return test{ - name: "fail upsert with new ID and fail update rollback", + name: "Fail: upsert when the status codes are (Internal, Internal)", args: args{ ctx: egctx, req: &payload.Upsert_Request{ - Vector: ovec, + Vector: &payload.Object_Vector{ + Id: uuid, + Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + }, Config: defaultUpsertConfig, }, }, @@ -1127,24 +1581,18 @@ func Test_server_Upsert(t *testing.T) { return "" }, BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) - } - return nil - }, - DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") - } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + err: status.Error(codes.Internal, errors.Join( + status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()), + ).Error()), }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -1222,7 +1670,11 @@ func Test_server_Remove(t *testing.T) { } defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + gotSt, gotOk := status.FromError(err) + wantSt, wantOk := status.FromError(w.err) + if gotOk != wantOk || gotSt.Code() != wantSt.Code() { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } } if !reflect.DeepEqual(gotLoc, w.wantLoc) { return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) @@ -1239,34 +1691,23 @@ func Test_server_Remove(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } - ovec := &payload.Object_Vector{ - Id: uuid, - Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + targets := []string{ + "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return ovec, nil - }, + targets[0]: &mockClient{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[1]: &mockClient{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + return loc, nil }, }, } - wantLoc := &payload.Object_Location{ - Uuid: uuid, - Ips: []string{"127.0.0.1"}, - } return test{ - name: "success remove with existing ID", + name: "Success: remove with existing ID", args: args{ ctx: egctx, req: &payload.Remove_Request{ @@ -1283,15 +1724,18 @@ func Test_server_Remove(t *testing.T) { return "" }, BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - wantLoc: wantLoc, + wantLoc: &payload.Object_Location{ + Uuid: uuid, + Ips: []string{"127.0.0.1", "127.0.0.1"}, + }, }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -1308,33 +1752,23 @@ func Test_server_Remove(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } - ovec := &payload.Object_Vector{ - Id: uuid, - Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + targets := []string{ + "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return ovec, nil - }, + targets[0]: &mockClient{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, - UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return loc, nil - }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) - }, + targets[1]: &mockClient{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, }, } return test{ - name: "fail remove with existing ID but upsert rollback success", + name: "Success: when the status codes are (NotFound, OK)", args: args{ ctx: egctx, req: &payload.Remove_Request{ @@ -1350,25 +1784,16 @@ func Test_server_Remove(t *testing.T) { FromForwardedContextFunc: func(_ context.Context) string { return "" }, - BroadCastFunc: func(ctx context.Context, f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) - } - return nil - }, - DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") - } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + wantLoc: loc, }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -1385,33 +1810,77 @@ func Test_server_Remove(t *testing.T) { Uuid: uuid, Ips: []string{"127.0.0.1"}, } - ovec := &payload.Object_Vector{ - Id: uuid, - Vector: vector.GaussianDistributedFloat32VectorGenerator(1, dimension)[0], + targets := []string{ + "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - "vald-mirror-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return ovec, nil - }, + targets[0]: &mockClient{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, - UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + }, + targets[1]: &mockClient{ + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - "vald-lb-gateway-01": &mockClient{ - GetObjectFunc: func(_ context.Context, _ *payload.Object_VectorRequest, _ ...grpc.CallOption) (*payload.Object_Vector, error) { - return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) + } + return test{ + name: "Fail: when the status codes are (Internal, OK)", + args: args{ + ctx: egctx, + req: &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: uuid, + }, + Config: defaultRemoveConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + targets := []string{ + "vald-01", "vald-02", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, + }, + targets[1]: &mockClient{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { - return loc, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) }, }, } return test{ - name: "fail remove with existing ID and fail upsert rollback", + name: "Fail: when the status codes are (Internal, Internal)", args: args{ ctx: egctx, req: &payload.Remove_Request{ @@ -1428,24 +1897,72 @@ func Test_server_Remove(t *testing.T) { return "" }, BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { - for tgt, c := range cmap { - f(ctx, tgt, c) + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, - DoMultiFunc: func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, _ ...grpc.CallOption) error) error { - if len(targets) != 1 { - return errors.New("invalid target") - } - if c, ok := cmap[targets[0]]; ok { - f(ctx, targets[0], c) + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.Join( + status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()), + ).Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) + + uuid := "test" + targets := []string{ + "vald-01", "vald-02", + } + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.NotFound, errors.ErrIndexNotFound.Error()) + }, + }, + targets[1]: &mockClient{ + RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { + return nil, status.Error(codes.NotFound, errors.ErrIndexNotFound.Error()) + }, + }, + } + return test{ + name: "Fail: when the status codes are (NotFound, NotFound)", + args: args{ + ctx: egctx, + req: &payload.Remove_Request{ + Id: &payload.Object_ID{ + Id: uuid, + }, + Config: defaultRemoveConfig, + }, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) } return nil }, }, }, want: want{ - err: status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + err: status.Error(codes.NotFound, vald.RemoveRPCName+" API id "+uuid+" not found"), }, afterFunc: func(t *testing.T, args args) { t.Helper() @@ -1489,593 +2006,286 @@ func Test_server_Remove(t *testing.T) { } } -// NOT IMPLEMENTED BELOW - -func TestNew(t *testing.T) { +func Test_server_RemoveByTimestamp(t *testing.T) { + defaultRemoveByTimestampReq := &payload.Remove_TimestampRequest{ + Timestamps: []*payload.Remove_Timestamp{}, + } type args struct { - opts []Option + ctx context.Context + req *payload.Remove_TimestampRequest + } + type fields struct { + eg errgroup.Group + gateway service.Gateway + mirror service.Mirror + vAddr string + streamConcurrency int + name string + ip string + UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - want vald.ServerWithMirror - err error + wantLocs *payload.Object_Locations + err error } type test struct { name string args args + fields fields want want - checkFunc func(want, vald.Server, error) error + checkFunc func(want, *payload.Object_Locations, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, got vald.Server, err error) error { + defaultCheckFunc := func(w want, gotLocs *payload.Object_Locations, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + gotSt, gotOk := status.FromError(err) + wantSt, wantOk := status.FromError(w.err) + if gotOk != wantOk || gotSt.Code() != wantSt.Code() { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } } - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + if !reflect.DeepEqual(gotLocs, w.wantLocs) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLocs, w.wantLocs) } return nil } tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - opts: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 { - opts:nil, - }, - want: want{}, - checkFunc: defaultCheckFunc, - beforeFunc: func(t *testing.T, args args) { - t.Helper() - }, - afterFunc: func(t *testing.T, args args) { - t.Helper() - }, - } - }(), - */ - } + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) - 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) + loc := &payload.Object_Location{ + Uuid: "test", + Ips: []string{ + "127.0.0.1", + }, } - if test.afterFunc != nil { - defer test.afterFunc(tt, test.args) + loc2 := &payload.Object_Location{ + Uuid: "test02", + Ips: []string{ + "127.0.0.1", + }, } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc + targets := []string{ + "vald-01", "vald-02", } - - got, err := New(test.args.opts...) - if err := checkFunc(test.want, got, err); err != nil { - tt.Errorf("error = %v", err) + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { + return &payload.Object_Locations{ + Locations: []*payload.Object_Location{ + loc, + }, + }, nil + }, + }, + targets[1]: &mockClient{ + RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { + return &payload.Object_Locations{ + Locations: []*payload.Object_Location{ + loc2, + }, + }, nil + }, + }, } - }) - } -} - -func Test_server_Register(t *testing.T) { - type args struct { - ctx context.Context - req *payload.Mirror_Targets - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - want *payload.Mirror_Targets - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Mirror_Targets, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, got *payload.Mirror_Targets, 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(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - ctx:nil, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror:nil, - }, - want: want{}, - checkFunc: defaultCheckFunc, - beforeFunc: func(t *testing.T, args args) { - t.Helper() - }, - afterFunc: func(t *testing.T, args args) { - t.Helper() - }, - } - }(), - */ - } + return test{ + name: "Success: removeByTimestamp", + args: args{ + ctx: egctx, + req: defaultRemoveByTimestampReq, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, + }, + }, + want: want{ + wantLocs: &payload.Object_Locations{ + Locations: []*payload.Object_Location{ + loc, loc2, + }, + }, + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) - 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) + loc := &payload.Object_Location{ + Uuid: "test", + Ips: []string{ + "127.0.0.1", + }, } - if test.afterFunc != nil { - defer test.afterFunc(tt, test.args) + targets := []string{ + "vald-01", "vald-02", } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { + return &payload.Object_Locations{ + Locations: []*payload.Object_Location{ + loc, + }, + }, nil + }, + }, + targets[1]: &mockClient{ + RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound("test02").Error()) + }, + }, } - s := &server{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, + return test{ + name: "Success: when the status codes are (NotFound, OK)", + args: args{ + ctx: egctx, + req: defaultRemoveByTimestampReq, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, + }, + }, + want: want{ + wantLocs: &payload.Object_Locations{ + Locations: []*payload.Object_Location{ + loc, + }, + }, + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) - got, err := s.Register(test.args.ctx, test.args.req) - if err := checkFunc(test.want, got, err); err != nil { - tt.Errorf("error = %v", err) + targets := []string{ + "vald-01", "vald-02", } - }) - } -} + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) + }, + }, + targets[1]: &mockClient{ + RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { + return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) + }, + }, + } + return test{ + name: "Fail: when the status codes are (Internal, Internal)", + args: args{ + ctx: egctx, + req: defaultRemoveByTimestampReq, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.Internal, errors.Join( + status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()), + status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()), + ).Error()), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), + func() test { + ctx, cancel := context.WithCancel(context.Background()) + eg, egctx := errgroup.New(ctx) -func Test_server_Advertise(t *testing.T) { - type args struct { - ctx context.Context - req *payload.Mirror_Targets - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Mirror_Targets - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Mirror_Targets, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Mirror_Targets, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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) + uuid1 := "test01" + uuid2 := "test02" + targets := []string{ + "vald-01", "vald-02", } - if test.afterFunc != nil { - defer test.afterFunc(tt, test.args) - } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc - } - s := &server{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.Advertise(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_Exists(t *testing.T) { - type args struct { - ctx context.Context - meta *payload.Object_ID - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantId *payload.Object_ID - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Object_ID, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotId *payload.Object_ID, 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(gotId, w.wantId) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotId, w.wantId) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - ctx:nil, - meta:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - meta:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotId, err := s.Exists(test.args.ctx, test.args.meta) - if err := checkFunc(test.want, gotId, err); err != nil { - tt.Errorf("error = %v", err) + cmap := map[string]vald.ClientWithMirror{ + targets[0]: &mockClient{ + RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid1).Error()) + }, + }, + targets[1]: &mockClient{ + RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { + return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid2).Error()) + }, + }, } - }) - } -} - -func Test_server_Search(t *testing.T) { - type args struct { - ctx context.Context - req *payload.Search_Request - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Search_Response - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Search_Response, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror:nil, - }, - want: want{}, - checkFunc: defaultCheckFunc, - beforeFunc: func(t *testing.T, args args) { - t.Helper() - }, - afterFunc: func(t *testing.T, args args) { - t.Helper() - }, - } - }(), - */ + return test{ + name: "Fail: when the status codes are (NotFound, NotFound)", + args: args{ + ctx: egctx, + req: defaultRemoveByTimestampReq, + }, + fields: fields{ + eg: eg, + gateway: &mockGateway{ + FromForwardedContextFunc: func(_ context.Context) string { + return "" + }, + BroadCastFunc: func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error { + for _, tgt := range targets { + f(ctx, tgt, cmap[tgt]) + } + return nil + }, + }, + }, + want: want{ + err: status.Error(codes.NotFound, vald.RemoveByTimestampRPCName+" API target not found"), + }, + afterFunc: func(t *testing.T, args args) { + t.Helper() + cancel() + }, + } + }(), } for _, tc := range tests { @@ -2104,48 +2314,38 @@ func Test_server_Search(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.Search(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { + gotLocs, err := s.RemoveByTimestamp(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotLocs, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_SearchByID(t *testing.T) { +// NOT IMPLEMENTED BELOW + +func TestNew(t *testing.T) { type args struct { - ctx context.Context - req *payload.Search_IDRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror + opts []Option } type want struct { - wantRes *payload.Search_Response - err error + want vald.ServerWithMirror + err error } type test struct { name string args args - fields fields want want - checkFunc func(want, *payload.Search_Response, error) error + checkFunc func(want, vald.Server, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotRes *payload.Search_Response, err error) error { + defaultCheckFunc := func(w want, got vald.Server, 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) + if !reflect.DeepEqual(got, w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) } return nil } @@ -2155,18 +2355,7 @@ func Test_server_SearchByID(t *testing.T) { { name: "test_case_1", args: args { - ctx:nil, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror:nil, + opts:nil, }, want: want{}, checkFunc: defaultCheckFunc, @@ -2185,18 +2374,7 @@ func Test_server_SearchByID(t *testing.T) { return test { name: "test_case_2", args: args { - ctx:nil, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror:nil, + opts:nil, }, want: want{}, checkFunc: defaultCheckFunc, @@ -2226,28 +2404,19 @@ func Test_server_SearchByID(t *testing.T) { if test.checkFunc == nil { checkFunc = defaultCheckFunc } - s := &server{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - gotRes, err := s.SearchByID(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { + got, err := New(test.args.opts...) + if err := checkFunc(test.want, got, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_StreamSearch(t *testing.T) { +func Test_server_Register(t *testing.T) { type args struct { - stream vald.Search_StreamSearchServer + ctx context.Context + req *payload.Mirror_Targets } type fields struct { eg errgroup.Group @@ -2260,21 +2429,25 @@ func Test_server_StreamSearch(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - err error + want *payload.Mirror_Targets + err error } type test struct { name string args args fields fields want want - checkFunc func(want, error) error + checkFunc func(want, *payload.Mirror_Targets, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, err error) error { + defaultCheckFunc := func(w want, got *payload.Mirror_Targets, 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(got, w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } return nil } tests := []test{ @@ -2283,7 +2456,8 @@ func Test_server_StreamSearch(t *testing.T) { { name: "test_case_1", args: args { - stream:nil, + ctx:nil, + req:nil, }, fields: fields { eg:nil, @@ -2312,7 +2486,8 @@ func Test_server_StreamSearch(t *testing.T) { return test { name: "test_case_2", args: args { - stream:nil, + ctx:nil, + req:nil, }, fields: fields { eg:nil, @@ -2363,17 +2538,18 @@ func Test_server_StreamSearch(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - err := s.StreamSearch(test.args.stream) - if err := checkFunc(test.want, err); err != nil { + got, err := s.Register(test.args.ctx, test.args.req) + if err := checkFunc(test.want, got, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_StreamSearchByID(t *testing.T) { +func Test_server_Advertise(t *testing.T) { type args struct { - stream vald.Search_StreamSearchByIDServer + ctx context.Context + req *payload.Mirror_Targets } type fields struct { eg errgroup.Group @@ -2386,21 +2562,25 @@ func Test_server_StreamSearchByID(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - err error + wantRes *payload.Mirror_Targets + err error } type test struct { name string args args fields fields want want - checkFunc func(want, error) error + checkFunc func(want, *payload.Mirror_Targets, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Mirror_Targets, 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{ @@ -2409,7 +2589,8 @@ func Test_server_StreamSearchByID(t *testing.T) { { name: "test_case_1", args: args { - stream:nil, + ctx:nil, + req:nil, }, fields: fields { eg:nil, @@ -2438,7 +2619,8 @@ func Test_server_StreamSearchByID(t *testing.T) { return test { name: "test_case_2", args: args { - stream:nil, + ctx:nil, + req:nil, }, fields: fields { eg:nil, @@ -2489,18 +2671,18 @@ func Test_server_StreamSearchByID(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - err := s.StreamSearchByID(test.args.stream) - if err := checkFunc(test.want, err); err != nil { + gotRes, err := s.Advertise(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_MultiSearch(t *testing.T) { +func Test_server_Exists(t *testing.T) { type args struct { - ctx context.Context - req *payload.Search_MultiRequest + ctx context.Context + meta *payload.Object_ID } type fields struct { eg errgroup.Group @@ -2513,24 +2695,24 @@ func Test_server_MultiSearch(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantRes *payload.Search_Responses - err error + wantId *payload.Object_ID + err error } type test struct { name string args args fields fields want want - checkFunc func(want, *payload.Search_Responses, error) error + checkFunc func(want, *payload.Object_ID, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, err error) error { + defaultCheckFunc := func(w want, gotId *payload.Object_ID, 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) + if !reflect.DeepEqual(gotId, w.wantId) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotId, w.wantId) } return nil } @@ -2541,7 +2723,7 @@ func Test_server_MultiSearch(t *testing.T) { name: "test_case_1", args: args { ctx:nil, - req:nil, + meta:nil, }, fields: fields { eg:nil, @@ -2571,7 +2753,7 @@ func Test_server_MultiSearch(t *testing.T) { name: "test_case_2", args: args { ctx:nil, - req:nil, + meta:nil, }, fields: fields { eg:nil, @@ -2622,18 +2804,18 @@ func Test_server_MultiSearch(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.MultiSearch(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { + gotId, err := s.Exists(test.args.ctx, test.args.meta) + if err := checkFunc(test.want, gotId, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_MultiSearchByID(t *testing.T) { +func Test_server_Search(t *testing.T) { type args struct { ctx context.Context - req *payload.Search_MultiIDRequest + req *payload.Search_Request } type fields struct { eg errgroup.Group @@ -2646,7 +2828,7 @@ func Test_server_MultiSearchByID(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantRes *payload.Search_Responses + wantRes *payload.Search_Response err error } type test struct { @@ -2654,11 +2836,11 @@ func Test_server_MultiSearchByID(t *testing.T) { args args fields fields want want - checkFunc func(want, *payload.Search_Responses, error) error + checkFunc func(want, *payload.Search_Response, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Search_Response, err error) error { if !errors.Is(err, w.err) { return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) } @@ -2755,7 +2937,7 @@ func Test_server_MultiSearchByID(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.MultiSearchByID(test.args.ctx, test.args.req) + gotRes, err := s.Search(test.args.ctx, test.args.req) if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } @@ -2763,10 +2945,10 @@ func Test_server_MultiSearchByID(t *testing.T) { } } -func Test_server_LinearSearch(t *testing.T) { +func Test_server_SearchByID(t *testing.T) { type args struct { ctx context.Context - req *payload.Search_Request + req *payload.Search_IDRequest } type fields struct { eg errgroup.Group @@ -2888,7 +3070,7 @@ func Test_server_LinearSearch(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.LinearSearch(test.args.ctx, test.args.req) + gotRes, err := s.SearchByID(test.args.ctx, test.args.req) if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } @@ -2896,10 +3078,9 @@ func Test_server_LinearSearch(t *testing.T) { } } -func Test_server_LinearSearchByID(t *testing.T) { +func Test_server_StreamSearch(t *testing.T) { type args struct { - ctx context.Context - req *payload.Search_IDRequest + stream vald.Search_StreamSearchServer } type fields struct { eg errgroup.Group @@ -2912,25 +3093,21 @@ func Test_server_LinearSearchByID(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantRes *payload.Search_Response - err error + err error } type test struct { name string args args fields fields want want - checkFunc func(want, *payload.Search_Response, error) error + checkFunc func(want, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotRes *payload.Search_Response, err error) error { + defaultCheckFunc := func(w want, 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{ @@ -2939,8 +3116,7 @@ func Test_server_LinearSearchByID(t *testing.T) { { name: "test_case_1", args: args { - ctx:nil, - req:nil, + stream:nil, }, fields: fields { eg:nil, @@ -2969,8 +3145,7 @@ func Test_server_LinearSearchByID(t *testing.T) { return test { name: "test_case_2", args: args { - ctx:nil, - req:nil, + stream:nil, }, fields: fields { eg:nil, @@ -3021,17 +3196,17 @@ func Test_server_LinearSearchByID(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.LinearSearchByID(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { + err := s.StreamSearch(test.args.stream) + if err := checkFunc(test.want, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_StreamLinearSearch(t *testing.T) { +func Test_server_StreamSearchByID(t *testing.T) { type args struct { - stream vald.Search_StreamLinearSearchServer + stream vald.Search_StreamSearchByIDServer } type fields struct { eg errgroup.Group @@ -3147,7 +3322,7 @@ func Test_server_StreamLinearSearch(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - err := s.StreamLinearSearch(test.args.stream) + err := s.StreamSearchByID(test.args.stream) if err := checkFunc(test.want, err); err != nil { tt.Errorf("error = %v", err) } @@ -3155,9 +3330,10 @@ func Test_server_StreamLinearSearch(t *testing.T) { } } -func Test_server_StreamLinearSearchByID(t *testing.T) { +func Test_server_MultiSearch(t *testing.T) { type args struct { - stream vald.Search_StreamLinearSearchByIDServer + ctx context.Context + req *payload.Search_MultiRequest } type fields struct { eg errgroup.Group @@ -3170,21 +3346,25 @@ func Test_server_StreamLinearSearchByID(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - err error + wantRes *payload.Search_Responses + err error } type test struct { name string args args fields fields want want - checkFunc func(want, error) error + checkFunc func(want, *payload.Search_Responses, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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{ @@ -3193,7 +3373,8 @@ func Test_server_StreamLinearSearchByID(t *testing.T) { { name: "test_case_1", args: args { - stream:nil, + ctx:nil, + req:nil, }, fields: fields { eg:nil, @@ -3222,7 +3403,8 @@ func Test_server_StreamLinearSearchByID(t *testing.T) { return test { name: "test_case_2", args: args { - stream:nil, + ctx:nil, + req:nil, }, fields: fields { eg:nil, @@ -3273,18 +3455,18 @@ func Test_server_StreamLinearSearchByID(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - err := s.StreamLinearSearchByID(test.args.stream) - if err := checkFunc(test.want, err); err != nil { + gotRes, err := s.MultiSearch(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_MultiLinearSearch(t *testing.T) { +func Test_server_MultiSearchByID(t *testing.T) { type args struct { ctx context.Context - req *payload.Search_MultiRequest + req *payload.Search_MultiIDRequest } type fields struct { eg errgroup.Group @@ -3406,7 +3588,7 @@ func Test_server_MultiLinearSearch(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.MultiLinearSearch(test.args.ctx, test.args.req) + gotRes, err := s.MultiSearchByID(test.args.ctx, test.args.req) if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } @@ -3414,10 +3596,10 @@ func Test_server_MultiLinearSearch(t *testing.T) { } } -func Test_server_MultiLinearSearchByID(t *testing.T) { +func Test_server_LinearSearch(t *testing.T) { type args struct { ctx context.Context - req *payload.Search_MultiIDRequest + req *payload.Search_Request } type fields struct { eg errgroup.Group @@ -3430,7 +3612,7 @@ func Test_server_MultiLinearSearchByID(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantRes *payload.Search_Responses + wantRes *payload.Search_Response err error } type test struct { @@ -3438,11 +3620,11 @@ func Test_server_MultiLinearSearchByID(t *testing.T) { args args fields fields want want - checkFunc func(want, *payload.Search_Responses, error) error + checkFunc func(want, *payload.Search_Response, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Search_Response, err error) error { if !errors.Is(err, w.err) { return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) } @@ -3539,7 +3721,7 @@ func Test_server_MultiLinearSearchByID(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.MultiLinearSearchByID(test.args.ctx, test.args.req) + gotRes, err := s.LinearSearch(test.args.ctx, test.args.req) if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } @@ -3547,12 +3729,10 @@ func Test_server_MultiLinearSearchByID(t *testing.T) { } } -func Test_server_insert(t *testing.T) { +func Test_server_LinearSearchByID(t *testing.T) { type args struct { - ctx context.Context - client vald.InsertClient - req *payload.Insert_Request - opts []grpc.CallOption + ctx context.Context + req *payload.Search_IDRequest } type fields struct { eg errgroup.Group @@ -3565,7 +3745,7 @@ func Test_server_insert(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantLoc *payload.Object_Location + wantRes *payload.Search_Response err error } type test struct { @@ -3573,16 +3753,16 @@ func Test_server_insert(t *testing.T) { args args fields fields want want - checkFunc func(want, *payload.Object_Location, error) error + checkFunc func(want, *payload.Search_Response, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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(gotLoc, w.wantLoc) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) + if !reflect.DeepEqual(gotRes, w.wantRes) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotRes, w.wantRes) } return nil } @@ -3593,9 +3773,7 @@ func Test_server_insert(t *testing.T) { name: "test_case_1", args: args { ctx:nil, - client:nil, req:nil, - opts:nil, }, fields: fields { eg:nil, @@ -3625,9 +3803,7 @@ func Test_server_insert(t *testing.T) { name: "test_case_2", args: args { ctx:nil, - client:nil, req:nil, - opts:nil, }, fields: fields { eg:nil, @@ -3678,17 +3854,17 @@ func Test_server_insert(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotLoc, err := s.insert(test.args.ctx, test.args.client, test.args.req, test.args.opts...) - if err := checkFunc(test.want, gotLoc, err); err != nil { + gotRes, err := s.LinearSearchByID(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_StreamInsert(t *testing.T) { +func Test_server_StreamLinearSearch(t *testing.T) { type args struct { - stream vald.Insert_StreamInsertServer + stream vald.Search_StreamLinearSearchServer } type fields struct { eg errgroup.Group @@ -3804,7 +3980,7 @@ func Test_server_StreamInsert(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - err := s.StreamInsert(test.args.stream) + err := s.StreamLinearSearch(test.args.stream) if err := checkFunc(test.want, err); err != nil { tt.Errorf("error = %v", err) } @@ -3812,10 +3988,9 @@ func Test_server_StreamInsert(t *testing.T) { } } -func Test_server_MultiInsert(t *testing.T) { +func Test_server_StreamLinearSearchByID(t *testing.T) { type args struct { - ctx context.Context - reqs *payload.Insert_MultiRequest + stream vald.Search_StreamLinearSearchByIDServer } type fields struct { eg errgroup.Group @@ -3828,25 +4003,21 @@ func Test_server_MultiInsert(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantRes *payload.Object_Locations - err error + err error } type test struct { name string args args fields fields want want - checkFunc func(want, *payload.Object_Locations, error) error + checkFunc func(want, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, err error) error { + defaultCheckFunc := func(w want, 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{ @@ -3855,8 +4026,7 @@ func Test_server_MultiInsert(t *testing.T) { { name: "test_case_1", args: args { - ctx:nil, - reqs:nil, + stream:nil, }, fields: fields { eg:nil, @@ -3885,8 +4055,7 @@ func Test_server_MultiInsert(t *testing.T) { return test { name: "test_case_2", args: args { - ctx:nil, - reqs:nil, + stream:nil, }, fields: fields { eg:nil, @@ -3937,20 +4106,18 @@ func Test_server_MultiInsert(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.MultiInsert(test.args.ctx, test.args.reqs) - if err := checkFunc(test.want, gotRes, err); err != nil { + err := s.StreamLinearSearchByID(test.args.stream) + if err := checkFunc(test.want, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_update(t *testing.T) { +func Test_server_MultiLinearSearch(t *testing.T) { type args struct { - ctx context.Context - client vald.UpdateClient - req *payload.Update_Request - opts []grpc.CallOption + ctx context.Context + req *payload.Search_MultiRequest } type fields struct { eg errgroup.Group @@ -3963,7 +4130,7 @@ func Test_server_update(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantLoc *payload.Object_Location + wantRes *payload.Search_Responses err error } type test struct { @@ -3971,16 +4138,16 @@ func Test_server_update(t *testing.T) { args args fields fields want want - checkFunc func(want, *payload.Object_Location, error) error + checkFunc func(want, *payload.Search_Responses, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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(gotLoc, w.wantLoc) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) + if !reflect.DeepEqual(gotRes, w.wantRes) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotRes, w.wantRes) } return nil } @@ -3991,9 +4158,7 @@ func Test_server_update(t *testing.T) { name: "test_case_1", args: args { ctx:nil, - client:nil, req:nil, - opts:nil, }, fields: fields { eg:nil, @@ -4023,9 +4188,7 @@ func Test_server_update(t *testing.T) { name: "test_case_2", args: args { ctx:nil, - client:nil, req:nil, - opts:nil, }, fields: fields { eg:nil, @@ -4076,17 +4239,18 @@ func Test_server_update(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotLoc, err := s.update(test.args.ctx, test.args.client, test.args.req, test.args.opts...) - if err := checkFunc(test.want, gotLoc, err); err != nil { + gotRes, err := s.MultiLinearSearch(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_StreamUpdate(t *testing.T) { +func Test_server_MultiLinearSearchByID(t *testing.T) { type args struct { - stream vald.Update_StreamUpdateServer + ctx context.Context + req *payload.Search_MultiIDRequest } type fields struct { eg errgroup.Group @@ -4099,21 +4263,25 @@ func Test_server_StreamUpdate(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - err error + wantRes *payload.Search_Responses + err error } type test struct { name string args args fields fields want want - checkFunc func(want, error) error + checkFunc func(want, *payload.Search_Responses, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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{ @@ -4122,7 +4290,8 @@ func Test_server_StreamUpdate(t *testing.T) { { name: "test_case_1", args: args { - stream:nil, + ctx:nil, + req:nil, }, fields: fields { eg:nil, @@ -4151,7 +4320,8 @@ func Test_server_StreamUpdate(t *testing.T) { return test { name: "test_case_2", args: args { - stream:nil, + ctx:nil, + req:nil, }, fields: fields { eg:nil, @@ -4202,18 +4372,17 @@ func Test_server_StreamUpdate(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - err := s.StreamUpdate(test.args.stream) - if err := checkFunc(test.want, err); err != nil { + gotRes, err := s.MultiLinearSearchByID(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_MultiUpdate(t *testing.T) { +func Test_server_StreamInsert(t *testing.T) { type args struct { - ctx context.Context - reqs *payload.Update_MultiRequest + stream vald.Insert_StreamInsertServer } type fields struct { eg errgroup.Group @@ -4226,25 +4395,21 @@ func Test_server_MultiUpdate(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantRes *payload.Object_Locations - err error + err error } type test struct { name string args args fields fields want want - checkFunc func(want, *payload.Object_Locations, error) error + checkFunc func(want, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, err error) error { + defaultCheckFunc := func(w want, 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{ @@ -4253,8 +4418,7 @@ func Test_server_MultiUpdate(t *testing.T) { { name: "test_case_1", args: args { - ctx:nil, - reqs:nil, + stream:nil, }, fields: fields { eg:nil, @@ -4283,8 +4447,7 @@ func Test_server_MultiUpdate(t *testing.T) { return test { name: "test_case_2", args: args { - ctx:nil, - reqs:nil, + stream:nil, }, fields: fields { eg:nil, @@ -4335,20 +4498,18 @@ func Test_server_MultiUpdate(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.MultiUpdate(test.args.ctx, test.args.reqs) - if err := checkFunc(test.want, gotRes, err); err != nil { + err := s.StreamInsert(test.args.stream) + if err := checkFunc(test.want, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_upsert(t *testing.T) { +func Test_server_MultiInsert(t *testing.T) { type args struct { - ctx context.Context - client vald.UpsertClient - req *payload.Upsert_Request - opts []grpc.CallOption + ctx context.Context + reqs *payload.Insert_MultiRequest } type fields struct { eg errgroup.Group @@ -4361,7 +4522,7 @@ func Test_server_upsert(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantLoc *payload.Object_Location + wantRes *payload.Object_Locations err error } type test struct { @@ -4369,16 +4530,16 @@ func Test_server_upsert(t *testing.T) { args args fields fields want want - checkFunc func(want, *payload.Object_Location, error) error + checkFunc func(want, *payload.Object_Locations, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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(gotLoc, w.wantLoc) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotLoc, w.wantLoc) + if !reflect.DeepEqual(gotRes, w.wantRes) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotRes, w.wantRes) } return nil } @@ -4389,9 +4550,7 @@ func Test_server_upsert(t *testing.T) { name: "test_case_1", args: args { ctx:nil, - client:nil, - req:nil, - opts:nil, + reqs:nil, }, fields: fields { eg:nil, @@ -4421,9 +4580,7 @@ func Test_server_upsert(t *testing.T) { name: "test_case_2", args: args { ctx:nil, - client:nil, - req:nil, - opts:nil, + reqs:nil, }, fields: fields { eg:nil, @@ -4474,17 +4631,17 @@ func Test_server_upsert(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotLoc, err := s.upsert(test.args.ctx, test.args.client, test.args.req, test.args.opts...) - if err := checkFunc(test.want, gotLoc, err); err != nil { + gotRes, err := s.MultiInsert(test.args.ctx, test.args.reqs) + if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_StreamUpsert(t *testing.T) { +func Test_server_StreamUpdate(t *testing.T) { type args struct { - stream vald.Upsert_StreamUpsertServer + stream vald.Update_StreamUpdateServer } type fields struct { eg errgroup.Group @@ -4600,7 +4757,7 @@ func Test_server_StreamUpsert(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - err := s.StreamUpsert(test.args.stream) + err := s.StreamUpdate(test.args.stream) if err := checkFunc(test.want, err); err != nil { tt.Errorf("error = %v", err) } @@ -4608,10 +4765,10 @@ func Test_server_StreamUpsert(t *testing.T) { } } -func Test_server_MultiUpsert(t *testing.T) { +func Test_server_MultiUpdate(t *testing.T) { type args struct { ctx context.Context - reqs *payload.Upsert_MultiRequest + reqs *payload.Update_MultiRequest } type fields struct { eg errgroup.Group @@ -4733,7 +4890,7 @@ func Test_server_MultiUpsert(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.MultiUpsert(test.args.ctx, test.args.reqs) + gotRes, err := s.MultiUpdate(test.args.ctx, test.args.reqs) if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } @@ -4741,12 +4898,9 @@ func Test_server_MultiUpsert(t *testing.T) { } } -func Test_server_remove(t *testing.T) { +func Test_server_StreamUpsert(t *testing.T) { type args struct { - ctx context.Context - client vald.RemoveClient - req *payload.Remove_Request - opts []grpc.CallOption + stream vald.Upsert_StreamUpsertServer } type fields struct { eg errgroup.Group @@ -4759,25 +4913,21 @@ func Test_server_remove(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - want *payload.Object_Location - err error + err error } type test struct { name string args args fields fields want want - checkFunc func(want, *payload.Object_Location, error) error + checkFunc func(want, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, got *payload.Object_Location, err error) error { + defaultCheckFunc := func(w want, 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(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } return nil } tests := []test{ @@ -4786,10 +4936,7 @@ func Test_server_remove(t *testing.T) { { name: "test_case_1", args: args { - ctx:nil, - client:nil, - req:nil, - opts:nil, + stream:nil, }, fields: fields { eg:nil, @@ -4818,10 +4965,7 @@ func Test_server_remove(t *testing.T) { return test { name: "test_case_2", args: args { - ctx:nil, - client:nil, - req:nil, - opts:nil, + stream:nil, }, fields: fields { eg:nil, @@ -4872,17 +5016,18 @@ func Test_server_remove(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - got, err := s.remove(test.args.ctx, test.args.client, test.args.req, test.args.opts...) - if err := checkFunc(test.want, got, err); err != nil { + err := s.StreamUpsert(test.args.stream) + if err := checkFunc(test.want, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_StreamRemove(t *testing.T) { +func Test_server_MultiUpsert(t *testing.T) { type args struct { - stream vald.Remove_StreamRemoveServer + ctx context.Context + reqs *payload.Upsert_MultiRequest } type fields struct { eg errgroup.Group @@ -4895,21 +5040,25 @@ func Test_server_StreamRemove(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - err error + wantRes *payload.Object_Locations + err error } type test struct { name string args args fields fields want want - checkFunc func(want, error) error + checkFunc func(want, *payload.Object_Locations, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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{ @@ -4918,7 +5067,8 @@ func Test_server_StreamRemove(t *testing.T) { { name: "test_case_1", args: args { - stream:nil, + ctx:nil, + reqs:nil, }, fields: fields { eg:nil, @@ -4947,7 +5097,8 @@ func Test_server_StreamRemove(t *testing.T) { return test { name: "test_case_2", args: args { - stream:nil, + ctx:nil, + reqs:nil, }, fields: fields { eg:nil, @@ -4998,18 +5149,17 @@ func Test_server_StreamRemove(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - err := s.StreamRemove(test.args.stream) - if err := checkFunc(test.want, err); err != nil { + gotRes, err := s.MultiUpsert(test.args.ctx, test.args.reqs) + if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_MultiRemove(t *testing.T) { +func Test_server_StreamRemove(t *testing.T) { type args struct { - ctx context.Context - reqs *payload.Remove_MultiRequest + stream vald.Remove_StreamRemoveServer } type fields struct { eg errgroup.Group @@ -5022,25 +5172,21 @@ func Test_server_MultiRemove(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantRes *payload.Object_Locations - err error + err error } type test struct { name string args args fields fields want want - checkFunc func(want, *payload.Object_Locations, error) error + checkFunc func(want, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, err error) error { + defaultCheckFunc := func(w want, 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{ @@ -5049,8 +5195,7 @@ func Test_server_MultiRemove(t *testing.T) { { name: "test_case_1", args: args { - ctx:nil, - reqs:nil, + stream:nil, }, fields: fields { eg:nil, @@ -5079,8 +5224,7 @@ func Test_server_MultiRemove(t *testing.T) { return test { name: "test_case_2", args: args { - ctx:nil, - reqs:nil, + stream:nil, }, fields: fields { eg:nil, @@ -5131,18 +5275,18 @@ func Test_server_MultiRemove(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotRes, err := s.MultiRemove(test.args.ctx, test.args.reqs) - if err := checkFunc(test.want, gotRes, err); err != nil { + err := s.StreamRemove(test.args.stream) + if err := checkFunc(test.want, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_GetObject(t *testing.T) { +func Test_server_MultiRemove(t *testing.T) { type args struct { - ctx context.Context - req *payload.Object_VectorRequest + ctx context.Context + reqs *payload.Remove_MultiRequest } type fields struct { eg errgroup.Group @@ -5155,7 +5299,7 @@ func Test_server_GetObject(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantVec *payload.Object_Vector + wantRes *payload.Object_Locations err error } type test struct { @@ -5163,16 +5307,16 @@ func Test_server_GetObject(t *testing.T) { args args fields fields want want - checkFunc func(want, *payload.Object_Vector, error) error + checkFunc func(want, *payload.Object_Locations, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotVec *payload.Object_Vector, err error) error { + defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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(gotVec, w.wantVec) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotVec, w.wantVec) + if !reflect.DeepEqual(gotRes, w.wantRes) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotRes, w.wantRes) } return nil } @@ -5183,7 +5327,7 @@ func Test_server_GetObject(t *testing.T) { name: "test_case_1", args: args { ctx:nil, - req:nil, + reqs:nil, }, fields: fields { eg:nil, @@ -5213,7 +5357,7 @@ func Test_server_GetObject(t *testing.T) { name: "test_case_2", args: args { ctx:nil, - req:nil, + reqs:nil, }, fields: fields { eg:nil, @@ -5264,15 +5408,15 @@ func Test_server_GetObject(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotVec, err := s.GetObject(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotVec, err); err != nil { + gotRes, err := s.MultiRemove(test.args.ctx, test.args.reqs) + if err := checkFunc(test.want, gotRes, err); err != nil { tt.Errorf("error = %v", err) } }) } } -func Test_server_getObjects(t *testing.T) { +func Test_server_GetObject(t *testing.T) { type args struct { ctx context.Context req *payload.Object_VectorRequest @@ -5288,24 +5432,24 @@ func Test_server_getObjects(t *testing.T) { UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror } type want struct { - wantVecs *sync.Map[string, *payload.Object_Vector] - err error + wantVec *payload.Object_Vector + err error } type test struct { name string args args fields fields want want - checkFunc func(want, *sync.Map[string, *payload.Object_Vector], error) error + checkFunc func(want, *payload.Object_Vector, error) error beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotVecs *sync.Map[string, *payload.Object_Vector], err error) error { + defaultCheckFunc := func(w want, gotVec *payload.Object_Vector, 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(gotVecs, w.wantVecs) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotVecs, w.wantVecs) + if !reflect.DeepEqual(gotVec, w.wantVec) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotVec, w.wantVec) } return nil } @@ -5397,8 +5541,8 @@ func Test_server_getObjects(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotVecs, err := s.getObjects(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotVecs, err); err != nil { + gotVec, err := s.GetObject(test.args.ctx, test.args.req) + if err := checkFunc(test.want, gotVec, err); err != nil { tt.Errorf("error = %v", err) } }) diff --git a/pkg/gateway/mirror/handler/grpc/mock_test.go b/pkg/gateway/mirror/handler/grpc/mock_test.go index 4a5d93b336..0bfb3548c1 100644 --- a/pkg/gateway/mirror/handler/grpc/mock_test.go +++ b/pkg/gateway/mirror/handler/grpc/mock_test.go @@ -151,7 +151,7 @@ func (m *mockClient) Remove(ctx context.Context, in *payload.Remove_Request, opt } func (m *mockClient) RemoveByTimestamp(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { - return m.RemoveByTimestamp(ctx, in, opts...) + return m.RemoveByTimestampFunc(ctx, in, opts...) } func (m *mockClient) StreamRemove(ctx context.Context, opts ...grpc.CallOption) (vald.Remove_StreamRemoveClient, error) { From 9661fc39567db61c2a23509783f20ab645caa8cb Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Wed, 8 Nov 2023 16:08:41 +0900 Subject: [PATCH 37/93] Update Mirror Gateway document (#2207) * fix: update mirror document Signed-off-by: hlts2 * fix: format Signed-off-by: hlts2 * feat: add removeByTimestamp section Signed-off-by: hlts2 * fix: grammar warning Signed-off-by: hlts2 * fix: grammar warning and refactor document Signed-off-by: hlts2 * fix: grammar warning Signed-off-by: hlts2 * feat: add mirror gateway troubleshooting docs Signed-off-by: hlts2 * style: format code with Gofumpt and Prettier This commit fixes the style issues introduced in 2c492f7 according to the output from Gofumpt and Prettier. Details: https://github.com/vdaas/vald/pull/2207 * feat: add contents of troubleshooting document Signed-off-by: hlts2 * fix: grammar warning Signed-off-by: hlts2 * fix: grammar Signed-off-by: hlts2 * fix: link path Signed-off-by: hlts2 * fix: invalid link path Signed-off-by: hlts2 * fix: refactor docs Signed-off-by: hlts2 * fix: deleted unnecessary contents Signed-off-by: hlts2 * fix: status handling logic document Signed-off-by: hlts2 * fix: document refactor Signed-off-by: hlts2 * fix: bugfix status handling document Signed-off-by: hlts2 * fix: refactor sentence Signed-off-by: hlts2 --------- Signed-off-by: hlts2 Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- docs/api/mirror-gateway.md | 78 +-------------------- docs/overview/component/mirror-gateway.md | 57 ++++++++------- docs/troubleshooting/mirror-gateway.md | 75 ++++++++++++++++++++ docs/user-guides/mirroring-configuration.md | 8 +-- 4 files changed, 110 insertions(+), 108 deletions(-) create mode 100644 docs/troubleshooting/mirror-gateway.md diff --git a/docs/api/mirror-gateway.md b/docs/api/mirror-gateway.md index 69e9de3cf6..4b05dad5c2 100644 --- a/docs/api/mirror-gateway.md +++ b/docs/api/mirror-gateway.md @@ -2,13 +2,11 @@ ## Overview -Mirror Service is responsible for providing the `Register` and `Advertise` interface for the Vald Mirror Gateway. +Mirror Service is responsible for providing the `Register` interface for the Vald Mirror Gateway. ```rpc service Mirror { rpc Register(payload.v1.Mirror.Targets) returns (payload.v1.Mirror.Targets) {} - - rpc Advertise(payload.v1.Mirror.Targets) returns (payload.v1.Mirror.Targets) {} } ``` @@ -85,77 +83,3 @@ Register RPC is the method to register other Vald Mirror Gateway targets. | 3 | INVALID_ARGUMENT | | 4 | DEADLINE_EXCEEDED | | 13 | INTERNAL | - -## Advertise RPC - -Advertise RPC is the method to advertise Vald Mirror Gateway targets. - -### Input - -- the scheme of `payload.v1.Mirror.Targets`. - - ```rpc - message Mirror { - message Target { - string host = 1; - uint32 port = 2; - } - - message Targets { - repeated Target targets = 1; - } - } - ``` - - - Mirror.Targets - - | field | type | label | required | desc. | - | :-----: | :------------ | :----------------------------- | :------: | :------------------------------- | - | targets | Mirror.Target | repeated(Array[Mirror.Target]) | \* | The multiple target information. | - - - Mirror.Target - - | field | type | label | required | desc. | - | :---: | :----- | :---- | :------: | :------------------- | - | host | string | | \* | The target hostname. | - | port | uint32 | | \* | The target port. | - -### Output - -- the scheme of `payload.v1.Mirror.Targets`. - -```rpc -message Mirror { - message Target { - string host = 1; - uint32 port = 2; - } - - message Targets { - repeated Target targets = 1; - } -} -``` - -- Mirror.Targets - - | field | type | label | required | desc. | - | :-----: | :------------ | :----------------------------- | :------: | :------------------------------- | - | targets | Mirror.Target | repeated(Array[Mirror.Target]) | | The multiple target information. | - -- Mirror.Target - - | field | type | label | required | desc. | - | :---: | :----- | :---- | :------: | :------------------- | - | host | string | | \* | The target hostname. | - | port | uint32 | | \* | The target port. | - -### Status Code - -| code | desc. | -| :--: | :---------------- | -| 0 | OK | -| 1 | CANCELLED | -| 3 | INVALID_ARGUMENT | -| 4 | DEADLINE_EXCEEDED | -| 13 | INTERNAL | diff --git a/docs/overview/component/mirror-gateway.md b/docs/overview/component/mirror-gateway.md index 8f40016a03..845ec1ed0b 100644 --- a/docs/overview/component/mirror-gateway.md +++ b/docs/overview/component/mirror-gateway.md @@ -10,7 +10,7 @@ This component makes it possible to enhance availability during a cluster failur Vald Mirror Gateway is responsible for the followings: -- Forward user requests ([Insert](https://vald.vdaas.org/docs/api/insert/) / [Upsert](https://vald.vdaas.org/docs/api/upsert/) / [Update](https://vald.vdaas.org/docs/api/update/) / [Remove](https://vald.vdaas.org/docs/api/remove/)) to the other Vald Mirror Gateways in the same group. +- Forward user requests ([Insert](../../api/insert.md) / [Upsert](../../api/upsert.md) / [Update](../../api/update.md) / [Remove](../../api/remove.md)) to the other Vald Mirror Gateways in the same group. - Manages the state of indexes stored in all clusters to ensure they are consistent. ## Features @@ -33,46 +33,49 @@ The `ValdMirrorTarget` is a Custom Resource related to the connection destinatio When two Vald clusters contain Vald Mirror Gateways, Vald Mirror Gateways can send the request to each other by applying `ValdMirrorTarget`. -For more information about `ValdMirrorTarget` configuration, please refer to [Custom Resource Configuration](https://vald.vdaas.org/docs/user-guides/mirroring-configuration/). +For more information about `ValdMirrorTarget` configuration, please refer to [Custom Resource Configuration](../../user-guides/mirroring-configuration.md). ### Request forwarding -The Vald Mirror Gateway forwards the incoming user request ([Insert](https://vald.vdaas.org/docs/api/insert/) / [Upsert](https://vald.vdaas.org/docs/api/upsert/) / [Update](https://vald.vdaas.org/docs/api/update/) / [Remove](https://vald.vdaas.org/docs/api/remove/)) to other Vald Mirror Gateways. +The Vald Mirror Gateway forwards the incoming user request ([Insert](../../api/insert.md) / [Upsert](../../api/upsert.md) / [Update](../../api/update.md) / [Remove](../../api/remove.md)) to other Vald Mirror Gateways. Then, while forwarding the user request, the Vald Mirror Gateway bypasses the incoming user request to Vald LB Gateway in its own cluster. -On the other hand, if the incoming user request is an [Object API](https://vald.vdaas.org/docs/api/object/) or [Search API](https://vald.vdaas.org/docs/api/search/), it is bypassed to only a Vald LB Gateway in its own cluster without forwarding it to other Vald Mirror Gateways. +On the other hand, if the incoming user request is an [Object API](../../api/object.md) or [Search API](../../api/search.md), it is bypassed to only a Vald LB Gateway in its own cluster without forwarding it to other Vald Mirror Gateways. -### Automatic rollback on failure +### Continuous processing on failure The request may fail at the forwarding destination or the bypass destination. -If some requests fail, the vector data will not be consistent across Vald clusters. +If some of the requests fails, the processing continues based on their status code. -To keep index state consistency, the Vald Mirror Gateway will send the rollback request for the failed request. After the rollback request succeeds, the index state will be the same as before requesting. +Here's an overview of how the Mirror Gateway handles failures for each type of request. -The following is the list of rollback types. +For more information about status code, please refer to [Mirror Gateway Troubleshooting](../../troubleshooting/mirror-gateway.md). - Insert Request - - Rollback Condition/Trigger - - Status code other than `ALREADY_EXISTS` exists - - Rollback request to the successful request - - REMOVE request -- Remove Request - - Rollback Condition/Trigger - - Status code other than `NOT_FOUND` exists - - Rollback request to the successful request - - UPSERT Request with old vector + + - If the target host returns a status code of `ALREADY_EXISTS`, the Update request is sent to this host. + - If the target host returns a status code other than `OK`, `ALREADY_EXISTS`, the Mirror Gateway returns that status code without continuous processing. + - If all target hosts return a status code `ALREADY_EXISTS`, the Mirror Gateway returns `ALREADY_EXISTS`. + - If all target hosts return a status code `OK` or `ALREADY_EXISTS`, the Mirror Gateway returns `OK`. + - Update Request - - Rollback Condition/Trigger - - Status code other than `ALREADY_EXISTS` exists - - Rollback request to the successful request - - REMOVE Request if there is no old vector data - - UPDATE Request if there is old vector data + + - If the target host returns a status code `NOT_FOUND`, the Insert request is sent to this host. + - If the target host returns a status code other than `OK`, `ALREADY_EXISTS`, the Mirror Gateway returns that status code without continuous processing. + - If all target hosts return a status code `ALREADY_EXISTS`, the Mirror Gateway returns `ALREADY_EXISTS`. + - If all target hosts return a status code `OK` or `ALREADY_EXISTS`, the Mirror Gateway returns `OK`. + - Upsert Request - - Rollback Condition/Trigger - - Status code other than `ALREADY_EXISTS` exists - - Rollback request to the successful request - - REMOVE Request if there is no old vector data - - UPDATE Request if there is old vector data + + - If all target hosts return a status code `ALREADY_EXISTS`, the Mirror Gateway returns `ALREADY_EXISTS`. + - If the target host returns a status code other than `OK` or `ALREADY_EXISTS`, the Mirror Gateway returns that status code without continuous processing. + - If all target hosts return a status code `OK` or `ALREADY_EXISTS`, the Mirror Gateway returns `OK`. + +- Remove/RemoveByTimestamp Request + + - If all target hosts return a status code `NOT_FOUND`, the Mirror Gateway returns `NOT_FOUND`. + - If the target host returns a status code other than `OK` or `NOT_FOUND`, the Mirror Gateway returns that status code without continuous processing. + - If all target hosts return a status code `OK` or `NOT_FOUND`, the Mirror Gateway returns `OK`. diff --git a/docs/troubleshooting/mirror-gateway.md b/docs/troubleshooting/mirror-gateway.md new file mode 100644 index 0000000000..eab467e302 --- /dev/null +++ b/docs/troubleshooting/mirror-gateway.md @@ -0,0 +1,75 @@ +# Mirror Gateway Troubleshooting + +This page introduces the popular troubleshooting for Mirror Gateway. + +Additionally, if you encounter some errors when using API, the [API status code](../api/status.md) helps you, too. + +## Insert Operation + +Mirror Gateway sends an Update request to its host if some requests are `ALREADY_EXISTS`. + +Therefore, in addition to the [Insert API status code](../api/insert.md#status-code), the [Update API status code](../api/update.md#status-code) may also be returned to the user. + +Here are some common reasons of error. + +| name | common reason | +| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| CANCELLED | Executed cancel() of rpc from client/server-side or network problems between client and server. | +| INVALID_ARGUMENT | The Dimension of the request vector is NOT the same as Vald Agent's config, the requested vector's ID is empty, or some request payload is invalid. | +| DEADLINE_EXCEEDED | The RPC timeout setting is too short on the client/server side. | +| ALREADY_EXISTS | Request ID is already inserted. This status code is returned when all target hosts return `ALREADY_EXISTS`. | +| NOT_FOUND | Requested ID is NOT inserted. This is the status code of the Update request. | +| INTERNAL | Target Vald cluster or network route has some critical error. | + +`0 (OK)` is also returned when all target hosts return `OK` or `ALREADY_EXISTS`. + +## Update Operation + +Mirror Gateway sends an Update request to its host if some requests are `NOT_FOUND`. + +Therefore, in addition to the [Update API status code](../api/update.md#status-code), the [Insert API status code](../api/insert.md#status-code) may also be returned to the user. + +Here are some common reasons of error. + +| name | common reason | +| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| CANCELLED | Executed cancel() of rpc from client/server-side or network problems between client and server. | +| INVALID_ARGUMENT | The Dimension of the request vector is NOT the same as Vald Agent's config, the requested vector's ID is empty, or some request payload is invalid. | +| DEADLINE_EXCEEDED | The RPC timeout setting is too short on the client/server side. | +| NOT_FOUND | Requested ID is NOT inserted. This status code is returned when all target hosts return `NOT_FOUND`. | +| ALREADY_EXISTS | Request a pair of ID and vector is already inserted. This status code is returned when all hosts return `ALREADY_EXISTS`. | +| INTERNAL | Target Vald cluster or network route has some critical error. | + +`0 (OK)` is also returned when all target hosts return `OK` or `ALREADY_EXISTS`. + +## Upsert Operation + +The request process may not be completed when the response code is NOT `0 (OK)`. + +Here are some common reasons of error. + +| name | common reason | +| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| CANCELLED | Executed cancel() of rpc from client/server-side or network problems between client and server. | +| INVALID_ARGUMENT | The Dimension of the request vector is NOT the same as Vald Agent's config, the requested vector's ID is empty, or some request payload is invalid. | +| DEADLINE_EXCEEDED | The RPC timeout setting is too short on the client/server side. | +| ALREADY_EXISTS | Requested pair of ID and vector is already inserted. This status code is returned when all target hosts return `ALREADY_EXISTS`. | +| INTERNAL | Target Vald cluster or network route has some critical error. | + +`0 (OK)` is also returned when all target hosts return `OK` or `ALREADY_EXISTS`. + +## Remove Operation + +The request process may not be completed when the response code is NOT `0 (OK)`. + +Here are some common reasons of error. + +| name | common reason | +| :---------------- | :--------------------------------------------------------------------------------------------------- | +| CANCELLED | Executed cancel() of rpc from client/server-side or network problems between client and server. | +| INVALID_ARGUMENT | The Requested vector's ID is empty, or some request payload is invalid. | +| DEADLINE_EXCEEDED | The RPC timeout setting is too short on the client/server side. | +| NOT_FOUND | Requested ID is NOT inserted. This status code is returned when all target hosts return `NOT_FOUND`. | +| INTERNAL | Target Vald cluster or network route has some critical error. | + +`0 (OK)` is also returned when all target hosts return `OK` or `NOT_FOUND`. diff --git a/docs/user-guides/mirroring-configuration.md b/docs/user-guides/mirroring-configuration.md index 4b30e04b2c..6926f53985 100644 --- a/docs/user-guides/mirroring-configuration.md +++ b/docs/user-guides/mirroring-configuration.md @@ -2,7 +2,7 @@ This page describes how to enable mirroring features on the Vald cluster. -Before you use the mirroring functions, please look at [the Vald Mirror Gateway document](../../docs/overview/component/mirror-gateway.md) for what you can do. +Before you use the mirroring functions, please look at [the Vald Mirror Gateway document](../overview/component/mirror-gateway.md) for what you can do. ## Requirement @@ -41,8 +41,8 @@ gateway: ... # gRPC client configuration (overrides defaults.grpc.client) client: {} - # The interval to advertise addresses of Mirror Gateway to other Mirror Gateway. - advertise_interval: "1s" + # The duration to register other Mirror Gateways. + register_duration: "1s" # The target namespace to discover ValdMirrorTarget (CR) resource. # The default value is its own namespace. namespace: "vald" @@ -58,7 +58,7 @@ gateway: The cluster role configuration is required when you deploy Vald clusters with Vald Mirror Gateway on multiple Namespaces in the Kubernetes cluster. -Please refer to [Cluster Role Configuration](https://vald.vdaas.org/docs/user-guides/cluster-role-binding/) about cluster role settings for Mirror Gateway. +Please refer to [Cluster Role Configuration](./cluster-role-binding.md) about cluster role settings for Mirror Gateway. ### Custom Resource Configuration From 08c44fb65b33089d577f9dbf1490c76b80cca948 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 16 Nov 2023 15:03:12 +0900 Subject: [PATCH 38/93] feat: schema and protobuf update Signed-off-by: hlts2 --- apis/docs/v1/docs.md | 2 +- apis/grpc/v1/mirror/mirror.pb.go | 2 +- apis/grpc/v1/payload/payload.pb.go | 878 +++++++++++------- .../proto/v1/agent/core/agent.swagger.json | 2 +- .../v1/discoverer/discoverer.swagger.json | 2 +- .../filter/egress/egress_filter.swagger.json | 2 +- .../ingress/ingress_filter.swagger.json | 2 +- .../manager/index/index_manager.swagger.json | 2 +- .../apis/proto/v1/mirror/mirror.swagger.json | 2 +- .../proto/v1/payload/payload.swagger.json | 2 +- .../apis/proto/v1/vald/filter.swagger.json | 2 +- .../apis/proto/v1/vald/insert.swagger.json | 2 +- .../apis/proto/v1/vald/object.swagger.json | 2 +- .../apis/proto/v1/vald/remove.swagger.json | 2 +- .../apis/proto/v1/vald/search.swagger.json | 2 +- .../apis/proto/v1/vald/update.swagger.json | 2 +- .../apis/proto/v1/vald/upsert.swagger.json | 2 +- .../vald-helm-operator/crds/valdrelease.yaml | 4 +- charts/vald/values.schema.json | 8 +- internal/config/mirror.go | 2 +- 20 files changed, 559 insertions(+), 365 deletions(-) diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index 165c28eb5f..60d29a9bd4 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -1440,7 +1440,7 @@ reached. Copyright (C) 2019-2023 vdaas.org vald team <vald@vdaas.org> Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. +You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index 05a460667c..5488814a40 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc v4.24.4 // source: apis/proto/v1/mirror/mirror.proto package mirror diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index 0f595076ff..76ed3c032f 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -545,6 +545,45 @@ func (*Info) Descriptor() ([]byte, []int) { return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{9} } +// Mirror related messages. +type Mirror struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Mirror) Reset() { + *x = Mirror{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror) ProtoMessage() {} + +func (x *Mirror) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + 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 Mirror.ProtoReflect.Descriptor instead. +func (*Mirror) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10} +} + // Represent an empty message. type Empty struct { state protoimpl.MessageState @@ -555,7 +594,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -568,7 +607,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -581,7 +620,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10} + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{11} } // Represent a search request. @@ -599,7 +638,7 @@ type Search_Request struct { func (x *Search_Request) Reset() { *x = Search_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -612,7 +651,7 @@ func (x *Search_Request) String() string { func (*Search_Request) ProtoMessage() {} func (x *Search_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -655,7 +694,7 @@ type Search_MultiRequest struct { func (x *Search_MultiRequest) Reset() { *x = Search_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -668,7 +707,7 @@ func (x *Search_MultiRequest) String() string { func (*Search_MultiRequest) ProtoMessage() {} func (x *Search_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -706,7 +745,7 @@ type Search_IDRequest struct { func (x *Search_IDRequest) Reset() { *x = Search_IDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -719,7 +758,7 @@ func (x *Search_IDRequest) String() string { func (*Search_IDRequest) ProtoMessage() {} func (x *Search_IDRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -762,7 +801,7 @@ type Search_MultiIDRequest struct { func (x *Search_MultiIDRequest) Reset() { *x = Search_MultiIDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -775,7 +814,7 @@ func (x *Search_MultiIDRequest) String() string { func (*Search_MultiIDRequest) ProtoMessage() {} func (x *Search_MultiIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -815,7 +854,7 @@ type Search_ObjectRequest struct { func (x *Search_ObjectRequest) Reset() { *x = Search_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -828,7 +867,7 @@ func (x *Search_ObjectRequest) String() string { func (*Search_ObjectRequest) ProtoMessage() {} func (x *Search_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -878,7 +917,7 @@ type Search_MultiObjectRequest struct { func (x *Search_MultiObjectRequest) Reset() { *x = Search_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -891,7 +930,7 @@ func (x *Search_MultiObjectRequest) String() string { func (*Search_MultiObjectRequest) ProtoMessage() {} func (x *Search_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -943,7 +982,7 @@ type Search_Config struct { func (x *Search_Config) Reset() { *x = Search_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -956,7 +995,7 @@ func (x *Search_Config) String() string { func (*Search_Config) ProtoMessage() {} func (x *Search_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1050,7 +1089,7 @@ type Search_Response struct { func (x *Search_Response) Reset() { *x = Search_Response{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1063,7 +1102,7 @@ func (x *Search_Response) String() string { func (*Search_Response) ProtoMessage() {} func (x *Search_Response) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1106,7 +1145,7 @@ type Search_Responses struct { func (x *Search_Responses) Reset() { *x = Search_Responses{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1119,7 +1158,7 @@ func (x *Search_Responses) String() string { func (*Search_Responses) ProtoMessage() {} func (x *Search_Responses) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1158,7 +1197,7 @@ type Search_StreamResponse struct { func (x *Search_StreamResponse) Reset() { *x = Search_StreamResponse{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1171,7 +1210,7 @@ func (x *Search_StreamResponse) String() string { func (*Search_StreamResponse) ProtoMessage() {} func (x *Search_StreamResponse) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1241,7 +1280,7 @@ type Filter_Target struct { func (x *Filter_Target) Reset() { *x = Filter_Target{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1254,7 +1293,7 @@ func (x *Filter_Target) String() string { func (*Filter_Target) ProtoMessage() {} func (x *Filter_Target) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1297,7 +1336,7 @@ type Filter_Config struct { func (x *Filter_Config) Reset() { *x = Filter_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1310,7 +1349,7 @@ func (x *Filter_Config) String() string { func (*Filter_Config) ProtoMessage() {} func (x *Filter_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1348,7 +1387,7 @@ type Insert_Request struct { func (x *Insert_Request) Reset() { *x = Insert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1361,7 +1400,7 @@ func (x *Insert_Request) String() string { func (*Insert_Request) ProtoMessage() {} func (x *Insert_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1404,7 +1443,7 @@ type Insert_MultiRequest struct { func (x *Insert_MultiRequest) Reset() { *x = Insert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1417,7 +1456,7 @@ func (x *Insert_MultiRequest) String() string { func (*Insert_MultiRequest) ProtoMessage() {} func (x *Insert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1457,7 +1496,7 @@ type Insert_ObjectRequest struct { func (x *Insert_ObjectRequest) Reset() { *x = Insert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1470,7 +1509,7 @@ func (x *Insert_ObjectRequest) String() string { func (*Insert_ObjectRequest) ProtoMessage() {} func (x *Insert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1520,7 +1559,7 @@ type Insert_MultiObjectRequest struct { func (x *Insert_MultiObjectRequest) Reset() { *x = Insert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1533,7 +1572,7 @@ func (x *Insert_MultiObjectRequest) String() string { func (*Insert_MultiObjectRequest) ProtoMessage() {} func (x *Insert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1573,7 +1612,7 @@ type Insert_Config struct { func (x *Insert_Config) Reset() { *x = Insert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1586,7 +1625,7 @@ func (x *Insert_Config) String() string { func (*Insert_Config) ProtoMessage() {} func (x *Insert_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1638,7 +1677,7 @@ type Update_Request struct { func (x *Update_Request) Reset() { *x = Update_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1651,7 +1690,7 @@ func (x *Update_Request) String() string { func (*Update_Request) ProtoMessage() {} func (x *Update_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1694,7 +1733,7 @@ type Update_MultiRequest struct { func (x *Update_MultiRequest) Reset() { *x = Update_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1707,7 +1746,7 @@ func (x *Update_MultiRequest) String() string { func (*Update_MultiRequest) ProtoMessage() {} func (x *Update_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1747,7 +1786,7 @@ type Update_ObjectRequest struct { func (x *Update_ObjectRequest) Reset() { *x = Update_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1760,7 +1799,7 @@ func (x *Update_ObjectRequest) String() string { func (*Update_ObjectRequest) ProtoMessage() {} func (x *Update_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1810,7 +1849,7 @@ type Update_MultiObjectRequest struct { func (x *Update_MultiObjectRequest) Reset() { *x = Update_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1823,7 +1862,7 @@ func (x *Update_MultiObjectRequest) String() string { func (*Update_MultiObjectRequest) ProtoMessage() {} func (x *Update_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1866,7 +1905,7 @@ type Update_Config struct { func (x *Update_Config) Reset() { *x = Update_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1879,7 +1918,7 @@ func (x *Update_Config) String() string { func (*Update_Config) ProtoMessage() {} func (x *Update_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1938,7 +1977,7 @@ type Upsert_Request struct { func (x *Upsert_Request) Reset() { *x = Upsert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1951,7 +1990,7 @@ func (x *Upsert_Request) String() string { func (*Upsert_Request) ProtoMessage() {} func (x *Upsert_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1994,7 +2033,7 @@ type Upsert_MultiRequest struct { func (x *Upsert_MultiRequest) Reset() { *x = Upsert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2007,7 +2046,7 @@ func (x *Upsert_MultiRequest) String() string { func (*Upsert_MultiRequest) ProtoMessage() {} func (x *Upsert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2047,7 +2086,7 @@ type Upsert_ObjectRequest struct { func (x *Upsert_ObjectRequest) Reset() { *x = Upsert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2060,7 +2099,7 @@ func (x *Upsert_ObjectRequest) String() string { func (*Upsert_ObjectRequest) ProtoMessage() {} func (x *Upsert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2110,7 +2149,7 @@ type Upsert_MultiObjectRequest struct { func (x *Upsert_MultiObjectRequest) Reset() { *x = Upsert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2123,7 +2162,7 @@ func (x *Upsert_MultiObjectRequest) String() string { func (*Upsert_MultiObjectRequest) ProtoMessage() {} func (x *Upsert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2166,7 +2205,7 @@ type Upsert_Config struct { func (x *Upsert_Config) Reset() { *x = Upsert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2179,7 +2218,7 @@ func (x *Upsert_Config) String() string { func (*Upsert_Config) ProtoMessage() {} func (x *Upsert_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2238,7 +2277,7 @@ type Remove_Request struct { func (x *Remove_Request) Reset() { *x = Remove_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2251,7 +2290,7 @@ func (x *Remove_Request) String() string { func (*Remove_Request) ProtoMessage() {} func (x *Remove_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2294,7 +2333,7 @@ type Remove_MultiRequest struct { func (x *Remove_MultiRequest) Reset() { *x = Remove_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2307,7 +2346,7 @@ func (x *Remove_MultiRequest) String() string { func (*Remove_MultiRequest) ProtoMessage() {} func (x *Remove_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2343,7 +2382,7 @@ type Remove_TimestampRequest struct { func (x *Remove_TimestampRequest) Reset() { *x = Remove_TimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2356,7 +2395,7 @@ func (x *Remove_TimestampRequest) String() string { func (*Remove_TimestampRequest) ProtoMessage() {} func (x *Remove_TimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2393,7 +2432,7 @@ type Remove_Timestamp struct { func (x *Remove_Timestamp) Reset() { *x = Remove_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2406,7 +2445,7 @@ func (x *Remove_Timestamp) String() string { func (*Remove_Timestamp) ProtoMessage() {} func (x *Remove_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2451,7 +2490,7 @@ type Remove_Config struct { func (x *Remove_Config) Reset() { *x = Remove_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2464,7 +2503,7 @@ func (x *Remove_Config) String() string { func (*Remove_Config) ProtoMessage() {} func (x *Remove_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2509,7 +2548,7 @@ type Object_VectorRequest struct { func (x *Object_VectorRequest) Reset() { *x = Object_VectorRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2522,7 +2561,7 @@ func (x *Object_VectorRequest) String() string { func (*Object_VectorRequest) ProtoMessage() {} func (x *Object_VectorRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2567,7 +2606,7 @@ type Object_Distance struct { func (x *Object_Distance) Reset() { *x = Object_Distance{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2580,7 +2619,7 @@ func (x *Object_Distance) String() string { func (*Object_Distance) ProtoMessage() {} func (x *Object_Distance) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2626,7 +2665,7 @@ type Object_StreamDistance struct { func (x *Object_StreamDistance) Reset() { *x = Object_StreamDistance{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2639,7 +2678,7 @@ func (x *Object_StreamDistance) String() string { func (*Object_StreamDistance) ProtoMessage() {} func (x *Object_StreamDistance) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2706,7 +2745,7 @@ type Object_ID struct { func (x *Object_ID) Reset() { *x = Object_ID{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2719,7 +2758,7 @@ func (x *Object_ID) String() string { func (*Object_ID) ProtoMessage() {} func (x *Object_ID) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2754,7 +2793,7 @@ type Object_IDs struct { func (x *Object_IDs) Reset() { *x = Object_IDs{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2767,7 +2806,7 @@ func (x *Object_IDs) String() string { func (*Object_IDs) ProtoMessage() {} func (x *Object_IDs) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2807,7 +2846,7 @@ type Object_Vector struct { func (x *Object_Vector) Reset() { *x = Object_Vector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2820,7 +2859,7 @@ func (x *Object_Vector) String() string { func (*Object_Vector) ProtoMessage() {} func (x *Object_Vector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2869,7 +2908,7 @@ type Object_Vectors struct { func (x *Object_Vectors) Reset() { *x = Object_Vectors{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2882,7 +2921,7 @@ func (x *Object_Vectors) String() string { func (*Object_Vectors) ProtoMessage() {} func (x *Object_Vectors) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2921,7 +2960,7 @@ type Object_StreamVector struct { func (x *Object_StreamVector) Reset() { *x = Object_StreamVector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2934,7 +2973,7 @@ func (x *Object_StreamVector) String() string { func (*Object_StreamVector) ProtoMessage() {} func (x *Object_StreamVector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3004,7 +3043,7 @@ type Object_ReshapeVector struct { func (x *Object_ReshapeVector) Reset() { *x = Object_ReshapeVector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3017,7 +3056,7 @@ func (x *Object_ReshapeVector) String() string { func (*Object_ReshapeVector) ProtoMessage() {} func (x *Object_ReshapeVector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3062,7 +3101,7 @@ type Object_Blob struct { func (x *Object_Blob) Reset() { *x = Object_Blob{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3075,7 +3114,7 @@ func (x *Object_Blob) String() string { func (*Object_Blob) ProtoMessage() {} func (x *Object_Blob) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3121,7 +3160,7 @@ type Object_StreamBlob struct { func (x *Object_StreamBlob) Reset() { *x = Object_StreamBlob{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3134,7 +3173,7 @@ func (x *Object_StreamBlob) String() string { func (*Object_StreamBlob) ProtoMessage() {} func (x *Object_StreamBlob) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3206,7 +3245,7 @@ type Object_Location struct { func (x *Object_Location) Reset() { *x = Object_Location{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3219,7 +3258,7 @@ func (x *Object_Location) String() string { func (*Object_Location) ProtoMessage() {} func (x *Object_Location) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3272,7 +3311,7 @@ type Object_StreamLocation struct { func (x *Object_StreamLocation) Reset() { *x = Object_StreamLocation{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3285,7 +3324,7 @@ func (x *Object_StreamLocation) String() string { func (*Object_StreamLocation) ProtoMessage() {} func (x *Object_StreamLocation) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3352,7 +3391,7 @@ type Object_Locations struct { func (x *Object_Locations) Reset() { *x = Object_Locations{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3365,7 +3404,7 @@ func (x *Object_Locations) String() string { func (*Object_Locations) ProtoMessage() {} func (x *Object_Locations) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3398,7 +3437,7 @@ type Object_List struct { func (x *Object_List) Reset() { *x = Object_List{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3411,7 +3450,7 @@ func (x *Object_List) String() string { func (*Object_List) ProtoMessage() {} func (x *Object_List) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3436,7 +3475,7 @@ type Object_List_Request struct { func (x *Object_List_Request) Reset() { *x = Object_List_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3449,7 +3488,7 @@ func (x *Object_List_Request) String() string { func (*Object_List_Request) ProtoMessage() {} func (x *Object_List_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3480,7 +3519,7 @@ type Object_List_Response struct { func (x *Object_List_Response) Reset() { *x = Object_List_Response{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3493,7 +3532,7 @@ func (x *Object_List_Response) String() string { func (*Object_List_Response) ProtoMessage() {} func (x *Object_List_Response) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3561,7 +3600,7 @@ type Control_CreateIndexRequest struct { func (x *Control_CreateIndexRequest) Reset() { *x = Control_CreateIndexRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3574,7 +3613,7 @@ func (x *Control_CreateIndexRequest) String() string { func (*Control_CreateIndexRequest) ProtoMessage() {} func (x *Control_CreateIndexRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3614,7 +3653,7 @@ type Discoverer_Request struct { func (x *Discoverer_Request) Reset() { *x = Discoverer_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3627,7 +3666,7 @@ func (x *Discoverer_Request) String() string { func (*Discoverer_Request) ProtoMessage() {} func (x *Discoverer_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3674,7 +3713,7 @@ type Info_Index struct { func (x *Info_Index) Reset() { *x = Info_Index{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3687,7 +3726,7 @@ func (x *Info_Index) String() string { func (*Info_Index) ProtoMessage() {} func (x *Info_Index) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3728,7 +3767,7 @@ type Info_Pod struct { func (x *Info_Pod) Reset() { *x = Info_Pod{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3741,7 +3780,7 @@ func (x *Info_Pod) String() string { func (*Info_Pod) ProtoMessage() {} func (x *Info_Pod) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3829,7 +3868,7 @@ type Info_Node struct { func (x *Info_Node) Reset() { *x = Info_Node{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3842,7 +3881,7 @@ func (x *Info_Node) String() string { func (*Info_Node) ProtoMessage() {} func (x *Info_Node) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3917,7 +3956,7 @@ type Info_CPU struct { func (x *Info_CPU) Reset() { *x = Info_CPU{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3930,7 +3969,7 @@ func (x *Info_CPU) String() string { func (*Info_CPU) ProtoMessage() {} func (x *Info_CPU) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3984,7 +4023,7 @@ type Info_Memory struct { func (x *Info_Memory) Reset() { *x = Info_Memory{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3997,7 +4036,7 @@ func (x *Info_Memory) String() string { func (*Info_Memory) ProtoMessage() {} func (x *Info_Memory) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4047,7 +4086,7 @@ type Info_Pods struct { func (x *Info_Pods) Reset() { *x = Info_Pods{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4060,7 +4099,7 @@ func (x *Info_Pods) String() string { func (*Info_Pods) ProtoMessage() {} func (x *Info_Pods) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4096,7 +4135,7 @@ type Info_Nodes struct { func (x *Info_Nodes) Reset() { *x = Info_Nodes{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4109,7 +4148,7 @@ func (x *Info_Nodes) String() string { func (*Info_Nodes) ProtoMessage() {} func (x *Info_Nodes) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4144,7 +4183,7 @@ type Info_IPs struct { func (x *Info_IPs) Reset() { *x = Info_IPs{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4157,7 +4196,7 @@ func (x *Info_IPs) String() string { func (*Info_IPs) ProtoMessage() {} func (x *Info_IPs) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4199,7 +4238,7 @@ type Info_Index_Count struct { func (x *Info_Index_Count) Reset() { *x = Info_Index_Count{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4212,7 +4251,7 @@ func (x *Info_Index_Count) String() string { func (*Info_Index_Count) ProtoMessage() {} func (x *Info_Index_Count) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] + 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 { @@ -4266,7 +4305,7 @@ type Info_Index_UUID struct { func (x *Info_Index_UUID) Reset() { *x = Info_Index_UUID{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4279,7 +4318,7 @@ func (x *Info_Index_UUID) String() string { func (*Info_Index_UUID) ProtoMessage() {} func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4307,7 +4346,7 @@ type Info_Index_UUID_Committed struct { func (x *Info_Index_UUID_Committed) Reset() { *x = Info_Index_UUID_Committed{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4320,7 +4359,7 @@ func (x *Info_Index_UUID_Committed) String() string { func (*Info_Index_UUID_Committed) ProtoMessage() {} func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4355,7 +4394,7 @@ type Info_Index_UUID_Uncommitted struct { func (x *Info_Index_UUID_Uncommitted) Reset() { *x = Info_Index_UUID_Uncommitted{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4368,7 +4407,7 @@ func (x *Info_Index_UUID_Uncommitted) String() string { func (*Info_Index_UUID_Uncommitted) ProtoMessage() {} func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4391,6 +4430,113 @@ func (x *Info_Index_UUID_Uncommitted) GetUuid() string { return "" } +// Represent server information. +type Mirror_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The target hostname. + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + // The target port. + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *Mirror_Target) Reset() { + *x = Mirror_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Target) ProtoMessage() {} + +func (x *Mirror_Target) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] + 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 Mirror_Target.ProtoReflect.Descriptor instead. +func (*Mirror_Target) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *Mirror_Target) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Mirror_Target) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +// Represent the multiple Target message. +type Mirror_Targets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The multiple target information. + Targets []*Mirror_Target `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *Mirror_Targets) Reset() { + *x = Mirror_Targets{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[76] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Targets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Targets) ProtoMessage() {} + +func (x *Mirror_Targets) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[76] + 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 Mirror_Targets.ProtoReflect.Descriptor instead. +func (*Mirror_Targets) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10, 1} +} + +func (x *Mirror_Targets) GetTargets() []*Mirror_Target { + if x != nil { + return x.Targets + } + return nil +} + var File_apis_proto_v1_payload_payload_proto protoreflect.FileDescriptor var file_apis_proto_v1_payload_payload_proto_rawDesc = []byte{ @@ -4817,14 +4963,22 @@ var file_apis_proto_v1_payload_payload_proto_rawDesc = []byte{ 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, + 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x7a, 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, + 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, + 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, + 0x6f, 0x72, 0x74, 0x1a, 0x3e, 0x0a, 0x07, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x33, + 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, + 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 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, } var ( @@ -4840,7 +4994,7 @@ func file_apis_proto_v1_payload_payload_proto_rawDescGZIP() []byte { } 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, 74) +var file_apis_proto_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 77) var file_apis_proto_v1_payload_payload_proto_goTypes = []interface{}{ (Search_AggregationAlgorithm)(0), // 0: payload.v1.Search.AggregationAlgorithm (Remove_Timestamp_Operator)(0), // 1: payload.v1.Remove.Timestamp.Operator @@ -4854,144 +5008,148 @@ var file_apis_proto_v1_payload_payload_proto_goTypes = []interface{}{ (*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_UUID)(nil), // 73: payload.v1.Info.Index.UUID - (*Info_Index_UUID_Committed)(nil), // 74: payload.v1.Info.Index.UUID.Committed - (*Info_Index_UUID_Uncommitted)(nil), // 75: payload.v1.Info.Index.UUID.Uncommitted - (*status.Status)(nil), // 76: google.rpc.Status + (*Mirror)(nil), // 12: payload.v1.Mirror + (*Empty)(nil), // 13: payload.v1.Empty + (*Search_Request)(nil), // 14: payload.v1.Search.Request + (*Search_MultiRequest)(nil), // 15: payload.v1.Search.MultiRequest + (*Search_IDRequest)(nil), // 16: payload.v1.Search.IDRequest + (*Search_MultiIDRequest)(nil), // 17: payload.v1.Search.MultiIDRequest + (*Search_ObjectRequest)(nil), // 18: payload.v1.Search.ObjectRequest + (*Search_MultiObjectRequest)(nil), // 19: payload.v1.Search.MultiObjectRequest + (*Search_Config)(nil), // 20: payload.v1.Search.Config + (*Search_Response)(nil), // 21: payload.v1.Search.Response + (*Search_Responses)(nil), // 22: payload.v1.Search.Responses + (*Search_StreamResponse)(nil), // 23: payload.v1.Search.StreamResponse + (*Filter_Target)(nil), // 24: payload.v1.Filter.Target + (*Filter_Config)(nil), // 25: payload.v1.Filter.Config + (*Insert_Request)(nil), // 26: payload.v1.Insert.Request + (*Insert_MultiRequest)(nil), // 27: payload.v1.Insert.MultiRequest + (*Insert_ObjectRequest)(nil), // 28: payload.v1.Insert.ObjectRequest + (*Insert_MultiObjectRequest)(nil), // 29: payload.v1.Insert.MultiObjectRequest + (*Insert_Config)(nil), // 30: payload.v1.Insert.Config + (*Update_Request)(nil), // 31: payload.v1.Update.Request + (*Update_MultiRequest)(nil), // 32: payload.v1.Update.MultiRequest + (*Update_ObjectRequest)(nil), // 33: payload.v1.Update.ObjectRequest + (*Update_MultiObjectRequest)(nil), // 34: payload.v1.Update.MultiObjectRequest + (*Update_Config)(nil), // 35: payload.v1.Update.Config + (*Upsert_Request)(nil), // 36: payload.v1.Upsert.Request + (*Upsert_MultiRequest)(nil), // 37: payload.v1.Upsert.MultiRequest + (*Upsert_ObjectRequest)(nil), // 38: payload.v1.Upsert.ObjectRequest + (*Upsert_MultiObjectRequest)(nil), // 39: payload.v1.Upsert.MultiObjectRequest + (*Upsert_Config)(nil), // 40: payload.v1.Upsert.Config + (*Remove_Request)(nil), // 41: payload.v1.Remove.Request + (*Remove_MultiRequest)(nil), // 42: payload.v1.Remove.MultiRequest + (*Remove_TimestampRequest)(nil), // 43: payload.v1.Remove.TimestampRequest + (*Remove_Timestamp)(nil), // 44: payload.v1.Remove.Timestamp + (*Remove_Config)(nil), // 45: payload.v1.Remove.Config + (*Object_VectorRequest)(nil), // 46: payload.v1.Object.VectorRequest + (*Object_Distance)(nil), // 47: payload.v1.Object.Distance + (*Object_StreamDistance)(nil), // 48: payload.v1.Object.StreamDistance + (*Object_ID)(nil), // 49: payload.v1.Object.ID + (*Object_IDs)(nil), // 50: payload.v1.Object.IDs + (*Object_Vector)(nil), // 51: payload.v1.Object.Vector + (*Object_Vectors)(nil), // 52: payload.v1.Object.Vectors + (*Object_StreamVector)(nil), // 53: payload.v1.Object.StreamVector + (*Object_ReshapeVector)(nil), // 54: payload.v1.Object.ReshapeVector + (*Object_Blob)(nil), // 55: payload.v1.Object.Blob + (*Object_StreamBlob)(nil), // 56: payload.v1.Object.StreamBlob + (*Object_Location)(nil), // 57: payload.v1.Object.Location + (*Object_StreamLocation)(nil), // 58: payload.v1.Object.StreamLocation + (*Object_Locations)(nil), // 59: payload.v1.Object.Locations + (*Object_List)(nil), // 60: payload.v1.Object.List + (*Object_List_Request)(nil), // 61: payload.v1.Object.List.Request + (*Object_List_Response)(nil), // 62: payload.v1.Object.List.Response + (*Control_CreateIndexRequest)(nil), // 63: payload.v1.Control.CreateIndexRequest + (*Discoverer_Request)(nil), // 64: payload.v1.Discoverer.Request + (*Info_Index)(nil), // 65: payload.v1.Info.Index + (*Info_Pod)(nil), // 66: payload.v1.Info.Pod + (*Info_Node)(nil), // 67: payload.v1.Info.Node + (*Info_CPU)(nil), // 68: payload.v1.Info.CPU + (*Info_Memory)(nil), // 69: payload.v1.Info.Memory + (*Info_Pods)(nil), // 70: payload.v1.Info.Pods + (*Info_Nodes)(nil), // 71: payload.v1.Info.Nodes + (*Info_IPs)(nil), // 72: payload.v1.Info.IPs + (*Info_Index_Count)(nil), // 73: payload.v1.Info.Index.Count + (*Info_Index_UUID)(nil), // 74: payload.v1.Info.Index.UUID + (*Info_Index_UUID_Committed)(nil), // 75: payload.v1.Info.Index.UUID.Committed + (*Info_Index_UUID_Uncommitted)(nil), // 76: payload.v1.Info.Index.UUID.Uncommitted + (*Mirror_Target)(nil), // 77: payload.v1.Mirror.Target + (*Mirror_Targets)(nil), // 78: payload.v1.Mirror.Targets + (*status.Status)(nil), // 79: google.rpc.Status } var file_apis_proto_v1_payload_payload_proto_depIdxs = []int32{ - 19, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config - 13, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request - 19, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config - 15, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest - 19, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config - 23, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target - 17, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest - 24, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config - 24, // 8: payload.v1.Search.Config.egress_filters:type_name -> payload.v1.Filter.Config + 20, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config + 14, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request + 20, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config + 16, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest + 20, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config + 24, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 18, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest + 25, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config + 25, // 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 - 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 - 76, // 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 + 47, // 10: payload.v1.Search.Response.results:type_name -> payload.v1.Object.Distance + 21, // 11: payload.v1.Search.Responses.responses:type_name -> payload.v1.Search.Response + 21, // 12: payload.v1.Search.StreamResponse.response:type_name -> payload.v1.Search.Response + 79, // 13: payload.v1.Search.StreamResponse.status:type_name -> google.rpc.Status + 24, // 14: payload.v1.Filter.Config.targets:type_name -> payload.v1.Filter.Target + 51, // 15: payload.v1.Insert.Request.vector:type_name -> payload.v1.Object.Vector + 30, // 16: payload.v1.Insert.Request.config:type_name -> payload.v1.Insert.Config + 26, // 17: payload.v1.Insert.MultiRequest.requests:type_name -> payload.v1.Insert.Request + 55, // 18: payload.v1.Insert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 30, // 19: payload.v1.Insert.ObjectRequest.config:type_name -> payload.v1.Insert.Config + 24, // 20: payload.v1.Insert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 28, // 21: payload.v1.Insert.MultiObjectRequest.requests:type_name -> payload.v1.Insert.ObjectRequest + 25, // 22: payload.v1.Insert.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 23: payload.v1.Update.Request.vector:type_name -> payload.v1.Object.Vector + 35, // 24: payload.v1.Update.Request.config:type_name -> payload.v1.Update.Config + 31, // 25: payload.v1.Update.MultiRequest.requests:type_name -> payload.v1.Update.Request + 55, // 26: payload.v1.Update.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 35, // 27: payload.v1.Update.ObjectRequest.config:type_name -> payload.v1.Update.Config + 24, // 28: payload.v1.Update.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 33, // 29: payload.v1.Update.MultiObjectRequest.requests:type_name -> payload.v1.Update.ObjectRequest + 25, // 30: payload.v1.Update.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 31: payload.v1.Upsert.Request.vector:type_name -> payload.v1.Object.Vector + 40, // 32: payload.v1.Upsert.Request.config:type_name -> payload.v1.Upsert.Config + 36, // 33: payload.v1.Upsert.MultiRequest.requests:type_name -> payload.v1.Upsert.Request + 55, // 34: payload.v1.Upsert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 40, // 35: payload.v1.Upsert.ObjectRequest.config:type_name -> payload.v1.Upsert.Config + 24, // 36: payload.v1.Upsert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 38, // 37: payload.v1.Upsert.MultiObjectRequest.requests:type_name -> payload.v1.Upsert.ObjectRequest + 25, // 38: payload.v1.Upsert.Config.filters:type_name -> payload.v1.Filter.Config + 49, // 39: payload.v1.Remove.Request.id:type_name -> payload.v1.Object.ID + 45, // 40: payload.v1.Remove.Request.config:type_name -> payload.v1.Remove.Config + 41, // 41: payload.v1.Remove.MultiRequest.requests:type_name -> payload.v1.Remove.Request + 44, // 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 - 76, // 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 - 76, // 50: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status - 54, // 51: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob - 76, // 52: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status - 56, // 53: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location - 76, // 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 - 76, // 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 - 66, // [66:66] is the sub-list for method output_type - 66, // [66:66] is the sub-list for method input_type - 66, // [66:66] is the sub-list for extension type_name - 66, // [66:66] is the sub-list for extension extendee - 0, // [0:66] is the sub-list for field type_name + 49, // 44: payload.v1.Object.VectorRequest.id:type_name -> payload.v1.Object.ID + 25, // 45: payload.v1.Object.VectorRequest.filters:type_name -> payload.v1.Filter.Config + 47, // 46: payload.v1.Object.StreamDistance.distance:type_name -> payload.v1.Object.Distance + 79, // 47: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status + 51, // 48: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector + 51, // 49: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector + 79, // 50: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status + 55, // 51: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob + 79, // 52: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status + 57, // 53: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location + 79, // 54: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status + 57, // 55: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location + 51, // 56: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector + 79, // 57: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status + 68, // 58: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU + 69, // 59: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory + 67, // 60: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node + 68, // 61: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU + 69, // 62: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory + 70, // 63: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods + 66, // 64: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod + 67, // 65: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node + 77, // 66: payload.v1.Mirror.Targets.targets:type_name -> payload.v1.Mirror.Target + 67, // [67:67] is the sub-list for method output_type + 67, // [67:67] is the sub-list for method input_type + 67, // [67:67] is the sub-list for extension type_name + 67, // [67:67] is the sub-list for extension extendee + 0, // [0:67] is the sub-list for field type_name } func init() { file_apis_proto_v1_payload_payload_proto_init() } @@ -5121,7 +5279,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { + switch v := v.(*Mirror); i { case 0: return &v.state case 1: @@ -5133,7 +5291,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Request); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -5145,7 +5303,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiRequest); i { + switch v := v.(*Search_Request); i { case 0: return &v.state case 1: @@ -5157,7 +5315,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_IDRequest); i { + switch v := v.(*Search_MultiRequest); i { case 0: return &v.state case 1: @@ -5169,7 +5327,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiIDRequest); i { + switch v := v.(*Search_IDRequest); i { case 0: return &v.state case 1: @@ -5181,7 +5339,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_ObjectRequest); i { + switch v := v.(*Search_MultiIDRequest); i { case 0: return &v.state case 1: @@ -5193,7 +5351,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiObjectRequest); i { + switch v := v.(*Search_ObjectRequest); i { case 0: return &v.state case 1: @@ -5205,7 +5363,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Config); i { + switch v := v.(*Search_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5217,7 +5375,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Response); i { + switch v := v.(*Search_Config); i { case 0: return &v.state case 1: @@ -5229,7 +5387,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Responses); i { + switch v := v.(*Search_Response); i { case 0: return &v.state case 1: @@ -5241,7 +5399,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_StreamResponse); i { + switch v := v.(*Search_Responses); i { case 0: return &v.state case 1: @@ -5253,7 +5411,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Target); i { + switch v := v.(*Search_StreamResponse); i { case 0: return &v.state case 1: @@ -5265,7 +5423,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Config); i { + switch v := v.(*Filter_Target); i { case 0: return &v.state case 1: @@ -5277,7 +5435,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Request); i { + switch v := v.(*Filter_Config); i { case 0: return &v.state case 1: @@ -5289,7 +5447,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiRequest); i { + switch v := v.(*Insert_Request); i { case 0: return &v.state case 1: @@ -5301,7 +5459,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_ObjectRequest); i { + switch v := v.(*Insert_MultiRequest); i { case 0: return &v.state case 1: @@ -5313,7 +5471,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiObjectRequest); i { + switch v := v.(*Insert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5325,7 +5483,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Config); i { + switch v := v.(*Insert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5337,7 +5495,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Request); i { + switch v := v.(*Insert_Config); i { case 0: return &v.state case 1: @@ -5349,7 +5507,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiRequest); i { + switch v := v.(*Update_Request); i { case 0: return &v.state case 1: @@ -5361,7 +5519,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_ObjectRequest); i { + switch v := v.(*Update_MultiRequest); i { case 0: return &v.state case 1: @@ -5373,7 +5531,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiObjectRequest); i { + switch v := v.(*Update_ObjectRequest); i { case 0: return &v.state case 1: @@ -5385,7 +5543,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Config); i { + switch v := v.(*Update_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5397,7 +5555,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Request); i { + switch v := v.(*Update_Config); i { case 0: return &v.state case 1: @@ -5409,7 +5567,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiRequest); i { + switch v := v.(*Upsert_Request); i { case 0: return &v.state case 1: @@ -5421,7 +5579,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_ObjectRequest); i { + switch v := v.(*Upsert_MultiRequest); i { case 0: return &v.state case 1: @@ -5433,7 +5591,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiObjectRequest); i { + switch v := v.(*Upsert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5445,7 +5603,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Config); i { + switch v := v.(*Upsert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5457,7 +5615,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Request); i { + switch v := v.(*Upsert_Config); i { case 0: return &v.state case 1: @@ -5469,7 +5627,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_MultiRequest); i { + switch v := v.(*Remove_Request); i { case 0: return &v.state case 1: @@ -5481,7 +5639,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_TimestampRequest); i { + switch v := v.(*Remove_MultiRequest); i { case 0: return &v.state case 1: @@ -5493,7 +5651,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Timestamp); i { + switch v := v.(*Remove_TimestampRequest); i { case 0: return &v.state case 1: @@ -5505,7 +5663,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Config); i { + switch v := v.(*Remove_Timestamp); i { case 0: return &v.state case 1: @@ -5517,7 +5675,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_VectorRequest); i { + switch v := v.(*Remove_Config); i { case 0: return &v.state case 1: @@ -5529,7 +5687,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Distance); i { + switch v := v.(*Object_VectorRequest); i { case 0: return &v.state case 1: @@ -5541,7 +5699,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamDistance); i { + switch v := v.(*Object_Distance); i { case 0: return &v.state case 1: @@ -5553,7 +5711,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ID); i { + switch v := v.(*Object_StreamDistance); i { case 0: return &v.state case 1: @@ -5565,7 +5723,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_IDs); i { + switch v := v.(*Object_ID); i { case 0: return &v.state case 1: @@ -5577,7 +5735,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vector); i { + switch v := v.(*Object_IDs); i { case 0: return &v.state case 1: @@ -5589,7 +5747,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vectors); i { + switch v := v.(*Object_Vector); i { case 0: return &v.state case 1: @@ -5601,7 +5759,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamVector); i { + switch v := v.(*Object_Vectors); i { case 0: return &v.state case 1: @@ -5613,7 +5771,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ReshapeVector); i { + switch v := v.(*Object_StreamVector); i { case 0: return &v.state case 1: @@ -5625,7 +5783,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Blob); i { + switch v := v.(*Object_ReshapeVector); i { case 0: return &v.state case 1: @@ -5637,7 +5795,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamBlob); i { + switch v := v.(*Object_Blob); i { case 0: return &v.state case 1: @@ -5649,7 +5807,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Location); i { + switch v := v.(*Object_StreamBlob); i { case 0: return &v.state case 1: @@ -5661,7 +5819,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamLocation); i { + switch v := v.(*Object_Location); i { case 0: return &v.state case 1: @@ -5673,7 +5831,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Locations); i { + switch v := v.(*Object_StreamLocation); i { case 0: return &v.state case 1: @@ -5685,7 +5843,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List); i { + switch v := v.(*Object_Locations); i { case 0: return &v.state case 1: @@ -5697,7 +5855,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Request); i { + switch v := v.(*Object_List); i { case 0: return &v.state case 1: @@ -5709,7 +5867,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Response); i { + switch v := v.(*Object_List_Request); i { case 0: return &v.state case 1: @@ -5721,7 +5879,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Control_CreateIndexRequest); i { + switch v := v.(*Object_List_Response); i { case 0: return &v.state case 1: @@ -5733,7 +5891,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Discoverer_Request); i { + switch v := v.(*Control_CreateIndexRequest); i { case 0: return &v.state case 1: @@ -5745,7 +5903,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index); i { + switch v := v.(*Discoverer_Request); i { case 0: return &v.state case 1: @@ -5757,7 +5915,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pod); i { + switch v := v.(*Info_Index); i { case 0: return &v.state case 1: @@ -5769,7 +5927,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Node); i { + switch v := v.(*Info_Pod); i { case 0: return &v.state case 1: @@ -5781,7 +5939,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_CPU); i { + switch v := v.(*Info_Node); i { case 0: return &v.state case 1: @@ -5793,7 +5951,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Memory); i { + switch v := v.(*Info_CPU); i { case 0: return &v.state case 1: @@ -5805,7 +5963,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pods); i { + switch v := v.(*Info_Memory); i { case 0: return &v.state case 1: @@ -5817,7 +5975,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Nodes); i { + switch v := v.(*Info_Pods); i { case 0: return &v.state case 1: @@ -5829,7 +5987,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_IPs); i { + switch v := v.(*Info_Nodes); i { case 0: return &v.state case 1: @@ -5841,7 +5999,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_Count); i { + switch v := v.(*Info_IPs); i { case 0: return &v.state case 1: @@ -5853,7 +6011,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID); i { + switch v := v.(*Info_Index_Count); i { case 0: return &v.state case 1: @@ -5865,7 +6023,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID_Committed); i { + switch v := v.(*Info_Index_UUID); i { case 0: return &v.state case 1: @@ -5877,6 +6035,18 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info_Index_UUID_Committed); 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{} { switch v := v.(*Info_Index_UUID_Uncommitted); i { case 0: return &v.state @@ -5888,28 +6058,52 @@ func file_apis_proto_v1_payload_payload_proto_init() { return nil } } + file_apis_proto_v1_payload_payload_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Target); 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[76].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Targets); 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[20].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[21].OneofWrappers = []interface{}{ (*Search_StreamResponse_Response)(nil), (*Search_StreamResponse_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[45].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[46].OneofWrappers = []interface{}{ (*Object_StreamDistance_Distance)(nil), (*Object_StreamDistance_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[50].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[51].OneofWrappers = []interface{}{ (*Object_StreamVector_Vector)(nil), (*Object_StreamVector_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[53].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[54].OneofWrappers = []interface{}{ (*Object_StreamBlob_Blob)(nil), (*Object_StreamBlob_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[55].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[56].OneofWrappers = []interface{}{ (*Object_StreamLocation_Location)(nil), (*Object_StreamLocation_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[59].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[60].OneofWrappers = []interface{}{ (*Object_List_Response_Vector)(nil), (*Object_List_Response_Status)(nil), } @@ -5919,7 +6113,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_apis_proto_v1_payload_payload_proto_rawDesc, NumEnums: 2, - NumMessages: 74, + NumMessages: 77, NumExtensions: 0, NumServices: 0, }, diff --git a/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json b/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json index a802b1512b..4910719033 100644 --- a/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json +++ b/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json @@ -142,7 +142,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json b/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json index 17c90f4c72..51bee365c1 100644 --- a/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json +++ b/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json @@ -208,7 +208,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json b/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json index 6859db29e3..b1bd9992a6 100644 --- a/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json +++ b/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json @@ -114,7 +114,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json b/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json index 6899db4647..7e88c9e8b5 100644 --- a/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json +++ b/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json @@ -114,7 +114,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json b/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json index 76548a29ca..835e1aa5b9 100644 --- a/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json +++ b/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json @@ -59,7 +59,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json index 7af975f3ad..ef686b137c 100644 --- a/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json +++ b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json @@ -89,7 +89,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json b/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json index a63839f548..dd665c6995 100644 --- a/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json +++ b/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json @@ -13,7 +13,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json index 45920b0eed..056169fcb7 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json @@ -357,7 +357,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json index 097a01ab1f..85ef4f072a 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json @@ -125,7 +125,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json index 0386cf3403..2c185ac5c5 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json @@ -161,7 +161,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json index 48abddde3b..350b138215 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json @@ -161,7 +161,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json index 8ffd27b0c5..5ead82c2d1 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json @@ -343,7 +343,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json index fad9af1b58..7b355f6d23 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json @@ -125,7 +125,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json index c61a1cf9ad..64ae13be12 100644 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json +++ b/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json @@ -125,7 +125,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." }, "value": { "type": "string", diff --git a/charts/vald-helm-operator/crds/valdrelease.yaml b/charts/vald-helm-operator/crds/valdrelease.yaml index da3f7666c2..410fc56938 100644 --- a/charts/vald-helm-operator/crds/valdrelease.yaml +++ b/charts/vald-helm-operator/crds/valdrelease.yaml @@ -6095,8 +6095,6 @@ spec: gateway_config: type: object properties: - advertise_interval: - type: string client: type: object properties: @@ -6339,6 +6337,8 @@ spec: type: string pod_name: type: string + register_duration: + type: string self_mirror_addr: type: string hpa: diff --git a/charts/vald/values.schema.json b/charts/vald/values.schema.json index 076f7440a6..11cc1f323a 100644 --- a/charts/vald/values.schema.json +++ b/charts/vald/values.schema.json @@ -10095,10 +10095,6 @@ "gateway_config": { "type": "object", "properties": { - "advertise_interval": { - "type": "string", - "description": "interval to advertise mirror-gateway information to other mirror-gateway." - }, "client": { "type": "object", "properties": { @@ -10542,6 +10538,10 @@ "type": "string", "description": "self mirror gateway pod name" }, + "register_duration": { + "type": "string", + "description": "duration to register mirror-gateway." + }, "self_mirror_addr": { "type": "string", "description": "address for self mirror-gateway" diff --git a/internal/config/mirror.go b/internal/config/mirror.go index 3d816480fe..05be169c1e 100644 --- a/internal/config/mirror.go +++ b/internal/config/mirror.go @@ -26,7 +26,7 @@ type Mirror struct { // PodName represents the mirror gateway pod name. PodName string `json:"pod_name" yaml:"pod_name"` // RegisterDuration represents the duration to register Mirror Gateway. - RegisterDuration string `json:"register_duration" yaml:"register_duration"` + RegisterDuration string `json:"register_duration" yaml:"register_duration"` // Namespace represents the target namespace to discover ValdMirrorTarget resource. Namespace string `json:"namespace" yaml:"namespace"` // DiscoveryDuration represents the duration to discover. From 7d7a69065fb9a2cb88cff12735a780229ad7e72f Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 16 Nov 2023 18:05:55 +0900 Subject: [PATCH 39/93] fix: reviewdog warning and add comment Signed-off-by: hlts2 --- internal/config/mirror.go | 28 ++- pkg/gateway/mirror/config/config.go | 88 +--------- pkg/gateway/mirror/handler/grpc/mock_test.go | 165 +----------------- pkg/gateway/mirror/service/discovery.go | 89 +++++----- .../mirror/service/discovery_option.go | 66 +++---- pkg/gateway/mirror/service/gateway.go | 39 +++-- pkg/gateway/mirror/service/mirror.go | 32 +++- pkg/gateway/mirror/service/mirror_option.go | 10 +- pkg/gateway/mirror/service/option.go | 4 + pkg/gateway/mirror/usecase/vald.go | 116 ++++++------ 10 files changed, 237 insertions(+), 400 deletions(-) diff --git a/internal/config/mirror.go b/internal/config/mirror.go index 05be169c1e..29989b43d0 100644 --- a/internal/config/mirror.go +++ b/internal/config/mirror.go @@ -16,26 +16,35 @@ package config // Mirror represents the Mirror Gateway configuration. type Mirror struct { // Net represents the network configuration tcp, udp, unix domain socket. - Net *Net `json:"net,omitempty" yaml:"net"` + Net *Net `json:"net,omitempty" yaml:"net"` + // GRPCClient represents the configurations for gRPC client. - Client *GRPCClient `json:"client" yaml:"client"` + Client *GRPCClient `json:"client" yaml:"client"` + // SelfMirrorAddr represents the address for the self Mirror Gateway. - SelfMirrorAddr string `json:"self_mirror_addr" yaml:"self_mirror_addr"` + SelfMirrorAddr string `json:"self_mirror_addr" yaml:"self_mirror_addr"` + // GatewayAddr represents the address for the Vald Gateway (e.g lb-gateway). - GatewayAddr string `json:"gateway_addr" yaml:"gateway_addr"` + GatewayAddr string `json:"gateway_addr" yaml:"gateway_addr"` + // PodName represents the mirror gateway pod name. - PodName string `json:"pod_name" yaml:"pod_name"` + PodName string `json:"pod_name" yaml:"pod_name"` + // RegisterDuration represents the duration to register Mirror Gateway. - RegisterDuration string `json:"register_duration" yaml:"register_duration"` + RegisterDuration string `json:"register_duration" yaml:"register_duration"` + // Namespace represents the target namespace to discover ValdMirrorTarget resource. - Namespace string `json:"namespace" yaml:"namespace"` + Namespace string `json:"namespace" yaml:"namespace"` + // DiscoveryDuration represents the duration to discover. DiscoveryDuration string `json:"discovery_duration" yaml:"discovery_duration"` + // Colocation represents the colocation name. - Colocation string `json:"colocation" yaml:"colocation"` + Colocation string `json:"colocation" yaml:"colocation"` + // Group represents the group name of the Mirror Gateways. // It is used to discover ValdMirrorTarget resources with the same group name. - Group string `json:"group" yaml:"group"` + Group string `json:"group" yaml:"group"` } // Bind binds the actual data from the Mirror receiver fields. @@ -48,6 +57,7 @@ func (m *Mirror) Bind() *Mirror { m.DiscoveryDuration = GetActualValue(m.DiscoveryDuration) m.Colocation = GetActualValue(m.Colocation) m.Group = GetActualValue(m.Group) + if m.Net != nil { m.Net = m.Net.Bind() } else { diff --git a/pkg/gateway/mirror/config/config.go b/pkg/gateway/mirror/config/config.go index ff440c1b0d..c4d9a970e4 100644 --- a/pkg/gateway/mirror/config/config.go +++ b/pkg/gateway/mirror/config/config.go @@ -19,8 +19,11 @@ import ( ) type ( + // GlobalConfig is a type alias of config.GlobalConfig representing application base configurations. GlobalConfig = config.GlobalConfig - Server = config.Server + + // Server is a type alias of config.Server representing server base configurations. + Server = config.Server ) // Config represent a application setting data content (config.yaml). @@ -38,6 +41,7 @@ type Data struct { Mirror *config.Mirror `json:"gateway" yaml:"gateway"` } +// NewConfig load configurations from file path. func NewConfig(path string) (cfg *Data, err error) { cfg = new(Data) @@ -46,7 +50,7 @@ func NewConfig(path string) (cfg *Data, err error) { } if cfg != nil { - cfg.Bind() + _ = cfg.Bind() } else { return nil, errors.ErrInvalidConfig } @@ -70,83 +74,3 @@ func NewConfig(path string) (cfg *Data, err error) { } return cfg, nil } - -// func FakeData() { -// d := Data{ -// Version: "v0.0.1", -// Server: &config.Servers{ -// Servers: []*config.Server{ -// { -// Name: "agent-rest", -// Host: "127.0.0.1", -// Port: 8080, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// { -// Name: "agent-grpc", -// Host: "127.0.0.1", -// Port: 8082, -// Mode: "GRPC", -// }, -// }, -// MetricsServers: []*config.Server{ -// { -// Name: "pprof", -// Host: "127.0.0.1", -// Port: 6060, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// }, -// HealthCheckServers: []*config.Server{ -// { -// Name: "livenesss", -// Host: "127.0.0.1", -// Port: 3000, -// }, -// { -// Name: "readiness", -// Host: "127.0.0.1", -// Port: 3001, -// }, -// }, -// StartUpStrategy: []string{ -// "livenesss", -// "pprof", -// "agent-grpc", -// "agent-rest", -// "readiness", -// }, -// ShutdownStrategy: []string{ -// "readiness", -// "agent-rest", -// "agent-grpc", -// "pprof", -// "livenesss", -// }, -// FullShutdownDuration: "30s", -// TLS: &config.TLS{ -// Enabled: false, -// Cert: "/path/to/cert", -// Key: "/path/to/key", -// CA: "/path/to/ca", -// }, -// }, -// Mirror: &config.Mirror{ -// }, -// } -// fmt.Println(config.ToRawYaml(d)) -// } diff --git a/pkg/gateway/mirror/handler/grpc/mock_test.go b/pkg/gateway/mirror/handler/grpc/mock_test.go index 0bfb3548c1..e5d367da14 100644 --- a/pkg/gateway/mirror/handler/grpc/mock_test.go +++ b/pkg/gateway/mirror/handler/grpc/mock_test.go @@ -23,129 +23,27 @@ import ( ) type mockClient struct { - InsertFunc func(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) - StreamInsertFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Insert_StreamInsertClient, error) - MultiInsertFunc func(ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) - - UpdateFunc func(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) - StreamUpdateFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Update_StreamUpdateClient, error) - MultiUpdateFunc func(ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) - - UpsertFunc func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) - StreamUpsertFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Upsert_StreamUpsertClient, error) - MultiUpsertFunc func(ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) - - SearchFunc func(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) - SearchByIDFunc func(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) - StreamSearchFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamSearchClient, error) - StreamSearchByIDFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamSearchByIDClient, error) - MultiSearchFunc func(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) - MultiSearchByIDFunc func(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) - LinearSearchFunc func(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) - LinearSearchByIDFunc func(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) - StreamLinearSearchFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamLinearSearchClient, error) - StreamLinearSearchByIDFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamLinearSearchByIDClient, error) - MultiLinearSearchFunc func(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) - MultiLinearSearchByIDFunc func(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) + vald.ClientWithMirror + InsertFunc func(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + UpdateFunc func(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + UpsertFunc func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) RemoveFunc func(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) RemoveByTimestampFunc func(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) - StreamRemoveFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Remove_StreamRemoveClient, error) - MultiRemoveFunc func(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) - - ExistsFunc func(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (*payload.Object_ID, error) - GetObjectFunc func(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) - StreamGetObjectFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Object_StreamGetObjectClient, error) - StreamListObjectFunc func(ctx context.Context, opts ...grpc.CallOption) (vald.Object_StreamListObjectClient, error) - - RegisterFunc func(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) - AdvertiseFunc func(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) } func (m *mockClient) Insert(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { return m.InsertFunc(ctx, in, opts...) } -func (m *mockClient) StreamInsert(ctx context.Context, opts ...grpc.CallOption) (vald.Insert_StreamInsertClient, error) { - return m.StreamInsertFunc(ctx, opts...) -} - -func (m *mockClient) MultiInsert(ctx context.Context, in *payload.Insert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { - return m.MultiInsertFunc(ctx, in, opts...) -} - func (m *mockClient) Update(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { return m.UpdateFunc(ctx, in, opts...) } -func (m *mockClient) StreamUpdate(ctx context.Context, opts ...grpc.CallOption) (vald.Update_StreamUpdateClient, error) { - return m.StreamUpdateFunc(ctx, opts...) -} - -func (m *mockClient) MultiUpdate(ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { - return m.MultiUpdateFunc(ctx, in, opts...) -} - func (m *mockClient) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { return m.UpsertFunc(ctx, in, opts...) } -func (m *mockClient) StreamUpsert(ctx context.Context, opts ...grpc.CallOption) (vald.Upsert_StreamUpsertClient, error) { - return m.StreamUpsertFunc(ctx, opts...) -} - -func (m *mockClient) MultiUpsert(ctx context.Context, in *payload.Upsert_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { - return m.MultiUpsertFunc(ctx, in, opts...) -} - -func (m *mockClient) Search(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) { - return m.SearchFunc(ctx, in, opts...) -} - -func (m *mockClient) SearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) { - return m.SearchByIDFunc(ctx, in, opts...) -} - -func (m *mockClient) StreamSearch(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamSearchClient, error) { - return m.StreamSearchFunc(ctx, opts...) -} - -func (m *mockClient) StreamSearchByID(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamSearchByIDClient, error) { - return m.StreamSearchByIDFunc(ctx, opts...) -} - -func (m *mockClient) MultiSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { - return m.MultiSearchFunc(ctx, in, opts...) -} - -func (m *mockClient) MultiSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { - return m.MultiSearchByIDFunc(ctx, in, opts...) -} - -func (m *mockClient) LinearSearch(ctx context.Context, in *payload.Search_Request, opts ...grpc.CallOption) (*payload.Search_Response, error) { - return m.LinearSearchFunc(ctx, in, opts...) -} - -func (m *mockClient) LinearSearchByID(ctx context.Context, in *payload.Search_IDRequest, opts ...grpc.CallOption) (*payload.Search_Response, error) { - return m.LinearSearchByIDFunc(ctx, in, opts...) -} - -func (m *mockClient) StreamLinearSearch(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamLinearSearchClient, error) { - return m.StreamLinearSearchFunc(ctx, opts...) -} - -func (m *mockClient) StreamLinearSearchByID(ctx context.Context, opts ...grpc.CallOption) (vald.Search_StreamLinearSearchByIDClient, error) { - return m.StreamLinearSearchByIDFunc(ctx, opts...) -} - -func (m *mockClient) MultiLinearSearch(ctx context.Context, in *payload.Search_MultiRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { - return m.MultiLinearSearchFunc(ctx, in, opts...) -} - -func (m *mockClient) MultiLinearSearchByID(ctx context.Context, in *payload.Search_MultiIDRequest, opts ...grpc.CallOption) (*payload.Search_Responses, error) { - return m.MultiLinearSearchByIDFunc(ctx, in, opts...) -} - func (m *mockClient) Remove(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { return m.RemoveFunc(ctx, in, opts...) } @@ -154,55 +52,16 @@ func (m *mockClient) RemoveByTimestamp(ctx context.Context, in *payload.Remove_T return m.RemoveByTimestampFunc(ctx, in, opts...) } -func (m *mockClient) StreamRemove(ctx context.Context, opts ...grpc.CallOption) (vald.Remove_StreamRemoveClient, error) { - return m.StreamRemoveFunc(ctx, opts...) -} - -func (m *mockClient) MultiRemove(ctx context.Context, in *payload.Remove_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { - return m.MultiRemoveFunc(ctx, in, opts...) -} - -func (m *mockClient) Exists(ctx context.Context, in *payload.Object_ID, opts ...grpc.CallOption) (*payload.Object_ID, error) { - return m.ExistsFunc(ctx, in, opts...) -} - -func (m *mockClient) GetObject(ctx context.Context, in *payload.Object_VectorRequest, opts ...grpc.CallOption) (*payload.Object_Vector, error) { - return m.GetObjectFunc(ctx, in, opts...) -} - -func (m *mockClient) StreamGetObject(ctx context.Context, opts ...grpc.CallOption) (vald.Object_StreamGetObjectClient, error) { - return m.StreamGetObjectFunc(ctx, opts...) -} - -func (m *mockClient) StreamListObject(ctx context.Context, in *payload.Object_List_Request, opts ...grpc.CallOption) (vald.Object_StreamListObjectClient, error) { - return m.StreamListObjectFunc(ctx, opts...) -} - -func (m *mockClient) Register(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) { - return m.RegisterFunc(ctx, in) -} - -func (m *mockClient) Advertise(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) { - return m.AdvertiseFunc(ctx, in) -} - -var _ vald.ClientWithMirror = (*mockClient)(nil) - type mockGateway struct { + service.Gateway + StartFunc func(ctx context.Context) (<-chan error, error) ForwardedContextFunc func(ctx context.Context, podName string) context.Context FromForwardedContextFunc func(ctx context.Context) string BroadCastFunc func(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error - DoFunc func(ctx context.Context, target string, - f func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error)) (interface{}, error) DoMultiFunc func(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error - GRPCClientFunc func() grpc.Client -} - -func (m *mockGateway) Start(ctx context.Context) (<-chan error, error) { - return m.StartFunc(ctx) } func (m *mockGateway) ForwardedContext(ctx context.Context, podName string) context.Context { @@ -219,20 +78,8 @@ func (m *mockGateway) BroadCast(ctx context.Context, return m.BroadCastFunc(ctx, f) } -func (m *mockGateway) Do(ctx context.Context, target string, - f func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error), -) (interface{}, error) { - return m.DoFunc(ctx, target, f) -} - func (m *mockGateway) DoMulti(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error, ) error { return m.DoMultiFunc(ctx, targets, f) } - -func (m *mockGateway) GRPCClient() grpc.Client { - return m.GRPCClientFunc() -} - -var _ service.Gateway = (*mockGateway)(nil) diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 033f69ef25..ce6f68f4f0 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -36,11 +36,14 @@ const ( groupKey = "group" ) -type Discoverer interface { +// Discovery represents an interface for the main logic of service discovery. +// The primary purpose of the Discovery interface is to reconcile custom resources, +// initiating or terminating gRPC connections based on the state of the custom resources. +type Discovery interface { Start(ctx context.Context) (<-chan error, error) } -type discoverer struct { +type discovery struct { namespace string labels map[string]string colocation string @@ -56,8 +59,10 @@ type discoverer struct { eg errgroup.Group } -func NewDiscoverer(opts ...DiscovererOption) (dsc Discoverer, err error) { - d := new(discoverer) +// NewDiscovery creates the Discovery object with optional configuration options. +// It returns the initialized Discovery object and an error if the creation process fails. +func NewDiscovery(opts ...DiscoveryOption) (dsc Discovery, err error) { + d := new(discovery) for _, opt := range append(defaultDiscovererOpts, opts...) { if err := opt(d); err != nil { oerr := errors.ErrOptionFailed(err, reflect.ValueOf(opt)) @@ -73,7 +78,7 @@ func NewDiscoverer(opts ...DiscovererOption) (dsc Discoverer, err error) { d.selfMirrAddrStr = strings.Join(d.selfMirrAddrs, ",") watcher, err := target.New( - target.WithControllerName("mirror discoverer"), + target.WithControllerName("mirror discovery"), target.WithNamespace(d.namespace), target.WithLabels(d.labels), target.WithOnErrorFunc(func(err error) { @@ -89,17 +94,16 @@ func NewDiscoverer(opts ...DiscovererOption) (dsc Discoverer, err error) { } d.ctrl, err = k8s.New( k8s.WithDialer(d.der), - k8s.WithControllerName("vald k8s mirror discoverer"), + k8s.WithControllerName("vald k8s mirror discovery"), k8s.WithDisableLeaderElection(), k8s.WithResourceController(watcher), ) - if err != nil { - return nil, err - } - return d, nil + return d, err } -func (d *discoverer) Start(ctx context.Context) (<-chan error, error) { +// Start initiates the service discovery process. +// It returns a channel for receiving errors and an error if the initialization fails. +func (d *discovery) Start(ctx context.Context) (<-chan error, error) { dech, err := d.ctrl.Start(ctx) if err != nil { return nil, err @@ -138,7 +142,7 @@ func (d *discoverer) Start(ctx context.Context) (<-chan error, error) { return ech, nil } -func (d *discoverer) loadTargets() map[string]target.Target { +func (d *discovery) loadTargets() map[string]target.Target { if v := d.targetsByName.Load(); v != nil { return *v } @@ -162,13 +166,13 @@ type deletedTarget struct { port uint32 } -func (d *discoverer) startSync(ctx context.Context, prev map[string]target.Target) (cur map[string]target.Target, err error) { - cur = d.loadTargets() +func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target) (current map[string]target.Target, err error) { + current = d.loadTargets() curAddrs := make(map[string]string) // map[addr: metadata.name] created := map[string]*createdTarget{} // map[addr: target.Target] updated := map[string]*updatedTarget{} // map[addr: *updatedTarget] - for name, ctgt := range cur { + for name, ctgt := range current { addr := net.JoinHostPort(ctgt.Host, uint16(ctgt.Port)) curAddrs[addr] = name if ptgt, ok := prev[name]; !ok { @@ -178,16 +182,24 @@ func (d *discoverer) startSync(ctx context.Context, prev map[string]target.Targe } } else { if ptgt.Host != ctgt.Host || ptgt.Port != ctgt.Port { - updated[addr] = &updatedTarget{name: name, old: ptgt, new: ctgt} + updated[addr] = &updatedTarget{ + name: name, + old: ptgt, + new: ctgt, + } } } } deleted := map[string]*deletedTarget{} // map[addr: *deletedTarget] for name, ptgt := range prev { - if _, ok := cur[name]; !ok { + if _, ok := current[name]; !ok { addr := net.JoinHostPort(ptgt.Host, uint16(ptgt.Port)) - deleted[addr] = &deletedTarget{name: name, host: ptgt.Host, port: uint32(ptgt.Port)} + deleted[addr] = &deletedTarget{ + name: name, + host: ptgt.Host, + port: uint32(ptgt.Port), + } } } @@ -195,19 +207,16 @@ func (d *discoverer) startSync(ctx context.Context, prev map[string]target.Targe log.Infof("created: %#v\tupdated: %#v\tdeleted: %#v", created, updated, deleted) err = errors.Join( errors.Join( - d.createTarget(ctx, created), - d.deleteTarget(ctx, deleted)), + d.connectTarget(ctx, created), + d.disconnectTarget(ctx, deleted)), d.updateTarget(ctx, updated)) - if err != nil { - return cur, err - } - return cur, nil + return current, err } for addr, name := range curAddrs { - // When the status code of a regularly running Advertise RPC is Unimplemented, the connection to the target will be disconnected + // When the status code of a regularly running Register RPC is Unimplemented, the connection to the target will be disconnected // so the status of the resource (CR) may be misaligned. To prevent this, change the status of the resource to Disconnected. - if !d.mirr.Exist(ctx, addr) && cur[name].Phase == target.MirrorTargetPhaseConnected { + if !d.mirr.Exist(ctx, addr) && current[name].Phase == target.MirrorTargetPhaseConnected { err = errors.Join(err, d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseDisconnected)) } } @@ -215,10 +224,10 @@ func (d *discoverer) startSync(ctx context.Context, prev map[string]target.Targe d.mirr.RangeAllMirrorAddr(func(addr string, _ any) bool { connected := d.mirr.IsConnected(ctx, addr) if name, ok := curAddrs[addr]; ok { - if st := target.MirrorTargetPhaseConnected; connected && cur[name].Phase != st { + if st := target.MirrorTargetPhaseConnected; connected && current[name].Phase != st { err = errors.Join(err, d.updateMirrorTargetPhase(ctx, name, st)) - } else if st := target.MirrorTargetPhaseDisconnected; !connected && cur[name].Phase != st { + } else if st := target.MirrorTargetPhaseDisconnected; !connected && current[name].Phase != st { err = errors.Join(err, d.updateMirrorTargetPhase(ctx, name, st)) } @@ -236,13 +245,10 @@ func (d *discoverer) startSync(ctx context.Context, prev map[string]target.Targe } return true }) - return cur, err + return current, err } -func (d *discoverer) createTarget(ctx context.Context, req map[string]*createdTarget) (err error) { - if len(req) == 0 { - return nil - } +func (d *discovery) connectTarget(ctx context.Context, req map[string]*createdTarget) (err error) { for _, created := range req { phase := target.MirrorTargetPhaseConnected cerr := d.mirr.Connect(ctx, &payload.Mirror_Target{ @@ -261,7 +267,7 @@ func (d *discoverer) createTarget(ctx context.Context, req map[string]*createdTa return err } -func (d *discoverer) createMirrorTargetResource(ctx context.Context, name, host string, port int) error { +func (d *discovery) createMirrorTargetResource(ctx context.Context, name, host string, port int) error { mt, err := target.NewMirrorTargetTemplate( target.WithMirrorTargetName(name), target.WithMirrorTargetNamespace(d.namespace), @@ -279,7 +285,7 @@ func (d *discoverer) createMirrorTargetResource(ctx context.Context, name, host return d.ctrl.GetManager().GetClient().Create(ctx, mt) } -func (d *discoverer) deleteTarget(ctx context.Context, req map[string]*deletedTarget) error { +func (d *discovery) disconnectTarget(ctx context.Context, req map[string]*deletedTarget) error { if len(req) == 0 { return nil } @@ -293,13 +299,13 @@ func (d *discoverer) deleteTarget(ctx context.Context, req map[string]*deletedTa return d.mirr.Disconnect(ctx, tgts...) } -func (d *discoverer) updateMirrorTargetPhase(ctx context.Context, name string, phase target.MirrorTargetPhase) error { +func (d *discovery) updateMirrorTargetPhase(ctx context.Context, name string, phase target.MirrorTargetPhase) error { c := d.ctrl.GetManager().GetClient() mt := &target.MirrorTarget{} - if err := c.Get(ctx, k8s.ObjectKey{ + err := c.Get(ctx, k8s.ObjectKey{ Namespace: d.namespace, - Name: name, - }, mt); err != nil { + Name: name}, mt) + if err != nil { return err } if mt.Status.Phase == phase { @@ -310,10 +316,7 @@ func (d *discoverer) updateMirrorTargetPhase(ctx context.Context, name string, p return c.Status().Update(ctx, mt) } -func (d *discoverer) updateTarget(ctx context.Context, req map[string]*updatedTarget) (err error) { - if len(req) == 0 { - return nil - } +func (d *discovery) updateTarget(ctx context.Context, req map[string]*updatedTarget) (err error) { for _, updated := range req { derr := d.mirr.Disconnect(ctx, &payload.Mirror_Target{ Host: updated.old.Host, diff --git a/pkg/gateway/mirror/service/discovery_option.go b/pkg/gateway/mirror/service/discovery_option.go index acf91fa7b8..8159bf18a1 100644 --- a/pkg/gateway/mirror/service/discovery_option.go +++ b/pkg/gateway/mirror/service/discovery_option.go @@ -20,29 +20,29 @@ import ( "github.com/vdaas/vald/internal/timeutil" ) -// Option represents the functional option for discoverer. -type DiscovererOption func(d *discoverer) error +// DiscoveryOption represents the functional option for discovery. +type DiscoveryOption func(d *discovery) error -var defaultDiscovererOpts = []DiscovererOption{ - WithDiscovererDuration("1s"), - WithDiscovererErrGroup(errgroup.Get()), - WithDiscovererColocation("dc1"), +var defaultDiscovererOpts = []DiscoveryOption{ + WithDiscoveryDuration("1s"), + WithDiscoveryErrGroup(errgroup.Get()), + WithDiscoveryColocation("dc1"), } -// WithDiscovererMirror returns the option to set the Mirror service. -func WithDiscovererMirror(m Mirror) DiscovererOption { - return func(d *discoverer) error { +// WithDiscoveryMirror returns the option to set the Mirror service. +func WithDiscoveryMirror(m Mirror) DiscoveryOption { + return func(d *discovery) error { if m == nil { - return errors.NewErrCriticalOption("discovererMirror", m) + return errors.NewErrCriticalOption("discoveryMirror", m) } d.mirr = m return nil } } -// WithDiscovererDialer returns the option to set the dialer for controller manager. -func WithDiscovererDialer(der net.Dialer) DiscovererOption { - return func(d *discoverer) error { +// WithDiscoveryDialer returns the option to set the dialer for controller manager. +func WithDiscoveryDialer(der net.Dialer) DiscoveryOption { + return func(d *discovery) error { if der != nil { d.der = der } @@ -50,9 +50,9 @@ func WithDiscovererDialer(der net.Dialer) DiscovererOption { } } -// WithDiscovererNamespace returns the option to set the namespace for discovery. -func WithDiscovererNamespace(ns string) DiscovererOption { - return func(d *discoverer) error { +// WithDiscoveryNamespace returns the option to set the namespace for discovery. +func WithDiscoveryNamespace(ns string) DiscoveryOption { + return func(d *discovery) error { if len(ns) != 0 { d.namespace = ns } @@ -60,9 +60,9 @@ func WithDiscovererNamespace(ns string) DiscovererOption { } } -// WithDiscovererGroup returns the option to set the Mirror group for discovery. -func WithDiscovererGroup(g string) DiscovererOption { - return func(d *discoverer) error { +// WithDiscoveryGroup returns the option to set the Mirror group for discovery. +func WithDiscoveryGroup(g string) DiscoveryOption { + return func(d *discovery) error { if len(g) != 0 { if d.labels == nil { d.labels = make(map[string]string) @@ -73,9 +73,9 @@ func WithDiscovererGroup(g string) DiscovererOption { } } -// WithDiscovererColocation returns the option to set the colocation name of datacenter. -func WithDiscovererColocation(loc string) DiscovererOption { - return func(d *discoverer) error { +// WithDiscoveryColocation returns the option to set the colocation name of datacenter. +func WithDiscoveryColocation(loc string) DiscoveryOption { + return func(d *discovery) error { if len(loc) != 0 { d.colocation = loc } @@ -83,24 +83,24 @@ func WithDiscovererColocation(loc string) DiscovererOption { } } -// WithDiscovererDuration returns the option to set the duration of the discovery. -func WithDiscovererDuration(s string) DiscovererOption { - return func(d *discoverer) error { +// WithDiscoveryDuration returns the option to set the duration of the discovery. +func WithDiscoveryDuration(s string) DiscoveryOption { + return func(d *discovery) error { if s == "" { return nil } dur, err := timeutil.Parse(s) if err != nil { - return errors.NewErrInvalidOption("discovererDuration", s, err) + return errors.NewErrInvalidOption("discoveryDuration", s, err) } d.dur = dur return nil } } -// WithDiscovererErrGroup returns the option to set the errgroup. -func WithDiscovererErrGroup(eg errgroup.Group) DiscovererOption { - return func(d *discoverer) error { +// WithDiscoveryErrGroup returns the option to set the errgroup. +func WithDiscoveryErrGroup(eg errgroup.Group) DiscoveryOption { + return func(d *discovery) error { if eg != nil { d.eg = eg } @@ -108,11 +108,11 @@ func WithDiscovererErrGroup(eg errgroup.Group) DiscovererOption { } } -// WithDiscovererSelfMirrorAddrs returns the option to set the self Mirror addresses. -func WithDiscovererSelfMirrorAddrs(addrs ...string) DiscovererOption { - return func(d *discoverer) error { +// WithDiscoverySelfMirrorAddrs returns the option to set the self Mirror addresses. +func WithDiscoverySelfMirrorAddrs(addrs ...string) DiscoveryOption { + return func(d *discovery) error { if len(addrs) == 0 { - return errors.NewErrCriticalOption("discovererSelfMirrorAddrs", addrs) + return errors.NewErrCriticalOption("discoverySelfMirrorAddrs", addrs) } d.selfMirrAddrs = append(d.selfMirrAddrs, addrs...) return nil diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index 6b00b6fe48..50ac6d116e 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -27,10 +27,15 @@ import ( ) const ( - forwardedContextKey = "forwarded-for" + // forwardedContextKey is the key used to store forwarding-related information in a context. + forwardedContextKey = "forwarded-for" + + // forwardedContextValue is the value associated with the forwardedContextKey + // to indicate that the context is related to forwarding through the mirror gateway. forwardedContextValue = "gateway mirror" ) +// Gateway represents an interface for interacting with gRPC clients. type Gateway interface { ForwardedContext(ctx context.Context, podName string) context.Context FromForwardedContext(ctx context.Context) string @@ -44,11 +49,13 @@ type Gateway interface { } type gateway struct { - client mirror.Client // Mirror Gateway client for other clusters and to the Vald gateway (LB gateway) client for own cluster. + // client is the Mirror Gateway client for other clusters and the Vald gateway (e.g. LB gateway) client for the own cluster. + client mirror.Client eg errgroup.Group podName string } +// NewGateway returns Gateway object if no error occurs. func NewGateway(opts ...Option) (Gateway, error) { g := new(gateway) for _, opt := range append(defaultGWOpts, opts...) { @@ -60,16 +67,19 @@ func NewGateway(opts ...Option) (Gateway, error) { return nil, oerr } log.Warn(oerr) - return nil, oerr } } return g, nil } +// GRPCClient returns the underlying gRPC client associated with this object. +// It provides access to the low-level gRPC client for advanced use cases. func (g *gateway) GRPCClient() grpc.Client { return g.client.GRPCClient() } +// ForwardedContext takes a context and a podName, returning a new context +// with additional information related to forwarding. func (g *gateway) ForwardedContext(ctx context.Context, podName string) context.Context { return grpc.NewOutgoingContext(ctx, grpc.MD{ forwardedContextKey: []string{ @@ -78,6 +88,8 @@ func (g *gateway) ForwardedContext(ctx context.Context, podName string) context. }) } +// FromForwardedContext extracts information from the forwarded context +// and returns the podName associated with it. func (g *gateway) FromForwardedContext(ctx context.Context) string { md, ok := grpc.FromIncomingContext(ctx) if !ok { @@ -93,6 +105,9 @@ func (g *gateway) FromForwardedContext(ctx context.Context) string { return "" } +// BroadCast performs a broadcast operation using the provided function +// to interact with gRPC clients for multiple targets. +// The provided function should handle the communication logic for a target. func (g *gateway) BroadCast(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error, ) (err error) { @@ -109,15 +124,14 @@ func (g *gateway) BroadCast(ctx context.Context, case <-ictx.Done(): return nil default: - err = f(ictx, addr, vald.NewValdClientWithMirror(conn), copts...) - if err != nil { - return err - } + return f(ictx, addr, vald.NewValdClientWithMirror(conn), copts...) } - return nil }) } +// Do performs a gRPC operation on a single target using the provided function. +// It returns the result of the operation and any associated error. +// The provided function should handle the communication logic for a target. func (g *gateway) Do(ctx context.Context, target string, f func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error), ) (res interface{}, err error) { @@ -138,6 +152,9 @@ func (g *gateway) Do(ctx context.Context, target string, ) } +// DoMulti performs a gRPC operation on multiple targets using the provided function. +// It returns an error if any of the operations fails. +// The provided function should handle the communication logic for a target. func (g *gateway) DoMulti(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error, ) error { @@ -157,12 +174,8 @@ func (g *gateway) DoMulti(ctx context.Context, targets []string, case <-ictx.Done(): return nil default: - err = f(ictx, addr, vald.NewValdClientWithMirror(conn), copts...) - if err != nil { - return err - } + return f(ictx, addr, vald.NewValdClientWithMirror(conn), copts...) } - return nil }, ) } diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index 97d4a81c66..e82cce670f 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -32,8 +32,10 @@ import ( "github.com/vdaas/vald/internal/sync/errgroup" ) -// Mirror manages other mirror gateway connection. -// If there is a new Mirror Gateway components, registers new connection. +// Mirror represents an interface for managing mirroring operations. +// It provides methods for starting the mirroring service, connecting and disconnecting targets, +// checking the connectivity status of a given address, checking the existence of an address, +// retrieving all mirror targets, and iterating over all mirror addresses. type Mirror interface { Start(ctx context.Context) <-chan error Connect(ctx context.Context, targets ...*payload.Mirror_Target) error @@ -54,6 +56,8 @@ type mirr struct { gateway Gateway } +// NewMirror creates the Mirror object with optional configuration options. +// It returns the initialized Mirror object and an error if the creation process fails. func NewMirror(opts ...MirrorOption) (_ Mirror, err error) { m := new(mirr) for _, opt := range append(defaultMirrOpts, opts...) { @@ -87,6 +91,8 @@ func NewMirror(opts ...MirrorOption) (_ Mirror, err error) { return m, err } +// Start starts the mirroring service. +// It returns a channel for receiving errors during the mirroring process. func (m *mirr) Start(ctx context.Context) <-chan error { ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.Start") defer func() { @@ -109,6 +115,7 @@ func (m *mirr) Start(ctx context.Context) <-chan error { if err != nil { select { case <-ctx.Done(): + return ctx.Err() case ech <- err: break } @@ -151,6 +158,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* span.End() } }() + reqInfo := &errdetails.RequestInfo{ ServingData: errdetails.Serialize(tgts), } @@ -158,7 +166,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.RegisterRPCName, } resTgts := make([]*payload.Mirror_Target, 0, len(tgts.GetTargets())) - exists := make(map[string]struct{}) + exists := make(map[string]bool) var mu sync.Mutex err := m.gateway.DoMulti(ctx, m.connectedMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { @@ -198,7 +206,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* ) attrs = trace.FromGRPCStatus(st.Code(), msg) - // When ingress is deleted, the controller's default backend results(Unimplemented error) are returned so that the connection should be disconnected. + // When the ingress resource is deleted, the controller's default backend results(Unimplemented error) are returned so that the connection should be disconnected. // If it is a different namespace on the same cluster, the connection is automatically disconnected because the net.grpc health check fails. if st != nil && st.Code() == codes.Unimplemented { host, port, err := net.SplitHostPort(target) @@ -226,8 +234,8 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* for _, tgt := range res.GetTargets() { addr := net.JoinHostPort(tgt.Host, uint16(tgt.Port)) mu.Lock() - if _, ok := exists[addr]; !ok { - exists[addr] = struct{}{} + if !exists[addr] { + exists[addr] = true resTgts = append(resTgts, res.GetTargets()...) } mu.Unlock() @@ -238,6 +246,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* return resTgts, err } +// Connect establishes gRPC connections to the specified Mirror targets, excluding this gateway and the LB Gateway. func (m *mirr) Connect(ctx context.Context, targets ...*payload.Mirror_Target) error { ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.Connect") defer func() { @@ -265,6 +274,7 @@ func (m *mirr) Connect(ctx context.Context, targets ...*payload.Mirror_Target) e return nil } +// Disconnect terminates gRPC connections to the specified Mirror targets. func (m *mirr) Disconnect(ctx context.Context, targets ...*payload.Mirror_Target) error { ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.Disconnect") defer func() { @@ -280,7 +290,8 @@ func (m *mirr) Disconnect(ctx context.Context, targets ...*payload.Mirror_Target if _, ok := m.gwAddrl.Load(addr); !ok { _, ok := m.addrl.Load(addr) if ok || m.IsConnected(ctx, addr) { - if err := m.gateway.GRPCClient().Disconnect(ctx, addr); err != nil && !errors.Is(err, errors.ErrGRPCClientConnNotFound(addr)) { + if err := m.gateway.GRPCClient().Disconnect(ctx, addr); err != nil && + !errors.Is(err, errors.ErrGRPCClientConnNotFound(addr)) { return err } m.addrl.Delete(addr) @@ -290,16 +301,19 @@ func (m *mirr) Disconnect(ctx context.Context, targets ...*payload.Mirror_Target return nil } +// IsConnected checks if the gRPC connection to the given address is connected. func (m *mirr) IsConnected(ctx context.Context, addr string) bool { return m.gateway.GRPCClient().IsConnected(ctx, addr) } +// Exist checks if the given address exists in the Mmirror. func (m *mirr) Exist(_ context.Context, addr string) bool { _, ok := m.addrl.Load(addr) return ok } -// MirrorTargets returns own address and the addresses of other mirror gateways to which this gateway is currently connected. +// MirrorTargets returns the Mirror targets, including the address of this gateway and the addresses of other Mirror Gateways +// to which this gateway is currently connected. func (m *mirr) MirrorTargets() ([]*payload.Mirror_Target, error) { addrs := m.gateway.GRPCClient().ConnectedAddrs() tgts := make([]*payload.Mirror_Target, 0, len(addrs)+1) @@ -329,7 +343,7 @@ func (m *mirr) isGatewayAddr(addr string) bool { return ok } -// connected returns the addresses of other mirror gateways to which this gateway is currently connected. +// connectedMirrorAddrs returns the addresses of other Mirror Gateways to which this gateway is currently connected. func (m *mirr) connectedMirrorAddrs() []string { connectedAddrs := m.gateway.GRPCClient().ConnectedAddrs() addrs := make([]string, 0, len(connectedAddrs)) diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go index 3a43016925..2cc1998d0b 100644 --- a/pkg/gateway/mirror/service/mirror_option.go +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -20,12 +20,14 @@ import ( "github.com/vdaas/vald/internal/sync/errgroup" ) +// MirrorOption represents the functional option for mirror. type MirrorOption func(m *mirr) error var defaultMirrOpts = []MirrorOption{ - WithRegisterDuration("1s"), + WithRegisterDuration("500ms"), } +// WithErrorGroup returns the option to set the error group. func WithErrorGroup(eg errgroup.Group) MirrorOption { return func(m *mirr) error { if eg != nil { @@ -35,7 +37,8 @@ func WithErrorGroup(eg errgroup.Group) MirrorOption { } } -func WithValdAddrs(addrs ...string) MirrorOption { +// WithGatewayAddrs returns the option to set the gateway addresses. +func WithGatewayAddrs(addrs ...string) MirrorOption { return func(m *mirr) error { if len(addrs) == 0 { return errors.NewErrCriticalOption("lbAddrs", addrs) @@ -47,6 +50,7 @@ func WithValdAddrs(addrs ...string) MirrorOption { } } +// WithSelfMirrorAddrs returns the option to set the self Mirror Gateway addresses. func WithSelfMirrorAddrs(addrs ...string) MirrorOption { return func(m *mirr) error { if len(addrs) == 0 { @@ -59,6 +63,7 @@ func WithSelfMirrorAddrs(addrs ...string) MirrorOption { } } +// WithGatewayAddrs returns the option to set the Gateway service. func WithGateway(g Gateway) MirrorOption { return func(m *mirr) error { if g != nil { @@ -68,6 +73,7 @@ func WithGateway(g Gateway) MirrorOption { } } +// WithRegisterDuration returns the option to set the register duration. func WithRegisterDuration(s string) MirrorOption { return func(m *mirr) error { if len(s) == 0 { diff --git a/pkg/gateway/mirror/service/option.go b/pkg/gateway/mirror/service/option.go index 7235258c88..9ad712bdc6 100644 --- a/pkg/gateway/mirror/service/option.go +++ b/pkg/gateway/mirror/service/option.go @@ -19,12 +19,14 @@ import ( "github.com/vdaas/vald/internal/sync/errgroup" ) +// Option represents the functional option for gateway. type Option func(g *gateway) error var defaultGWOpts = []Option{ WithErrGroup(errgroup.Get()), } +// WithMirrorClient returns the option to set the Mirror client. func WithMirrorClient(c mirror.Client) Option { return func(g *gateway) error { if c != nil { @@ -34,6 +36,7 @@ func WithMirrorClient(c mirror.Client) Option { } } +// WithErrGroup returns the option to set the error group. func WithErrGroup(eg errgroup.Group) Option { return func(g *gateway) error { if eg != nil { @@ -43,6 +46,7 @@ func WithErrGroup(eg errgroup.Group) Option { } } +// WithErrGroup returns the option to set the pod name. func WithPodName(s string) Option { return func(g *gateway) error { if len(s) == 0 { diff --git a/pkg/gateway/mirror/usecase/vald.go b/pkg/gateway/mirror/usecase/vald.go index 5e4fb5d342..cb2caad851 100644 --- a/pkg/gateway/mirror/usecase/vald.go +++ b/pkg/gateway/mirror/usecase/vald.go @@ -17,13 +17,14 @@ import ( "context" "github.com/vdaas/vald/apis/grpc/v1/vald" - mclient "github.com/vdaas/vald/internal/client/v1/client/mirror" + "github.com/vdaas/vald/internal/client/v1/client/mirror" + "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/observability" - backoffmetrics "github.com/vdaas/vald/internal/observability/metrics/backoff" + bometrics "github.com/vdaas/vald/internal/observability/metrics/backoff" cbmetrics "github.com/vdaas/vald/internal/observability/metrics/circuitbreaker" - mirrormetrics "github.com/vdaas/vald/internal/observability/metrics/gateway/mirror" + mirrmetrics "github.com/vdaas/vald/internal/observability/metrics/gateway/mirror" "github.com/vdaas/vald/internal/runner" "github.com/vdaas/vald/internal/safety" "github.com/vdaas/vald/internal/servers/server" @@ -38,23 +39,25 @@ import ( type run struct { eg errgroup.Group - der net.Dialer + dialer net.Dialer cfg *config.Data server starter.Server - c mclient.Client - gw service.Gateway - mirr service.Mirror - dsc service.Discoverer + client mirror.Client + gateway service.Gateway + mirror service.Mirror + discover service.Discovery observability observability.Observability } +// New returns Runner instance. func New(cfg *config.Data) (r runner.Runner, err error) { eg := errgroup.Get() + netOpts, err := cfg.Mirror.Net.Opts() if err != nil { return nil, err } - der, err := net.NewDialer(netOpts...) + dialer, err := net.NewDialer(netOpts...) if err != nil { return nil, err } @@ -63,43 +66,44 @@ func New(cfg *config.Data) (r runner.Runner, err error) { if err != nil { return nil, err } + // skipcq: CRT-D0001 cOpts = append(cOpts, grpc.WithErrGroup(eg)) - c, err := mclient.New( - mclient.WithAddrs(cfg.Mirror.Client.Addrs...), - mclient.WithClient(grpc.New(cOpts...)), + client, err := mirror.New( + mirror.WithAddrs(cfg.Mirror.Client.Addrs...), + mirror.WithClient(grpc.New(cOpts...)), ) if err != nil { return nil, err } - gw, err := service.NewGateway( + gateway, err := service.NewGateway( service.WithErrGroup(eg), - service.WithMirrorClient(c), + service.WithMirrorClient(client), service.WithPodName(cfg.Mirror.PodName), ) if err != nil { return nil, err } - mirr, err := service.NewMirror( + mirror, err := service.NewMirror( service.WithErrorGroup(eg), service.WithRegisterDuration(cfg.Mirror.RegisterDuration), - service.WithValdAddrs(cfg.Mirror.GatewayAddr), + service.WithGatewayAddrs(cfg.Mirror.GatewayAddr), service.WithSelfMirrorAddrs(cfg.Mirror.SelfMirrorAddr), - service.WithGateway(gw), + service.WithGateway(gateway), ) if err != nil { return nil, err } - dsc, err := service.NewDiscoverer( - service.WithDiscovererNamespace(cfg.Mirror.Namespace), - service.WithDiscovererGroup(cfg.Mirror.Group), - service.WithDiscovererDuration(cfg.Mirror.DiscoveryDuration), - service.WithDiscovererSelfMirrorAddrs(cfg.Mirror.SelfMirrorAddr), - service.WithDiscovererColocation(cfg.Mirror.Colocation), - service.WithDiscovererDialer(der), - service.WithDiscovererMirror(mirr), - service.WithDiscovererErrGroup(eg), + discover, err := service.NewDiscovery( + service.WithDiscoveryNamespace(cfg.Mirror.Namespace), + service.WithDiscoveryGroup(cfg.Mirror.Group), + service.WithDiscoveryDuration(cfg.Mirror.DiscoveryDuration), + service.WithDiscoverySelfMirrorAddrs(cfg.Mirror.SelfMirrorAddr), + service.WithDiscoveryColocation(cfg.Mirror.Colocation), + service.WithDiscoveryDialer(dialer), + service.WithDiscoveryMirror(mirror), + service.WithDiscoveryErrGroup(eg), ) if err != nil { return nil, err @@ -108,8 +112,8 @@ func New(cfg *config.Data) (r runner.Runner, err error) { v, err := handler.New( handler.WithValdAddr(cfg.Mirror.GatewayAddr), handler.WithErrGroup(eg), - handler.WithGateway(gw), - handler.WithMirror(mirr), + handler.WithGateway(gateway), + handler.WithMirror(mirror), handler.WithStreamConcurrency(cfg.Server.GetGRPCStreamConcurrency()), ) if err != nil { @@ -129,9 +133,9 @@ func New(cfg *config.Data) (r runner.Runner, err error) { if cfg.Observability.Enabled { obs, err = observability.NewWithConfig( cfg.Observability, - backoffmetrics.New(), + bometrics.New(), cbmetrics.New(), - mirrormetrics.New(mirr), + mirrmetrics.New(mirror), ) if err != nil { return nil, err @@ -163,20 +167,21 @@ func New(cfg *config.Data) (r runner.Runner, err error) { return &run{ eg: eg, - der: der, + dialer: dialer, cfg: cfg, server: srv, - c: c, - gw: gw, - mirr: mirr, - dsc: dsc, + client: client, + gateway: gateway, + mirror: mirror, + discover: discover, observability: obs, }, nil } +// PreStart is a method called before execution of Start. func (r *run) PreStart(ctx context.Context) error { - if r.der != nil { - r.der.StartDialerCache(ctx) + if r.dialer != nil { + r.dialer.StartDialerCache(ctx) } if r.observability != nil { return r.observability.PreStart(ctx) @@ -184,24 +189,25 @@ func (r *run) PreStart(ctx context.Context) error { return nil } -func (r *run) Start(ctx context.Context) (<-chan error, error) { +// Start is a method used to initiate an operation in the run, and it returns a channel for receiving errors +// during the operation and an error representing any initialization errors. +func (r *run) Start(ctx context.Context) (_ <-chan error, err error) { ech := make(chan error, 6) var mech, dech, cech, sech, oech <-chan error - var err error sech = r.server.ListenAndServe(ctx) - if r.c != nil { - cech, err = r.c.Start(ctx) + if r.client != nil { + cech, err = r.client.Start(ctx) if err != nil { close(ech) return nil, err } } - if r.mirr != nil { - mech = r.mirr.Start(ctx) + if r.mirror != nil { + mech = r.mirror.Start(ctx) } - if r.dsc != nil { - dech, err = r.dsc.Start(ctx) + if r.discover != nil { + dech, err = r.discover.Start(ctx) if err != nil { close(ech) return nil, err @@ -226,7 +232,7 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { if err != nil { select { case <-ctx.Done(): - return ctx.Err() + return errors.Join(ctx.Err(), err) case ech <- err: } } @@ -235,17 +241,27 @@ func (r *run) Start(ctx context.Context) (<-chan error, error) { return ech, nil } -func (r *run) PreStop(ctx context.Context) error { +// PreStop is a method called before execution of Stop. +func (*run) PreStop(_ context.Context) error { return nil } -func (r *run) Stop(ctx context.Context) error { +// Stop is a method used to stop an operation in the run. +func (r *run) Stop(ctx context.Context) (errs error) { if r.observability != nil { - r.observability.Stop(ctx) + if err := r.observability.Stop(ctx); err != nil { + errs = errors.Join(errs, err) + } + } + if r.server != nil { + if err := r.server.Shutdown(ctx); err != nil { + errs = errors.Join(errs, err) + } } - return r.server.Shutdown(ctx) + return errs } +// PtopStop is a method called after execution of Stop. func (*run) PostStop(_ context.Context) error { return nil } From c9007ed7c7208f2eea3c39a98af44d40aa6394ba Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 09:06:30 +0000 Subject: [PATCH 40/93] style: format code with Gofumpt and Prettier This commit fixes the style issues introduced in 7d7a690 according to the output from Gofumpt and Prettier. Details: https://github.com/vdaas/vald/pull/2237 --- pkg/gateway/mirror/service/discovery.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index ce6f68f4f0..4538161053 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -304,7 +304,8 @@ func (d *discovery) updateMirrorTargetPhase(ctx context.Context, name string, ph mt := &target.MirrorTarget{} err := c.Get(ctx, k8s.ObjectKey{ Namespace: d.namespace, - Name: name}, mt) + Name: name, + }, mt) if err != nil { return err } From 78734df8661144c3fcd85fd4b3a3dd5c151b2ca8 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 16 Nov 2023 18:29:55 +0900 Subject: [PATCH 41/93] fix: reviewdog warning Signed-off-by: hlts2 --- internal/client/v1/client/mirror/mirror.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/client/v1/client/mirror/mirror.go b/internal/client/v1/client/mirror/mirror.go index ad3f337f3f..1c9216a809 100644 --- a/internal/client/v1/client/mirror/mirror.go +++ b/internal/client/v1/client/mirror/mirror.go @@ -61,7 +61,7 @@ func (c *client) Start(ctx context.Context) (<-chan error, error) { } func (c *client) Stop(ctx context.Context) error { - return c.Stop(ctx) + return c.c.Close(ctx) } func (c *client) GRPCClient() grpc.Client { From 88dad2e27a79e2e955fcc2cf87b3ba2962110007 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 16 Nov 2023 18:48:42 +0900 Subject: [PATCH 42/93] fix: reviewdog warning Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler_test.go | 10 +++++----- pkg/gateway/mirror/service/gateway.go | 2 +- pkg/gateway/mirror/service/option.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index 29d97f9664..d3313566d3 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -2707,12 +2707,12 @@ func Test_server_Exists(t *testing.T) { beforeFunc func(*testing.T, args) afterFunc func(*testing.T, args) } - defaultCheckFunc := func(w want, gotId *payload.Object_ID, err error) error { + defaultCheckFunc := func(w want, gotID *payload.Object_ID, 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(gotId, w.wantId) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotId, w.wantId) + if !reflect.DeepEqual(gotID, w.wantId) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotID, w.wantId) } return nil } @@ -2804,8 +2804,8 @@ func Test_server_Exists(t *testing.T) { UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, } - gotId, err := s.Exists(test.args.ctx, test.args.meta) - if err := checkFunc(test.want, gotId, err); err != nil { + gotID, err := s.Exists(test.args.ctx, test.args.meta) + if err := checkFunc(test.want, gotID, err); err != nil { tt.Errorf("error = %v", err) } }) diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index 50ac6d116e..f4a91613e4 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -58,7 +58,7 @@ type gateway struct { // NewGateway returns Gateway object if no error occurs. func NewGateway(opts ...Option) (Gateway, error) { g := new(gateway) - for _, opt := range append(defaultGWOpts, opts...) { + for _, opt := range append(defaultGatewayOpts, opts...) { if err := opt(g); err != nil { oerr := errors.ErrOptionFailed(err, reflect.ValueOf(opt)) e := &errors.ErrCriticalOption{} diff --git a/pkg/gateway/mirror/service/option.go b/pkg/gateway/mirror/service/option.go index 9ad712bdc6..979a23ce58 100644 --- a/pkg/gateway/mirror/service/option.go +++ b/pkg/gateway/mirror/service/option.go @@ -22,7 +22,7 @@ import ( // Option represents the functional option for gateway. type Option func(g *gateway) error -var defaultGWOpts = []Option{ +var defaultGatewayOpts = []Option{ WithErrGroup(errgroup.Get()), } From ee0f48a1c0fd912d3b4f889e9c76d81c0ec257af Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 16 Nov 2023 19:16:13 +0900 Subject: [PATCH 43/93] fix: move mirror client mock definition to internal package Signed-off-by: hlts2 --- .../test/mock/client/mirror_client_mock.go | 52 +++++ .../mirror/handler/grpc/handler_test.go | 189 +++++++++--------- pkg/gateway/mirror/handler/grpc/mock_test.go | 49 +---- 3 files changed, 156 insertions(+), 134 deletions(-) create mode 100644 internal/test/mock/client/mirror_client_mock.go diff --git a/internal/test/mock/client/mirror_client_mock.go b/internal/test/mock/client/mirror_client_mock.go new file mode 100644 index 0000000000..d99af5609e --- /dev/null +++ b/internal/test/mock/client/mirror_client_mock.go @@ -0,0 +1,52 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package client + +import ( + "context" + + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/apis/grpc/v1/vald" + "github.com/vdaas/vald/internal/net/grpc" +) + +type MirrorClientMock struct { + vald.ClientWithMirror + + InsertFunc func(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + UpdateFunc func(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + UpsertFunc func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + RemoveFunc func(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) + RemoveByTimestampFunc func(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) +} + +func (mc *MirrorClientMock) Insert(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return mc.InsertFunc(ctx, in, opts...) +} + +func (mc *MirrorClientMock) Update(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return mc.UpdateFunc(ctx, in, opts...) +} + +func (mc *MirrorClientMock) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return mc.UpsertFunc(ctx, in, opts...) +} + +func (mc *MirrorClientMock) Remove(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { + return mc.RemoveFunc(ctx, in, opts...) +} + +func (mc *MirrorClientMock) RemoveByTimestamp(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { + return mc.RemoveByTimestampFunc(ctx, in, opts...) +} diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index d3313566d3..8b7fd25b90 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -27,6 +27,7 @@ import ( "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/internal/test/data/vector" "github.com/vdaas/vald/internal/test/goleak" + clientmock "github.com/vdaas/vald/internal/test/mock/client" "github.com/vdaas/vald/pkg/gateway/mirror/service" ) @@ -89,12 +90,12 @@ func Test_server_Insert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, @@ -114,7 +115,7 @@ func Test_server_Insert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -151,7 +152,7 @@ func Test_server_Insert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return &payload.Object_Location{ Uuid: uuid, @@ -159,7 +160,7 @@ func Test_server_Insert(t *testing.T) { }, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -182,7 +183,7 @@ func Test_server_Insert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -225,7 +226,7 @@ func Test_server_Insert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return &payload.Object_Location{ Uuid: uuid, @@ -233,7 +234,7 @@ func Test_server_Insert(t *testing.T) { }, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -256,7 +257,7 @@ func Test_server_Insert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -299,12 +300,12 @@ func Test_server_Insert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -324,7 +325,7 @@ func Test_server_Insert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -358,12 +359,12 @@ func Test_server_Insert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, @@ -383,7 +384,7 @@ func Test_server_Insert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -413,12 +414,12 @@ func Test_server_Insert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) }, @@ -438,7 +439,7 @@ func Test_server_Insert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -471,7 +472,7 @@ func Test_server_Insert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return &payload.Object_Location{ Uuid: uuid, @@ -479,7 +480,7 @@ func Test_server_Insert(t *testing.T) { }, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ InsertFunc: func(_ context.Context, _ *payload.Insert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -502,7 +503,7 @@ func Test_server_Insert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -628,12 +629,12 @@ func Test_server_Update(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, @@ -653,7 +654,7 @@ func Test_server_Update(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -690,12 +691,12 @@ func Test_server_Update(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -715,7 +716,7 @@ func Test_server_Update(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -752,12 +753,12 @@ func Test_server_Update(t *testing.T) { "vald-01", "vald-02", "vald-03", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, @@ -765,7 +766,7 @@ func Test_server_Update(t *testing.T) { return loc, nil }, }, - targets[2]: &mockClient{ + targets[2]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, @@ -785,7 +786,7 @@ func Test_server_Update(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -834,12 +835,12 @@ func Test_server_Update(t *testing.T) { "vald-01", "vald-02", "vald-03", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, @@ -847,7 +848,7 @@ func Test_server_Update(t *testing.T) { return loc, nil }, }, - targets[2]: &mockClient{ + targets[2]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -867,7 +868,7 @@ func Test_server_Update(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -912,12 +913,12 @@ func Test_server_Update(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, @@ -937,7 +938,7 @@ func Test_server_Update(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -971,12 +972,12 @@ func Test_server_Update(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, @@ -996,7 +997,7 @@ func Test_server_Update(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1026,12 +1027,12 @@ func Test_server_Update(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -1051,7 +1052,7 @@ func Test_server_Update(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1084,12 +1085,12 @@ func Test_server_Update(t *testing.T) { "vald-01", "vald-02", "vald-03", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, @@ -1097,7 +1098,7 @@ func Test_server_Update(t *testing.T) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, - targets[2]: &mockClient{ + targets[2]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -1117,7 +1118,7 @@ func Test_server_Update(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1161,12 +1162,12 @@ func Test_server_Update(t *testing.T) { "vald-01", "vald-02", "vald-03", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, @@ -1174,7 +1175,7 @@ func Test_server_Update(t *testing.T) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - targets[2]: &mockClient{ + targets[2]: &clientmock.MirrorClientMock{ UpdateFunc: func(_ context.Context, _ *payload.Update_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, @@ -1194,7 +1195,7 @@ func Test_server_Update(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1320,12 +1321,12 @@ func Test_server_Upsert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, @@ -1345,7 +1346,7 @@ func Test_server_Upsert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1382,12 +1383,12 @@ func Test_server_Upsert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpsertFunc: func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -1407,7 +1408,7 @@ func Test_server_Upsert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1437,12 +1438,12 @@ func Test_server_Upsert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpsertFunc: func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.AlreadyExists, errors.ErrMetaDataAlreadyExists(uuid).Error()) }, @@ -1462,7 +1463,7 @@ func Test_server_Upsert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1496,12 +1497,12 @@ func Test_server_Upsert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, @@ -1521,7 +1522,7 @@ func Test_server_Upsert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1551,12 +1552,12 @@ func Test_server_Upsert(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ UpsertFunc: func(_ context.Context, _ *payload.Upsert_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) }, @@ -1576,7 +1577,7 @@ func Test_server_Upsert(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1695,12 +1696,12 @@ func Test_server_Remove(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, @@ -1719,7 +1720,7 @@ func Test_server_Remove(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1756,12 +1757,12 @@ func Test_server_Remove(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid).Error()) }, @@ -1780,7 +1781,7 @@ func Test_server_Remove(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1814,12 +1815,12 @@ func Test_server_Remove(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return loc, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, @@ -1838,7 +1839,7 @@ func Test_server_Remove(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1868,12 +1869,12 @@ func Test_server_Remove(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) }, @@ -1892,7 +1893,7 @@ func Test_server_Remove(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -1925,12 +1926,12 @@ func Test_server_Remove(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrIndexNotFound.Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ RemoveFunc: func(_ context.Context, _ *payload.Remove_Request, _ ...grpc.CallOption) (*payload.Object_Location, error) { return nil, status.Error(codes.NotFound, errors.ErrIndexNotFound.Error()) }, @@ -1949,7 +1950,7 @@ func Test_server_Remove(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -2071,7 +2072,7 @@ func Test_server_RemoveByTimestamp(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { return &payload.Object_Locations{ Locations: []*payload.Object_Location{ @@ -2080,7 +2081,7 @@ func Test_server_RemoveByTimestamp(t *testing.T) { }, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { return &payload.Object_Locations{ Locations: []*payload.Object_Location{ @@ -2098,7 +2099,7 @@ func Test_server_RemoveByTimestamp(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -2137,7 +2138,7 @@ func Test_server_RemoveByTimestamp(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { return &payload.Object_Locations{ Locations: []*payload.Object_Location{ @@ -2146,7 +2147,7 @@ func Test_server_RemoveByTimestamp(t *testing.T) { }, nil }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound("test02").Error()) }, @@ -2160,7 +2161,7 @@ func Test_server_RemoveByTimestamp(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -2193,12 +2194,12 @@ func Test_server_RemoveByTimestamp(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerHalfOpenFlowLimitation.Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { return nil, status.Error(codes.Internal, errors.ErrCircuitBreakerOpenState.Error()) }, @@ -2212,7 +2213,7 @@ func Test_server_RemoveByTimestamp(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, @@ -2246,12 +2247,12 @@ func Test_server_RemoveByTimestamp(t *testing.T) { "vald-01", "vald-02", } cmap := map[string]vald.ClientWithMirror{ - targets[0]: &mockClient{ + targets[0]: &clientmock.MirrorClientMock{ RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid1).Error()) }, }, - targets[1]: &mockClient{ + targets[1]: &clientmock.MirrorClientMock{ RemoveByTimestampFunc: func(_ context.Context, _ *payload.Remove_TimestampRequest, _ ...grpc.CallOption) (*payload.Object_Locations, error) { return nil, status.Error(codes.NotFound, errors.ErrObjectIDNotFound(uuid2).Error()) }, @@ -2265,7 +2266,7 @@ func Test_server_RemoveByTimestamp(t *testing.T) { }, fields: fields{ eg: eg, - gateway: &mockGateway{ + gateway: &gatewayMock{ FromForwardedContextFunc: func(_ context.Context) string { return "" }, diff --git a/pkg/gateway/mirror/handler/grpc/mock_test.go b/pkg/gateway/mirror/handler/grpc/mock_test.go index e5d367da14..642d45de87 100644 --- a/pkg/gateway/mirror/handler/grpc/mock_test.go +++ b/pkg/gateway/mirror/handler/grpc/mock_test.go @@ -16,43 +16,12 @@ package grpc import ( "context" - "github.com/vdaas/vald/apis/grpc/v1/payload" "github.com/vdaas/vald/apis/grpc/v1/vald" "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/pkg/gateway/mirror/service" ) -type mockClient struct { - vald.ClientWithMirror - - InsertFunc func(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) - UpdateFunc func(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) - UpsertFunc func(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) - RemoveFunc func(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) - RemoveByTimestampFunc func(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) -} - -func (m *mockClient) Insert(ctx context.Context, in *payload.Insert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { - return m.InsertFunc(ctx, in, opts...) -} - -func (m *mockClient) Update(ctx context.Context, in *payload.Update_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { - return m.UpdateFunc(ctx, in, opts...) -} - -func (m *mockClient) Upsert(ctx context.Context, in *payload.Upsert_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { - return m.UpsertFunc(ctx, in, opts...) -} - -func (m *mockClient) Remove(ctx context.Context, in *payload.Remove_Request, opts ...grpc.CallOption) (*payload.Object_Location, error) { - return m.RemoveFunc(ctx, in, opts...) -} - -func (m *mockClient) RemoveByTimestamp(ctx context.Context, in *payload.Remove_TimestampRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error) { - return m.RemoveByTimestampFunc(ctx, in, opts...) -} - -type mockGateway struct { +type gatewayMock struct { service.Gateway StartFunc func(ctx context.Context) (<-chan error, error) @@ -64,22 +33,22 @@ type mockGateway struct { f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error } -func (m *mockGateway) ForwardedContext(ctx context.Context, podName string) context.Context { - return m.ForwardedContextFunc(ctx, podName) +func (gm *gatewayMock) ForwardedContext(ctx context.Context, podName string) context.Context { + return gm.ForwardedContextFunc(ctx, podName) } -func (m *mockGateway) FromForwardedContext(ctx context.Context) string { - return m.FromForwardedContextFunc(ctx) +func (gm *gatewayMock) FromForwardedContext(ctx context.Context) string { + return gm.FromForwardedContextFunc(ctx) } -func (m *mockGateway) BroadCast(ctx context.Context, +func (gm *gatewayMock) BroadCast(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error, ) error { - return m.BroadCastFunc(ctx, f) + return gm.BroadCastFunc(ctx, f) } -func (m *mockGateway) DoMulti(ctx context.Context, targets []string, +func (gm *gatewayMock) DoMulti(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error, ) error { - return m.DoMultiFunc(ctx, targets, f) + return gm.DoMultiFunc(ctx, targets, f) } From 374dc5785f308b82188ace0ac735908681b71dca Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 21 Nov 2023 10:49:32 +0900 Subject: [PATCH 44/93] feat: add new handler base logic Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 109 ++++++++++++++++++--- pkg/gateway/mirror/service/gateway.go | 6 +- 2 files changed, 97 insertions(+), 18 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index cd3a43cf7c..232d5d3c6a 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -16,6 +16,7 @@ package grpc import ( "context" "fmt" + "io" "reflect" "github.com/vdaas/vald/apis/grpc/v1/payload" @@ -158,7 +159,7 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { id, err = vc.Exists(ctx, meta, copts...) return id, err }) @@ -222,7 +223,7 @@ func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res * } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.Search(ctx, req, copts...) return res, err }) @@ -289,7 +290,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.SearchByID(ctx, req, copts...) return res, err }) @@ -452,7 +453,7 @@ func (s *server) MultiSearch(ctx context.Context, req *payload.Search_MultiReque } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.MultiSearch(ctx, req, copts...) return res, err }) @@ -516,7 +517,7 @@ func (s *server) MultiSearchByID(ctx context.Context, req *payload.Search_MultiI } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.MultiSearchByID(ctx, req, copts...) return res, err }) @@ -580,7 +581,7 @@ func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.LinearSearch(ctx, req, copts...) return res, err }) @@ -647,7 +648,7 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.LinearSearchByID(ctx, req, copts...) return res, err }) @@ -813,7 +814,7 @@ func (s *server) MultiLinearSearch(ctx context.Context, req *payload.Search_Mult } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.MultiLinearSearch(ctx, req, copts...) return res, err }) @@ -877,7 +878,7 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, req *payload.Search_ } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { res, err = vc.MultiLinearSearchByID(ctx, req, copts...) return res, err }) @@ -947,7 +948,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { loc, err = s.doInsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { - _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { loc, err = vc.Insert(ctx, req, copts...) return loc, err }) @@ -1445,7 +1446,7 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { loc, err = s.doUpdate(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { - _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { loc, err = vc.Update(ctx, req, copts...) return loc, err }) @@ -1973,7 +1974,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { loc, err = s.doUpsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { - s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { loc, err = vc.Upsert(ctx, req, copts...) return loc, err }) @@ -2334,7 +2335,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { loc, err = s.doRemove(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { - s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { loc, err = vc.Remove(ctx, req, copts...) return loc, err }) @@ -2690,7 +2691,7 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if len(reqSrcPodName) != 0 { locs, err = s.doRemoveByTimestamp(ctx, req, func(ctx context.Context) (*payload.Object_Locations, error) { - _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { locs, err = vc.RemoveByTimestamp(ctx, req, copts...) return locs, err }) @@ -2923,7 +2924,7 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques } }() - _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err = s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { vec, err = vc.GetObject(ctx, req, copts...) return vec, err }) @@ -3028,6 +3029,84 @@ func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err return nil } +func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald.Object_StreamListObjectServer) error { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.StreamListObjectRPCName), apiName+"/"+vald.StreamListObjectRPCName) + defer func() { + if span != nil { + span.End() + } + }() + + _, err := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "Do/"+target), apiName+"/"+vald.StreamListObjectRPCName+"/"+target) + defer func() { + if span != nil { + span.End() + } + }() + client, err := vc.StreamListObject(ctx, req, copts...) + if err != nil { + return nil, err + } + + ctx, cancel := context.WithCancel(ctx) + defer cancel() + eg, egctx := errgroup.WithContext(ctx) + eg.SetLimit(s.streamConcurrency) + + var ( + mu sync.Mutex + emu sync.Mutex + errs = make([]error, 0, s.streamConcurrency) + ) + finalize := func() error { + err := eg.Wait() + if err != nil { + + } + return nil + } + for { + select { + case <-egctx.Done(): + return nil, finalize() + default: + res, err := client.Recv() + if err != nil { + if err != io.EOF && errors.Is(err, io.EOF) { + return nil, finalize() + } + return nil, errors.Join(err, finalize()) + } + if res != nil { + eg.Go(safety.RecoverFunc(func() (err error) { + // TODO: add trace + mu.Lock() + err = stream.Send(res) + mu.Unlock() + if err != nil { + emu.Lock() + errs = append(errs, err) + emu.Unlock() + } + return nil + })) + } + } + } + }) + if err != nil { + if span != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.StreamListObjectRPCName+" gRPC error response") + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil +} + type errorState struct { err error code codes.Code diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index f4a91613e4..9699bc4f96 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -42,7 +42,7 @@ type Gateway interface { BroadCast(ctx context.Context, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error Do(ctx context.Context, target string, - f func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error)) (interface{}, error) + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error)) (interface{}, error) DoMulti(ctx context.Context, targets []string, f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error GRPCClient() grpc.Client @@ -133,7 +133,7 @@ func (g *gateway) BroadCast(ctx context.Context, // It returns the result of the operation and any associated error. // The provided function should handle the communication logic for a target. func (g *gateway) Do(ctx context.Context, target string, - f func(ctx context.Context, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error), + f func(ctx context.Context, addr string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error), ) (res interface{}, err error) { ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Gateway.Do") defer func() { @@ -147,7 +147,7 @@ func (g *gateway) Do(ctx context.Context, target string, } return g.client.GRPCClient().Do(g.ForwardedContext(ctx, g.podName), target, func(ictx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) { - return f(ictx, vald.NewValdClientWithMirror(conn), copts...) + return f(ictx, target, vald.NewValdClientWithMirror(conn), copts...) }, ) } From 9e875305f3b28101218f84dca6354fa8031e9389 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 21 Nov 2023 18:21:51 +0900 Subject: [PATCH 45/93] fix: refactor stream list object rpc Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 159 +++++++++++++++------ 1 file changed, 112 insertions(+), 47 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 232d5d3c6a..fe921cfa22 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -18,6 +18,7 @@ import ( "fmt" "io" "reflect" + "sync/atomic" "github.com/vdaas/vald/apis/grpc/v1/payload" "github.com/vdaas/vald/apis/grpc/v1/vald" @@ -3037,7 +3038,7 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald. } }() - _, err := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { + _, err := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (obj interface{}, err error) { ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "Do/"+target), apiName+"/"+vald.StreamListObjectRPCName+"/"+target) defer func() { if span != nil { @@ -3048,52 +3049,7 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald. if err != nil { return nil, err } - - ctx, cancel := context.WithCancel(ctx) - defer cancel() - eg, egctx := errgroup.WithContext(ctx) - eg.SetLimit(s.streamConcurrency) - - var ( - mu sync.Mutex - emu sync.Mutex - errs = make([]error, 0, s.streamConcurrency) - ) - finalize := func() error { - err := eg.Wait() - if err != nil { - - } - return nil - } - for { - select { - case <-egctx.Done(): - return nil, finalize() - default: - res, err := client.Recv() - if err != nil { - if err != io.EOF && errors.Is(err, io.EOF) { - return nil, finalize() - } - return nil, errors.Join(err, finalize()) - } - if res != nil { - eg.Go(safety.RecoverFunc(func() (err error) { - // TODO: add trace - mu.Lock() - err = stream.Send(res) - mu.Unlock() - if err != nil { - emu.Lock() - errs = append(errs, err) - emu.Unlock() - } - return nil - })) - } - } - } + return obj, s.streamListObject(ctx, client, stream) }) if err != nil { if span != nil { @@ -3107,6 +3063,115 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald. return nil } +func (s *server) streamListObject(ctx context.Context, clientS vald.Object_StreamListObjectClient, serverS vald.Object_StreamListObjectServer) (err error) { + cctx, cancel := context.WithCancel(ctx) + defer cancel() + eg, egctx := errgroup.WithContext(cctx) + eg.SetLimit(s.streamConcurrency) + + var mu, rmu sync.Mutex + var egCnt int64 + for { + select { + case <-egctx.Done(): + // If the root context is not canceld error, it is treated as an error. + if ctx.Err() != nil && !errors.Is(ctx.Err(), context.Canceled) { + err = errors.Join(ctx.Err(), err) + } + if egerr := eg.Wait(); egerr != nil { + err = errors.Join(err, egerr) + } + return err + default: + eg.Go(safety.RecoverFunc(func() (err error) { + id := fmt.Sprintf("stream-%020d", atomic.AddInt64(&egCnt, 1)) + _, span := trace.StartSpan(egctx, apiName+"/streamListObject/"+id) + defer func() { + if span != nil { + span.End() + } + }() + + rmu.Lock() + res, err := clientS.Recv() + rmu.Unlock() + if err != nil { + if errors.Is(err, io.EOF) { + cancel() + return nil + } + err = errors.ErrServerStreamClientRecv(err) + var attr trace.Attributes + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled("Stream Recv returned canceld error at "+id, err) + attr = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded("Stream Recv returned deadlin exceeded error at "+id, err) + attr = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, "Stream Recv returned an error at "+id) + if st != nil { + attr = trace.FromGRPCStatus(st.Code(), msg) + } + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attr...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + if res.GetVector() == nil { + return nil + } + + mu.Lock() + err = serverS.Send(res) + mu.Unlock() + if err != nil { + if errors.Is(err, io.EOF) { + cancel() + return nil + } + err = errors.ErrServerStreamServerSend(err) + var attr trace.Attributes + switch { + case errors.Is(err, context.Canceled): + err = status.WrapWithCanceled("Stream Send returned canceld error at "+id, err) + attr = trace.StatusCodeCancelled(err.Error()) + case errors.Is(err, context.DeadlineExceeded): + err = status.WrapWithDeadlineExceeded("Stream Send returned deadlin exceeded error at "+id, err) + attr = trace.StatusCodeDeadlineExceeded(err.Error()) + default: + var ( + st *status.Status + msg string + ) + st, msg, err = status.ParseError(err, codes.Internal, "Stream Send returned an error at "+id) + if st != nil { + attr = trace.FromGRPCStatus(st.Code(), msg) + } + } + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(attr...) + span.SetStatus(trace.StatusError, err.Error()) + } + return err + } + return nil + })) + } + } +} + type errorState struct { err error code codes.Code From e62a657d94823a0f7a04640cbd19e1331e354d15 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 22 Nov 2023 14:01:59 +0900 Subject: [PATCH 46/93] fix: divide logic to other function Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 149 ++++++++++++++++----- 1 file changed, 119 insertions(+), 30 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index fe921cfa22..5f5bbbd350 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -943,11 +943,9 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * } }() - reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. - if len(reqSrcPodName) != 0 { + if s.isProxied(ctx) { loc, err = s.doInsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { loc, err = vc.Insert(ctx, req, copts...) @@ -980,6 +978,16 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * // If this condition is matched, it means the request from user. // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. + return s.handleInsert(ctx, req) +} + +func (s *server) handleInsert(ctx context.Context, req *payload.Insert_Request) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleInsert"), apiName+"/handleInsert") + defer func() { + if span != nil { + span.End() + } + }() var mu sync.Mutex var result sync.Map[string, *errorState] // map[target host: error state] @@ -1118,12 +1126,34 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * // And send Update API requst to ALREADY_EXIST cluster using the query requested by the user. log.Warnf("failed to "+vald.InsertRPCName+" API: %#v", err) - updateReq := &payload.Update_Request{ + resLoc, err := s.handleInsertResult(ctx, alreadyExistsTgts, &payload.Update_Request{ Vector: req.GetVector(), Config: &payload.Update_Config{ Timestamp: req.GetConfig().GetTimestamp(), }, + }, &result) + if err != nil { + return nil, err + } + loc.Name = resLoc.Name + loc.Ips = append(loc.Ips, resLoc.Ips...) + return loc, nil +} + +func (s *server) handleInsertResult(ctx context.Context, alreadyExistsTgts []string, req *payload.Update_Request, result *sync.Map[string, *errorState]) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleInsertResult"), apiName+"/handleInsertResult") + defer func() { + if span != nil { + span.End() + } + }() + + var mu sync.Mutex + loc = &payload.Object_Location{ + Uuid: req.GetVector().GetId(), + Ips: make([]string, 0), } + err = s.gateway.DoMulti(ctx, alreadyExistsTgts, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "DoMulti/"+target), apiName+"/"+vald.UpdateRPCName+"/"+target) defer func() { @@ -1133,8 +1163,8 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * }() code := codes.OK - ce, err := s.doUpdate(ctx, updateReq, func(ctx context.Context) (*payload.Object_Location, error) { - return vc.Update(ctx, updateReq, copts...) + ce, err := s.doUpdate(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + return vc.Update(ctx, req, copts...) }) if err != nil { var ( @@ -1170,7 +1200,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * }) if err != nil { reqInfo := &errdetails.RequestInfo{ - RequestId: updateReq.GetVector().GetId(), + RequestId: req.GetVector().GetId(), } resInfo := &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.InsertRPCName + ".DoMulti", @@ -1203,7 +1233,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * } alreadyExistsTgts = alreadyExistsTgts[0:0] - successTgts = successTgts[0:0] + successTgts := make([]string, 0, result.Len()/2) result.Range(func(target string, es *errorState) bool { switch { case es.err == nil: @@ -1217,14 +1247,14 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * return true }) if err == nil || (len(successTgts) > 0 && result.Len() == len(successTgts)+len(alreadyExistsTgts)) { - log.Debugf(vald.UpdateRPCName+"for "+vald.InsertRPCName+" API request succeeded to %#v", loc) + log.Debugf(vald.UpdateRPCName+" for "+vald.InsertRPCName+" API request succeeded to %#v", loc) return loc, nil } - reqInfo = &errdetails.RequestInfo{ + reqInfo := &errdetails.RequestInfo{ RequestId: req.GetVector().GetId(), } - resInfo = &errdetails.ResourceInfo{ + resInfo := &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.InsertRPCName + "." + vald.UpdateRPCName, ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), } @@ -1441,11 +1471,9 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * } }() - reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. - if len(reqSrcPodName) != 0 { + if s.isProxied(ctx) { loc, err = s.doUpdate(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { loc, err = vc.Update(ctx, req, copts...) @@ -1478,6 +1506,16 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * // If this condition is matched, it means the request from user. // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. + return s.handleUpdate(ctx, req) +} + +func (s *server) handleUpdate(ctx context.Context, req *payload.Update_Request) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpdate"), apiName+"/handleUpdate") + defer func() { + if span != nil { + span.End() + } + }() var mu sync.Mutex var result sync.Map[string, *errorState] // map[target host: error state] @@ -1631,12 +1669,34 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * // And send Insert API requst to NOT_FOUND cluster using query requested by the user. log.Warnf("failed to "+vald.UpdateRPCName+" API: %#v", err) - insReq := &payload.Insert_Request{ + resLoc, err := s.handleUpdateResult(ctx, notFoundTgts, &payload.Insert_Request{ Vector: req.GetVector(), Config: &payload.Insert_Config{ Timestamp: req.GetConfig().GetTimestamp(), }, + }, &result) + if err != nil { + return nil, err + } + loc.Name = resLoc.Name + loc.Ips = append(loc.Ips, resLoc.Ips...) + return loc, nil +} + +func (s *server) handleUpdateResult(ctx context.Context, notFoundTgts []string, req *payload.Insert_Request, result *sync.Map[string, *errorState]) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpdateResult"), apiName+"/handleUpdateResult") + defer func() { + if span != nil { + span.End() + } + }() + + var mu sync.Mutex + loc = &payload.Object_Location{ + Uuid: req.GetVector().GetId(), + Ips: make([]string, 0), } + err = s.gateway.DoMulti(ctx, notFoundTgts, func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "BroadCast/"+target), apiName+"/"+vald.InsertRPCName+"/"+target) defer func() { @@ -1646,8 +1706,8 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * }() code := codes.OK - ce, err := s.doInsert(ctx, insReq, func(ctx context.Context) (*payload.Object_Location, error) { - return vc.Insert(ctx, insReq, copts...) + ce, err := s.doInsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { + return vc.Insert(ctx, req, copts...) }) if err != nil { var ( @@ -1717,9 +1777,9 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * return nil, err } - alreadyExistsCnt = 0 + alreadyExistsCnt := 0 notFoundTgts = notFoundTgts[0:0] - successTgts = successTgts[0:0] + successTgts := make([]string, 0, result.Len()/2) result.Range(func(target string, em *errorState) bool { switch { case em.err == nil: @@ -1740,11 +1800,11 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * return loc, nil } - reqInfo = &errdetails.RequestInfo{ + reqInfo := &errdetails.RequestInfo{ RequestId: req.GetVector().GetId(), ServingData: errdetails.Serialize(req), } - resInfo = &errdetails.ResourceInfo{ + resInfo := &errdetails.ResourceInfo{ ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1." + vald.UpdateRPCName + "." + vald.InsertRPCName, ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), } @@ -1969,11 +2029,9 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * } }() - reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. - if len(reqSrcPodName) != 0 { + if s.isProxied(ctx) { loc, err = s.doUpsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { loc, err = vc.Upsert(ctx, req, copts...) @@ -2007,6 +2065,16 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * // If this condition is matched, it means the request from user. // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. + return s.handleUpsert(ctx, req) +} + +func (s *server) handleUpsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpsert"), apiName+"/handleUpsert") + defer func() { + if span != nil { + span.End() + } + }() var mu sync.Mutex var result sync.Map[string, *errorState] // map[target host: error state] @@ -2330,11 +2398,9 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * } }() - reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. - if len(reqSrcPodName) != 0 { + if s.isProxied(ctx) { loc, err = s.doRemove(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { loc, err = vc.Remove(ctx, req, copts...) @@ -2367,6 +2433,16 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * // If this condition is matched, it means the request from user. // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. + return s.handleRemove(ctx, req) +} + +func (s *server) handleRemove(ctx context.Context, req *payload.Remove_Request) (loc *payload.Object_Location, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleRemove"), apiName+"/handleRemove") + defer func() { + if span != nil { + span.End() + } + }() var mu sync.Mutex var result sync.Map[string, *errorState] // map[target host: error state] @@ -2686,11 +2762,9 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time } }() - reqSrcPodName := s.gateway.FromForwardedContext(ctx) - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. - if len(reqSrcPodName) != 0 { + if s.isProxied(ctx) { locs, err = s.doRemoveByTimestamp(ctx, req, func(ctx context.Context) (*payload.Object_Locations, error) { _, derr := s.gateway.Do(ctx, s.vAddr, func(ctx context.Context, _ string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error) { locs, err = vc.RemoveByTimestamp(ctx, req, copts...) @@ -2723,6 +2797,17 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time // If this condition is matched, it means the request from user. // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. + return s.handleRemoveByTimestamp(ctx, req) + +} + +func (s *server) handleRemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, err error) { + ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleRemoveByTimestamp"), apiName+"/handleRemoveByTimestamp") + defer func() { + if span != nil { + span.End() + } + }() var mu sync.Mutex var result sync.Map[string, *errorState] // map[target host: error state] @@ -3172,6 +3257,10 @@ func (s *server) streamListObject(ctx context.Context, clientS vald.Object_Strea } } +func (s *server) isProxied(ctx context.Context) bool { + return len(s.gateway.FromForwardedContext(ctx)) != 0 +} + type errorState struct { err error code codes.Code From 6c6b744d2fdfb52d4fa9c5066c2cc469c9da5abe Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 05:02:36 +0000 Subject: [PATCH 47/93] style: format code with Gofumpt and Prettier This commit fixes the style issues introduced in e62a657 according to the output from Gofumpt and Prettier. Details: https://github.com/vdaas/vald/pull/2237 --- pkg/gateway/mirror/handler/grpc/handler.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 5f5bbbd350..786b0136ee 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -2798,7 +2798,6 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time // If this condition is matched, it means the request from user. // So this component sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. return s.handleRemoveByTimestamp(ctx, req) - } func (s *server) handleRemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, err error) { From 104c22bfbf9c90feddf344c3ef4fdfd8e7824478 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 29 Nov 2023 15:52:06 +0900 Subject: [PATCH 48/93] make proto/all format Signed-off-by: hlts2 --- apis/docs/v1/docs.md | 1151 +++++++++-------- apis/grpc/v1/agent/core/agent.pb.go | 2 +- apis/grpc/v1/agent/sidecar/sidecar.pb.go | 2 +- apis/grpc/v1/discoverer/discoverer.pb.go | 2 +- .../grpc/v1/filter/egress/egress_filter.pb.go | 2 +- .../v1/filter/ingress/ingress_filter.pb.go | 2 +- .../grpc/v1/manager/index/index_manager.pb.go | 2 +- apis/grpc/v1/mirror/mirror.pb.go | 2 +- apis/grpc/v1/payload/payload.pb.go | 898 ++++++++----- .../v1/rpc/errdetails/error_details.pb.go | 2 +- apis/grpc/v1/vald/filter.pb.go | 2 +- apis/grpc/v1/vald/insert.pb.go | 2 +- apis/grpc/v1/vald/object.pb.go | 2 +- apis/grpc/v1/vald/remove.pb.go | 2 +- apis/grpc/v1/vald/search.pb.go | 2 +- apis/grpc/v1/vald/update.pb.go | 2 +- apis/grpc/v1/vald/upsert.pb.go | 2 +- 17 files changed, 1168 insertions(+), 911 deletions(-) diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index 8c7c76e29e..d67b989a75 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -4,32 +4,18 @@ ## Table of Contents +- [apis/proto/v1/agent/core/agent.proto](#apis_proto_v1_agent_core_agent-proto) + - [Agent](#core-v1-Agent) +- [apis/proto/v1/agent/sidecar/sidecar.proto](#apis_proto_v1_agent_sidecar_sidecar-proto) + - [Sidecar](#sidecar-v1-Sidecar) +- [apis/proto/v1/discoverer/discoverer.proto](#apis_proto_v1_discoverer_discoverer-proto) + - [Discoverer](#discoverer-v1-Discoverer) - [apis/proto/v1/filter/egress/egress_filter.proto](#apis_proto_v1_filter_egress_egress_filter-proto) - [Filter](#filter-egress-v1-Filter) - [apis/proto/v1/filter/ingress/ingress_filter.proto](#apis_proto_v1_filter_ingress_ingress_filter-proto) - [Filter](#filter-ingress-v1-Filter) -- [apis/proto/v1/rpc/error_details.proto](#apis_proto_v1_rpc_error_details-proto) - - [BadRequest](#rpc-v1-BadRequest) - - [BadRequest.FieldViolation](#rpc-v1-BadRequest-FieldViolation) - - [DebugInfo](#rpc-v1-DebugInfo) - - [ErrorInfo](#rpc-v1-ErrorInfo) - - [ErrorInfo.MetadataEntry](#rpc-v1-ErrorInfo-MetadataEntry) - - [Help](#rpc-v1-Help) - - [Help.Link](#rpc-v1-Help-Link) - - [LocalizedMessage](#rpc-v1-LocalizedMessage) - - [PreconditionFailure](#rpc-v1-PreconditionFailure) - - [PreconditionFailure.Violation](#rpc-v1-PreconditionFailure-Violation) - - [QuotaFailure](#rpc-v1-QuotaFailure) - - [QuotaFailure.Violation](#rpc-v1-QuotaFailure-Violation) - - [RequestInfo](#rpc-v1-RequestInfo) - - [ResourceInfo](#rpc-v1-ResourceInfo) - - [RetryInfo](#rpc-v1-RetryInfo) - [apis/proto/v1/manager/index/index_manager.proto](#apis_proto_v1_manager_index_index_manager-proto) - [Index](#manager-index-v1-Index) -- [apis/proto/v1/agent/sidecar/sidecar.proto](#apis_proto_v1_agent_sidecar_sidecar-proto) - - [Sidecar](#sidecar-v1-Sidecar) -- [apis/proto/v1/agent/core/agent.proto](#apis_proto_v1_agent_core_agent-proto) - - [Agent](#core-v1-Agent) - [apis/proto/v1/payload/payload.proto](#apis_proto_v1_payload_payload-proto) - [Control](#payload-v1-Control) @@ -59,6 +45,9 @@ - [Insert.MultiRequest](#payload-v1-Insert-MultiRequest) - [Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) - [Insert.Request](#payload-v1-Insert-Request) + - [Mirror](#payload-v1-Mirror) + - [Mirror.Target](#payload-v1-Mirror-Target) + - [Mirror.Targets](#payload-v1-Mirror-Targets) - [Object](#payload-v1-Object) - [Object.Blob](#payload-v1-Object-Blob) - [Object.Distance](#payload-v1-Object-Distance) @@ -112,24 +101,92 @@ - [Remove.Timestamp.Operator](#payload-v1-Remove-Timestamp-Operator) - [Search.AggregationAlgorithm](#payload-v1-Search-AggregationAlgorithm) -- [apis/proto/v1/discoverer/discoverer.proto](#apis_proto_v1_discoverer_discoverer-proto) - - [Discoverer](#discoverer-v1-Discoverer) -- [apis/proto/v1/vald/remove.proto](#apis_proto_v1_vald_remove-proto) - - [Remove](#vald-v1-Remove) +- [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/upsert.proto](#apis_proto_v1_vald_upsert-proto) - - [Upsert](#vald-v1-Upsert) - [apis/proto/v1/vald/object.proto](#apis_proto_v1_vald_object-proto) - [Object](#vald-v1-Object) -- [apis/proto/v1/vald/filter.proto](#apis_proto_v1_vald_filter-proto) - - [Filter](#vald-v1-Filter) +- [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/update.proto](#apis_proto_v1_vald_update-proto) - [Update](#vald-v1-Update) +- [apis/proto/v1/vald/upsert.proto](#apis_proto_v1_vald_upsert-proto) + - [Upsert](#vald-v1-Upsert) +- [apis/proto/v1/rpc/error_details.proto](#apis_proto_v1_rpc_error_details-proto) + - [BadRequest](#rpc-v1-BadRequest) + - [BadRequest.FieldViolation](#rpc-v1-BadRequest-FieldViolation) + - [DebugInfo](#rpc-v1-DebugInfo) + - [ErrorInfo](#rpc-v1-ErrorInfo) + - [ErrorInfo.MetadataEntry](#rpc-v1-ErrorInfo-MetadataEntry) + - [Help](#rpc-v1-Help) + - [Help.Link](#rpc-v1-Help-Link) + - [LocalizedMessage](#rpc-v1-LocalizedMessage) + - [PreconditionFailure](#rpc-v1-PreconditionFailure) + - [PreconditionFailure.Violation](#rpc-v1-PreconditionFailure-Violation) + - [QuotaFailure](#rpc-v1-QuotaFailure) + - [QuotaFailure.Violation](#rpc-v1-QuotaFailure-Violation) + - [RequestInfo](#rpc-v1-RequestInfo) + - [ResourceInfo](#rpc-v1-ResourceInfo) + - [RetryInfo](#rpc-v1-RetryInfo) +- [apis/proto/v1/mirror/mirror.proto](#apis_proto_v1_mirror_mirror-proto) + - [Mirror](#mirror-v1-Mirror) - [Scalar Value Types](#scalar-value-types) + + +

    Top

    + +## 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. | +| GetTimestamp | [.payload.v1.Object.GetTimestampRequest](#payload-v1-Object-GetTimestampRequest) | [.payload.v1.Object.Timestamp](#payload-v1-Object-Timestamp) | Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process | + + + +

    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

    @@ -164,583 +221,328 @@ Represent the ingress filter service. | 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/rpc/error_details.proto +## apis/proto/v1/manager/index/index_manager.proto - + -### BadRequest +### Index -Describes violations in a client request. This error type focuses on the -syntactic aspects of the request. +Represent the index manager service. -| Field | Type | Label | Description | -| ---------------- | -------------------------------------------------------------- | -------- | --------------------------------------------- | -| field_violations | [BadRequest.FieldViolation](#rpc-v1-BadRequest-FieldViolation) | repeated | Describes all violations in a client request. | +| 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. | - + -### BadRequest.FieldViolation +

    Top

    -A message type used to describe a single bad request field. +## apis/proto/v1/payload/payload.proto -| Field | Type | Label | Description | -| ----- | ----------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -| field | [string](#string) | | A path that leads to a field in the request body. The value will be a sequence of dot-separated identifiers that identify a protocol buffer field. | + -Consider the following: +### Control -message CreateContactRequest { message EmailAddress { enum Type { TYPE_UNSPECIFIED = 0; HOME = 1; WORK = 2; } +Control related messages. -optional string email = 1; repeated EmailType type = 2; } + -string full_name = 1; repeated EmailAddress email_addresses = 2; } +### Control.CreateIndexRequest -In this example, in proto `field` could take one of the following values: +Represent the create index request. -- `full_name` for a violation in the `full_name` value _ `email_addresses[1].email` for a violation in the `email` field of the first `email_addresses` message _ `email_addresses[3].type[2]` for a violation in the second `type` value in the third `email_addresses` message. +| Field | Type | Label | Description | +| --------- | ----------------- | ----- | -------------------------------------------- | +| pool_size | [uint32](#uint32) | | The pool size of the create index operation. | -In JSON, the same values are represented as: + -- `fullName` for a violation in the `fullName` value _ `emailAddresses[1].email` for a violation in the `email` field of the first `emailAddresses` message _ `emailAddresses[3].type[2]` for a violation in the second `type` value in the third `emailAddresses` message. | - | description | [string](#string) | | A description of why the request element is bad. | +### Discoverer - +Discoverer related messages. -### DebugInfo + -Describes additional debugging info. +### Discoverer.Request -| Field | Type | Label | Description | -| ------------- | ----------------- | -------- | ------------------------------------------------------------ | -| stack_entries | [string](#string) | repeated | The stack trace entries indicating where the error occurred. | -| detail | [string](#string) | | Additional debugging information provided by the server. | +Represent the dicoverer request. - +| Field | Type | Label | Description | +| --------- | ----------------- | ----- | -------------------------------- | +| name | [string](#string) | | The agent name to be discovered. | +| namespace | [string](#string) | | The namespace to be discovered. | +| node | [string](#string) | | The node to be discovered. | -### ErrorInfo + -Describes the cause of the error with structured details. +### Empty -Example of an error when contacting the "pubsub.googleapis.com" API when it -is not enabled: +Represent an empty message. - { "reason": "API_DISABLED" - "domain": "googleapis.com" - "metadata": { - "resource": "projects/123", - "service": "pubsub.googleapis.com" - } - } + -This response indicates that the pubsub.googleapis.com API is not enabled. +### Filter -Example of an error that is returned when attempting to create a Spanner -instance in a region that is out of stock: +Filter related messages. - { "reason": "STOCKOUT" - "domain": "spanner.googleapis.com", - "metadata": { - "availableRegions": "us-central1,us-east2" - } - } + -| Field | Type | Label | Description | -| -------- | ---------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| reason | [string](#string) | | The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. | -| domain | [string](#string) | | The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". | -| metadata | [ErrorInfo.MetadataEntry](#rpc-v1-ErrorInfo-MetadataEntry) | repeated | Additional structured details about this error. | +### Filter.Config -Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. | +Represent filter configuration. - +| Field | Type | Label | Description | +| ------- | ------------------------------------------ | -------- | ------------------------------------------ | +| targets | [Filter.Target](#payload-v1-Filter-Target) | repeated | Represent the filter target configuration. | -### ErrorInfo.MetadataEntry + -| Field | Type | Label | Description | -| ----- | ----------------- | ----- | ----------- | -| key | [string](#string) | | | -| value | [string](#string) | | | +### Filter.Target - +Represent the target filter server. -### Help +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | -------------------- | +| host | [string](#string) | | The target hostname. | +| port | [uint32](#uint32) | | The target port. | -Provides links to documentation or for performing an out of band action. + -For example, if a quota check failed with an error indicating the calling -project hasn't enabled the accessed service, this can contain a URL pointing -directly to the right place in the developer console to flip the bit. +### Info -| Field | Type | Label | Description | -| ----- | ------------------------------ | -------- | ------------------------------------------------------------------------ | -| links | [Help.Link](#rpc-v1-Help-Link) | repeated | URL(s) pointing to additional information on handling the current error. | +Info related messages. - + -### Help.Link +### Info.CPU -Describes a URL link. +Represent the CPU information message. -| Field | Type | Label | Description | -| ----------- | ----------------- | ----- | ------------------------------- | -| description | [string](#string) | | Describes what the link offers. | -| url | [string](#string) | | The URL of the link. | +| Field | Type | Label | Description | +| ------- | ----------------- | ----- | --------------------------- | +| limit | [double](#double) | | The CPU resource limit. | +| request | [double](#double) | | The CPU resource requested. | +| usage | [double](#double) | | The CPU usage. | - + -### LocalizedMessage +### Info.IPs -Provides a localized error message that is safe to return to the user -which can be attached to an RPC error. +Represent the multiple IP message. -| Field | Type | Label | Description | -| ------- | ----------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| locale | [string](#string) | | The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX" | -| message | [string](#string) | | The localized error message in the above locale. | +| Field | Type | Label | Description | +| ----- | ----------------- | -------- | ----------- | +| ip | [string](#string) | repeated | | - + -### PreconditionFailure +### Info.Index -Describes what preconditions have failed. +Represent the index information messages. -For example, if an RPC failed because it required the Terms of Service to be -acknowledged, it could list the terms of service violation in the -PreconditionFailure message. + -| Field | Type | Label | Description | -| ---------- | ---------------------------------------------------------------------- | -------- | -------------------------------------- | -| violations | [PreconditionFailure.Violation](#rpc-v1-PreconditionFailure-Violation) | repeated | Describes all precondition violations. | +### Info.Index.Count - +Represent the index count message. -### PreconditionFailure.Violation +| Field | Type | Label | Description | +| ----------- | ----------------- | ----- | ---------------------------- | +| stored | [uint32](#uint32) | | The stored index count. | +| uncommitted | [uint32](#uint32) | | The uncommitted index count. | +| indexing | [bool](#bool) | | The indexing index count. | +| saving | [bool](#bool) | | The saving index count. | -A message type used to describe a single precondition failure. + -| Field | Type | Label | Description | -| ----------- | ----------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| type | [string](#string) | | The type of PreconditionFailure. We recommend using a service-specific enum type to define the supported precondition violation subjects. For example, "TOS" for "Terms of Service violation". | -| subject | [string](#string) | | The subject, relative to the type, that failed. For example, "google.com/cloud" relative to the "TOS" type would indicate which terms of service is being referenced. | -| description | [string](#string) | | A description of how the precondition failed. Developers can use this description to understand how to fix the failure. | +### Info.Index.UUID -For example: "Terms of service not accepted". | +Represent the UUID message. - + -### QuotaFailure +### Info.Index.UUID.Committed -Describes how a quota check failed. +The committed UUID. -For example if a daily limit was exceeded for the calling project, -a service could respond with a QuotaFailure detail containing the project -id and the description of the quota limit that was exceeded. If the -calling project hasn't enabled the service in the developer console, then -a service could respond with the project id and set `service_disabled` -to true. +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | ----------- | +| uuid | [string](#string) | | | -Also see RetryInfo and Help types for other details about handling a -quota failure. + -| Field | Type | Label | Description | -| ---------- | -------------------------------------------------------- | -------- | ------------------------------- | -| violations | [QuotaFailure.Violation](#rpc-v1-QuotaFailure-Violation) | repeated | Describes all quota violations. | +### Info.Index.UUID.Uncommitted - +The uncommitted UUID. -### QuotaFailure.Violation +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | ----------- | +| uuid | [string](#string) | | | -A message type used to describe a single quota violation. For example, a -daily quota or a custom quota that was exceeded. + -| Field | Type | Label | Description | -| ----------- | ----------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| subject | [string](#string) | | The subject on which the quota check failed. For example, "clientip:<ip address of client>" or "project:<Google developer project id>". | -| description | [string](#string) | | A description of how the quota check failed. Clients can use this description to find more about the quota configuration in the service's public documentation, or find the relevant quota limit to adjust through developer console. | +### Info.Memory -For example: "Service disabled" or "Daily Limit for read operations exceeded". | +Represent the memory information message. - +| Field | Type | Label | Description | +| ------- | ----------------- | ----- | --------------------- | +| limit | [double](#double) | | The memory limit. | +| request | [double](#double) | | The memory requested. | +| usage | [double](#double) | | The memory usage. | -### RequestInfo + -Contains metadata about the request that clients can attach when filing a bug -or providing other forms of feedback. +### Info.Node -| Field | Type | Label | Description | -| ------------ | ----------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| request_id | [string](#string) | | An opaque string that should only be interpreted by the service generating it. For example, it can be used to identify requests in the service's logs. | -| serving_data | [string](#string) | | Any data that was used to serve this request. For example, an encrypted stack trace that can be sent back to the service provider for debugging. | +Represent the node information message. - +| Field | Type | Label | Description | +| ------------- | -------------------------------------- | ----- | ------------------------------------ | +| name | [string](#string) | | The name of the node. | +| internal_addr | [string](#string) | | The internal IP address of the node. | +| external_addr | [string](#string) | | The external IP address of the node. | +| cpu | [Info.CPU](#payload-v1-Info-CPU) | | The CPU information of the node. | +| memory | [Info.Memory](#payload-v1-Info-Memory) | | The memory information of the node. | +| Pods | [Info.Pods](#payload-v1-Info-Pods) | | The pod information of the node. | -### ResourceInfo + -Describes the resource that is being accessed. +### Info.Nodes -| Field | Type | Label | Description | -| ------------- | ----------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| resource_type | [string](#string) | | A name for the type of resource being accessed, e.g. "sql table", "cloud storage bucket", "file", "Google calendar"; or the type URL of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". | -| resource_name | [string](#string) | | The name of the resource being accessed. For example, a shared calendar name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. | -| owner | [string](#string) | | The owner of the resource (optional). For example, "user:<owner email>" or "project:<Google developer project id>". | -| description | [string](#string) | | Describes what error is encountered when accessing this resource. For example, updating a cloud project may require the `writer` permission on the developer console project. | +Represent the multiple node information message. - +| Field | Type | Label | Description | +| ----- | ---------------------------------- | -------- | ------------------------------ | +| nodes | [Info.Node](#payload-v1-Info-Node) | repeated | The multiple node information. | -### RetryInfo + -Describes when the clients can retry a failed request. Clients could ignore -the recommendation here or retry when this information is missing from error -responses. +### Info.Pod -It's always recommended that clients should use exponential backoff when -retrying. +Represent the pod information message. -Clients should wait until `retry_delay` amount of time has passed since -receiving the error response before retrying. If retrying requests also -fail, clients should use an exponential backoff scheme to gradually increase -the delay between retries based on `retry_delay`, until either a maximum -number of retries have been reached or a maximum retry delay cap has been -reached. +| Field | Type | Label | Description | +| --------- | -------------------------------------- | ----- | ------------------------------------- | +| app_name | [string](#string) | | The app name of the pod on the label. | +| name | [string](#string) | | The name of the pod. | +| namespace | [string](#string) | | The namespace of the pod. | +| ip | [string](#string) | | The IP of the pod. | +| cpu | [Info.CPU](#payload-v1-Info-CPU) | | The CPU information of the pod. | +| memory | [Info.Memory](#payload-v1-Info-Memory) | | The memory information of the pod. | +| node | [Info.Node](#payload-v1-Info-Node) | | The node information of the pod. | -| Field | Type | Label | Description | -| ----------- | ----------------------------------------------------- | ----- | ------------------------------------------------------------------------- | -| retry_delay | [google.protobuf.Duration](#google-protobuf-Duration) | | Clients should wait at least this long between retrying the same request. | + - +### Info.Pods -

    Top

    +Represent the multiple pod information message. -## apis/proto/v1/manager/index/index_manager.proto +| Field | Type | Label | Description | +| ----- | -------------------------------- | -------- | ----------------------------- | +| pods | [Info.Pod](#payload-v1-Info-Pod) | repeated | The multiple pod information. | - + -### Index +### Insert -Represent the index manager service. +Insert related messages. -| 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. | + - +### Insert.Config -

    Top

    +Represent insert configurations. -## apis/proto/v1/agent/sidecar/sidecar.proto +| Field | Type | Label | Description | +| ----------------------- | ------------------------------------------ | ----- | --------------------------------------------------- | +| skip_strict_exist_check | [bool](#bool) | | A flag to skip exist check during insert operation. | +| filters | [Filter.Config](#payload-v1-Filter-Config) | | Filter configurations. | +| timestamp | [int64](#int64) | | Insert timestamp. | - + -### Sidecar +### Insert.MultiObjectRequest -Represent the agent sidecar service. +Represent the multiple insert by binary object request. -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ----------- | +| Field | Type | Label | Description | +| -------- | -------------------------------------------------------- | -------- | -------------------------------------------- | +| requests | [Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) | repeated | Represent multiple insert by object content. | - + -

    Top

    +### Insert.MultiRequest -## apis/proto/v1/agent/core/agent.proto +Represent the multiple insert request. - +| Field | Type | Label | Description | +| -------- | -------------------------------------------- | -------- | ------------------------------------------ | +| requests | [Insert.Request](#payload-v1-Insert-Request) | repeated | Represent multiple insert request content. | -### Agent + -Represent the agent service. +### Insert.ObjectRequest -| 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. | -| GetTimestamp | [.payload.v1.Object.GetTimestampRequest](#payload-v1-Object-GetTimestampRequest) | [.payload.v1.Object.Timestamp](#payload-v1-Object-Timestamp) | Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process | +Represent the insert by binary object request. - +| Field | Type | Label | Description | +| ---------- | ------------------------------------------ | ----- | ---------------------------------------- | +| object | [Object.Blob](#payload-v1-Object-Blob) | | The binary object to be inserted. | +| config | [Insert.Config](#payload-v1-Insert-Config) | | The configuration of the insert request. | +| vectorizer | [Filter.Target](#payload-v1-Filter-Target) | | Filter configurations. | -

    Top

    + -## apis/proto/v1/payload/payload.proto +### Insert.Request - +Represent the insert request. -### Control +| Field | Type | Label | Description | +| ------ | ------------------------------------------ | ----- | ---------------------------------------- | +| vector | [Object.Vector](#payload-v1-Object-Vector) | | The vector to be inserted. | +| config | [Insert.Config](#payload-v1-Insert-Config) | | The configuration of the insert request. | -Control related messages. + - +### Mirror -### Control.CreateIndexRequest +Mirror related messages. -Represent the create index request. + -| Field | Type | Label | Description | -| --------- | ----------------- | ----- | -------------------------------------------- | -| pool_size | [uint32](#uint32) | | The pool size of the create index operation. | +### Mirror.Target - +Represent server information. -### Discoverer +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | -------------------- | +| host | [string](#string) | | The target hostname. | +| port | [uint32](#uint32) | | The target port. | -Discoverer related messages. + - +### Mirror.Targets -### Discoverer.Request +Represent the multiple Target message. -Represent the dicoverer request. +| Field | Type | Label | Description | +| ------- | ------------------------------------------ | -------- | -------------------------------- | +| targets | [Mirror.Target](#payload-v1-Mirror-Target) | repeated | The multiple target information. | -| Field | Type | Label | Description | -| --------- | ----------------- | ----- | -------------------------------- | -| name | [string](#string) | | The agent name to be discovered. | -| namespace | [string](#string) | | The namespace to be discovered. | -| node | [string](#string) | | The node to be discovered. | + - +### Object -### Empty +Common messages. -Represent an empty message. + - - -### Filter - -Filter related messages. - - - -### Filter.Config - -Represent filter configuration. - -| Field | Type | Label | Description | -| ------- | ------------------------------------------ | -------- | ------------------------------------------ | -| targets | [Filter.Target](#payload-v1-Filter-Target) | repeated | Represent the filter target configuration. | - - - -### Filter.Target - -Represent the target filter server. - -| Field | Type | Label | Description | -| ----- | ----------------- | ----- | -------------------- | -| host | [string](#string) | | The target hostname. | -| port | [uint32](#uint32) | | The target port. | - - - -### Info - -Info related messages. - - - -### Info.CPU - -Represent the CPU information message. - -| Field | Type | Label | Description | -| ------- | ----------------- | ----- | --------------------------- | -| limit | [double](#double) | | The CPU resource limit. | -| request | [double](#double) | | The CPU resource requested. | -| usage | [double](#double) | | The CPU usage. | - - - -### Info.IPs - -Represent the multiple IP message. - -| Field | Type | Label | Description | -| ----- | ----------------- | -------- | ----------- | -| ip | [string](#string) | repeated | | - - - -### Info.Index - -Represent the index information messages. - - - -### Info.Index.Count - -Represent the index count message. - -| Field | Type | Label | Description | -| ----------- | ----------------- | ----- | ---------------------------- | -| stored | [uint32](#uint32) | | The stored index count. | -| uncommitted | [uint32](#uint32) | | The uncommitted index count. | -| indexing | [bool](#bool) | | The indexing index count. | -| saving | [bool](#bool) | | The saving index count. | - - - -### Info.Index.UUID - -Represent the UUID message. - - - -### Info.Index.UUID.Committed - -The committed UUID. - -| Field | Type | Label | Description | -| ----- | ----------------- | ----- | ----------- | -| uuid | [string](#string) | | | - - - -### Info.Index.UUID.Uncommitted - -The uncommitted UUID. - -| Field | Type | Label | Description | -| ----- | ----------------- | ----- | ----------- | -| uuid | [string](#string) | | | - - - -### Info.Memory - -Represent the memory information message. - -| Field | Type | Label | Description | -| ------- | ----------------- | ----- | --------------------- | -| limit | [double](#double) | | The memory limit. | -| request | [double](#double) | | The memory requested. | -| usage | [double](#double) | | The memory usage. | - - - -### Info.Node - -Represent the node information message. - -| Field | Type | Label | Description | -| ------------- | -------------------------------------- | ----- | ------------------------------------ | -| name | [string](#string) | | The name of the node. | -| internal_addr | [string](#string) | | The internal IP address of the node. | -| external_addr | [string](#string) | | The external IP address of the node. | -| cpu | [Info.CPU](#payload-v1-Info-CPU) | | The CPU information of the node. | -| memory | [Info.Memory](#payload-v1-Info-Memory) | | The memory information of the node. | -| Pods | [Info.Pods](#payload-v1-Info-Pods) | | The pod information of the node. | - - - -### Info.Nodes - -Represent the multiple node information message. - -| Field | Type | Label | Description | -| ----- | ---------------------------------- | -------- | ------------------------------ | -| nodes | [Info.Node](#payload-v1-Info-Node) | repeated | The multiple node information. | - - - -### Info.Pod - -Represent the pod information message. - -| Field | Type | Label | Description | -| --------- | -------------------------------------- | ----- | ------------------------------------- | -| app_name | [string](#string) | | The app name of the pod on the label. | -| name | [string](#string) | | The name of the pod. | -| namespace | [string](#string) | | The namespace of the pod. | -| ip | [string](#string) | | The IP of the pod. | -| cpu | [Info.CPU](#payload-v1-Info-CPU) | | The CPU information of the pod. | -| memory | [Info.Memory](#payload-v1-Info-Memory) | | The memory information of the pod. | -| node | [Info.Node](#payload-v1-Info-Node) | | The node information of the pod. | - - - -### Info.Pods - -Represent the multiple pod information message. - -| Field | Type | Label | Description | -| ----- | -------------------------------- | -------- | ----------------------------- | -| pods | [Info.Pod](#payload-v1-Info-Pod) | repeated | The multiple pod information. | - - - -### Insert - -Insert related messages. - - - -### Insert.Config - -Represent insert configurations. - -| Field | Type | Label | Description | -| ----------------------- | ------------------------------------------ | ----- | --------------------------------------------------- | -| skip_strict_exist_check | [bool](#bool) | | A flag to skip exist check during insert operation. | -| filters | [Filter.Config](#payload-v1-Filter-Config) | | Filter configurations. | -| timestamp | [int64](#int64) | | Insert timestamp. | - - - -### Insert.MultiObjectRequest - -Represent the multiple insert by binary object request. - -| Field | Type | Label | Description | -| -------- | -------------------------------------------------------- | -------- | -------------------------------------------- | -| requests | [Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) | repeated | Represent multiple insert by object content. | - - - -### Insert.MultiRequest - -Represent the multiple insert request. - -| Field | Type | Label | Description | -| -------- | -------------------------------------------- | -------- | ------------------------------------------ | -| requests | [Insert.Request](#payload-v1-Insert-Request) | repeated | Represent multiple insert request content. | - - - -### Insert.ObjectRequest - -Represent the insert by binary object request. - -| Field | Type | Label | Description | -| ---------- | ------------------------------------------ | ----- | ---------------------------------------- | -| object | [Object.Blob](#payload-v1-Object-Blob) | | The binary object to be inserted. | -| config | [Insert.Config](#payload-v1-Insert-Config) | | The configuration of the insert request. | -| vectorizer | [Filter.Target](#payload-v1-Filter-Target) | | Filter configurations. | - - - -### Insert.Request - -Represent the insert request. - -| Field | Type | Label | Description | -| ------ | ------------------------------------------ | ----- | ---------------------------------------- | -| vector | [Object.Vector](#payload-v1-Object-Vector) | | The vector to be inserted. | -| config | [Insert.Config](#payload-v1-Insert-Config) | | The configuration of the insert request. | - - - -### Object - -Common messages. - - - -### Object.Blob +### Object.Blob Represent the binary object. @@ -1262,41 +1064,32 @@ AggregationAlgorithm is enum of each aggregation algorithms | SortPoolSlice | 3 | | | PairingHeap | 4 | | - +

    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/vald/filter.proto -## apis/proto/v1/vald/remove.proto + - +### Filter -### Remove +Filter service provides ways to connect to Vald through filter. -Remove service provides ways to remove indexed vectors. - -| Method Name | Request Type | Response Type | Description | -| ----------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| Remove | [.payload.v1.Remove.Request](#payload-v1-Remove-Request) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to remove an indexed vector. | -| RemoveByTimestamp | [.payload.v1.Remove.TimestampRequest](#payload-v1-Remove-TimestampRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to remove an indexed vector based on timestamp. | -| StreamRemove | [.payload.v1.Remove.Request](#payload-v1-Remove-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to remove multiple indexed vectors by bidirectional streaming. | -| MultiRemove | [.payload.v1.Remove.MultiRequest](#payload-v1-Remove-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to remove multiple indexed vectors in a single request. | +| Method Name | Request Type | Response Type | Description | +| ------------------ | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------ | +| SearchObject | [.payload.v1.Search.ObjectRequest](#payload-v1-Search-ObjectRequest) | [.payload.v1.Search.Response](#payload-v1-Search-Response) | A method to search object. | +| MultiSearchObject | [.payload.v1.Search.MultiObjectRequest](#payload-v1-Search-MultiObjectRequest) | [.payload.v1.Search.Responses](#payload-v1-Search-Responses) | A method to search multiple objects. | +| StreamSearchObject | [.payload.v1.Search.ObjectRequest](#payload-v1-Search-ObjectRequest) stream | [.payload.v1.Search.StreamResponse](#payload-v1-Search-StreamResponse) stream | A method to search object by bidirectional streaming. | +| InsertObject | [.payload.v1.Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method insert object. | +| StreamInsertObject | [.payload.v1.Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | Represent the streaming RPC to insert object by bidirectional streaming. | +| MultiInsertObject | [.payload.v1.Insert.MultiObjectRequest](#payload-v1-Insert-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to insert multiple objects. | +| UpdateObject | [.payload.v1.Update.ObjectRequest](#payload-v1-Update-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to update object. | +| StreamUpdateObject | [.payload.v1.Update.ObjectRequest](#payload-v1-Update-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to update object by bidirectional streaming. | +| MultiUpdateObject | [.payload.v1.Update.MultiObjectRequest](#payload-v1-Update-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to update multiple objects. | +| UpsertObject | [.payload.v1.Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to upsert object. | +| StreamUpsertObject | [.payload.v1.Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to upsert object by bidirectional streaming. | +| MultiUpsertObject | [.payload.v1.Upsert.MultiObjectRequest](#payload-v1-Upsert-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to upsert multiple objects. | @@ -1316,24 +1109,6 @@ Insert service provides ways to add new vectors. | StreamInsert | [.payload.v1.Insert.Request](#payload-v1-Insert-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to add new multiple vectors by bidirectional streaming. | | MultiInsert | [.payload.v1.Insert.MultiRequest](#payload-v1-Insert-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to add new multiple vectors 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

    @@ -1353,32 +1128,24 @@ Object service provides ways to fetch indexed vectors. | StreamGetObject | [.payload.v1.Object.VectorRequest](#payload-v1-Object-VectorRequest) stream | [.payload.v1.Object.StreamVector](#payload-v1-Object-StreamVector) stream | A method to fetch vectors by bidirectional streaming. | | StreamListObject | [.payload.v1.Object.List.Request](#payload-v1-Object-List-Request) | [.payload.v1.Object.List.Response](#payload-v1-Object-List-Response) stream | A method to get all the vectors with server streaming | - +

    Top

    -## apis/proto/v1/vald/filter.proto +## apis/proto/v1/vald/remove.proto - + -### Filter +### Remove -Filter service provides ways to connect to Vald through filter. +Remove service provides ways to remove indexed vectors. -| Method Name | Request Type | Response Type | Description | -| ------------------ | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -| SearchObject | [.payload.v1.Search.ObjectRequest](#payload-v1-Search-ObjectRequest) | [.payload.v1.Search.Response](#payload-v1-Search-Response) | A method to search object. | -| MultiSearchObject | [.payload.v1.Search.MultiObjectRequest](#payload-v1-Search-MultiObjectRequest) | [.payload.v1.Search.Responses](#payload-v1-Search-Responses) | A method to search multiple objects. | -| StreamSearchObject | [.payload.v1.Search.ObjectRequest](#payload-v1-Search-ObjectRequest) stream | [.payload.v1.Search.StreamResponse](#payload-v1-Search-StreamResponse) stream | A method to search object by bidirectional streaming. | -| InsertObject | [.payload.v1.Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method insert object. | -| StreamInsertObject | [.payload.v1.Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | Represent the streaming RPC to insert object by bidirectional streaming. | -| MultiInsertObject | [.payload.v1.Insert.MultiObjectRequest](#payload-v1-Insert-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to insert multiple objects. | -| UpdateObject | [.payload.v1.Update.ObjectRequest](#payload-v1-Update-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to update object. | -| StreamUpdateObject | [.payload.v1.Update.ObjectRequest](#payload-v1-Update-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to update object by bidirectional streaming. | -| MultiUpdateObject | [.payload.v1.Update.MultiObjectRequest](#payload-v1-Update-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to update multiple objects. | -| UpsertObject | [.payload.v1.Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to upsert object. | -| StreamUpsertObject | [.payload.v1.Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to upsert object by bidirectional streaming. | -| MultiUpsertObject | [.payload.v1.Upsert.MultiObjectRequest](#payload-v1-Upsert-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to upsert multiple objects. | +| Method Name | Request Type | Response Type | Description | +| ----------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| Remove | [.payload.v1.Remove.Request](#payload-v1-Remove-Request) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to remove an indexed vector. | +| RemoveByTimestamp | [.payload.v1.Remove.TimestampRequest](#payload-v1-Remove-TimestampRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to remove an indexed vector based on timestamp. | +| StreamRemove | [.payload.v1.Remove.Request](#payload-v1-Remove-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to remove multiple indexed vectors by bidirectional streaming. | +| MultiRemove | [.payload.v1.Remove.MultiRequest](#payload-v1-Remove-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to remove multiple indexed vectors in a single request. | @@ -1425,6 +1192,302 @@ Update service provides ways to update indexed vectors. | 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/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/rpc/error_details.proto + + + +### BadRequest + +Describes violations in a client request. This error type focuses on the +syntactic aspects of the request. + +| Field | Type | Label | Description | +| ---------------- | -------------------------------------------------------------- | -------- | --------------------------------------------- | +| field_violations | [BadRequest.FieldViolation](#rpc-v1-BadRequest-FieldViolation) | repeated | Describes all violations in a client request. | + + + +### BadRequest.FieldViolation + +A message type used to describe a single bad request field. + +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| field | [string](#string) | | A path that leads to a field in the request body. The value will be a sequence of dot-separated identifiers that identify a protocol buffer field. | + +Consider the following: + +message CreateContactRequest { message EmailAddress { enum Type { TYPE_UNSPECIFIED = 0; HOME = 1; WORK = 2; } + +optional string email = 1; repeated EmailType type = 2; } + +string full_name = 1; repeated EmailAddress email_addresses = 2; } + +In this example, in proto `field` could take one of the following values: + +- `full_name` for a violation in the `full_name` value _ `email_addresses[1].email` for a violation in the `email` field of the first `email_addresses` message _ `email_addresses[3].type[2]` for a violation in the second `type` value in the third `email_addresses` message. + +In JSON, the same values are represented as: + +- `fullName` for a violation in the `fullName` value _ `emailAddresses[1].email` for a violation in the `email` field of the first `emailAddresses` message _ `emailAddresses[3].type[2]` for a violation in the second `type` value in the third `emailAddresses` message. | + | description | [string](#string) | | A description of why the request element is bad. | + + + +### DebugInfo + +Describes additional debugging info. + +| Field | Type | Label | Description | +| ------------- | ----------------- | -------- | ------------------------------------------------------------ | +| stack_entries | [string](#string) | repeated | The stack trace entries indicating where the error occurred. | +| detail | [string](#string) | | Additional debugging information provided by the server. | + + + +### ErrorInfo + +Describes the cause of the error with structured details. + +Example of an error when contacting the "pubsub.googleapis.com" API when it +is not enabled: + + { "reason": "API_DISABLED" + "domain": "googleapis.com" + "metadata": { + "resource": "projects/123", + "service": "pubsub.googleapis.com" + } + } + +This response indicates that the pubsub.googleapis.com API is not enabled. + +Example of an error that is returned when attempting to create a Spanner +instance in a region that is out of stock: + + { "reason": "STOCKOUT" + "domain": "spanner.googleapis.com", + "metadata": { + "availableRegions": "us-central1,us-east2" + } + } + +| Field | Type | Label | Description | +| -------- | ---------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| reason | [string](#string) | | The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. | +| domain | [string](#string) | | The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". | +| metadata | [ErrorInfo.MetadataEntry](#rpc-v1-ErrorInfo-MetadataEntry) | repeated | Additional structured details about this error. | + +Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. | + + + +### ErrorInfo.MetadataEntry + +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | ----------- | +| key | [string](#string) | | | +| value | [string](#string) | | | + + + +### Help + +Provides links to documentation or for performing an out of band action. + +For example, if a quota check failed with an error indicating the calling +project hasn't enabled the accessed service, this can contain a URL pointing +directly to the right place in the developer console to flip the bit. + +| Field | Type | Label | Description | +| ----- | ------------------------------ | -------- | ------------------------------------------------------------------------ | +| links | [Help.Link](#rpc-v1-Help-Link) | repeated | URL(s) pointing to additional information on handling the current error. | + + + +### Help.Link + +Describes a URL link. + +| Field | Type | Label | Description | +| ----------- | ----------------- | ----- | ------------------------------- | +| description | [string](#string) | | Describes what the link offers. | +| url | [string](#string) | | The URL of the link. | + + + +### LocalizedMessage + +Provides a localized error message that is safe to return to the user +which can be attached to an RPC error. + +| Field | Type | Label | Description | +| ------- | ----------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| locale | [string](#string) | | The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX" | +| message | [string](#string) | | The localized error message in the above locale. | + + + +### PreconditionFailure + +Describes what preconditions have failed. + +For example, if an RPC failed because it required the Terms of Service to be +acknowledged, it could list the terms of service violation in the +PreconditionFailure message. + +| Field | Type | Label | Description | +| ---------- | ---------------------------------------------------------------------- | -------- | -------------------------------------- | +| violations | [PreconditionFailure.Violation](#rpc-v1-PreconditionFailure-Violation) | repeated | Describes all precondition violations. | + + + +### PreconditionFailure.Violation + +A message type used to describe a single precondition failure. + +| Field | Type | Label | Description | +| ----------- | ----------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | [string](#string) | | The type of PreconditionFailure. We recommend using a service-specific enum type to define the supported precondition violation subjects. For example, "TOS" for "Terms of Service violation". | +| subject | [string](#string) | | The subject, relative to the type, that failed. For example, "google.com/cloud" relative to the "TOS" type would indicate which terms of service is being referenced. | +| description | [string](#string) | | A description of how the precondition failed. Developers can use this description to understand how to fix the failure. | + +For example: "Terms of service not accepted". | + + + +### QuotaFailure + +Describes how a quota check failed. + +For example if a daily limit was exceeded for the calling project, +a service could respond with a QuotaFailure detail containing the project +id and the description of the quota limit that was exceeded. If the +calling project hasn't enabled the service in the developer console, then +a service could respond with the project id and set `service_disabled` +to true. + +Also see RetryInfo and Help types for other details about handling a +quota failure. + +| Field | Type | Label | Description | +| ---------- | -------------------------------------------------------- | -------- | ------------------------------- | +| violations | [QuotaFailure.Violation](#rpc-v1-QuotaFailure-Violation) | repeated | Describes all quota violations. | + + + +### QuotaFailure.Violation + +A message type used to describe a single quota violation. For example, a +daily quota or a custom quota that was exceeded. + +| Field | Type | Label | Description | +| ----------- | ----------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| subject | [string](#string) | | The subject on which the quota check failed. For example, "clientip:<ip address of client>" or "project:<Google developer project id>". | +| description | [string](#string) | | A description of how the quota check failed. Clients can use this description to find more about the quota configuration in the service's public documentation, or find the relevant quota limit to adjust through developer console. | + +For example: "Service disabled" or "Daily Limit for read operations exceeded". | + + + +### RequestInfo + +Contains metadata about the request that clients can attach when filing a bug +or providing other forms of feedback. + +| Field | Type | Label | Description | +| ------------ | ----------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| request_id | [string](#string) | | An opaque string that should only be interpreted by the service generating it. For example, it can be used to identify requests in the service's logs. | +| serving_data | [string](#string) | | Any data that was used to serve this request. For example, an encrypted stack trace that can be sent back to the service provider for debugging. | + + + +### ResourceInfo + +Describes the resource that is being accessed. + +| Field | Type | Label | Description | +| ------------- | ----------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| resource_type | [string](#string) | | A name for the type of resource being accessed, e.g. "sql table", "cloud storage bucket", "file", "Google calendar"; or the type URL of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". | +| resource_name | [string](#string) | | The name of the resource being accessed. For example, a shared calendar name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. | +| owner | [string](#string) | | The owner of the resource (optional). For example, "user:<owner email>" or "project:<Google developer project id>". | +| description | [string](#string) | | Describes what error is encountered when accessing this resource. For example, updating a cloud project may require the `writer` permission on the developer console project. | + + + +### RetryInfo + +Describes when the clients can retry a failed request. Clients could ignore +the recommendation here or retry when this information is missing from error +responses. + +It's always recommended that clients should use exponential backoff when +retrying. + +Clients should wait until `retry_delay` amount of time has passed since +receiving the error response before retrying. If retrying requests also +fail, clients should use an exponential backoff scheme to gradually increase +the delay between retries based on `retry_delay`, until either a maximum +number of retries have been reached or a maximum retry delay cap has been +reached. + +| Field | Type | Label | Description | +| ----------- | ----------------------------------------------------- | ----- | ------------------------------------------------------------------------- | +| retry_delay | [google.protobuf.Duration](#google-protobuf-Duration) | | Clients should wait at least this long between retrying the same request. | + + + +

    Top

    + +## apis/proto/v1/mirror/mirror.proto + +Copyright (C) 2019-2023 vdaas.org vald team <vald@vdaas.org> + +Licensed under the Apache License, Version 2.0 (the "License"); +You may not use this file except in compliance with the License. +You may obtain a copy of the License at + +https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + + +### Mirror + +Represent the mirror service. + +| Method Name | Request Type | Response Type | Description | +| ----------- | -------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------- | +| Register | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Register is the RPC to register other mirror servers. | +| Advertise | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Advertise is the RPC to advertise other mirror servers. | + ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/apis/grpc/v1/agent/core/agent.pb.go b/apis/grpc/v1/agent/core/agent.pb.go index 1a644a12d3..8e23c516db 100644 --- a/apis/grpc/v1/agent/core/agent.pb.go +++ b/apis/grpc/v1/agent/core/agent.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/agent/core/agent.proto package core diff --git a/apis/grpc/v1/agent/sidecar/sidecar.pb.go b/apis/grpc/v1/agent/sidecar/sidecar.pb.go index ca6b2cba93..cb3e0113ed 100644 --- a/apis/grpc/v1/agent/sidecar/sidecar.pb.go +++ b/apis/grpc/v1/agent/sidecar/sidecar.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/agent/sidecar/sidecar.proto package sidecar diff --git a/apis/grpc/v1/discoverer/discoverer.pb.go b/apis/grpc/v1/discoverer/discoverer.pb.go index 6afe527031..20e34451c4 100644 --- a/apis/grpc/v1/discoverer/discoverer.pb.go +++ b/apis/grpc/v1/discoverer/discoverer.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/discoverer/discoverer.proto 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 0bbfce5f77..d6ecb8f1ef 100644 --- a/apis/grpc/v1/filter/egress/egress_filter.pb.go +++ b/apis/grpc/v1/filter/egress/egress_filter.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/filter/egress/egress_filter.proto 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 9cbaa9af3b..7a6dff2af9 100644 --- a/apis/grpc/v1/filter/ingress/ingress_filter.pb.go +++ b/apis/grpc/v1/filter/ingress/ingress_filter.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/filter/ingress/ingress_filter.proto 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 7c03f50043..68dd5700d0 100644 --- a/apis/grpc/v1/manager/index/index_manager.pb.go +++ b/apis/grpc/v1/manager/index/index_manager.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/manager/index/index_manager.proto package index diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index 5488814a40..0a45dfc725 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/mirror/mirror.proto package mirror diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index 1bf72db76b..b394f9fd9a 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/payload/payload.proto package payload @@ -551,6 +551,45 @@ func (*Info) Descriptor() ([]byte, []int) { return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{9} } +// Mirror related messages. +type Mirror struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Mirror) Reset() { + *x = Mirror{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror) ProtoMessage() {} + +func (x *Mirror) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + 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 Mirror.ProtoReflect.Descriptor instead. +func (*Mirror) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10} +} + // Represent an empty message. type Empty struct { state protoimpl.MessageState @@ -561,7 +600,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -574,7 +613,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -587,7 +626,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10} + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{11} } // Represent a search request. @@ -605,7 +644,7 @@ type Search_Request struct { func (x *Search_Request) Reset() { *x = Search_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -618,7 +657,7 @@ func (x *Search_Request) String() string { func (*Search_Request) ProtoMessage() {} func (x *Search_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -661,7 +700,7 @@ type Search_MultiRequest struct { func (x *Search_MultiRequest) Reset() { *x = Search_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -674,7 +713,7 @@ func (x *Search_MultiRequest) String() string { func (*Search_MultiRequest) ProtoMessage() {} func (x *Search_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -712,7 +751,7 @@ type Search_IDRequest struct { func (x *Search_IDRequest) Reset() { *x = Search_IDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -725,7 +764,7 @@ func (x *Search_IDRequest) String() string { func (*Search_IDRequest) ProtoMessage() {} func (x *Search_IDRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -768,7 +807,7 @@ type Search_MultiIDRequest struct { func (x *Search_MultiIDRequest) Reset() { *x = Search_MultiIDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -781,7 +820,7 @@ func (x *Search_MultiIDRequest) String() string { func (*Search_MultiIDRequest) ProtoMessage() {} func (x *Search_MultiIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -821,7 +860,7 @@ type Search_ObjectRequest struct { func (x *Search_ObjectRequest) Reset() { *x = Search_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -834,7 +873,7 @@ func (x *Search_ObjectRequest) String() string { func (*Search_ObjectRequest) ProtoMessage() {} func (x *Search_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -884,7 +923,7 @@ type Search_MultiObjectRequest struct { func (x *Search_MultiObjectRequest) Reset() { *x = Search_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -897,7 +936,7 @@ func (x *Search_MultiObjectRequest) String() string { func (*Search_MultiObjectRequest) ProtoMessage() {} func (x *Search_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -949,7 +988,7 @@ type Search_Config struct { func (x *Search_Config) Reset() { *x = Search_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -962,7 +1001,7 @@ func (x *Search_Config) String() string { func (*Search_Config) ProtoMessage() {} func (x *Search_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1056,7 +1095,7 @@ type Search_Response struct { func (x *Search_Response) Reset() { *x = Search_Response{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1069,7 +1108,7 @@ func (x *Search_Response) String() string { func (*Search_Response) ProtoMessage() {} func (x *Search_Response) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1112,7 +1151,7 @@ type Search_Responses struct { func (x *Search_Responses) Reset() { *x = Search_Responses{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1125,7 +1164,7 @@ func (x *Search_Responses) String() string { func (*Search_Responses) ProtoMessage() {} func (x *Search_Responses) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1164,7 +1203,7 @@ type Search_StreamResponse struct { func (x *Search_StreamResponse) Reset() { *x = Search_StreamResponse{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1177,7 +1216,7 @@ func (x *Search_StreamResponse) String() string { func (*Search_StreamResponse) ProtoMessage() {} func (x *Search_StreamResponse) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1247,7 +1286,7 @@ type Filter_Target struct { func (x *Filter_Target) Reset() { *x = Filter_Target{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1260,7 +1299,7 @@ func (x *Filter_Target) String() string { func (*Filter_Target) ProtoMessage() {} func (x *Filter_Target) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1303,7 +1342,7 @@ type Filter_Config struct { func (x *Filter_Config) Reset() { *x = Filter_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1316,7 +1355,7 @@ func (x *Filter_Config) String() string { func (*Filter_Config) ProtoMessage() {} func (x *Filter_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1354,7 +1393,7 @@ type Insert_Request struct { func (x *Insert_Request) Reset() { *x = Insert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1367,7 +1406,7 @@ func (x *Insert_Request) String() string { func (*Insert_Request) ProtoMessage() {} func (x *Insert_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1410,7 +1449,7 @@ type Insert_MultiRequest struct { func (x *Insert_MultiRequest) Reset() { *x = Insert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1423,7 +1462,7 @@ func (x *Insert_MultiRequest) String() string { func (*Insert_MultiRequest) ProtoMessage() {} func (x *Insert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1463,7 +1502,7 @@ type Insert_ObjectRequest struct { func (x *Insert_ObjectRequest) Reset() { *x = Insert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1476,7 +1515,7 @@ func (x *Insert_ObjectRequest) String() string { func (*Insert_ObjectRequest) ProtoMessage() {} func (x *Insert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1526,7 +1565,7 @@ type Insert_MultiObjectRequest struct { func (x *Insert_MultiObjectRequest) Reset() { *x = Insert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1539,7 +1578,7 @@ func (x *Insert_MultiObjectRequest) String() string { func (*Insert_MultiObjectRequest) ProtoMessage() {} func (x *Insert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1579,7 +1618,7 @@ type Insert_Config struct { func (x *Insert_Config) Reset() { *x = Insert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1592,7 +1631,7 @@ func (x *Insert_Config) String() string { func (*Insert_Config) ProtoMessage() {} func (x *Insert_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1644,7 +1683,7 @@ type Update_Request struct { func (x *Update_Request) Reset() { *x = Update_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1657,7 +1696,7 @@ func (x *Update_Request) String() string { func (*Update_Request) ProtoMessage() {} func (x *Update_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1700,7 +1739,7 @@ type Update_MultiRequest struct { func (x *Update_MultiRequest) Reset() { *x = Update_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1713,7 +1752,7 @@ func (x *Update_MultiRequest) String() string { func (*Update_MultiRequest) ProtoMessage() {} func (x *Update_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1753,7 +1792,7 @@ type Update_ObjectRequest struct { func (x *Update_ObjectRequest) Reset() { *x = Update_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1766,7 +1805,7 @@ func (x *Update_ObjectRequest) String() string { func (*Update_ObjectRequest) ProtoMessage() {} func (x *Update_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1816,7 +1855,7 @@ type Update_MultiObjectRequest struct { func (x *Update_MultiObjectRequest) Reset() { *x = Update_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1829,7 +1868,7 @@ func (x *Update_MultiObjectRequest) String() string { func (*Update_MultiObjectRequest) ProtoMessage() {} func (x *Update_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1872,7 +1911,7 @@ type Update_Config struct { func (x *Update_Config) Reset() { *x = Update_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1885,7 +1924,7 @@ func (x *Update_Config) String() string { func (*Update_Config) ProtoMessage() {} func (x *Update_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1944,7 +1983,7 @@ type Upsert_Request struct { func (x *Upsert_Request) Reset() { *x = Upsert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1957,7 +1996,7 @@ func (x *Upsert_Request) String() string { func (*Upsert_Request) ProtoMessage() {} func (x *Upsert_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2000,7 +2039,7 @@ type Upsert_MultiRequest struct { func (x *Upsert_MultiRequest) Reset() { *x = Upsert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2013,7 +2052,7 @@ func (x *Upsert_MultiRequest) String() string { func (*Upsert_MultiRequest) ProtoMessage() {} func (x *Upsert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2053,7 +2092,7 @@ type Upsert_ObjectRequest struct { func (x *Upsert_ObjectRequest) Reset() { *x = Upsert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2066,7 +2105,7 @@ func (x *Upsert_ObjectRequest) String() string { func (*Upsert_ObjectRequest) ProtoMessage() {} func (x *Upsert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2116,7 +2155,7 @@ type Upsert_MultiObjectRequest struct { func (x *Upsert_MultiObjectRequest) Reset() { *x = Upsert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2129,7 +2168,7 @@ func (x *Upsert_MultiObjectRequest) String() string { func (*Upsert_MultiObjectRequest) ProtoMessage() {} func (x *Upsert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2172,7 +2211,7 @@ type Upsert_Config struct { func (x *Upsert_Config) Reset() { *x = Upsert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2185,7 +2224,7 @@ func (x *Upsert_Config) String() string { func (*Upsert_Config) ProtoMessage() {} func (x *Upsert_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2244,7 +2283,7 @@ type Remove_Request struct { func (x *Remove_Request) Reset() { *x = Remove_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2257,7 +2296,7 @@ func (x *Remove_Request) String() string { func (*Remove_Request) ProtoMessage() {} func (x *Remove_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2300,7 +2339,7 @@ type Remove_MultiRequest struct { func (x *Remove_MultiRequest) Reset() { *x = Remove_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2313,7 +2352,7 @@ func (x *Remove_MultiRequest) String() string { func (*Remove_MultiRequest) ProtoMessage() {} func (x *Remove_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2349,7 +2388,7 @@ type Remove_TimestampRequest struct { func (x *Remove_TimestampRequest) Reset() { *x = Remove_TimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2362,7 +2401,7 @@ func (x *Remove_TimestampRequest) String() string { func (*Remove_TimestampRequest) ProtoMessage() {} func (x *Remove_TimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2400,7 +2439,7 @@ type Remove_Timestamp struct { func (x *Remove_Timestamp) Reset() { *x = Remove_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2413,7 +2452,7 @@ func (x *Remove_Timestamp) String() string { func (*Remove_Timestamp) ProtoMessage() {} func (x *Remove_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2458,7 +2497,7 @@ type Remove_Config struct { func (x *Remove_Config) Reset() { *x = Remove_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2471,7 +2510,7 @@ func (x *Remove_Config) String() string { func (*Remove_Config) ProtoMessage() {} func (x *Remove_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2516,7 +2555,7 @@ type Object_VectorRequest struct { func (x *Object_VectorRequest) Reset() { *x = Object_VectorRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2529,7 +2568,7 @@ func (x *Object_VectorRequest) String() string { func (*Object_VectorRequest) ProtoMessage() {} func (x *Object_VectorRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2574,7 +2613,7 @@ type Object_Distance struct { func (x *Object_Distance) Reset() { *x = Object_Distance{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2587,7 +2626,7 @@ func (x *Object_Distance) String() string { func (*Object_Distance) ProtoMessage() {} func (x *Object_Distance) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2633,7 +2672,7 @@ type Object_StreamDistance struct { func (x *Object_StreamDistance) Reset() { *x = Object_StreamDistance{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2646,7 +2685,7 @@ func (x *Object_StreamDistance) String() string { func (*Object_StreamDistance) ProtoMessage() {} func (x *Object_StreamDistance) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2713,7 +2752,7 @@ type Object_ID struct { func (x *Object_ID) Reset() { *x = Object_ID{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2726,7 +2765,7 @@ func (x *Object_ID) String() string { func (*Object_ID) ProtoMessage() {} func (x *Object_ID) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2761,7 +2800,7 @@ type Object_IDs struct { func (x *Object_IDs) Reset() { *x = Object_IDs{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2774,7 +2813,7 @@ func (x *Object_IDs) String() string { func (*Object_IDs) ProtoMessage() {} func (x *Object_IDs) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2814,7 +2853,7 @@ type Object_Vector struct { func (x *Object_Vector) Reset() { *x = Object_Vector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2827,7 +2866,7 @@ func (x *Object_Vector) String() string { func (*Object_Vector) ProtoMessage() {} func (x *Object_Vector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2877,7 +2916,7 @@ type Object_GetTimestampRequest struct { func (x *Object_GetTimestampRequest) Reset() { *x = Object_GetTimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2890,7 +2929,7 @@ func (x *Object_GetTimestampRequest) String() string { func (*Object_GetTimestampRequest) ProtoMessage() {} func (x *Object_GetTimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2928,7 +2967,7 @@ type Object_Timestamp struct { func (x *Object_Timestamp) Reset() { *x = Object_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2941,7 +2980,7 @@ func (x *Object_Timestamp) String() string { func (*Object_Timestamp) ProtoMessage() {} func (x *Object_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2983,7 +3022,7 @@ type Object_Vectors struct { func (x *Object_Vectors) Reset() { *x = Object_Vectors{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2996,7 +3035,7 @@ func (x *Object_Vectors) String() string { func (*Object_Vectors) ProtoMessage() {} func (x *Object_Vectors) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3035,7 +3074,7 @@ type Object_StreamVector struct { func (x *Object_StreamVector) Reset() { *x = Object_StreamVector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3048,7 +3087,7 @@ func (x *Object_StreamVector) String() string { func (*Object_StreamVector) ProtoMessage() {} func (x *Object_StreamVector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3118,7 +3157,7 @@ type Object_ReshapeVector struct { func (x *Object_ReshapeVector) Reset() { *x = Object_ReshapeVector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3131,7 +3170,7 @@ func (x *Object_ReshapeVector) String() string { func (*Object_ReshapeVector) ProtoMessage() {} func (x *Object_ReshapeVector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3176,7 +3215,7 @@ type Object_Blob struct { func (x *Object_Blob) Reset() { *x = Object_Blob{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3189,7 +3228,7 @@ func (x *Object_Blob) String() string { func (*Object_Blob) ProtoMessage() {} func (x *Object_Blob) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3235,7 +3274,7 @@ type Object_StreamBlob struct { func (x *Object_StreamBlob) Reset() { *x = Object_StreamBlob{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3248,7 +3287,7 @@ func (x *Object_StreamBlob) String() string { func (*Object_StreamBlob) ProtoMessage() {} func (x *Object_StreamBlob) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3320,7 +3359,7 @@ type Object_Location struct { func (x *Object_Location) Reset() { *x = Object_Location{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3333,7 +3372,7 @@ func (x *Object_Location) String() string { func (*Object_Location) ProtoMessage() {} func (x *Object_Location) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3386,7 +3425,7 @@ type Object_StreamLocation struct { func (x *Object_StreamLocation) Reset() { *x = Object_StreamLocation{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3399,7 +3438,7 @@ func (x *Object_StreamLocation) String() string { func (*Object_StreamLocation) ProtoMessage() {} func (x *Object_StreamLocation) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3466,7 +3505,7 @@ type Object_Locations struct { func (x *Object_Locations) Reset() { *x = Object_Locations{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3479,7 +3518,7 @@ func (x *Object_Locations) String() string { func (*Object_Locations) ProtoMessage() {} func (x *Object_Locations) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3512,7 +3551,7 @@ type Object_List struct { func (x *Object_List) Reset() { *x = Object_List{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3525,7 +3564,7 @@ func (x *Object_List) String() string { func (*Object_List) ProtoMessage() {} func (x *Object_List) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3550,7 +3589,7 @@ type Object_List_Request struct { func (x *Object_List_Request) Reset() { *x = Object_List_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3563,7 +3602,7 @@ func (x *Object_List_Request) String() string { func (*Object_List_Request) ProtoMessage() {} func (x *Object_List_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3594,7 +3633,7 @@ type Object_List_Response struct { func (x *Object_List_Response) Reset() { *x = Object_List_Response{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3607,7 +3646,7 @@ func (x *Object_List_Response) String() string { func (*Object_List_Response) ProtoMessage() {} func (x *Object_List_Response) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3675,7 +3714,7 @@ type Control_CreateIndexRequest struct { func (x *Control_CreateIndexRequest) Reset() { *x = Control_CreateIndexRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3688,7 +3727,7 @@ func (x *Control_CreateIndexRequest) String() string { func (*Control_CreateIndexRequest) ProtoMessage() {} func (x *Control_CreateIndexRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3728,7 +3767,7 @@ type Discoverer_Request struct { func (x *Discoverer_Request) Reset() { *x = Discoverer_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3741,7 +3780,7 @@ func (x *Discoverer_Request) String() string { func (*Discoverer_Request) ProtoMessage() {} func (x *Discoverer_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3788,7 +3827,7 @@ type Info_Index struct { func (x *Info_Index) Reset() { *x = Info_Index{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3801,7 +3840,7 @@ func (x *Info_Index) String() string { func (*Info_Index) ProtoMessage() {} func (x *Info_Index) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3842,7 +3881,7 @@ type Info_Pod struct { func (x *Info_Pod) Reset() { *x = Info_Pod{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3855,7 +3894,7 @@ func (x *Info_Pod) String() string { func (*Info_Pod) ProtoMessage() {} func (x *Info_Pod) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3943,7 +3982,7 @@ type Info_Node struct { func (x *Info_Node) Reset() { *x = Info_Node{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3956,7 +3995,7 @@ func (x *Info_Node) String() string { func (*Info_Node) ProtoMessage() {} func (x *Info_Node) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4031,7 +4070,7 @@ type Info_CPU struct { func (x *Info_CPU) Reset() { *x = Info_CPU{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4044,7 +4083,7 @@ func (x *Info_CPU) String() string { func (*Info_CPU) ProtoMessage() {} func (x *Info_CPU) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4098,7 +4137,7 @@ type Info_Memory struct { func (x *Info_Memory) Reset() { *x = Info_Memory{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4111,7 +4150,7 @@ func (x *Info_Memory) String() string { func (*Info_Memory) ProtoMessage() {} func (x *Info_Memory) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4161,7 +4200,7 @@ type Info_Pods struct { func (x *Info_Pods) Reset() { *x = Info_Pods{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4174,7 +4213,7 @@ func (x *Info_Pods) String() string { func (*Info_Pods) ProtoMessage() {} func (x *Info_Pods) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4210,7 +4249,7 @@ type Info_Nodes struct { func (x *Info_Nodes) Reset() { *x = Info_Nodes{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4223,7 +4262,7 @@ func (x *Info_Nodes) String() string { func (*Info_Nodes) ProtoMessage() {} func (x *Info_Nodes) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] + 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 { @@ -4258,7 +4297,7 @@ type Info_IPs struct { func (x *Info_IPs) Reset() { *x = Info_IPs{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4271,7 +4310,7 @@ func (x *Info_IPs) String() string { func (*Info_IPs) ProtoMessage() {} func (x *Info_IPs) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4313,7 +4352,7 @@ type Info_Index_Count struct { func (x *Info_Index_Count) Reset() { *x = Info_Index_Count{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4326,7 +4365,7 @@ func (x *Info_Index_Count) String() string { func (*Info_Index_Count) ProtoMessage() {} func (x *Info_Index_Count) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4380,7 +4419,7 @@ type Info_Index_UUID struct { func (x *Info_Index_UUID) Reset() { *x = Info_Index_UUID{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4393,7 +4432,7 @@ func (x *Info_Index_UUID) String() string { func (*Info_Index_UUID) ProtoMessage() {} func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4421,7 +4460,7 @@ type Info_Index_UUID_Committed struct { func (x *Info_Index_UUID_Committed) Reset() { *x = Info_Index_UUID_Committed{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4434,7 +4473,7 @@ func (x *Info_Index_UUID_Committed) String() string { func (*Info_Index_UUID_Committed) ProtoMessage() {} func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4469,7 +4508,7 @@ type Info_Index_UUID_Uncommitted struct { func (x *Info_Index_UUID_Uncommitted) Reset() { *x = Info_Index_UUID_Uncommitted{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4482,7 +4521,7 @@ func (x *Info_Index_UUID_Uncommitted) String() string { func (*Info_Index_UUID_Uncommitted) ProtoMessage() {} func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4505,6 +4544,113 @@ func (x *Info_Index_UUID_Uncommitted) GetUuid() string { return "" } +// Represent server information. +type Mirror_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The target hostname. + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + // The target port. + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *Mirror_Target) Reset() { + *x = Mirror_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Target) ProtoMessage() {} + +func (x *Mirror_Target) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[77] + 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 Mirror_Target.ProtoReflect.Descriptor instead. +func (*Mirror_Target) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *Mirror_Target) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Mirror_Target) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +// Represent the multiple Target message. +type Mirror_Targets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The multiple target information. + Targets []*Mirror_Target `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *Mirror_Targets) Reset() { + *x = Mirror_Targets{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Targets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Targets) ProtoMessage() {} + +func (x *Mirror_Targets) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[78] + 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 Mirror_Targets.ProtoReflect.Descriptor instead. +func (*Mirror_Targets) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10, 1} +} + +func (x *Mirror_Targets) GetTargets() []*Mirror_Target { + if x != nil { + return x.Targets + } + return nil +} + var File_apis_proto_v1_payload_payload_proto protoreflect.FileDescriptor var file_apis_proto_v1_payload_payload_proto_rawDesc = []byte{ @@ -4940,14 +5086,22 @@ var file_apis_proto_v1_payload_payload_proto_rawDesc = []byte{ 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, + 0x02, 0x69, 0x70, 0x22, 0x7a, 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x30, 0x0a, + 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, + 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, + 0x3e, 0x0a, 0x07, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 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, } var ( @@ -4963,7 +5117,7 @@ func file_apis_proto_v1_payload_payload_proto_rawDescGZIP() []byte { } 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_msgTypes = make([]protoimpl.MessageInfo, 79) var file_apis_proto_v1_payload_payload_proto_goTypes = []interface{}{ (Search_AggregationAlgorithm)(0), // 0: payload.v1.Search.AggregationAlgorithm (Remove_Timestamp_Operator)(0), // 1: payload.v1.Remove.Timestamp.Operator @@ -4977,147 +5131,151 @@ var file_apis_proto_v1_payload_payload_proto_goTypes = []interface{}{ (*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_GetTimestampRequest)(nil), // 51: payload.v1.Object.GetTimestampRequest - (*Object_Timestamp)(nil), // 52: payload.v1.Object.Timestamp - (*Object_Vectors)(nil), // 53: payload.v1.Object.Vectors - (*Object_StreamVector)(nil), // 54: payload.v1.Object.StreamVector - (*Object_ReshapeVector)(nil), // 55: payload.v1.Object.ReshapeVector - (*Object_Blob)(nil), // 56: payload.v1.Object.Blob - (*Object_StreamBlob)(nil), // 57: payload.v1.Object.StreamBlob - (*Object_Location)(nil), // 58: payload.v1.Object.Location - (*Object_StreamLocation)(nil), // 59: payload.v1.Object.StreamLocation - (*Object_Locations)(nil), // 60: payload.v1.Object.Locations - (*Object_List)(nil), // 61: payload.v1.Object.List - (*Object_List_Request)(nil), // 62: payload.v1.Object.List.Request - (*Object_List_Response)(nil), // 63: payload.v1.Object.List.Response - (*Control_CreateIndexRequest)(nil), // 64: payload.v1.Control.CreateIndexRequest - (*Discoverer_Request)(nil), // 65: payload.v1.Discoverer.Request - (*Info_Index)(nil), // 66: payload.v1.Info.Index - (*Info_Pod)(nil), // 67: payload.v1.Info.Pod - (*Info_Node)(nil), // 68: payload.v1.Info.Node - (*Info_CPU)(nil), // 69: payload.v1.Info.CPU - (*Info_Memory)(nil), // 70: payload.v1.Info.Memory - (*Info_Pods)(nil), // 71: payload.v1.Info.Pods - (*Info_Nodes)(nil), // 72: payload.v1.Info.Nodes - (*Info_IPs)(nil), // 73: payload.v1.Info.IPs - (*Info_Index_Count)(nil), // 74: payload.v1.Info.Index.Count - (*Info_Index_UUID)(nil), // 75: payload.v1.Info.Index.UUID - (*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 + (*Mirror)(nil), // 12: payload.v1.Mirror + (*Empty)(nil), // 13: payload.v1.Empty + (*Search_Request)(nil), // 14: payload.v1.Search.Request + (*Search_MultiRequest)(nil), // 15: payload.v1.Search.MultiRequest + (*Search_IDRequest)(nil), // 16: payload.v1.Search.IDRequest + (*Search_MultiIDRequest)(nil), // 17: payload.v1.Search.MultiIDRequest + (*Search_ObjectRequest)(nil), // 18: payload.v1.Search.ObjectRequest + (*Search_MultiObjectRequest)(nil), // 19: payload.v1.Search.MultiObjectRequest + (*Search_Config)(nil), // 20: payload.v1.Search.Config + (*Search_Response)(nil), // 21: payload.v1.Search.Response + (*Search_Responses)(nil), // 22: payload.v1.Search.Responses + (*Search_StreamResponse)(nil), // 23: payload.v1.Search.StreamResponse + (*Filter_Target)(nil), // 24: payload.v1.Filter.Target + (*Filter_Config)(nil), // 25: payload.v1.Filter.Config + (*Insert_Request)(nil), // 26: payload.v1.Insert.Request + (*Insert_MultiRequest)(nil), // 27: payload.v1.Insert.MultiRequest + (*Insert_ObjectRequest)(nil), // 28: payload.v1.Insert.ObjectRequest + (*Insert_MultiObjectRequest)(nil), // 29: payload.v1.Insert.MultiObjectRequest + (*Insert_Config)(nil), // 30: payload.v1.Insert.Config + (*Update_Request)(nil), // 31: payload.v1.Update.Request + (*Update_MultiRequest)(nil), // 32: payload.v1.Update.MultiRequest + (*Update_ObjectRequest)(nil), // 33: payload.v1.Update.ObjectRequest + (*Update_MultiObjectRequest)(nil), // 34: payload.v1.Update.MultiObjectRequest + (*Update_Config)(nil), // 35: payload.v1.Update.Config + (*Upsert_Request)(nil), // 36: payload.v1.Upsert.Request + (*Upsert_MultiRequest)(nil), // 37: payload.v1.Upsert.MultiRequest + (*Upsert_ObjectRequest)(nil), // 38: payload.v1.Upsert.ObjectRequest + (*Upsert_MultiObjectRequest)(nil), // 39: payload.v1.Upsert.MultiObjectRequest + (*Upsert_Config)(nil), // 40: payload.v1.Upsert.Config + (*Remove_Request)(nil), // 41: payload.v1.Remove.Request + (*Remove_MultiRequest)(nil), // 42: payload.v1.Remove.MultiRequest + (*Remove_TimestampRequest)(nil), // 43: payload.v1.Remove.TimestampRequest + (*Remove_Timestamp)(nil), // 44: payload.v1.Remove.Timestamp + (*Remove_Config)(nil), // 45: payload.v1.Remove.Config + (*Object_VectorRequest)(nil), // 46: payload.v1.Object.VectorRequest + (*Object_Distance)(nil), // 47: payload.v1.Object.Distance + (*Object_StreamDistance)(nil), // 48: payload.v1.Object.StreamDistance + (*Object_ID)(nil), // 49: payload.v1.Object.ID + (*Object_IDs)(nil), // 50: payload.v1.Object.IDs + (*Object_Vector)(nil), // 51: payload.v1.Object.Vector + (*Object_GetTimestampRequest)(nil), // 52: payload.v1.Object.GetTimestampRequest + (*Object_Timestamp)(nil), // 53: payload.v1.Object.Timestamp + (*Object_Vectors)(nil), // 54: payload.v1.Object.Vectors + (*Object_StreamVector)(nil), // 55: payload.v1.Object.StreamVector + (*Object_ReshapeVector)(nil), // 56: payload.v1.Object.ReshapeVector + (*Object_Blob)(nil), // 57: payload.v1.Object.Blob + (*Object_StreamBlob)(nil), // 58: payload.v1.Object.StreamBlob + (*Object_Location)(nil), // 59: payload.v1.Object.Location + (*Object_StreamLocation)(nil), // 60: payload.v1.Object.StreamLocation + (*Object_Locations)(nil), // 61: payload.v1.Object.Locations + (*Object_List)(nil), // 62: payload.v1.Object.List + (*Object_List_Request)(nil), // 63: payload.v1.Object.List.Request + (*Object_List_Response)(nil), // 64: payload.v1.Object.List.Response + (*Control_CreateIndexRequest)(nil), // 65: payload.v1.Control.CreateIndexRequest + (*Discoverer_Request)(nil), // 66: payload.v1.Discoverer.Request + (*Info_Index)(nil), // 67: payload.v1.Info.Index + (*Info_Pod)(nil), // 68: payload.v1.Info.Pod + (*Info_Node)(nil), // 69: payload.v1.Info.Node + (*Info_CPU)(nil), // 70: payload.v1.Info.CPU + (*Info_Memory)(nil), // 71: payload.v1.Info.Memory + (*Info_Pods)(nil), // 72: payload.v1.Info.Pods + (*Info_Nodes)(nil), // 73: payload.v1.Info.Nodes + (*Info_IPs)(nil), // 74: payload.v1.Info.IPs + (*Info_Index_Count)(nil), // 75: payload.v1.Info.Index.Count + (*Info_Index_UUID)(nil), // 76: payload.v1.Info.Index.UUID + (*Info_Index_UUID_Committed)(nil), // 77: payload.v1.Info.Index.UUID.Committed + (*Info_Index_UUID_Uncommitted)(nil), // 78: payload.v1.Info.Index.UUID.Uncommitted + (*Mirror_Target)(nil), // 79: payload.v1.Mirror.Target + (*Mirror_Targets)(nil), // 80: payload.v1.Mirror.Targets + (*status.Status)(nil), // 81: google.rpc.Status } var file_apis_proto_v1_payload_payload_proto_depIdxs = []int32{ - 19, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config - 13, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request - 19, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config - 15, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest - 19, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config - 23, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target - 17, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest - 24, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config - 24, // 8: payload.v1.Search.Config.egress_filters:type_name -> payload.v1.Filter.Config + 20, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config + 14, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request + 20, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config + 16, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest + 20, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config + 24, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 18, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest + 25, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config + 25, // 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 - 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 - 56, // 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 - 56, // 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 - 56, // 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 + 47, // 10: payload.v1.Search.Response.results:type_name -> payload.v1.Object.Distance + 21, // 11: payload.v1.Search.Responses.responses:type_name -> payload.v1.Search.Response + 21, // 12: payload.v1.Search.StreamResponse.response:type_name -> payload.v1.Search.Response + 81, // 13: payload.v1.Search.StreamResponse.status:type_name -> google.rpc.Status + 24, // 14: payload.v1.Filter.Config.targets:type_name -> payload.v1.Filter.Target + 51, // 15: payload.v1.Insert.Request.vector:type_name -> payload.v1.Object.Vector + 30, // 16: payload.v1.Insert.Request.config:type_name -> payload.v1.Insert.Config + 26, // 17: payload.v1.Insert.MultiRequest.requests:type_name -> payload.v1.Insert.Request + 57, // 18: payload.v1.Insert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 30, // 19: payload.v1.Insert.ObjectRequest.config:type_name -> payload.v1.Insert.Config + 24, // 20: payload.v1.Insert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 28, // 21: payload.v1.Insert.MultiObjectRequest.requests:type_name -> payload.v1.Insert.ObjectRequest + 25, // 22: payload.v1.Insert.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 23: payload.v1.Update.Request.vector:type_name -> payload.v1.Object.Vector + 35, // 24: payload.v1.Update.Request.config:type_name -> payload.v1.Update.Config + 31, // 25: payload.v1.Update.MultiRequest.requests:type_name -> payload.v1.Update.Request + 57, // 26: payload.v1.Update.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 35, // 27: payload.v1.Update.ObjectRequest.config:type_name -> payload.v1.Update.Config + 24, // 28: payload.v1.Update.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 33, // 29: payload.v1.Update.MultiObjectRequest.requests:type_name -> payload.v1.Update.ObjectRequest + 25, // 30: payload.v1.Update.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 31: payload.v1.Upsert.Request.vector:type_name -> payload.v1.Object.Vector + 40, // 32: payload.v1.Upsert.Request.config:type_name -> payload.v1.Upsert.Config + 36, // 33: payload.v1.Upsert.MultiRequest.requests:type_name -> payload.v1.Upsert.Request + 57, // 34: payload.v1.Upsert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 40, // 35: payload.v1.Upsert.ObjectRequest.config:type_name -> payload.v1.Upsert.Config + 24, // 36: payload.v1.Upsert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 38, // 37: payload.v1.Upsert.MultiObjectRequest.requests:type_name -> payload.v1.Upsert.ObjectRequest + 25, // 38: payload.v1.Upsert.Config.filters:type_name -> payload.v1.Filter.Config + 49, // 39: payload.v1.Remove.Request.id:type_name -> payload.v1.Object.ID + 45, // 40: payload.v1.Remove.Request.config:type_name -> payload.v1.Remove.Config + 41, // 41: payload.v1.Remove.MultiRequest.requests:type_name -> payload.v1.Remove.Request + 44, // 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 - 48, // 48: payload.v1.Object.GetTimestampRequest.id:type_name -> payload.v1.Object.ID - 50, // 49: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector - 50, // 50: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector - 78, // 51: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status - 56, // 52: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob - 78, // 53: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status - 58, // 54: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location - 78, // 55: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status - 58, // 56: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location - 50, // 57: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector - 78, // 58: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status - 69, // 59: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU - 70, // 60: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory - 68, // 61: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node - 69, // 62: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU - 70, // 63: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory - 71, // 64: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods - 67, // 65: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod - 68, // 66: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node - 67, // [67:67] is the sub-list for method output_type - 67, // [67:67] is the sub-list for method input_type - 67, // [67:67] is the sub-list for extension type_name - 67, // [67:67] is the sub-list for extension extendee - 0, // [0:67] is the sub-list for field type_name + 49, // 44: payload.v1.Object.VectorRequest.id:type_name -> payload.v1.Object.ID + 25, // 45: payload.v1.Object.VectorRequest.filters:type_name -> payload.v1.Filter.Config + 47, // 46: payload.v1.Object.StreamDistance.distance:type_name -> payload.v1.Object.Distance + 81, // 47: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status + 49, // 48: payload.v1.Object.GetTimestampRequest.id:type_name -> payload.v1.Object.ID + 51, // 49: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector + 51, // 50: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector + 81, // 51: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status + 57, // 52: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob + 81, // 53: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status + 59, // 54: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location + 81, // 55: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status + 59, // 56: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location + 51, // 57: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector + 81, // 58: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status + 70, // 59: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU + 71, // 60: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory + 69, // 61: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node + 70, // 62: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU + 71, // 63: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory + 72, // 64: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods + 68, // 65: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod + 69, // 66: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node + 79, // 67: payload.v1.Mirror.Targets.targets:type_name -> payload.v1.Mirror.Target + 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 } func init() { file_apis_proto_v1_payload_payload_proto_init() } @@ -5247,7 +5405,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { + switch v := v.(*Mirror); i { case 0: return &v.state case 1: @@ -5259,7 +5417,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Request); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -5271,7 +5429,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiRequest); i { + switch v := v.(*Search_Request); i { case 0: return &v.state case 1: @@ -5283,7 +5441,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_IDRequest); i { + switch v := v.(*Search_MultiRequest); i { case 0: return &v.state case 1: @@ -5295,7 +5453,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiIDRequest); i { + switch v := v.(*Search_IDRequest); i { case 0: return &v.state case 1: @@ -5307,7 +5465,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_ObjectRequest); i { + switch v := v.(*Search_MultiIDRequest); i { case 0: return &v.state case 1: @@ -5319,7 +5477,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiObjectRequest); i { + switch v := v.(*Search_ObjectRequest); i { case 0: return &v.state case 1: @@ -5331,7 +5489,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Config); i { + switch v := v.(*Search_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5343,7 +5501,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Response); i { + switch v := v.(*Search_Config); i { case 0: return &v.state case 1: @@ -5355,7 +5513,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Responses); i { + switch v := v.(*Search_Response); i { case 0: return &v.state case 1: @@ -5367,7 +5525,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_StreamResponse); i { + switch v := v.(*Search_Responses); i { case 0: return &v.state case 1: @@ -5379,7 +5537,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Target); i { + switch v := v.(*Search_StreamResponse); i { case 0: return &v.state case 1: @@ -5391,7 +5549,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Config); i { + switch v := v.(*Filter_Target); i { case 0: return &v.state case 1: @@ -5403,7 +5561,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Request); i { + switch v := v.(*Filter_Config); i { case 0: return &v.state case 1: @@ -5415,7 +5573,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiRequest); i { + switch v := v.(*Insert_Request); i { case 0: return &v.state case 1: @@ -5427,7 +5585,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_ObjectRequest); i { + switch v := v.(*Insert_MultiRequest); i { case 0: return &v.state case 1: @@ -5439,7 +5597,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiObjectRequest); i { + switch v := v.(*Insert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5451,7 +5609,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Config); i { + switch v := v.(*Insert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5463,7 +5621,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Request); i { + switch v := v.(*Insert_Config); i { case 0: return &v.state case 1: @@ -5475,7 +5633,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiRequest); i { + switch v := v.(*Update_Request); i { case 0: return &v.state case 1: @@ -5487,7 +5645,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_ObjectRequest); i { + switch v := v.(*Update_MultiRequest); i { case 0: return &v.state case 1: @@ -5499,7 +5657,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiObjectRequest); i { + switch v := v.(*Update_ObjectRequest); i { case 0: return &v.state case 1: @@ -5511,7 +5669,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Config); i { + switch v := v.(*Update_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5523,7 +5681,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Request); i { + switch v := v.(*Update_Config); i { case 0: return &v.state case 1: @@ -5535,7 +5693,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiRequest); i { + switch v := v.(*Upsert_Request); i { case 0: return &v.state case 1: @@ -5547,7 +5705,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_ObjectRequest); i { + switch v := v.(*Upsert_MultiRequest); i { case 0: return &v.state case 1: @@ -5559,7 +5717,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiObjectRequest); i { + switch v := v.(*Upsert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5571,7 +5729,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Config); i { + switch v := v.(*Upsert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5583,7 +5741,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Request); i { + switch v := v.(*Upsert_Config); i { case 0: return &v.state case 1: @@ -5595,7 +5753,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_MultiRequest); i { + switch v := v.(*Remove_Request); i { case 0: return &v.state case 1: @@ -5607,7 +5765,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_TimestampRequest); i { + switch v := v.(*Remove_MultiRequest); i { case 0: return &v.state case 1: @@ -5619,7 +5777,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Timestamp); i { + switch v := v.(*Remove_TimestampRequest); i { case 0: return &v.state case 1: @@ -5631,7 +5789,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Config); i { + switch v := v.(*Remove_Timestamp); i { case 0: return &v.state case 1: @@ -5643,7 +5801,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_VectorRequest); i { + switch v := v.(*Remove_Config); i { case 0: return &v.state case 1: @@ -5655,7 +5813,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Distance); i { + switch v := v.(*Object_VectorRequest); i { case 0: return &v.state case 1: @@ -5667,7 +5825,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamDistance); i { + switch v := v.(*Object_Distance); i { case 0: return &v.state case 1: @@ -5679,7 +5837,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ID); i { + switch v := v.(*Object_StreamDistance); i { case 0: return &v.state case 1: @@ -5691,7 +5849,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_IDs); i { + switch v := v.(*Object_ID); i { case 0: return &v.state case 1: @@ -5703,7 +5861,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vector); i { + switch v := v.(*Object_IDs); i { case 0: return &v.state case 1: @@ -5715,7 +5873,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_GetTimestampRequest); i { + switch v := v.(*Object_Vector); i { case 0: return &v.state case 1: @@ -5727,7 +5885,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Timestamp); i { + switch v := v.(*Object_GetTimestampRequest); i { case 0: return &v.state case 1: @@ -5739,7 +5897,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vectors); i { + switch v := v.(*Object_Timestamp); i { case 0: return &v.state case 1: @@ -5751,7 +5909,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamVector); i { + switch v := v.(*Object_Vectors); i { case 0: return &v.state case 1: @@ -5763,7 +5921,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ReshapeVector); i { + switch v := v.(*Object_StreamVector); i { case 0: return &v.state case 1: @@ -5775,7 +5933,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Blob); i { + switch v := v.(*Object_ReshapeVector); i { case 0: return &v.state case 1: @@ -5787,7 +5945,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamBlob); i { + switch v := v.(*Object_Blob); i { case 0: return &v.state case 1: @@ -5799,7 +5957,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Location); i { + switch v := v.(*Object_StreamBlob); i { case 0: return &v.state case 1: @@ -5811,7 +5969,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamLocation); i { + switch v := v.(*Object_Location); i { case 0: return &v.state case 1: @@ -5823,7 +5981,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Locations); i { + switch v := v.(*Object_StreamLocation); i { case 0: return &v.state case 1: @@ -5835,7 +5993,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List); i { + switch v := v.(*Object_Locations); i { case 0: return &v.state case 1: @@ -5847,7 +6005,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Request); i { + switch v := v.(*Object_List); i { case 0: return &v.state case 1: @@ -5859,7 +6017,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Response); i { + switch v := v.(*Object_List_Request); i { case 0: return &v.state case 1: @@ -5871,7 +6029,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Control_CreateIndexRequest); i { + switch v := v.(*Object_List_Response); i { case 0: return &v.state case 1: @@ -5883,7 +6041,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Discoverer_Request); i { + switch v := v.(*Control_CreateIndexRequest); i { case 0: return &v.state case 1: @@ -5895,7 +6053,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index); i { + switch v := v.(*Discoverer_Request); i { case 0: return &v.state case 1: @@ -5907,7 +6065,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pod); i { + switch v := v.(*Info_Index); i { case 0: return &v.state case 1: @@ -5919,7 +6077,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Node); i { + switch v := v.(*Info_Pod); i { case 0: return &v.state case 1: @@ -5931,7 +6089,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_CPU); i { + switch v := v.(*Info_Node); i { case 0: return &v.state case 1: @@ -5943,7 +6101,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Memory); i { + switch v := v.(*Info_CPU); i { case 0: return &v.state case 1: @@ -5955,7 +6113,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pods); i { + switch v := v.(*Info_Memory); i { case 0: return &v.state case 1: @@ -5967,7 +6125,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Nodes); i { + switch v := v.(*Info_Pods); i { case 0: return &v.state case 1: @@ -5979,7 +6137,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_IPs); i { + switch v := v.(*Info_Nodes); i { case 0: return &v.state case 1: @@ -5991,7 +6149,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_Count); i { + switch v := v.(*Info_IPs); i { case 0: return &v.state case 1: @@ -6003,7 +6161,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID); i { + switch v := v.(*Info_Index_Count); i { case 0: return &v.state case 1: @@ -6015,7 +6173,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID_Committed); i { + switch v := v.(*Info_Index_UUID); i { case 0: return &v.state case 1: @@ -6027,6 +6185,18 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info_Index_UUID_Committed); 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[76].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Info_Index_UUID_Uncommitted); i { case 0: return &v.state @@ -6038,28 +6208,52 @@ func file_apis_proto_v1_payload_payload_proto_init() { return nil } } + file_apis_proto_v1_payload_payload_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Target); 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[78].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Targets); 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[20].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[21].OneofWrappers = []interface{}{ (*Search_StreamResponse_Response)(nil), (*Search_StreamResponse_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[45].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[46].OneofWrappers = []interface{}{ (*Object_StreamDistance_Distance)(nil), (*Object_StreamDistance_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[52].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[53].OneofWrappers = []interface{}{ (*Object_StreamVector_Vector)(nil), (*Object_StreamVector_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[55].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[56].OneofWrappers = []interface{}{ (*Object_StreamBlob_Blob)(nil), (*Object_StreamBlob_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[57].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[58].OneofWrappers = []interface{}{ (*Object_StreamLocation_Location)(nil), (*Object_StreamLocation_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[61].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[62].OneofWrappers = []interface{}{ (*Object_List_Response_Vector)(nil), (*Object_List_Response_Status)(nil), } @@ -6069,7 +6263,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_apis_proto_v1_payload_payload_proto_rawDesc, NumEnums: 2, - NumMessages: 76, + NumMessages: 79, NumExtensions: 0, NumServices: 0, }, diff --git a/apis/grpc/v1/rpc/errdetails/error_details.pb.go b/apis/grpc/v1/rpc/errdetails/error_details.pb.go index cb886e1056..c4a47a53ae 100644 --- a/apis/grpc/v1/rpc/errdetails/error_details.pb.go +++ b/apis/grpc/v1/rpc/errdetails/error_details.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/rpc/error_details.proto package errdetails diff --git a/apis/grpc/v1/vald/filter.pb.go b/apis/grpc/v1/vald/filter.pb.go index 445d914de8..ee64b7f689 100644 --- a/apis/grpc/v1/vald/filter.pb.go +++ b/apis/grpc/v1/vald/filter.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/vald/filter.proto package vald diff --git a/apis/grpc/v1/vald/insert.pb.go b/apis/grpc/v1/vald/insert.pb.go index 12e9cdadcb..d2417538a2 100644 --- a/apis/grpc/v1/vald/insert.pb.go +++ b/apis/grpc/v1/vald/insert.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/vald/insert.proto package vald diff --git a/apis/grpc/v1/vald/object.pb.go b/apis/grpc/v1/vald/object.pb.go index 82038cb45b..eb191f57df 100644 --- a/apis/grpc/v1/vald/object.pb.go +++ b/apis/grpc/v1/vald/object.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/vald/object.proto package vald diff --git a/apis/grpc/v1/vald/remove.pb.go b/apis/grpc/v1/vald/remove.pb.go index cdd4498fd6..ee444a6b46 100644 --- a/apis/grpc/v1/vald/remove.pb.go +++ b/apis/grpc/v1/vald/remove.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/vald/remove.proto package vald diff --git a/apis/grpc/v1/vald/search.pb.go b/apis/grpc/v1/vald/search.pb.go index b0882e457c..55d3e3e61a 100644 --- a/apis/grpc/v1/vald/search.pb.go +++ b/apis/grpc/v1/vald/search.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/vald/search.proto package vald diff --git a/apis/grpc/v1/vald/update.pb.go b/apis/grpc/v1/vald/update.pb.go index 2ba6c96aad..9e2413ee98 100644 --- a/apis/grpc/v1/vald/update.pb.go +++ b/apis/grpc/v1/vald/update.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/vald/update.proto package vald diff --git a/apis/grpc/v1/vald/upsert.pb.go b/apis/grpc/v1/vald/upsert.pb.go index 9996c63db2..038b02d04d 100644 --- a/apis/grpc/v1/vald/upsert.pb.go +++ b/apis/grpc/v1/vald/upsert.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc v4.25.0 // source: apis/proto/v1/vald/upsert.proto package vald From a36f1a87955de7c6ad72778d23fdd2c518a0b693 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 29 Nov 2023 16:15:43 +0900 Subject: [PATCH 49/93] fix: return grpc error Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 786b0136ee..f84b19e2a0 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -3136,8 +3136,8 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald. return obj, s.streamListObject(ctx, client, stream) }) if err != nil { + st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.StreamListObjectRPCName+" gRPC error response") if span != nil { - st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.StreamListObjectRPCName+" gRPC error response") span.RecordError(err) span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) span.SetStatus(trace.StatusError, err.Error()) From 23b1f7248295a99f652a1668ce23e051ea88f6cf Mon Sep 17 00:00:00 2001 From: hlts2 Date: Mon, 4 Dec 2023 12:23:40 +0900 Subject: [PATCH 50/93] fix: make proto/all format Signed-off-by: hlts2 --- apis/docs/v1/docs.md | 360 +++++++----- apis/grpc/v1/payload/payload.pb.go | 898 ++++++++++++++++++----------- 2 files changed, 758 insertions(+), 500 deletions(-) diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index e1292b86c9..d67b989a75 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -45,6 +45,9 @@ - [Insert.MultiRequest](#payload-v1-Insert-MultiRequest) - [Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) - [Insert.Request](#payload-v1-Insert-Request) + - [Mirror](#payload-v1-Mirror) + - [Mirror.Target](#payload-v1-Mirror-Target) + - [Mirror.Targets](#payload-v1-Mirror-Targets) - [Object](#payload-v1-Object) - [Object.Blob](#payload-v1-Object-Blob) - [Object.Distance](#payload-v1-Object-Distance) @@ -94,9 +97,24 @@ - [Upsert.MultiRequest](#payload-v1-Upsert-MultiRequest) - [Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) - [Upsert.Request](#payload-v1-Upsert-Request) + - [Remove.Timestamp.Operator](#payload-v1-Remove-Timestamp-Operator) - [Search.AggregationAlgorithm](#payload-v1-Search-AggregationAlgorithm) +- [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/update.proto](#apis_proto_v1_vald_update-proto) + - [Update](#vald-v1-Update) +- [apis/proto/v1/vald/upsert.proto](#apis_proto_v1_vald_upsert-proto) + - [Upsert](#vald-v1-Upsert) - [apis/proto/v1/rpc/error_details.proto](#apis_proto_v1_rpc_error_details-proto) - [BadRequest](#rpc-v1-BadRequest) - [BadRequest.FieldViolation](#rpc-v1-BadRequest-FieldViolation) @@ -113,20 +131,8 @@ - [RequestInfo](#rpc-v1-RequestInfo) - [ResourceInfo](#rpc-v1-ResourceInfo) - [RetryInfo](#rpc-v1-RetryInfo) -- [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/update.proto](#apis_proto_v1_vald_update-proto) - - [Update](#vald-v1-Update) -- [apis/proto/v1/vald/upsert.proto](#apis_proto_v1_vald_upsert-proto) - - [Upsert](#vald-v1-Upsert) +- [apis/proto/v1/mirror/mirror.proto](#apis_proto_v1_mirror_mirror-proto) + - [Mirror](#mirror-v1-Mirror) - [Scalar Value Types](#scalar-value-types) @@ -501,6 +507,33 @@ Represent the insert request. | vector | [Object.Vector](#payload-v1-Object-Vector) | | The vector to be inserted. | | config | [Insert.Config](#payload-v1-Insert-Config) | | The configuration of the insert request. | + + +### Mirror + +Mirror related messages. + + + +### Mirror.Target + +Represent server information. + +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | -------------------- | +| host | [string](#string) | | The target hostname. | +| port | [uint32](#uint32) | | The target port. | + + + +### Mirror.Targets + +Represent the multiple Target message. + +| Field | Type | Label | Description | +| ------- | ------------------------------------------ | -------- | -------------------------------- | +| targets | [Mirror.Target](#payload-v1-Mirror-Target) | repeated | The multiple target information. | + ### Object @@ -1031,6 +1064,152 @@ AggregationAlgorithm is enum of each aggregation algorithms | SortPoolSlice | 3 | | | PairingHeap | 4 | | + + +

    Top

    + +## apis/proto/v1/vald/filter.proto + + + +### Filter + +Filter service provides ways to connect to Vald through filter. + +| Method Name | Request Type | Response Type | Description | +| ------------------ | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------ | +| SearchObject | [.payload.v1.Search.ObjectRequest](#payload-v1-Search-ObjectRequest) | [.payload.v1.Search.Response](#payload-v1-Search-Response) | A method to search object. | +| MultiSearchObject | [.payload.v1.Search.MultiObjectRequest](#payload-v1-Search-MultiObjectRequest) | [.payload.v1.Search.Responses](#payload-v1-Search-Responses) | A method to search multiple objects. | +| StreamSearchObject | [.payload.v1.Search.ObjectRequest](#payload-v1-Search-ObjectRequest) stream | [.payload.v1.Search.StreamResponse](#payload-v1-Search-StreamResponse) stream | A method to search object by bidirectional streaming. | +| InsertObject | [.payload.v1.Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method insert object. | +| StreamInsertObject | [.payload.v1.Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | Represent the streaming RPC to insert object by bidirectional streaming. | +| MultiInsertObject | [.payload.v1.Insert.MultiObjectRequest](#payload-v1-Insert-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to insert multiple objects. | +| UpdateObject | [.payload.v1.Update.ObjectRequest](#payload-v1-Update-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to update object. | +| StreamUpdateObject | [.payload.v1.Update.ObjectRequest](#payload-v1-Update-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to update object by bidirectional streaming. | +| MultiUpdateObject | [.payload.v1.Update.MultiObjectRequest](#payload-v1-Update-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to update multiple objects. | +| UpsertObject | [.payload.v1.Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to upsert object. | +| StreamUpsertObject | [.payload.v1.Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to upsert object by bidirectional streaming. | +| MultiUpsertObject | [.payload.v1.Upsert.MultiObjectRequest](#payload-v1-Upsert-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to upsert multiple objects. | + + + +

    Top

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

    Top

    + +## apis/proto/v1/vald/object.proto + + + +### Object + +Object service provides ways to fetch indexed vectors. + +| Method Name | Request Type | Response Type | Description | +| ---------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------- | +| Exists | [.payload.v1.Object.ID](#payload-v1-Object-ID) | [.payload.v1.Object.ID](#payload-v1-Object-ID) | A method to check whether a specified ID is indexed or not. | +| GetObject | [.payload.v1.Object.VectorRequest](#payload-v1-Object-VectorRequest) | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | A method to fetch a vector. | +| StreamGetObject | [.payload.v1.Object.VectorRequest](#payload-v1-Object-VectorRequest) stream | [.payload.v1.Object.StreamVector](#payload-v1-Object-StreamVector) stream | A method to fetch vectors by bidirectional streaming. | +| StreamListObject | [.payload.v1.Object.List.Request](#payload-v1-Object-List-Request) | [.payload.v1.Object.List.Response](#payload-v1-Object-List-Response) stream | A method to get all the vectors with server streaming | + + + +

    Top

    + +## apis/proto/v1/vald/remove.proto + + + +### Remove + +Remove service provides ways to remove indexed vectors. + +| Method Name | Request Type | Response Type | Description | +| ----------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| Remove | [.payload.v1.Remove.Request](#payload-v1-Remove-Request) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to remove an indexed vector. | +| RemoveByTimestamp | [.payload.v1.Remove.TimestampRequest](#payload-v1-Remove-TimestampRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to remove an indexed vector based on timestamp. | +| StreamRemove | [.payload.v1.Remove.Request](#payload-v1-Remove-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to remove multiple indexed vectors by bidirectional streaming. | +| MultiRemove | [.payload.v1.Remove.MultiRequest](#payload-v1-Remove-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to remove multiple indexed vectors in a single request. | + + + +

    Top

    + +## 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/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/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

    @@ -1278,151 +1457,36 @@ reached. | ----------- | ----------------------------------------------------- | ----- | ------------------------------------------------------------------------- | | retry_delay | [google.protobuf.Duration](#google-protobuf-Duration) | | Clients should wait at least this long between retrying the same request. | - - -

    Top

    - -## apis/proto/v1/vald/filter.proto - - - -### Filter - -Filter service provides ways to connect to Vald through filter. - -| Method Name | Request Type | Response Type | Description | -| ------------------ | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -| SearchObject | [.payload.v1.Search.ObjectRequest](#payload-v1-Search-ObjectRequest) | [.payload.v1.Search.Response](#payload-v1-Search-Response) | A method to search object. | -| MultiSearchObject | [.payload.v1.Search.MultiObjectRequest](#payload-v1-Search-MultiObjectRequest) | [.payload.v1.Search.Responses](#payload-v1-Search-Responses) | A method to search multiple objects. | -| StreamSearchObject | [.payload.v1.Search.ObjectRequest](#payload-v1-Search-ObjectRequest) stream | [.payload.v1.Search.StreamResponse](#payload-v1-Search-StreamResponse) stream | A method to search object by bidirectional streaming. | -| InsertObject | [.payload.v1.Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method insert object. | -| StreamInsertObject | [.payload.v1.Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | Represent the streaming RPC to insert object by bidirectional streaming. | -| MultiInsertObject | [.payload.v1.Insert.MultiObjectRequest](#payload-v1-Insert-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to insert multiple objects. | -| UpdateObject | [.payload.v1.Update.ObjectRequest](#payload-v1-Update-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to update object. | -| StreamUpdateObject | [.payload.v1.Update.ObjectRequest](#payload-v1-Update-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to update object by bidirectional streaming. | -| MultiUpdateObject | [.payload.v1.Update.MultiObjectRequest](#payload-v1-Update-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to update multiple objects. | -| UpsertObject | [.payload.v1.Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to upsert object. | -| StreamUpsertObject | [.payload.v1.Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to upsert object by bidirectional streaming. | -| MultiUpsertObject | [.payload.v1.Upsert.MultiObjectRequest](#payload-v1-Upsert-MultiObjectRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to upsert multiple objects. | - - - -

    Top

    - -## apis/proto/v1/vald/insert.proto - - - -### Insert - -Insert service provides ways to add new vectors. - -| Method Name | Request Type | Response Type | Description | -| ------------ | ------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------- | -| Insert | [.payload.v1.Insert.Request](#payload-v1-Insert-Request) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to add a new single vector. | -| StreamInsert | [.payload.v1.Insert.Request](#payload-v1-Insert-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to add new multiple vectors by bidirectional streaming. | -| MultiInsert | [.payload.v1.Insert.MultiRequest](#payload-v1-Insert-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to add new multiple vectors in a single request. | - - - -

    Top

    - -## apis/proto/v1/vald/object.proto - - - -### Object - -Object service provides ways to fetch indexed vectors. - -| Method Name | Request Type | Response Type | Description | -| ---------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------- | -| Exists | [.payload.v1.Object.ID](#payload-v1-Object-ID) | [.payload.v1.Object.ID](#payload-v1-Object-ID) | A method to check whether a specified ID is indexed or not. | -| GetObject | [.payload.v1.Object.VectorRequest](#payload-v1-Object-VectorRequest) | [.payload.v1.Object.Vector](#payload-v1-Object-Vector) | A method to fetch a vector. | -| StreamGetObject | [.payload.v1.Object.VectorRequest](#payload-v1-Object-VectorRequest) stream | [.payload.v1.Object.StreamVector](#payload-v1-Object-StreamVector) stream | A method to fetch vectors by bidirectional streaming. | -| StreamListObject | [.payload.v1.Object.List.Request](#payload-v1-Object-List-Request) | [.payload.v1.Object.List.Response](#payload-v1-Object-List-Response) stream | A method to get all the vectors with server streaming | - - +

    Top

    -## apis/proto/v1/vald/remove.proto +## apis/proto/v1/mirror/mirror.proto - +Copyright (C) 2019-2023 vdaas.org vald team <vald@vdaas.org> -### Remove +Licensed under the Apache License, Version 2.0 (the "License"); +You may not use this file except in compliance with the License. +You may obtain a copy of the License at -Remove service provides ways to remove indexed vectors. +https://www.apache.org/licenses/LICENSE-2.0 -| Method Name | Request Type | Response Type | Description | -| ----------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| Remove | [.payload.v1.Remove.Request](#payload-v1-Remove-Request) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to remove an indexed vector. | -| RemoveByTimestamp | [.payload.v1.Remove.TimestampRequest](#payload-v1-Remove-TimestampRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to remove an indexed vector based on timestamp. | -| StreamRemove | [.payload.v1.Remove.Request](#payload-v1-Remove-Request) stream | [.payload.v1.Object.StreamLocation](#payload-v1-Object-StreamLocation) stream | A method to remove multiple indexed vectors by bidirectional streaming. | -| MultiRemove | [.payload.v1.Remove.MultiRequest](#payload-v1-Remove-MultiRequest) | [.payload.v1.Object.Locations](#payload-v1-Object-Locations) | A method to remove multiple indexed vectors in a single request. | - - - -

    Top

    +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. -## apis/proto/v1/vald/search.proto + - +### Mirror -### Search - -Search service provides ways to search indexed vectors. +Represent the mirror service. -| 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/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/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. | +| Method Name | Request Type | Response Type | Description | +| ----------- | -------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------- | +| Register | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Register is the RPC to register other mirror servers. | +| Advertise | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Advertise is the RPC to advertise other mirror servers. | ## Scalar Value Types diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index 00a5590b8b..524828d645 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -550,6 +550,45 @@ func (*Info) Descriptor() ([]byte, []int) { return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{9} } +// Mirror related messages. +type Mirror struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Mirror) Reset() { + *x = Mirror{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror) ProtoMessage() {} + +func (x *Mirror) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + 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 Mirror.ProtoReflect.Descriptor instead. +func (*Mirror) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10} +} + // Represent an empty message. type Empty struct { state protoimpl.MessageState @@ -560,7 +599,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -573,7 +612,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[10] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -586,7 +625,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10} + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{11} } // Represent a search request. @@ -604,7 +643,7 @@ type Search_Request struct { func (x *Search_Request) Reset() { *x = Search_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -617,7 +656,7 @@ func (x *Search_Request) String() string { func (*Search_Request) ProtoMessage() {} func (x *Search_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[11] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -660,7 +699,7 @@ type Search_MultiRequest struct { func (x *Search_MultiRequest) Reset() { *x = Search_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -673,7 +712,7 @@ func (x *Search_MultiRequest) String() string { func (*Search_MultiRequest) ProtoMessage() {} func (x *Search_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[12] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -711,7 +750,7 @@ type Search_IDRequest struct { func (x *Search_IDRequest) Reset() { *x = Search_IDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -724,7 +763,7 @@ func (x *Search_IDRequest) String() string { func (*Search_IDRequest) ProtoMessage() {} func (x *Search_IDRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[13] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -767,7 +806,7 @@ type Search_MultiIDRequest struct { func (x *Search_MultiIDRequest) Reset() { *x = Search_MultiIDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -780,7 +819,7 @@ func (x *Search_MultiIDRequest) String() string { func (*Search_MultiIDRequest) ProtoMessage() {} func (x *Search_MultiIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[14] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -820,7 +859,7 @@ type Search_ObjectRequest struct { func (x *Search_ObjectRequest) Reset() { *x = Search_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -833,7 +872,7 @@ func (x *Search_ObjectRequest) String() string { func (*Search_ObjectRequest) ProtoMessage() {} func (x *Search_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[15] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -883,7 +922,7 @@ type Search_MultiObjectRequest struct { func (x *Search_MultiObjectRequest) Reset() { *x = Search_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -896,7 +935,7 @@ func (x *Search_MultiObjectRequest) String() string { func (*Search_MultiObjectRequest) ProtoMessage() {} func (x *Search_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[16] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -948,7 +987,7 @@ type Search_Config struct { func (x *Search_Config) Reset() { *x = Search_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -961,7 +1000,7 @@ func (x *Search_Config) String() string { func (*Search_Config) ProtoMessage() {} func (x *Search_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[17] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1055,7 +1094,7 @@ type Search_Response struct { func (x *Search_Response) Reset() { *x = Search_Response{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1068,7 +1107,7 @@ func (x *Search_Response) String() string { func (*Search_Response) ProtoMessage() {} func (x *Search_Response) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[18] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1111,7 +1150,7 @@ type Search_Responses struct { func (x *Search_Responses) Reset() { *x = Search_Responses{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1124,7 +1163,7 @@ func (x *Search_Responses) String() string { func (*Search_Responses) ProtoMessage() {} func (x *Search_Responses) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[19] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1163,7 +1202,7 @@ type Search_StreamResponse struct { func (x *Search_StreamResponse) Reset() { *x = Search_StreamResponse{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1176,7 +1215,7 @@ func (x *Search_StreamResponse) String() string { func (*Search_StreamResponse) ProtoMessage() {} func (x *Search_StreamResponse) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[20] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1246,7 +1285,7 @@ type Filter_Target struct { func (x *Filter_Target) Reset() { *x = Filter_Target{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1259,7 +1298,7 @@ func (x *Filter_Target) String() string { func (*Filter_Target) ProtoMessage() {} func (x *Filter_Target) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[21] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1302,7 +1341,7 @@ type Filter_Config struct { func (x *Filter_Config) Reset() { *x = Filter_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1315,7 +1354,7 @@ func (x *Filter_Config) String() string { func (*Filter_Config) ProtoMessage() {} func (x *Filter_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[22] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1353,7 +1392,7 @@ type Insert_Request struct { func (x *Insert_Request) Reset() { *x = Insert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1366,7 +1405,7 @@ func (x *Insert_Request) String() string { func (*Insert_Request) ProtoMessage() {} func (x *Insert_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[23] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1409,7 +1448,7 @@ type Insert_MultiRequest struct { func (x *Insert_MultiRequest) Reset() { *x = Insert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1422,7 +1461,7 @@ func (x *Insert_MultiRequest) String() string { func (*Insert_MultiRequest) ProtoMessage() {} func (x *Insert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[24] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1462,7 +1501,7 @@ type Insert_ObjectRequest struct { func (x *Insert_ObjectRequest) Reset() { *x = Insert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1475,7 +1514,7 @@ func (x *Insert_ObjectRequest) String() string { func (*Insert_ObjectRequest) ProtoMessage() {} func (x *Insert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[25] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1525,7 +1564,7 @@ type Insert_MultiObjectRequest struct { func (x *Insert_MultiObjectRequest) Reset() { *x = Insert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1538,7 +1577,7 @@ func (x *Insert_MultiObjectRequest) String() string { func (*Insert_MultiObjectRequest) ProtoMessage() {} func (x *Insert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[26] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1578,7 +1617,7 @@ type Insert_Config struct { func (x *Insert_Config) Reset() { *x = Insert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1591,7 +1630,7 @@ func (x *Insert_Config) String() string { func (*Insert_Config) ProtoMessage() {} func (x *Insert_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[27] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1643,7 +1682,7 @@ type Update_Request struct { func (x *Update_Request) Reset() { *x = Update_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1656,7 +1695,7 @@ func (x *Update_Request) String() string { func (*Update_Request) ProtoMessage() {} func (x *Update_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[28] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1699,7 +1738,7 @@ type Update_MultiRequest struct { func (x *Update_MultiRequest) Reset() { *x = Update_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1712,7 +1751,7 @@ func (x *Update_MultiRequest) String() string { func (*Update_MultiRequest) ProtoMessage() {} func (x *Update_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[29] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1752,7 +1791,7 @@ type Update_ObjectRequest struct { func (x *Update_ObjectRequest) Reset() { *x = Update_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1765,7 +1804,7 @@ func (x *Update_ObjectRequest) String() string { func (*Update_ObjectRequest) ProtoMessage() {} func (x *Update_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[30] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1815,7 +1854,7 @@ type Update_MultiObjectRequest struct { func (x *Update_MultiObjectRequest) Reset() { *x = Update_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1828,7 +1867,7 @@ func (x *Update_MultiObjectRequest) String() string { func (*Update_MultiObjectRequest) ProtoMessage() {} func (x *Update_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[31] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1871,7 +1910,7 @@ type Update_Config struct { func (x *Update_Config) Reset() { *x = Update_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1884,7 +1923,7 @@ func (x *Update_Config) String() string { func (*Update_Config) ProtoMessage() {} func (x *Update_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[32] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1943,7 +1982,7 @@ type Upsert_Request struct { func (x *Upsert_Request) Reset() { *x = Upsert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1956,7 +1995,7 @@ func (x *Upsert_Request) String() string { func (*Upsert_Request) ProtoMessage() {} func (x *Upsert_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[33] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1999,7 +2038,7 @@ type Upsert_MultiRequest struct { func (x *Upsert_MultiRequest) Reset() { *x = Upsert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2012,7 +2051,7 @@ func (x *Upsert_MultiRequest) String() string { func (*Upsert_MultiRequest) ProtoMessage() {} func (x *Upsert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[34] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2052,7 +2091,7 @@ type Upsert_ObjectRequest struct { func (x *Upsert_ObjectRequest) Reset() { *x = Upsert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2065,7 +2104,7 @@ func (x *Upsert_ObjectRequest) String() string { func (*Upsert_ObjectRequest) ProtoMessage() {} func (x *Upsert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[35] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2115,7 +2154,7 @@ type Upsert_MultiObjectRequest struct { func (x *Upsert_MultiObjectRequest) Reset() { *x = Upsert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2128,7 +2167,7 @@ func (x *Upsert_MultiObjectRequest) String() string { func (*Upsert_MultiObjectRequest) ProtoMessage() {} func (x *Upsert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[36] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2171,7 +2210,7 @@ type Upsert_Config struct { func (x *Upsert_Config) Reset() { *x = Upsert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2184,7 +2223,7 @@ func (x *Upsert_Config) String() string { func (*Upsert_Config) ProtoMessage() {} func (x *Upsert_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[37] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2243,7 +2282,7 @@ type Remove_Request struct { func (x *Remove_Request) Reset() { *x = Remove_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2256,7 +2295,7 @@ func (x *Remove_Request) String() string { func (*Remove_Request) ProtoMessage() {} func (x *Remove_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[38] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2299,7 +2338,7 @@ type Remove_MultiRequest struct { func (x *Remove_MultiRequest) Reset() { *x = Remove_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2312,7 +2351,7 @@ func (x *Remove_MultiRequest) String() string { func (*Remove_MultiRequest) ProtoMessage() {} func (x *Remove_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[39] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2348,7 +2387,7 @@ type Remove_TimestampRequest struct { func (x *Remove_TimestampRequest) Reset() { *x = Remove_TimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2361,7 +2400,7 @@ func (x *Remove_TimestampRequest) String() string { func (*Remove_TimestampRequest) ProtoMessage() {} func (x *Remove_TimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[40] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2399,7 +2438,7 @@ type Remove_Timestamp struct { func (x *Remove_Timestamp) Reset() { *x = Remove_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2412,7 +2451,7 @@ func (x *Remove_Timestamp) String() string { func (*Remove_Timestamp) ProtoMessage() {} func (x *Remove_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[41] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2457,7 +2496,7 @@ type Remove_Config struct { func (x *Remove_Config) Reset() { *x = Remove_Config{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2470,7 +2509,7 @@ func (x *Remove_Config) String() string { func (*Remove_Config) ProtoMessage() {} func (x *Remove_Config) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[42] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2515,7 +2554,7 @@ type Object_VectorRequest struct { func (x *Object_VectorRequest) Reset() { *x = Object_VectorRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2528,7 +2567,7 @@ func (x *Object_VectorRequest) String() string { func (*Object_VectorRequest) ProtoMessage() {} func (x *Object_VectorRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[43] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2573,7 +2612,7 @@ type Object_Distance struct { func (x *Object_Distance) Reset() { *x = Object_Distance{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2586,7 +2625,7 @@ func (x *Object_Distance) String() string { func (*Object_Distance) ProtoMessage() {} func (x *Object_Distance) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[44] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2632,7 +2671,7 @@ type Object_StreamDistance struct { func (x *Object_StreamDistance) Reset() { *x = Object_StreamDistance{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2645,7 +2684,7 @@ func (x *Object_StreamDistance) String() string { func (*Object_StreamDistance) ProtoMessage() {} func (x *Object_StreamDistance) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[45] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2712,7 +2751,7 @@ type Object_ID struct { func (x *Object_ID) Reset() { *x = Object_ID{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2725,7 +2764,7 @@ func (x *Object_ID) String() string { func (*Object_ID) ProtoMessage() {} func (x *Object_ID) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[46] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2760,7 +2799,7 @@ type Object_IDs struct { func (x *Object_IDs) Reset() { *x = Object_IDs{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2773,7 +2812,7 @@ func (x *Object_IDs) String() string { func (*Object_IDs) ProtoMessage() {} func (x *Object_IDs) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[47] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2813,7 +2852,7 @@ type Object_Vector struct { func (x *Object_Vector) Reset() { *x = Object_Vector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2826,7 +2865,7 @@ func (x *Object_Vector) String() string { func (*Object_Vector) ProtoMessage() {} func (x *Object_Vector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[48] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2876,7 +2915,7 @@ type Object_GetTimestampRequest struct { func (x *Object_GetTimestampRequest) Reset() { *x = Object_GetTimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2889,7 +2928,7 @@ func (x *Object_GetTimestampRequest) String() string { func (*Object_GetTimestampRequest) ProtoMessage() {} func (x *Object_GetTimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[49] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2927,7 +2966,7 @@ type Object_Timestamp struct { func (x *Object_Timestamp) Reset() { *x = Object_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2940,7 +2979,7 @@ func (x *Object_Timestamp) String() string { func (*Object_Timestamp) ProtoMessage() {} func (x *Object_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[50] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2982,7 +3021,7 @@ type Object_Vectors struct { func (x *Object_Vectors) Reset() { *x = Object_Vectors{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2995,7 +3034,7 @@ func (x *Object_Vectors) String() string { func (*Object_Vectors) ProtoMessage() {} func (x *Object_Vectors) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[51] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3034,7 +3073,7 @@ type Object_StreamVector struct { func (x *Object_StreamVector) Reset() { *x = Object_StreamVector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3047,7 +3086,7 @@ func (x *Object_StreamVector) String() string { func (*Object_StreamVector) ProtoMessage() {} func (x *Object_StreamVector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[52] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3117,7 +3156,7 @@ type Object_ReshapeVector struct { func (x *Object_ReshapeVector) Reset() { *x = Object_ReshapeVector{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3130,7 +3169,7 @@ func (x *Object_ReshapeVector) String() string { func (*Object_ReshapeVector) ProtoMessage() {} func (x *Object_ReshapeVector) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[53] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3175,7 +3214,7 @@ type Object_Blob struct { func (x *Object_Blob) Reset() { *x = Object_Blob{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3188,7 +3227,7 @@ func (x *Object_Blob) String() string { func (*Object_Blob) ProtoMessage() {} func (x *Object_Blob) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[54] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3234,7 +3273,7 @@ type Object_StreamBlob struct { func (x *Object_StreamBlob) Reset() { *x = Object_StreamBlob{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3247,7 +3286,7 @@ func (x *Object_StreamBlob) String() string { func (*Object_StreamBlob) ProtoMessage() {} func (x *Object_StreamBlob) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[55] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3319,7 +3358,7 @@ type Object_Location struct { func (x *Object_Location) Reset() { *x = Object_Location{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3332,7 +3371,7 @@ func (x *Object_Location) String() string { func (*Object_Location) ProtoMessage() {} func (x *Object_Location) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[56] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3385,7 +3424,7 @@ type Object_StreamLocation struct { func (x *Object_StreamLocation) Reset() { *x = Object_StreamLocation{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3398,7 +3437,7 @@ func (x *Object_StreamLocation) String() string { func (*Object_StreamLocation) ProtoMessage() {} func (x *Object_StreamLocation) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[57] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3465,7 +3504,7 @@ type Object_Locations struct { func (x *Object_Locations) Reset() { *x = Object_Locations{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3478,7 +3517,7 @@ func (x *Object_Locations) String() string { func (*Object_Locations) ProtoMessage() {} func (x *Object_Locations) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[58] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3511,7 +3550,7 @@ type Object_List struct { func (x *Object_List) Reset() { *x = Object_List{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3524,7 +3563,7 @@ func (x *Object_List) String() string { func (*Object_List) ProtoMessage() {} func (x *Object_List) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[59] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3549,7 +3588,7 @@ type Object_List_Request struct { func (x *Object_List_Request) Reset() { *x = Object_List_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3562,7 +3601,7 @@ func (x *Object_List_Request) String() string { func (*Object_List_Request) ProtoMessage() {} func (x *Object_List_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[60] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3593,7 +3632,7 @@ type Object_List_Response struct { func (x *Object_List_Response) Reset() { *x = Object_List_Response{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3606,7 +3645,7 @@ func (x *Object_List_Response) String() string { func (*Object_List_Response) ProtoMessage() {} func (x *Object_List_Response) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[61] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3674,7 +3713,7 @@ type Control_CreateIndexRequest struct { func (x *Control_CreateIndexRequest) Reset() { *x = Control_CreateIndexRequest{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3687,7 +3726,7 @@ func (x *Control_CreateIndexRequest) String() string { func (*Control_CreateIndexRequest) ProtoMessage() {} func (x *Control_CreateIndexRequest) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[62] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3727,7 +3766,7 @@ type Discoverer_Request struct { func (x *Discoverer_Request) Reset() { *x = Discoverer_Request{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3740,7 +3779,7 @@ func (x *Discoverer_Request) String() string { func (*Discoverer_Request) ProtoMessage() {} func (x *Discoverer_Request) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[63] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3787,7 +3826,7 @@ type Info_Index struct { func (x *Info_Index) Reset() { *x = Info_Index{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3800,7 +3839,7 @@ func (x *Info_Index) String() string { func (*Info_Index) ProtoMessage() {} func (x *Info_Index) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[64] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3841,7 +3880,7 @@ type Info_Pod struct { func (x *Info_Pod) Reset() { *x = Info_Pod{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3854,7 +3893,7 @@ func (x *Info_Pod) String() string { func (*Info_Pod) ProtoMessage() {} func (x *Info_Pod) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[65] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3942,7 +3981,7 @@ type Info_Node struct { func (x *Info_Node) Reset() { *x = Info_Node{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3955,7 +3994,7 @@ func (x *Info_Node) String() string { func (*Info_Node) ProtoMessage() {} func (x *Info_Node) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[66] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4030,7 +4069,7 @@ type Info_CPU struct { func (x *Info_CPU) Reset() { *x = Info_CPU{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4043,7 +4082,7 @@ func (x *Info_CPU) String() string { func (*Info_CPU) ProtoMessage() {} func (x *Info_CPU) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[67] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4097,7 +4136,7 @@ type Info_Memory struct { func (x *Info_Memory) Reset() { *x = Info_Memory{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4110,7 +4149,7 @@ func (x *Info_Memory) String() string { func (*Info_Memory) ProtoMessage() {} func (x *Info_Memory) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[68] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4160,7 +4199,7 @@ type Info_Pods struct { func (x *Info_Pods) Reset() { *x = Info_Pods{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4173,7 +4212,7 @@ func (x *Info_Pods) String() string { func (*Info_Pods) ProtoMessage() {} func (x *Info_Pods) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[69] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4209,7 +4248,7 @@ type Info_Nodes struct { func (x *Info_Nodes) Reset() { *x = Info_Nodes{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4222,7 +4261,7 @@ func (x *Info_Nodes) String() string { func (*Info_Nodes) ProtoMessage() {} func (x *Info_Nodes) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[70] + 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 { @@ -4257,7 +4296,7 @@ type Info_IPs struct { func (x *Info_IPs) Reset() { *x = Info_IPs{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4270,7 +4309,7 @@ func (x *Info_IPs) String() string { func (*Info_IPs) ProtoMessage() {} func (x *Info_IPs) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[71] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4312,7 +4351,7 @@ type Info_Index_Count struct { func (x *Info_Index_Count) Reset() { *x = Info_Index_Count{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4325,7 +4364,7 @@ func (x *Info_Index_Count) String() string { func (*Info_Index_Count) ProtoMessage() {} func (x *Info_Index_Count) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[72] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4379,7 +4418,7 @@ type Info_Index_UUID struct { func (x *Info_Index_UUID) Reset() { *x = Info_Index_UUID{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4392,7 +4431,7 @@ func (x *Info_Index_UUID) String() string { func (*Info_Index_UUID) ProtoMessage() {} func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[73] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4420,7 +4459,7 @@ type Info_Index_UUID_Committed struct { func (x *Info_Index_UUID_Committed) Reset() { *x = Info_Index_UUID_Committed{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4433,7 +4472,7 @@ func (x *Info_Index_UUID_Committed) String() string { func (*Info_Index_UUID_Committed) ProtoMessage() {} func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[74] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4468,7 +4507,7 @@ type Info_Index_UUID_Uncommitted struct { func (x *Info_Index_UUID_Uncommitted) Reset() { *x = Info_Index_UUID_Uncommitted{} if protoimpl.UnsafeEnabled { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4481,7 +4520,7 @@ func (x *Info_Index_UUID_Uncommitted) String() string { func (*Info_Index_UUID_Uncommitted) ProtoMessage() {} func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { - mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[75] + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4504,6 +4543,113 @@ func (x *Info_Index_UUID_Uncommitted) GetUuid() string { return "" } +// Represent server information. +type Mirror_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The target hostname. + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + // The target port. + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *Mirror_Target) Reset() { + *x = Mirror_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Target) ProtoMessage() {} + +func (x *Mirror_Target) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[77] + 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 Mirror_Target.ProtoReflect.Descriptor instead. +func (*Mirror_Target) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *Mirror_Target) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Mirror_Target) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +// Represent the multiple Target message. +type Mirror_Targets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The multiple target information. + Targets []*Mirror_Target `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *Mirror_Targets) Reset() { + *x = Mirror_Targets{} + if protoimpl.UnsafeEnabled { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Targets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Targets) ProtoMessage() {} + +func (x *Mirror_Targets) ProtoReflect() protoreflect.Message { + mi := &file_apis_proto_v1_payload_payload_proto_msgTypes[78] + 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 Mirror_Targets.ProtoReflect.Descriptor instead. +func (*Mirror_Targets) Descriptor() ([]byte, []int) { + return file_apis_proto_v1_payload_payload_proto_rawDescGZIP(), []int{10, 1} +} + +func (x *Mirror_Targets) GetTargets() []*Mirror_Target { + if x != nil { + return x.Targets + } + return nil +} + var File_apis_proto_v1_payload_payload_proto protoreflect.FileDescriptor var file_apis_proto_v1_payload_payload_proto_rawDesc = []byte{ @@ -4932,15 +5078,23 @@ var file_apis_proto_v1_payload_payload_proto_rawDesc = []byte{ 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, + 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x7a, + 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x3e, 0x0a, 0x07, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 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, } var ( @@ -4956,7 +5110,7 @@ func file_apis_proto_v1_payload_payload_proto_rawDescGZIP() []byte { } 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_msgTypes = make([]protoimpl.MessageInfo, 79) var file_apis_proto_v1_payload_payload_proto_goTypes = []interface{}{ (Search_AggregationAlgorithm)(0), // 0: payload.v1.Search.AggregationAlgorithm (Remove_Timestamp_Operator)(0), // 1: payload.v1.Remove.Timestamp.Operator @@ -4970,147 +5124,151 @@ var file_apis_proto_v1_payload_payload_proto_goTypes = []interface{}{ (*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_GetTimestampRequest)(nil), // 51: payload.v1.Object.GetTimestampRequest - (*Object_Timestamp)(nil), // 52: payload.v1.Object.Timestamp - (*Object_Vectors)(nil), // 53: payload.v1.Object.Vectors - (*Object_StreamVector)(nil), // 54: payload.v1.Object.StreamVector - (*Object_ReshapeVector)(nil), // 55: payload.v1.Object.ReshapeVector - (*Object_Blob)(nil), // 56: payload.v1.Object.Blob - (*Object_StreamBlob)(nil), // 57: payload.v1.Object.StreamBlob - (*Object_Location)(nil), // 58: payload.v1.Object.Location - (*Object_StreamLocation)(nil), // 59: payload.v1.Object.StreamLocation - (*Object_Locations)(nil), // 60: payload.v1.Object.Locations - (*Object_List)(nil), // 61: payload.v1.Object.List - (*Object_List_Request)(nil), // 62: payload.v1.Object.List.Request - (*Object_List_Response)(nil), // 63: payload.v1.Object.List.Response - (*Control_CreateIndexRequest)(nil), // 64: payload.v1.Control.CreateIndexRequest - (*Discoverer_Request)(nil), // 65: payload.v1.Discoverer.Request - (*Info_Index)(nil), // 66: payload.v1.Info.Index - (*Info_Pod)(nil), // 67: payload.v1.Info.Pod - (*Info_Node)(nil), // 68: payload.v1.Info.Node - (*Info_CPU)(nil), // 69: payload.v1.Info.CPU - (*Info_Memory)(nil), // 70: payload.v1.Info.Memory - (*Info_Pods)(nil), // 71: payload.v1.Info.Pods - (*Info_Nodes)(nil), // 72: payload.v1.Info.Nodes - (*Info_IPs)(nil), // 73: payload.v1.Info.IPs - (*Info_Index_Count)(nil), // 74: payload.v1.Info.Index.Count - (*Info_Index_UUID)(nil), // 75: payload.v1.Info.Index.UUID - (*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 + (*Mirror)(nil), // 12: payload.v1.Mirror + (*Empty)(nil), // 13: payload.v1.Empty + (*Search_Request)(nil), // 14: payload.v1.Search.Request + (*Search_MultiRequest)(nil), // 15: payload.v1.Search.MultiRequest + (*Search_IDRequest)(nil), // 16: payload.v1.Search.IDRequest + (*Search_MultiIDRequest)(nil), // 17: payload.v1.Search.MultiIDRequest + (*Search_ObjectRequest)(nil), // 18: payload.v1.Search.ObjectRequest + (*Search_MultiObjectRequest)(nil), // 19: payload.v1.Search.MultiObjectRequest + (*Search_Config)(nil), // 20: payload.v1.Search.Config + (*Search_Response)(nil), // 21: payload.v1.Search.Response + (*Search_Responses)(nil), // 22: payload.v1.Search.Responses + (*Search_StreamResponse)(nil), // 23: payload.v1.Search.StreamResponse + (*Filter_Target)(nil), // 24: payload.v1.Filter.Target + (*Filter_Config)(nil), // 25: payload.v1.Filter.Config + (*Insert_Request)(nil), // 26: payload.v1.Insert.Request + (*Insert_MultiRequest)(nil), // 27: payload.v1.Insert.MultiRequest + (*Insert_ObjectRequest)(nil), // 28: payload.v1.Insert.ObjectRequest + (*Insert_MultiObjectRequest)(nil), // 29: payload.v1.Insert.MultiObjectRequest + (*Insert_Config)(nil), // 30: payload.v1.Insert.Config + (*Update_Request)(nil), // 31: payload.v1.Update.Request + (*Update_MultiRequest)(nil), // 32: payload.v1.Update.MultiRequest + (*Update_ObjectRequest)(nil), // 33: payload.v1.Update.ObjectRequest + (*Update_MultiObjectRequest)(nil), // 34: payload.v1.Update.MultiObjectRequest + (*Update_Config)(nil), // 35: payload.v1.Update.Config + (*Upsert_Request)(nil), // 36: payload.v1.Upsert.Request + (*Upsert_MultiRequest)(nil), // 37: payload.v1.Upsert.MultiRequest + (*Upsert_ObjectRequest)(nil), // 38: payload.v1.Upsert.ObjectRequest + (*Upsert_MultiObjectRequest)(nil), // 39: payload.v1.Upsert.MultiObjectRequest + (*Upsert_Config)(nil), // 40: payload.v1.Upsert.Config + (*Remove_Request)(nil), // 41: payload.v1.Remove.Request + (*Remove_MultiRequest)(nil), // 42: payload.v1.Remove.MultiRequest + (*Remove_TimestampRequest)(nil), // 43: payload.v1.Remove.TimestampRequest + (*Remove_Timestamp)(nil), // 44: payload.v1.Remove.Timestamp + (*Remove_Config)(nil), // 45: payload.v1.Remove.Config + (*Object_VectorRequest)(nil), // 46: payload.v1.Object.VectorRequest + (*Object_Distance)(nil), // 47: payload.v1.Object.Distance + (*Object_StreamDistance)(nil), // 48: payload.v1.Object.StreamDistance + (*Object_ID)(nil), // 49: payload.v1.Object.ID + (*Object_IDs)(nil), // 50: payload.v1.Object.IDs + (*Object_Vector)(nil), // 51: payload.v1.Object.Vector + (*Object_GetTimestampRequest)(nil), // 52: payload.v1.Object.GetTimestampRequest + (*Object_Timestamp)(nil), // 53: payload.v1.Object.Timestamp + (*Object_Vectors)(nil), // 54: payload.v1.Object.Vectors + (*Object_StreamVector)(nil), // 55: payload.v1.Object.StreamVector + (*Object_ReshapeVector)(nil), // 56: payload.v1.Object.ReshapeVector + (*Object_Blob)(nil), // 57: payload.v1.Object.Blob + (*Object_StreamBlob)(nil), // 58: payload.v1.Object.StreamBlob + (*Object_Location)(nil), // 59: payload.v1.Object.Location + (*Object_StreamLocation)(nil), // 60: payload.v1.Object.StreamLocation + (*Object_Locations)(nil), // 61: payload.v1.Object.Locations + (*Object_List)(nil), // 62: payload.v1.Object.List + (*Object_List_Request)(nil), // 63: payload.v1.Object.List.Request + (*Object_List_Response)(nil), // 64: payload.v1.Object.List.Response + (*Control_CreateIndexRequest)(nil), // 65: payload.v1.Control.CreateIndexRequest + (*Discoverer_Request)(nil), // 66: payload.v1.Discoverer.Request + (*Info_Index)(nil), // 67: payload.v1.Info.Index + (*Info_Pod)(nil), // 68: payload.v1.Info.Pod + (*Info_Node)(nil), // 69: payload.v1.Info.Node + (*Info_CPU)(nil), // 70: payload.v1.Info.CPU + (*Info_Memory)(nil), // 71: payload.v1.Info.Memory + (*Info_Pods)(nil), // 72: payload.v1.Info.Pods + (*Info_Nodes)(nil), // 73: payload.v1.Info.Nodes + (*Info_IPs)(nil), // 74: payload.v1.Info.IPs + (*Info_Index_Count)(nil), // 75: payload.v1.Info.Index.Count + (*Info_Index_UUID)(nil), // 76: payload.v1.Info.Index.UUID + (*Info_Index_UUID_Committed)(nil), // 77: payload.v1.Info.Index.UUID.Committed + (*Info_Index_UUID_Uncommitted)(nil), // 78: payload.v1.Info.Index.UUID.Uncommitted + (*Mirror_Target)(nil), // 79: payload.v1.Mirror.Target + (*Mirror_Targets)(nil), // 80: payload.v1.Mirror.Targets + (*status.Status)(nil), // 81: google.rpc.Status } var file_apis_proto_v1_payload_payload_proto_depIdxs = []int32{ - 19, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config - 13, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request - 19, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config - 15, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest - 19, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config - 23, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target - 17, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest - 24, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config - 24, // 8: payload.v1.Search.Config.egress_filters:type_name -> payload.v1.Filter.Config + 20, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config + 14, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request + 20, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config + 16, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest + 20, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config + 24, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 18, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest + 25, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config + 25, // 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 - 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 - 56, // 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 - 56, // 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 - 56, // 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 + 47, // 10: payload.v1.Search.Response.results:type_name -> payload.v1.Object.Distance + 21, // 11: payload.v1.Search.Responses.responses:type_name -> payload.v1.Search.Response + 21, // 12: payload.v1.Search.StreamResponse.response:type_name -> payload.v1.Search.Response + 81, // 13: payload.v1.Search.StreamResponse.status:type_name -> google.rpc.Status + 24, // 14: payload.v1.Filter.Config.targets:type_name -> payload.v1.Filter.Target + 51, // 15: payload.v1.Insert.Request.vector:type_name -> payload.v1.Object.Vector + 30, // 16: payload.v1.Insert.Request.config:type_name -> payload.v1.Insert.Config + 26, // 17: payload.v1.Insert.MultiRequest.requests:type_name -> payload.v1.Insert.Request + 57, // 18: payload.v1.Insert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 30, // 19: payload.v1.Insert.ObjectRequest.config:type_name -> payload.v1.Insert.Config + 24, // 20: payload.v1.Insert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 28, // 21: payload.v1.Insert.MultiObjectRequest.requests:type_name -> payload.v1.Insert.ObjectRequest + 25, // 22: payload.v1.Insert.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 23: payload.v1.Update.Request.vector:type_name -> payload.v1.Object.Vector + 35, // 24: payload.v1.Update.Request.config:type_name -> payload.v1.Update.Config + 31, // 25: payload.v1.Update.MultiRequest.requests:type_name -> payload.v1.Update.Request + 57, // 26: payload.v1.Update.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 35, // 27: payload.v1.Update.ObjectRequest.config:type_name -> payload.v1.Update.Config + 24, // 28: payload.v1.Update.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 33, // 29: payload.v1.Update.MultiObjectRequest.requests:type_name -> payload.v1.Update.ObjectRequest + 25, // 30: payload.v1.Update.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 31: payload.v1.Upsert.Request.vector:type_name -> payload.v1.Object.Vector + 40, // 32: payload.v1.Upsert.Request.config:type_name -> payload.v1.Upsert.Config + 36, // 33: payload.v1.Upsert.MultiRequest.requests:type_name -> payload.v1.Upsert.Request + 57, // 34: payload.v1.Upsert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 40, // 35: payload.v1.Upsert.ObjectRequest.config:type_name -> payload.v1.Upsert.Config + 24, // 36: payload.v1.Upsert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 38, // 37: payload.v1.Upsert.MultiObjectRequest.requests:type_name -> payload.v1.Upsert.ObjectRequest + 25, // 38: payload.v1.Upsert.Config.filters:type_name -> payload.v1.Filter.Config + 49, // 39: payload.v1.Remove.Request.id:type_name -> payload.v1.Object.ID + 45, // 40: payload.v1.Remove.Request.config:type_name -> payload.v1.Remove.Config + 41, // 41: payload.v1.Remove.MultiRequest.requests:type_name -> payload.v1.Remove.Request + 44, // 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 - 48, // 48: payload.v1.Object.GetTimestampRequest.id:type_name -> payload.v1.Object.ID - 50, // 49: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector - 50, // 50: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector - 78, // 51: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status - 56, // 52: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob - 78, // 53: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status - 58, // 54: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location - 78, // 55: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status - 58, // 56: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location - 50, // 57: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector - 78, // 58: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status - 69, // 59: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU - 70, // 60: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory - 68, // 61: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node - 69, // 62: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU - 70, // 63: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory - 71, // 64: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods - 67, // 65: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod - 68, // 66: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node - 67, // [67:67] is the sub-list for method output_type - 67, // [67:67] is the sub-list for method input_type - 67, // [67:67] is the sub-list for extension type_name - 67, // [67:67] is the sub-list for extension extendee - 0, // [0:67] is the sub-list for field type_name + 49, // 44: payload.v1.Object.VectorRequest.id:type_name -> payload.v1.Object.ID + 25, // 45: payload.v1.Object.VectorRequest.filters:type_name -> payload.v1.Filter.Config + 47, // 46: payload.v1.Object.StreamDistance.distance:type_name -> payload.v1.Object.Distance + 81, // 47: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status + 49, // 48: payload.v1.Object.GetTimestampRequest.id:type_name -> payload.v1.Object.ID + 51, // 49: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector + 51, // 50: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector + 81, // 51: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status + 57, // 52: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob + 81, // 53: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status + 59, // 54: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location + 81, // 55: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status + 59, // 56: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location + 51, // 57: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector + 81, // 58: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status + 70, // 59: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU + 71, // 60: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory + 69, // 61: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node + 70, // 62: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU + 71, // 63: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory + 72, // 64: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods + 68, // 65: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod + 69, // 66: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node + 79, // 67: payload.v1.Mirror.Targets.targets:type_name -> payload.v1.Mirror.Target + 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 } func init() { file_apis_proto_v1_payload_payload_proto_init() } @@ -5240,7 +5398,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { + switch v := v.(*Mirror); i { case 0: return &v.state case 1: @@ -5252,7 +5410,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Request); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -5264,7 +5422,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiRequest); i { + switch v := v.(*Search_Request); i { case 0: return &v.state case 1: @@ -5276,7 +5434,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_IDRequest); i { + switch v := v.(*Search_MultiRequest); i { case 0: return &v.state case 1: @@ -5288,7 +5446,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiIDRequest); i { + switch v := v.(*Search_IDRequest); i { case 0: return &v.state case 1: @@ -5300,7 +5458,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_ObjectRequest); i { + switch v := v.(*Search_MultiIDRequest); i { case 0: return &v.state case 1: @@ -5312,7 +5470,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiObjectRequest); i { + switch v := v.(*Search_ObjectRequest); i { case 0: return &v.state case 1: @@ -5324,7 +5482,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Config); i { + switch v := v.(*Search_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5336,7 +5494,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Response); i { + switch v := v.(*Search_Config); i { case 0: return &v.state case 1: @@ -5348,7 +5506,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Responses); i { + switch v := v.(*Search_Response); i { case 0: return &v.state case 1: @@ -5360,7 +5518,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_StreamResponse); i { + switch v := v.(*Search_Responses); i { case 0: return &v.state case 1: @@ -5372,7 +5530,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Target); i { + switch v := v.(*Search_StreamResponse); i { case 0: return &v.state case 1: @@ -5384,7 +5542,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Config); i { + switch v := v.(*Filter_Target); i { case 0: return &v.state case 1: @@ -5396,7 +5554,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Request); i { + switch v := v.(*Filter_Config); i { case 0: return &v.state case 1: @@ -5408,7 +5566,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiRequest); i { + switch v := v.(*Insert_Request); i { case 0: return &v.state case 1: @@ -5420,7 +5578,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_ObjectRequest); i { + switch v := v.(*Insert_MultiRequest); i { case 0: return &v.state case 1: @@ -5432,7 +5590,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiObjectRequest); i { + switch v := v.(*Insert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5444,7 +5602,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Config); i { + switch v := v.(*Insert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5456,7 +5614,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Request); i { + switch v := v.(*Insert_Config); i { case 0: return &v.state case 1: @@ -5468,7 +5626,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiRequest); i { + switch v := v.(*Update_Request); i { case 0: return &v.state case 1: @@ -5480,7 +5638,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_ObjectRequest); i { + switch v := v.(*Update_MultiRequest); i { case 0: return &v.state case 1: @@ -5492,7 +5650,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiObjectRequest); i { + switch v := v.(*Update_ObjectRequest); i { case 0: return &v.state case 1: @@ -5504,7 +5662,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Config); i { + switch v := v.(*Update_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5516,7 +5674,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Request); i { + switch v := v.(*Update_Config); i { case 0: return &v.state case 1: @@ -5528,7 +5686,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiRequest); i { + switch v := v.(*Upsert_Request); i { case 0: return &v.state case 1: @@ -5540,7 +5698,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_ObjectRequest); i { + switch v := v.(*Upsert_MultiRequest); i { case 0: return &v.state case 1: @@ -5552,7 +5710,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiObjectRequest); i { + switch v := v.(*Upsert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5564,7 +5722,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Config); i { + switch v := v.(*Upsert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5576,7 +5734,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Request); i { + switch v := v.(*Upsert_Config); i { case 0: return &v.state case 1: @@ -5588,7 +5746,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_MultiRequest); i { + switch v := v.(*Remove_Request); i { case 0: return &v.state case 1: @@ -5600,7 +5758,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_TimestampRequest); i { + switch v := v.(*Remove_MultiRequest); i { case 0: return &v.state case 1: @@ -5612,7 +5770,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Timestamp); i { + switch v := v.(*Remove_TimestampRequest); i { case 0: return &v.state case 1: @@ -5624,7 +5782,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Config); i { + switch v := v.(*Remove_Timestamp); i { case 0: return &v.state case 1: @@ -5636,7 +5794,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_VectorRequest); i { + switch v := v.(*Remove_Config); i { case 0: return &v.state case 1: @@ -5648,7 +5806,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Distance); i { + switch v := v.(*Object_VectorRequest); i { case 0: return &v.state case 1: @@ -5660,7 +5818,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamDistance); i { + switch v := v.(*Object_Distance); i { case 0: return &v.state case 1: @@ -5672,7 +5830,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ID); i { + switch v := v.(*Object_StreamDistance); i { case 0: return &v.state case 1: @@ -5684,7 +5842,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_IDs); i { + switch v := v.(*Object_ID); i { case 0: return &v.state case 1: @@ -5696,7 +5854,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vector); i { + switch v := v.(*Object_IDs); i { case 0: return &v.state case 1: @@ -5708,7 +5866,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_GetTimestampRequest); i { + switch v := v.(*Object_Vector); i { case 0: return &v.state case 1: @@ -5720,7 +5878,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Timestamp); i { + switch v := v.(*Object_GetTimestampRequest); i { case 0: return &v.state case 1: @@ -5732,7 +5890,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vectors); i { + switch v := v.(*Object_Timestamp); i { case 0: return &v.state case 1: @@ -5744,7 +5902,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamVector); i { + switch v := v.(*Object_Vectors); i { case 0: return &v.state case 1: @@ -5756,7 +5914,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ReshapeVector); i { + switch v := v.(*Object_StreamVector); i { case 0: return &v.state case 1: @@ -5768,7 +5926,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Blob); i { + switch v := v.(*Object_ReshapeVector); i { case 0: return &v.state case 1: @@ -5780,7 +5938,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamBlob); i { + switch v := v.(*Object_Blob); i { case 0: return &v.state case 1: @@ -5792,7 +5950,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Location); i { + switch v := v.(*Object_StreamBlob); i { case 0: return &v.state case 1: @@ -5804,7 +5962,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamLocation); i { + switch v := v.(*Object_Location); i { case 0: return &v.state case 1: @@ -5816,7 +5974,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Locations); i { + switch v := v.(*Object_StreamLocation); i { case 0: return &v.state case 1: @@ -5828,7 +5986,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List); i { + switch v := v.(*Object_Locations); i { case 0: return &v.state case 1: @@ -5840,7 +5998,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Request); i { + switch v := v.(*Object_List); i { case 0: return &v.state case 1: @@ -5852,7 +6010,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Response); i { + switch v := v.(*Object_List_Request); i { case 0: return &v.state case 1: @@ -5864,7 +6022,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Control_CreateIndexRequest); i { + switch v := v.(*Object_List_Response); i { case 0: return &v.state case 1: @@ -5876,7 +6034,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Discoverer_Request); i { + switch v := v.(*Control_CreateIndexRequest); i { case 0: return &v.state case 1: @@ -5888,7 +6046,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index); i { + switch v := v.(*Discoverer_Request); i { case 0: return &v.state case 1: @@ -5900,7 +6058,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pod); i { + switch v := v.(*Info_Index); i { case 0: return &v.state case 1: @@ -5912,7 +6070,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Node); i { + switch v := v.(*Info_Pod); i { case 0: return &v.state case 1: @@ -5924,7 +6082,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_CPU); i { + switch v := v.(*Info_Node); i { case 0: return &v.state case 1: @@ -5936,7 +6094,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Memory); i { + switch v := v.(*Info_CPU); i { case 0: return &v.state case 1: @@ -5948,7 +6106,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pods); i { + switch v := v.(*Info_Memory); i { case 0: return &v.state case 1: @@ -5960,7 +6118,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Nodes); i { + switch v := v.(*Info_Pods); i { case 0: return &v.state case 1: @@ -5972,7 +6130,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_IPs); i { + switch v := v.(*Info_Nodes); i { case 0: return &v.state case 1: @@ -5984,7 +6142,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_Count); i { + switch v := v.(*Info_IPs); i { case 0: return &v.state case 1: @@ -5996,7 +6154,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID); i { + switch v := v.(*Info_Index_Count); i { case 0: return &v.state case 1: @@ -6008,7 +6166,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID_Committed); i { + switch v := v.(*Info_Index_UUID); i { case 0: return &v.state case 1: @@ -6020,6 +6178,18 @@ func file_apis_proto_v1_payload_payload_proto_init() { } } file_apis_proto_v1_payload_payload_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info_Index_UUID_Committed); 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[76].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Info_Index_UUID_Uncommitted); i { case 0: return &v.state @@ -6031,28 +6201,52 @@ func file_apis_proto_v1_payload_payload_proto_init() { return nil } } + file_apis_proto_v1_payload_payload_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Target); 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[78].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Targets); 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[20].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[21].OneofWrappers = []interface{}{ (*Search_StreamResponse_Response)(nil), (*Search_StreamResponse_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[45].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[46].OneofWrappers = []interface{}{ (*Object_StreamDistance_Distance)(nil), (*Object_StreamDistance_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[52].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[53].OneofWrappers = []interface{}{ (*Object_StreamVector_Vector)(nil), (*Object_StreamVector_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[55].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[56].OneofWrappers = []interface{}{ (*Object_StreamBlob_Blob)(nil), (*Object_StreamBlob_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[57].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[58].OneofWrappers = []interface{}{ (*Object_StreamLocation_Location)(nil), (*Object_StreamLocation_Status)(nil), } - file_apis_proto_v1_payload_payload_proto_msgTypes[61].OneofWrappers = []interface{}{ + file_apis_proto_v1_payload_payload_proto_msgTypes[62].OneofWrappers = []interface{}{ (*Object_List_Response_Vector)(nil), (*Object_List_Response_Status)(nil), } @@ -6062,7 +6256,7 @@ func file_apis_proto_v1_payload_payload_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_apis_proto_v1_payload_payload_proto_rawDesc, NumEnums: 2, - NumMessages: 76, + NumMessages: 79, NumExtensions: 0, NumServices: 0, }, From 68a807288df3f25d1ae390e27516dab68af033b8 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Mon, 4 Dec 2023 17:58:01 +0900 Subject: [PATCH 51/93] feat: add mirror service test Signed-off-by: hlts2 --- internal/test/mock/grpc/grpc_client_mock.go | 25 + pkg/gateway/mirror/service/mirror.go | 23 +- pkg/gateway/mirror/service/mirror_test.go | 1207 +++++++++++++++++++ 3 files changed, 1235 insertions(+), 20 deletions(-) create mode 100644 pkg/gateway/mirror/service/mirror_test.go diff --git a/internal/test/mock/grpc/grpc_client_mock.go b/internal/test/mock/grpc/grpc_client_mock.go index 926bbf8c61..b7cf27c384 100644 --- a/internal/test/mock/grpc/grpc_client_mock.go +++ b/internal/test/mock/grpc/grpc_client_mock.go @@ -17,6 +17,7 @@ import ( "context" "github.com/vdaas/vald/internal/net/grpc" + "github.com/vdaas/vald/internal/net/grpc/pool" ) // GRPCClientMock is the mock for gRPC client. @@ -29,6 +30,10 @@ type GRPCClientMock struct { addr string, conn *grpc.ClientConn, copts ...grpc.CallOption) error) error + ConnectFunc func(ctx context.Context, addr string, dopts ...grpc.DialOption) (pool.Conn, error) + DisconnectFunc func(ctx context.Context, addr string) error + IsConnectedFunc func(ctx context.Context, addr string) bool + ConnectedAddrsFunc func() []string } // OrderedRangeConcurrent calls the OrderedRangeConcurrentFunc object. @@ -42,3 +47,23 @@ func (gc *GRPCClientMock) OrderedRangeConcurrent(ctx context.Context, ) error { return gc.OrderedRangeConcurrentFunc(ctx, order, concurrency, f) } + +// ConnectedAddrs calls the ConnectedAddrsFunc object. +func (gc *GRPCClientMock) ConnectedAddrs() []string { + return gc.ConnectedAddrsFunc() +} + +// Connect calls the ConnectFunc object. +func (gc *GRPCClientMock) Connect(ctx context.Context, addr string, dopts ...grpc.DialOption) (pool.Conn, error) { + return gc.ConnectFunc(ctx, addr, dopts...) +} + +// Disconnect calls the DisconnectFunc object. +func (gc *GRPCClientMock) Disconnect(ctx context.Context, addr string) error { + return gc.DisconnectFunc(ctx, addr) +} + +// IsConnected calls the IsConnectedFunc object. +func (gc *GRPCClientMock) IsConnected(ctx context.Context, addr string) bool { + return gc.IsConnectedFunc(ctx, addr) +} diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index e82cce670f..dc0042f775 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -169,7 +169,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* exists := make(map[string]bool) var mu sync.Mutex - err := m.gateway.DoMulti(ctx, m.connectedMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + err := m.gateway.DoMulti(ctx, m.connectedOtherMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.registers/"+target) defer func() { if span != nil { @@ -343,8 +343,8 @@ func (m *mirr) isGatewayAddr(addr string) bool { return ok } -// connectedMirrorAddrs returns the addresses of other Mirror Gateways to which this gateway is currently connected. -func (m *mirr) connectedMirrorAddrs() []string { +// connectedOtherMirrorAddrs returns the addresses of other Mirror Gateways to which this gateway is currently connected. +func (m *mirr) connectedOtherMirrorAddrs() []string { connectedAddrs := m.gateway.GRPCClient().ConnectedAddrs() addrs := make([]string, 0, len(connectedAddrs)) for _, addr := range connectedAddrs { @@ -366,20 +366,3 @@ func (m *mirr) RangeAllMirrorAddr(f func(addr string, _ any) bool) { return true }) } - -func (m *mirr) toMirrorTargets(addrs ...string) ([]*payload.Mirror_Target, error) { - tgts := make([]*payload.Mirror_Target, 0, len(addrs)) - for _, addr := range addrs { - if ok := m.isGatewayAddr(addr); !ok { - host, port, err := net.SplitHostPort(addr) - if err != nil { - return nil, err - } - tgts = append(tgts, &payload.Mirror_Target{ - Host: host, - Port: uint32(port), - }) - } - } - return tgts, nil -} diff --git a/pkg/gateway/mirror/service/mirror_test.go b/pkg/gateway/mirror/service/mirror_test.go new file mode 100644 index 0000000000..16b0604d0a --- /dev/null +++ b/pkg/gateway/mirror/service/mirror_test.go @@ -0,0 +1,1207 @@ +package service + +import ( + "context" + "net" + "reflect" + "testing" + + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/net/grpc" + "github.com/vdaas/vald/internal/net/grpc/pool" + "github.com/vdaas/vald/internal/test/goleak" + grpcmock "github.com/vdaas/vald/internal/test/mock/grpc" +) + +func Test_mirr_Connect(t *testing.T) { + type args struct { + ctx context.Context + targets []*payload.Mirror_Target + } + type fields struct { + gatewayAddr string + selfMirrAddr string + gateway Gateway + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + func() test { + gatewayAddr := "192.168.1.2:8081" + selfMirrorAddr := "192.168.1.3:8081" + return test{ + name: "Succeeded to connect to other mirror gateways", + args: args{ + ctx: context.Background(), + targets: []*payload.Mirror_Target{ + { + Host: "192.168.2.2", + Port: 8081, + }, + { + Host: "192.168.3.2", + Port: 8081, + }, + }, + }, + fields: fields{ + selfMirrAddr: selfMirrorAddr, + gatewayAddr: gatewayAddr, + gateway: &GatewayMock{ + GRPCClientFunc: func() grpc.Client { + return &grpcmock.GRPCClientMock{ + IsConnectedFunc: func(_ context.Context, _ string) bool { + return false + }, + ConnectFunc: func(_ context.Context, _ string, _ ...grpc.DialOption) (conn pool.Conn, err error) { + return conn, err + }, + } + }, + }, + }, + } + }(), + func() test { + gatewayAddr := "192.168.1.2:8081" + selfMirrorAddr := "192.168.1.3:8081" + return test{ + name: "Failed to connect to other mirror gateways due to an invalid address", + args: args{ + ctx: context.Background(), + targets: []*payload.Mirror_Target{ + { + Host: "192.168.2.2", + }, + }, + }, + fields: fields{ + selfMirrAddr: selfMirrorAddr, + gatewayAddr: gatewayAddr, + gateway: &GatewayMock{ + GRPCClientFunc: func() grpc.Client { + return &grpcmock.GRPCClientMock{ + IsConnectedFunc: func(_ context.Context, _ string) bool { + return false + }, + ConnectFunc: func(_ context.Context, _ string, _ ...grpc.DialOption) (pool.Conn, error) { + return nil, errors.New("missing port in address") + }, + } + }, + }, + }, + want: want{ + err: errors.New("missing port in address"), + }, + } + }(), + } + + 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 + } + m, err := NewMirror( + WithSelfMirrorAddrs(test.fields.selfMirrAddr), + WithGatewayAddrs(test.fields.gatewayAddr), + WithGateway(test.fields.gateway), + ) + if err != nil { + t.Fatal(err) + } + + err = m.Connect(test.args.ctx, test.args.targets...) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_mirr_Disconnect(t *testing.T) { + type args struct { + ctx context.Context + targets []*payload.Mirror_Target + } + type fields struct { + gatewayAddr string + selfMirrAddr string + gateway Gateway + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + func() test { + gatewayAddr := "192.168.1.2:8081" + selfMirrorAddr := "192.168.1.3:8081" + return test{ + name: "Succeeded to disconnect to other mirror gateways", + args: args{ + ctx: context.Background(), + targets: []*payload.Mirror_Target{ + { + Host: "192.168.2.2", + Port: 8081, + }, + { + Host: "192.168.3.2", + Port: 8081, + }, + }, + }, + fields: fields{ + selfMirrAddr: selfMirrorAddr, + gatewayAddr: gatewayAddr, + gateway: &GatewayMock{ + GRPCClientFunc: func() grpc.Client { + return &grpcmock.GRPCClientMock{ + IsConnectedFunc: func(_ context.Context, _ string) bool { + return true + }, + DisconnectFunc: func(_ context.Context, _ string) error { + return nil + }, + } + }, + }, + }, + } + }(), + func() test { + gatewayAddr := "192.168.1.2:8081" + selfMirrorAddr := "192.168.1.3:8081" + return test{ + name: "Failed to connect to other mirror gateways due to an invalid address", + args: args{ + ctx: context.Background(), + targets: []*payload.Mirror_Target{ + { + Host: "192.168.2.2", + }, + }, + }, + fields: fields{ + selfMirrAddr: selfMirrorAddr, + gatewayAddr: gatewayAddr, + gateway: &GatewayMock{ + GRPCClientFunc: func() grpc.Client { + return &grpcmock.GRPCClientMock{ + IsConnectedFunc: func(_ context.Context, _ string) bool { + return true + }, + DisconnectFunc: func(_ context.Context, _ string) error { + return errors.New("missing port in address") + }, + } + }, + }, + }, + want: want{ + err: errors.New("missing port in address"), + }, + } + }(), + } + + 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 + } + m, err := NewMirror( + WithSelfMirrorAddrs(test.fields.selfMirrAddr), + WithGatewayAddrs(test.fields.gatewayAddr), + WithGateway(test.fields.gateway), + ) + if err != nil { + t.Fatal(err) + } + + err = m.Disconnect(test.args.ctx, test.args.targets...) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_mirr_MirrorTargets(t *testing.T) { + type fields struct { + gatewayAddr string + gateway Gateway + } + type want struct { + want []*payload.Mirror_Target + err error + } + type test struct { + name string + fields fields + want want + checkFunc func(want, []*payload.Mirror_Target, error) error + beforeFunc func(*testing.T) + afterFunc func(*testing.T) + } + defaultCheckFunc := func(w want, got []*payload.Mirror_Target, 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(got, w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } + return nil + } + tests := []test{ + func() test { + gatewayAddr := "192.168.1.3:8081" + connectedAddrs := []string{ + "192.168.1.2:8081", // mirror gateway address. + "192.168.2.2:8081", // mirror gateway address. + gatewayAddr, + } + return test{ + name: "returns only the addresses of the mirror gateways", + fields: fields{ + gatewayAddr: gatewayAddr, + gateway: &GatewayMock{ + GRPCClientFunc: func() grpc.Client { + return &grpcmock.GRPCClientMock{ + ConnectedAddrsFunc: func() []string { + return connectedAddrs + }, + } + }, + }, + }, + want: want{ + want: []*payload.Mirror_Target{ + { + Host: "192.168.1.2", + Port: 8081, + }, + { + Host: "192.168.2.2", + Port: 8081, + }, + }, + }, + } + }(), + func() test { + gatewayAddr := "192.168.1.3:8081" + connectedAddrs := []string{ + "192.168.1.2:8081", // mirror gateway address. + "192.168.2.2", // mirror gateway address. + gatewayAddr, + } + return test{ + name: "returns an error when there is invalid address", + fields: fields{ + gatewayAddr: gatewayAddr, + gateway: &GatewayMock{ + GRPCClientFunc: func() grpc.Client { + return &grpcmock.GRPCClientMock{ + ConnectedAddrsFunc: func() []string { + return connectedAddrs + }, + } + }, + }, + }, + want: want{ + err: &net.AddrError{ + Err: "missing port in address", + Addr: "192.168.2.2", + }, + }, + } + }(), + } + + 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 + } + + m, err := NewMirror( + WithGatewayAddrs(test.fields.gatewayAddr), + WithGateway(test.fields.gateway), + ) + if err != nil { + t.Fatal(err) + } + + got, err := m.MirrorTargets() + if err := checkFunc(test.want, got, err); err != nil { + tt.Errorf("error = %v", err) + } + }) + } +} + +func Test_mirr_connectedOtherMirrorAddrs(t *testing.T) { + type fields struct { + gatewayAddr string + selfMirrAddr string + gateway Gateway + } + type want struct { + want []string + } + type test struct { + name string + fields fields + want want + checkFunc func(want, []string) error + beforeFunc func(*testing.T) + afterFunc func(*testing.T) + } + defaultCheckFunc := func(w want, got []string) error { + if !reflect.DeepEqual(got, w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } + return nil + } + tests := []test{ + func() test { + gatewayAddr := "192.168.1.3:8081" + selfMirrorAddr := "192.168.1.2:8081" + connectedAddrs := []string{ + selfMirrorAddr, + "192.168.2.2:8081", // othre mirror gateway address. + gatewayAddr, + } + return test{ + name: "returns only the address of the other mirror gateway", + fields: fields{ + selfMirrAddr: selfMirrorAddr, + gatewayAddr: gatewayAddr, + gateway: &GatewayMock{ + GRPCClientFunc: func() grpc.Client { + return &grpcmock.GRPCClientMock{ + ConnectedAddrsFunc: func() []string { + return connectedAddrs + }, + } + }, + }, + }, + want: want{ + want: []string{ + "192.168.2.2:8081", + }, + }, + } + }(), + } + + 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 + } + + m, err := NewMirror( + WithSelfMirrorAddrs(test.fields.selfMirrAddr), + WithGatewayAddrs(test.fields.gatewayAddr), + WithGateway(test.fields.gateway), + ) + if err != nil { + t.Fatal(err) + } + if mirr, ok := m.(*mirr); ok { + got := mirr.connectedOtherMirrorAddrs() + if err := checkFunc(test.want, got); err != nil { + tt.Errorf("error = %v", err) + } + } + }) + } +} + +// NOT IMPLEMENTED BELOW +// +// func TestNewMirror(t *testing.T) { +// type args struct { +// opts []MirrorOption +// } +// type want struct { +// want Mirror +// err error +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want, Mirror, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got Mirror, 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(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// opts: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 { +// opts: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 +// } +// +// got, err := NewMirror(test.args.opts...) +// if err := checkFunc(test.want, got, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_mirr_Start(t *testing.T) { +// type args struct { +// ctx context.Context +// } +// type fields struct { +// addrl sync.Map[string, any] +// selfMirrTgts []*payload.Mirror_Target +// selfMirrAddrl sync.Map[string, any] +// gwAddrl sync.Map[string, any] +// eg errgroup.Group +// registerDur time.Duration +// gateway Gateway +// } +// type want struct { +// want <-chan error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, <-chan error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got <-chan error) error { +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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, +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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 +// } +// m := &mirr{ +// addrl: test.fields.addrl, +// selfMirrTgts: test.fields.selfMirrTgts, +// selfMirrAddrl: test.fields.selfMirrAddrl, +// gwAddrl: test.fields.gwAddrl, +// eg: test.fields.eg, +// registerDur: test.fields.registerDur, +// gateway: test.fields.gateway, +// } +// +// got := m.Start(test.args.ctx) +// if err := checkFunc(test.want, got); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_mirr_Disconnect(t *testing.T) { +// type args struct { +// ctx context.Context +// targets []*payload.Mirror_Target +// } +// type fields struct { +// addrl sync.Map[string, any] +// selfMirrTgts []*payload.Mirror_Target +// selfMirrAddrl sync.Map[string, any] +// gwAddrl sync.Map[string, any] +// eg errgroup.Group +// registerDur time.Duration +// gateway Gateway +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// targets:nil, +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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, +// targets:nil, +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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 +// } +// m := &mirr{ +// addrl: test.fields.addrl, +// selfMirrTgts: test.fields.selfMirrTgts, +// selfMirrAddrl: test.fields.selfMirrAddrl, +// gwAddrl: test.fields.gwAddrl, +// eg: test.fields.eg, +// registerDur: test.fields.registerDur, +// gateway: test.fields.gateway, +// } +// +// err := m.Disconnect(test.args.ctx, test.args.targets...) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_mirr_IsConnected(t *testing.T) { +// type args struct { +// ctx context.Context +// addr string +// } +// type fields struct { +// addrl sync.Map[string, any] +// selfMirrTgts []*payload.Mirror_Target +// selfMirrAddrl sync.Map[string, any] +// gwAddrl sync.Map[string, any] +// eg errgroup.Group +// registerDur time.Duration +// gateway Gateway +// } +// type want struct { +// want bool +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, bool) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got bool) error { +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// addr:"", +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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, +// addr:"", +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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 +// } +// m := &mirr{ +// addrl: test.fields.addrl, +// selfMirrTgts: test.fields.selfMirrTgts, +// selfMirrAddrl: test.fields.selfMirrAddrl, +// gwAddrl: test.fields.gwAddrl, +// eg: test.fields.eg, +// registerDur: test.fields.registerDur, +// gateway: test.fields.gateway, +// } +// +// got := m.IsConnected(test.args.ctx, test.args.addr) +// if err := checkFunc(test.want, got); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_mirr_Exist(t *testing.T) { +// type args struct { +// in0 context.Context +// addr string +// } +// type fields struct { +// addrl sync.Map[string, any] +// selfMirrTgts []*payload.Mirror_Target +// selfMirrAddrl sync.Map[string, any] +// gwAddrl sync.Map[string, any] +// eg errgroup.Group +// registerDur time.Duration +// gateway Gateway +// } +// type want struct { +// want bool +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, bool) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got bool) error { +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// in0:nil, +// addr:"", +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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 { +// in0:nil, +// addr:"", +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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 +// } +// m := &mirr{ +// addrl: test.fields.addrl, +// selfMirrTgts: test.fields.selfMirrTgts, +// selfMirrAddrl: test.fields.selfMirrAddrl, +// gwAddrl: test.fields.gwAddrl, +// eg: test.fields.eg, +// registerDur: test.fields.registerDur, +// gateway: test.fields.gateway, +// } +// +// got := m.Exist(test.args.in0, test.args.addr) +// if err := checkFunc(test.want, got); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_mirr_RangeAllMirrorAddr(t *testing.T) { +// type args struct { +// f func(addr string, _ any) bool +// } +// type fields struct { +// addrl sync.Map[string, any] +// selfMirrTgts []*payload.Mirror_Target +// selfMirrAddrl sync.Map[string, any] +// gwAddrl sync.Map[string, any] +// eg errgroup.Group +// registerDur time.Duration +// gateway Gateway +// } +// type want struct { +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want) error { +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// f:nil, +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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 { +// f:nil, +// }, +// fields: fields { +// addrl:nil, +// selfMirrTgts:nil, +// selfMirrAddrl:nil, +// gwAddrl:nil, +// eg:nil, +// registerDur:nil, +// gateway: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 +// } +// m := &mirr{ +// addrl: test.fields.addrl, +// selfMirrTgts: test.fields.selfMirrTgts, +// selfMirrAddrl: test.fields.selfMirrAddrl, +// gwAddrl: test.fields.gwAddrl, +// eg: test.fields.eg, +// registerDur: test.fields.registerDur, +// gateway: test.fields.gateway, +// } +// +// m.RangeAllMirrorAddr(test.args.f) +// if err := checkFunc(test.want); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } From d6580ec3bef2b800be0918039793e40f827519fc Mon Sep 17 00:00:00 2001 From: hlts2 Date: Mon, 4 Dec 2023 18:07:59 +0900 Subject: [PATCH 52/93] fix: add mock definition code Signed-off-by: hlts2 --- .../mirror/service/gateway_mock_test.go | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 pkg/gateway/mirror/service/gateway_mock_test.go diff --git a/pkg/gateway/mirror/service/gateway_mock_test.go b/pkg/gateway/mirror/service/gateway_mock_test.go new file mode 100644 index 0000000000..efe33a389f --- /dev/null +++ b/pkg/gateway/mirror/service/gateway_mock_test.go @@ -0,0 +1,58 @@ +package service + +import ( + "context" + + "github.com/vdaas/vald/apis/grpc/v1/vald" + "github.com/vdaas/vald/internal/net/grpc" +) + +// GatewayMock represents mock struct for Gateway. +type GatewayMock struct { + Gateway + ForwardedContextFunc func(ctx context.Context, podName string) context.Context + FromForwardedContextFunc func(ctx context.Context) string + BroadCastFunc func(ctx context.Context, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error + DoFunc func(ctx context.Context, target string, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) (interface{}, error)) (interface{}, error) + DoMultiFunc func(ctx context.Context, targets []string, + f func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error) error + GRPCClientFunc func() grpc.Client +} + +// ForwardedContext calls ForwardedContextFunc object. +func (gm *GatewayMock) ForwardedContext(ctx context.Context, podName string) context.Context { + return gm.ForwardedContextFunc(ctx, podName) +} + +// FromForwardedContext calls FromForwardedContextFunc object. +func (gm *GatewayMock) FromForwardedContext(ctx context.Context) string { + return gm.FromForwardedContextFunc(ctx) +} + +// BroadCast calls BroadCastFunc object. +func (gm *GatewayMock) BroadCast(ctx context.Context, + f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + return gm.BroadCastFunc(ctx, f) + +} + +// Do calls DoFunc object. +func (gm *GatewayMock) Do(ctx context.Context, target string, + f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) (interface{}, error)) (interface{}, error) { + return gm.DoFunc(ctx, target, f) + +} + +// DoMulti calls DoMultiFunc object. +func (gm *GatewayMock) DoMulti(ctx context.Context, targets []string, + f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + return gm.DoMultiFunc(ctx, targets, f) + +} + +// GRPCClient calls GRPCClientFunc object. +func (gm *GatewayMock) GRPCClient() grpc.Client { + return gm.GRPCClientFunc() +} From 2b1cac5a5fd47946b95b6a544e24d50d73ae89e0 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 09:08:43 +0000 Subject: [PATCH 53/93] style: format code with Gofumpt and Prettier This commit fixes the style issues introduced in d6580ec according to the output from Gofumpt and Prettier. Details: https://github.com/vdaas/vald/pull/2237 --- pkg/gateway/mirror/service/gateway_mock_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/gateway/mirror/service/gateway_mock_test.go b/pkg/gateway/mirror/service/gateway_mock_test.go index efe33a389f..dd1182808f 100644 --- a/pkg/gateway/mirror/service/gateway_mock_test.go +++ b/pkg/gateway/mirror/service/gateway_mock_test.go @@ -33,23 +33,23 @@ func (gm *GatewayMock) FromForwardedContext(ctx context.Context) string { // BroadCast calls BroadCastFunc object. func (gm *GatewayMock) BroadCast(ctx context.Context, - f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error, +) error { return gm.BroadCastFunc(ctx, f) - } // Do calls DoFunc object. func (gm *GatewayMock) Do(ctx context.Context, target string, - f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) (interface{}, error)) (interface{}, error) { + f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) (interface{}, error), +) (interface{}, error) { return gm.DoFunc(ctx, target, f) - } // DoMulti calls DoMultiFunc object. func (gm *GatewayMock) DoMulti(ctx context.Context, targets []string, - f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error) error { + f func(_ context.Context, _ string, _ vald.ClientWithMirror, _ ...grpc.CallOption) error, +) error { return gm.DoMultiFunc(ctx, targets, f) - } // GRPCClient calls GRPCClientFunc object. From 19ee2725e6735259bd0d49dd8c8bf09decef3460 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 5 Dec 2023 11:09:05 +0900 Subject: [PATCH 54/93] fix: use internal method Signed-off-by: hlts2 --- pkg/gateway/mirror/service/mirror.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index dc0042f775..d288dc6edc 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -287,7 +287,7 @@ func (m *mirr) Disconnect(ctx context.Context, targets ...*payload.Mirror_Target } for _, target := range targets { addr := net.JoinHostPort(target.GetHost(), uint16(target.GetPort())) - if _, ok := m.gwAddrl.Load(addr); !ok { + if !m.isGatewayAddr(addr) { _, ok := m.addrl.Load(addr) if ok || m.IsConnected(ctx, addr) { if err := m.gateway.GRPCClient().Disconnect(ctx, addr); err != nil && From f5afe4c64db1a735ec05c017419899521da10626 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 5 Dec 2023 11:43:15 +0900 Subject: [PATCH 55/93] fix: delete Exist method because it is not needed Signed-off-by: hlts2 --- pkg/gateway/mirror/service/discovery.go | 2 +- pkg/gateway/mirror/service/mirror.go | 7 -- pkg/gateway/mirror/service/mirror_test.go | 126 ---------------------- 3 files changed, 1 insertion(+), 134 deletions(-) diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 4538161053..57eed86a5b 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -216,7 +216,7 @@ func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target for addr, name := range curAddrs { // When the status code of a regularly running Register RPC is Unimplemented, the connection to the target will be disconnected // so the status of the resource (CR) may be misaligned. To prevent this, change the status of the resource to Disconnected. - if !d.mirr.Exist(ctx, addr) && current[name].Phase == target.MirrorTargetPhaseConnected { + if !d.mirr.IsConnected(ctx, addr) && current[name].Phase == target.MirrorTargetPhaseConnected { err = errors.Join(err, d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseDisconnected)) } } diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index d288dc6edc..786648f94a 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -41,7 +41,6 @@ type Mirror interface { Connect(ctx context.Context, targets ...*payload.Mirror_Target) error Disconnect(ctx context.Context, targets ...*payload.Mirror_Target) error IsConnected(ctx context.Context, addr string) bool - Exist(ctx context.Context, addr string) bool MirrorTargets() ([]*payload.Mirror_Target, error) RangeAllMirrorAddr(f func(addr string, _ any) bool) } @@ -306,12 +305,6 @@ func (m *mirr) IsConnected(ctx context.Context, addr string) bool { return m.gateway.GRPCClient().IsConnected(ctx, addr) } -// Exist checks if the given address exists in the Mmirror. -func (m *mirr) Exist(_ context.Context, addr string) bool { - _, ok := m.addrl.Load(addr) - return ok -} - // MirrorTargets returns the Mirror targets, including the address of this gateway and the addresses of other Mirror Gateways // to which this gateway is currently connected. func (m *mirr) MirrorTargets() ([]*payload.Mirror_Target, error) { diff --git a/pkg/gateway/mirror/service/mirror_test.go b/pkg/gateway/mirror/service/mirror_test.go index 16b0604d0a..a88f9c3794 100644 --- a/pkg/gateway/mirror/service/mirror_test.go +++ b/pkg/gateway/mirror/service/mirror_test.go @@ -962,132 +962,6 @@ func Test_mirr_connectedOtherMirrorAddrs(t *testing.T) { // } // } // -// func Test_mirr_Exist(t *testing.T) { -// type args struct { -// in0 context.Context -// addr string -// } -// type fields struct { -// addrl sync.Map[string, any] -// selfMirrTgts []*payload.Mirror_Target -// selfMirrAddrl sync.Map[string, any] -// gwAddrl sync.Map[string, any] -// eg errgroup.Group -// registerDur time.Duration -// gateway Gateway -// } -// type want struct { -// want bool -// } -// type test struct { -// name string -// args args -// fields fields -// want want -// checkFunc func(want, bool) error -// beforeFunc func(*testing.T, args) -// afterFunc func(*testing.T, args) -// } -// defaultCheckFunc := func(w want, got bool) error { -// if !reflect.DeepEqual(got, w.want) { -// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) -// } -// return nil -// } -// tests := []test{ -// // TODO test cases -// /* -// { -// name: "test_case_1", -// args: args { -// in0:nil, -// addr:"", -// }, -// fields: fields { -// addrl:nil, -// selfMirrTgts:nil, -// selfMirrAddrl:nil, -// gwAddrl:nil, -// eg:nil, -// registerDur:nil, -// gateway: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 { -// in0:nil, -// addr:"", -// }, -// fields: fields { -// addrl:nil, -// selfMirrTgts:nil, -// selfMirrAddrl:nil, -// gwAddrl:nil, -// eg:nil, -// registerDur:nil, -// gateway: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 -// } -// m := &mirr{ -// addrl: test.fields.addrl, -// selfMirrTgts: test.fields.selfMirrTgts, -// selfMirrAddrl: test.fields.selfMirrAddrl, -// gwAddrl: test.fields.gwAddrl, -// eg: test.fields.eg, -// registerDur: test.fields.registerDur, -// gateway: test.fields.gateway, -// } -// -// got := m.Exist(test.args.in0, test.args.addr) -// if err := checkFunc(test.want, got); err != nil { -// tt.Errorf("error = %v", err) -// } -// -// }) -// } -// } -// // func Test_mirr_RangeAllMirrorAddr(t *testing.T) { // type args struct { // f func(addr string, _ any) bool From 6c2789ca11f111e37329367aec4ae30780455eb8 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 5 Dec 2023 14:45:56 +0900 Subject: [PATCH 56/93] fix: use address cache insted of connectedAddr method Signed-off-by: hlts2 --- .../metrics/gateway/mirror/mirror.go | 2 +- pkg/gateway/mirror/handler/grpc/handler.go | 2 +- pkg/gateway/mirror/service/discovery.go | 2 +- pkg/gateway/mirror/service/mirror.go | 49 ++--- pkg/gateway/mirror/service/mirror_test.go | 173 +++++++++++------- 5 files changed, 131 insertions(+), 97 deletions(-) diff --git a/internal/observability/metrics/gateway/mirror/mirror.go b/internal/observability/metrics/gateway/mirror/mirror.go index 1635e928b5..ae4b5d8d24 100644 --- a/internal/observability/metrics/gateway/mirror/mirror.go +++ b/internal/observability/metrics/gateway/mirror/mirror.go @@ -68,7 +68,7 @@ func (mm *mirrorMetrics) Register(m metrics.Meter) error { targetGauge, }, func(ctx context.Context) { - mm.mirr.RangeAllMirrorAddr(func(addr string, _ any) bool { + mm.mirr.RangeMirrorAddr(func(addr string, _ any) bool { targetGauge.Observe(ctx, 1, attribute.String(targetAddrKey, addr)) return true }) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index f84b19e2a0..7f1bd598f1 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -123,7 +123,7 @@ func (s *server) Register(ctx context.Context, req *payload.Mirror_Targets) (*pa } // Get own address and the addresses of other mirror gateways to which this gateway is currently connected. - tgts, err := s.mirror.MirrorTargets() + tgts, err := s.mirror.MirrorTargets(ctx) if err != nil { err = status.WrapWithInternal(vald.RegisterRPCName+" API failed to get connected vald gateway targets", err, &errdetails.BadRequest{ diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 57eed86a5b..3a6bffa754 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -221,7 +221,7 @@ func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target } } - d.mirr.RangeAllMirrorAddr(func(addr string, _ any) bool { + d.mirr.RangeMirrorAddr(func(addr string, _ any) bool { connected := d.mirr.IsConnected(ctx, addr) if name, ok := curAddrs[addr]; ok { if st := target.MirrorTargetPhaseConnected; connected && current[name].Phase != st { diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index 786648f94a..3185ee6efe 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -41,8 +41,8 @@ type Mirror interface { Connect(ctx context.Context, targets ...*payload.Mirror_Target) error Disconnect(ctx context.Context, targets ...*payload.Mirror_Target) error IsConnected(ctx context.Context, addr string) bool - MirrorTargets() ([]*payload.Mirror_Target, error) - RangeAllMirrorAddr(f func(addr string, _ any) bool) + MirrorTargets(ctx context.Context) ([]*payload.Mirror_Target, error) + RangeMirrorAddr(f func(addr string, _ any) bool) } type mirr struct { @@ -110,7 +110,7 @@ func (m *mirr) Start(ctx context.Context) <-chan error { select { case <-ctx.Done(): case <-tic.C: - tgt, err := m.MirrorTargets() + tgt, err := m.MirrorTargets(ctx) if err != nil { select { case <-ctx.Done(): @@ -139,7 +139,6 @@ func (m *mirr) Start(ctx context.Context) <-chan error { case <-ctx.Done(): return ctx.Err() case ech <- err: - break } } } @@ -168,7 +167,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* exists := make(map[string]bool) var mu sync.Mutex - err := m.gateway.DoMulti(ctx, m.connectedOtherMirrorAddrs(), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { + err := m.gateway.DoMulti(ctx, m.connectedOtherMirrorAddrs(ctx), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.registers/"+target) defer func() { if span != nil { @@ -307,23 +306,29 @@ func (m *mirr) IsConnected(ctx context.Context, addr string) bool { // MirrorTargets returns the Mirror targets, including the address of this gateway and the addresses of other Mirror Gateways // to which this gateway is currently connected. -func (m *mirr) MirrorTargets() ([]*payload.Mirror_Target, error) { - addrs := m.gateway.GRPCClient().ConnectedAddrs() - tgts := make([]*payload.Mirror_Target, 0, len(addrs)+1) - tgts = append(tgts, m.selfMirrTgts...) - for _, addr := range addrs { - if !m.isGatewayAddr(addr) { - host, port, err := net.SplitHostPort(addr) +func (m *mirr) MirrorTargets(ctx context.Context) (tgts []*payload.Mirror_Target, err error) { + tgts = make([]*payload.Mirror_Target, 0, m.addrl.Len()) + m.RangeMirrorAddr(func(addr string, _ any) bool { + if m.IsConnected(ctx, addr) { + var ( + host string + port uint16 + ) + host, port, err = net.SplitHostPort(addr) if err != nil { - return nil, err + return false } tgts = append(tgts, &payload.Mirror_Target{ Host: host, Port: uint32(port), }) } + return true + }) + if err != nil { + return nil, err } - return tgts, nil + return append(tgts, m.selfMirrTgts...), nil } func (m *mirr) isSelfMirrorAddr(addr string) bool { @@ -337,21 +342,19 @@ func (m *mirr) isGatewayAddr(addr string) bool { } // connectedOtherMirrorAddrs returns the addresses of other Mirror Gateways to which this gateway is currently connected. -func (m *mirr) connectedOtherMirrorAddrs() []string { - connectedAddrs := m.gateway.GRPCClient().ConnectedAddrs() - addrs := make([]string, 0, len(connectedAddrs)) - for _, addr := range connectedAddrs { - if !m.isSelfMirrorAddr(addr) && - !m.isGatewayAddr(addr) { +func (m *mirr) connectedOtherMirrorAddrs(ctx context.Context) (addrs []string) { + m.RangeMirrorAddr(func(addr string, _ any) bool { + if m.IsConnected(ctx, addr) { addrs = append(addrs, addr) } - } + return true + }) return addrs } -func (m *mirr) RangeAllMirrorAddr(f func(addr string, _ any) bool) { +func (m *mirr) RangeMirrorAddr(f func(addr string, _ any) bool) { m.addrl.Range(func(addr string, value any) bool { - if !m.isGatewayAddr(addr) { + if !m.isGatewayAddr(addr) && !m.isSelfMirrorAddr(addr) { if !f(addr, value) { return false } diff --git a/pkg/gateway/mirror/service/mirror_test.go b/pkg/gateway/mirror/service/mirror_test.go index a88f9c3794..284a22a286 100644 --- a/pkg/gateway/mirror/service/mirror_test.go +++ b/pkg/gateway/mirror/service/mirror_test.go @@ -2,7 +2,6 @@ package service import ( "context" - "net" "reflect" "testing" @@ -281,9 +280,13 @@ func Test_mirr_Disconnect(t *testing.T) { } func Test_mirr_MirrorTargets(t *testing.T) { + type args struct { + ctx context.Context + } type fields struct { - gatewayAddr string - gateway Gateway + gatewayAddr string + selfMirrAddr string + gateway Gateway } type want struct { want []*payload.Mirror_Target @@ -291,10 +294,11 @@ func Test_mirr_MirrorTargets(t *testing.T) { } type test struct { name string + args args fields fields want want checkFunc func(want, []*payload.Mirror_Target, error) error - beforeFunc func(*testing.T) + beforeFunc func(*testing.T, Mirror) afterFunc func(*testing.T) } defaultCheckFunc := func(w want, got []*payload.Mirror_Target, err error) error { @@ -308,67 +312,67 @@ func Test_mirr_MirrorTargets(t *testing.T) { } tests := []test{ func() test { - gatewayAddr := "192.168.1.3:8081" - connectedAddrs := []string{ - "192.168.1.2:8081", // mirror gateway address. - "192.168.2.2:8081", // mirror gateway address. - gatewayAddr, + gatewayAddr := "192.168.1.2:8081" + selfMirrorAddr := "192.168.1.3:8081" + connectTargets := []*payload.Mirror_Target{ + { + Host: "192.168.1.2", // gateway addresses + Port: 8081, + }, + { + Host: "192.168.2.2", // other mirror address + Port: 8081, + }, + { + Host: "192.168.3.2", // other mirror address + Port: 8081, + }, } + connected := make(map[string]bool) return test{ name: "returns only the addresses of the mirror gateways", + args: args{ + ctx: context.Background(), + }, fields: fields{ - gatewayAddr: gatewayAddr, + gatewayAddr: gatewayAddr, + selfMirrAddr: selfMirrorAddr, gateway: &GatewayMock{ GRPCClientFunc: func() grpc.Client { return &grpcmock.GRPCClientMock{ - ConnectedAddrsFunc: func() []string { - return connectedAddrs + ConnectFunc: func(_ context.Context, addr string, _ ...grpc.DialOption) (conn pool.Conn, err error) { + connected[addr] = true + return conn, err + }, + IsConnectedFunc: func(_ context.Context, addr string) bool { + return connected[addr] }, } }, }, }, + beforeFunc: func(t *testing.T, m Mirror) { + t.Helper() + if err := m.Connect(context.Background(), connectTargets...); err != nil { + t.Fatal(err) + } + }, want: want{ want: []*payload.Mirror_Target{ { - Host: "192.168.1.2", + Host: "192.168.2.2", // other mirror address Port: 8081, }, { - Host: "192.168.2.2", + Host: "192.168.3.2", // other mirror address Port: 8081, }, - }, - }, - } - }(), - func() test { - gatewayAddr := "192.168.1.3:8081" - connectedAddrs := []string{ - "192.168.1.2:8081", // mirror gateway address. - "192.168.2.2", // mirror gateway address. - gatewayAddr, - } - return test{ - name: "returns an error when there is invalid address", - fields: fields{ - gatewayAddr: gatewayAddr, - gateway: &GatewayMock{ - GRPCClientFunc: func() grpc.Client { - return &grpcmock.GRPCClientMock{ - ConnectedAddrsFunc: func() []string { - return connectedAddrs - }, - } + { + Host: "192.168.1.3", // self mirror address + Port: 8081, }, }, }, - want: want{ - err: &net.AddrError{ - Err: "missing port in address", - Addr: "192.168.2.2", - }, - }, } }(), } @@ -378,8 +382,18 @@ func Test_mirr_MirrorTargets(t *testing.T) { t.Run(test.name, func(tt *testing.T) { tt.Parallel() defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) + + m, err := NewMirror( + WithSelfMirrorAddrs(test.fields.selfMirrAddr), + WithGatewayAddrs(test.fields.gatewayAddr), + WithGateway(test.fields.gateway), + ) + if err != nil { + t.Fatal(err) + } + if test.beforeFunc != nil { - test.beforeFunc(tt) + test.beforeFunc(tt, m) } if test.afterFunc != nil { defer test.afterFunc(tt) @@ -389,15 +403,7 @@ func Test_mirr_MirrorTargets(t *testing.T) { checkFunc = defaultCheckFunc } - m, err := NewMirror( - WithGatewayAddrs(test.fields.gatewayAddr), - WithGateway(test.fields.gateway), - ) - if err != nil { - t.Fatal(err) - } - - got, err := m.MirrorTargets() + got, err := m.MirrorTargets(test.args.ctx) if err := checkFunc(test.want, got, err); err != nil { tt.Errorf("error = %v", err) } @@ -406,6 +412,9 @@ func Test_mirr_MirrorTargets(t *testing.T) { } func Test_mirr_connectedOtherMirrorAddrs(t *testing.T) { + type args struct { + ctx context.Context + } type fields struct { gatewayAddr string selfMirrAddr string @@ -416,10 +425,11 @@ func Test_mirr_connectedOtherMirrorAddrs(t *testing.T) { } type test struct { name string + args args fields fields want want checkFunc func(want, []string) error - beforeFunc func(*testing.T) + beforeFunc func(*testing.T, Mirror) afterFunc func(*testing.T) } defaultCheckFunc := func(w want, got []string) error { @@ -430,28 +440,47 @@ func Test_mirr_connectedOtherMirrorAddrs(t *testing.T) { } tests := []test{ func() test { - gatewayAddr := "192.168.1.3:8081" - selfMirrorAddr := "192.168.1.2:8081" - connectedAddrs := []string{ - selfMirrorAddr, - "192.168.2.2:8081", // othre mirror gateway address. - gatewayAddr, + gatewayAddr := "192.168.1.2:8081" + selfMirrorAddr := "192.168.1.3:8081" + connectTargets := []*payload.Mirror_Target{ + { + Host: "192.168.1.2", // gateway addresses + Port: 8081, + }, + { + Host: "192.168.2.2", // other mirror address + Port: 8081, + }, } + connected := make(map[string]bool) return test{ name: "returns only the address of the other mirror gateway", + args: args{ + ctx: context.Background(), + }, fields: fields{ selfMirrAddr: selfMirrorAddr, gatewayAddr: gatewayAddr, gateway: &GatewayMock{ GRPCClientFunc: func() grpc.Client { return &grpcmock.GRPCClientMock{ - ConnectedAddrsFunc: func() []string { - return connectedAddrs + ConnectFunc: func(_ context.Context, addr string, _ ...grpc.DialOption) (conn pool.Conn, err error) { + connected[addr] = true + return conn, err + }, + IsConnectedFunc: func(_ context.Context, addr string) bool { + return connected[addr] }, } }, }, }, + beforeFunc: func(t *testing.T, m Mirror) { + t.Helper() + if err := m.Connect(context.Background(), connectTargets...); err != nil { + t.Fatal(err) + } + }, want: want{ want: []string{ "192.168.2.2:8081", @@ -466,8 +495,18 @@ func Test_mirr_connectedOtherMirrorAddrs(t *testing.T) { t.Run(test.name, func(tt *testing.T) { tt.Parallel() defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) + + m, err := NewMirror( + WithSelfMirrorAddrs(test.fields.selfMirrAddr), + WithGatewayAddrs(test.fields.gatewayAddr), + WithGateway(test.fields.gateway), + ) + if err != nil { + t.Fatal(err) + } + if test.beforeFunc != nil { - test.beforeFunc(tt) + test.beforeFunc(tt, m) } if test.afterFunc != nil { defer test.afterFunc(tt) @@ -477,16 +516,8 @@ func Test_mirr_connectedOtherMirrorAddrs(t *testing.T) { checkFunc = defaultCheckFunc } - m, err := NewMirror( - WithSelfMirrorAddrs(test.fields.selfMirrAddr), - WithGatewayAddrs(test.fields.gatewayAddr), - WithGateway(test.fields.gateway), - ) - if err != nil { - t.Fatal(err) - } if mirr, ok := m.(*mirr); ok { - got := mirr.connectedOtherMirrorAddrs() + got := mirr.connectedOtherMirrorAddrs(test.args.ctx) if err := checkFunc(test.want, got); err != nil { tt.Errorf("error = %v", err) } From b0329171a282268696ab3fe0db289df68bb61bde Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 5 Dec 2023 15:40:13 +0900 Subject: [PATCH 57/93] fix: make format Signed-off-by: hlts2 --- .../observability/metrics/mem/malloc/malloc_test.go | 13 +++++++++++++ pkg/gateway/mirror/service/gateway_mock_test.go | 13 +++++++++++++ pkg/gateway/mirror/service/mirror_test.go | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/internal/observability/metrics/mem/malloc/malloc_test.go b/internal/observability/metrics/mem/malloc/malloc_test.go index 70adfed31d..c71e1540db 100644 --- a/internal/observability/metrics/mem/malloc/malloc_test.go +++ b/internal/observability/metrics/mem/malloc/malloc_test.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package malloc // NOT IMPLEMENTED BELOW diff --git a/pkg/gateway/mirror/service/gateway_mock_test.go b/pkg/gateway/mirror/service/gateway_mock_test.go index dd1182808f..1003af7c52 100644 --- a/pkg/gateway/mirror/service/gateway_mock_test.go +++ b/pkg/gateway/mirror/service/gateway_mock_test.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package service import ( diff --git a/pkg/gateway/mirror/service/mirror_test.go b/pkg/gateway/mirror/service/mirror_test.go index 284a22a286..1648841f65 100644 --- a/pkg/gateway/mirror/service/mirror_test.go +++ b/pkg/gateway/mirror/service/mirror_test.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package service import ( From f34b1428eff48e8b32d6153a5181229779f7d254 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 5 Dec 2023 19:05:32 +0900 Subject: [PATCH 58/93] feat: improve connection management and add new test Signed-off-by: hlts2 --- internal/test/mock/k8s/controller_runtime.go | 100 +++++ internal/test/mock/k8s/reconciler.go | 33 ++ pkg/gateway/mirror/service/discovery.go | 52 ++- .../mirror/service/discovery_option.go | 12 + pkg/gateway/mirror/service/discovery_test.go | 418 ++++++++++++++++++ .../mirror/service/mirror_mock_test.go | 36 ++ 6 files changed, 629 insertions(+), 22 deletions(-) create mode 100644 internal/test/mock/k8s/controller_runtime.go create mode 100644 internal/test/mock/k8s/reconciler.go create mode 100644 pkg/gateway/mirror/service/discovery_test.go create mode 100644 pkg/gateway/mirror/service/mirror_mock_test.go diff --git a/internal/test/mock/k8s/controller_runtime.go b/internal/test/mock/k8s/controller_runtime.go new file mode 100644 index 0000000000..3cd949b9cf --- /dev/null +++ b/internal/test/mock/k8s/controller_runtime.go @@ -0,0 +1,100 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package k8s + +import ( + "context" + + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" +) + +type SubResourceWriterMock struct { + client.SubResourceWriter + + UpdateFunc func(context.Context, client.Object, ...client.SubResourceUpdateOption) error +} + +func (sm *SubResourceWriterMock) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error { + return sm.UpdateFunc(ctx, obj, opts...) +} + +type ClientMock struct { + client.Client + + StatusFunc func() client.SubResourceWriter + GetFunc func(context.Context, client.ObjectKey, client.Object, ...client.GetOption) error + CreateFunc func(context.Context, client.Object, ...client.CreateOption) error + DeleteFunc func(context.Context, client.Object, ...client.DeleteOption) error + DeleteAllOfFunc func(context.Context, client.Object, ...client.DeleteAllOfOption) error +} + +func (cm *ClientMock) Status() client.SubResourceWriter { + return cm.StatusFunc() +} + +func (cm *ClientMock) Get(ctx context.Context, objKey client.ObjectKey, obj client.Object, opts ...client.GetOption) error { + return cm.GetFunc(ctx, objKey, obj, opts...) +} + +func (cm *ClientMock) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error { + return cm.CreateFunc(ctx, obj, opts...) +} + +func (cm *ClientMock) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error { + return cm.Delete(ctx, obj, opts...) +} + +func (cm *ClientMock) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error { + return cm.DeleteAllOf(ctx, obj, opts...) +} + +type ManagerMock struct { + manager.Manager + + GetClientFunc func() client.Client +} + +func (mm *ManagerMock) GetClient() client.Client { + return mm.GetClientFunc() +} + +// NewDefaultManagerMock returns default empty mock object. +func NewDefaultManagerMock() manager.Manager { + return &ManagerMock{ + GetClientFunc: func() client.Client { + return &ClientMock{ + StatusFunc: func() client.SubResourceWriter { + return &SubResourceWriterMock{ + UpdateFunc: func(_ context.Context, _ client.Object, _ ...client.SubResourceUpdateOption) error { + return nil + }, + } + }, + GetFunc: func(_ context.Context, _ client.ObjectKey, _ client.Object, _ ...client.GetOption) error { + return nil + }, + CreateFunc: func(_ context.Context, _ client.Object, _ ...client.CreateOption) error { + return nil + }, + DeleteFunc: func(_ context.Context, _ client.Object, _ ...client.DeleteOption) error { + return nil + }, + DeleteAllOfFunc: func(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error { + return nil + }, + } + }, + } +} diff --git a/internal/test/mock/k8s/reconciler.go b/internal/test/mock/k8s/reconciler.go new file mode 100644 index 0000000000..2613368110 --- /dev/null +++ b/internal/test/mock/k8s/reconciler.go @@ -0,0 +1,33 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package k8s + +import ( + "context" + + "github.com/vdaas/vald/internal/k8s" +) + +type ControllerMock struct { + StartFunc func(ctx context.Context) (<-chan error, error) + GetManagerFunc func() k8s.Manager +} + +func (m *ControllerMock) Start(ctx context.Context) (<-chan error, error) { + return m.StartFunc(ctx) +} + +func (m *ControllerMock) GetManager() k8s.Manager { + return m.GetManagerFunc() +} diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 3a6bffa754..2745953fcf 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -84,23 +84,28 @@ func NewDiscovery(opts ...DiscoveryOption) (dsc Discovery, err error) { target.WithOnErrorFunc(func(err error) { log.Error("failed to reconcile:", err) }), - target.WithOnReconcileFunc(func(ctx context.Context, list map[string]target.Target) { - log.Debugf("mirror reconciled\t%#v", list) - d.targetsByName.Store(&list) - }), + target.WithOnReconcileFunc(d.onReconcile), ) if err != nil { return nil, err } - d.ctrl, err = k8s.New( - k8s.WithDialer(d.der), - k8s.WithControllerName("vald k8s mirror discovery"), - k8s.WithDisableLeaderElection(), - k8s.WithResourceController(watcher), - ) + + if d.ctrl == nil { + d.ctrl, err = k8s.New( + k8s.WithDialer(d.der), + k8s.WithControllerName("vald k8s mirror discovery"), + k8s.WithDisableLeaderElection(), + k8s.WithResourceController(watcher), + ) + } return d, err } +func (d *discovery) onReconcile(ctx context.Context, list map[string]target.Target) { + log.Debugf("mirror reconciled\t%#v", list) + d.targetsByName.Store(&list) +} + // Start initiates the service discovery process. // It returns a channel for receiving errors and an error if the initialization fails. func (d *discovery) Start(ctx context.Context) (<-chan error, error) { @@ -212,7 +217,10 @@ func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target d.updateTarget(ctx, updated)) return current, err } + return current, d.syncWithAddr(ctx, current, curAddrs) +} +func (d *discovery) syncWithAddr(ctx context.Context, current map[string]target.Target, curAddrs map[string]string) (err error) { for addr, name := range curAddrs { // When the status code of a regularly running Register RPC is Unimplemented, the connection to the target will be disconnected // so the status of the resource (CR) may be misaligned. To prevent this, change the status of the resource to Disconnected. @@ -245,7 +253,7 @@ func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target } return true }) - return current, err + return err } func (d *discovery) connectTarget(ctx context.Context, req map[string]*createdTarget) (err error) { @@ -259,10 +267,7 @@ func (d *discovery) connectTarget(ctx context.Context, req map[string]*createdTa err = errors.Join(err, cerr) phase = target.MirrorTargetPhaseDisconnected } - uerr := d.updateMirrorTargetPhase(ctx, created.name, phase) - if uerr != nil { - err = errors.Join(err, uerr) - } + err = errors.Join(err, d.updateMirrorTargetPhase(ctx, created.name, phase)) } return err } @@ -285,18 +290,20 @@ func (d *discovery) createMirrorTargetResource(ctx context.Context, name, host s return d.ctrl.GetManager().GetClient().Create(ctx, mt) } -func (d *discovery) disconnectTarget(ctx context.Context, req map[string]*deletedTarget) error { - if len(req) == 0 { - return nil - } - tgts := make([]*payload.Mirror_Target, 0, len(req)) +func (d *discovery) disconnectTarget(ctx context.Context, req map[string]*deletedTarget) (err error) { for _, deleted := range req { - tgts = append(tgts, &payload.Mirror_Target{ + phase := target.MirrorTargetPhaseDisconnected + derr := d.mirr.Disconnect(ctx, &payload.Mirror_Target{ Host: deleted.host, Port: deleted.port, }) + if derr != nil { + err = errors.Join(err, derr) + phase = target.MirrorTargetPhaseUnknown + } + err = errors.Join(err, d.updateMirrorTargetPhase(ctx, deleted.name, phase)) } - return d.mirr.Disconnect(ctx, tgts...) + return err } func (d *discovery) updateMirrorTargetPhase(ctx context.Context, name string, phase target.MirrorTargetPhase) error { @@ -325,6 +332,7 @@ func (d *discovery) updateTarget(ctx context.Context, req map[string]*updatedTar }) if derr != nil { err = errors.Join(err, derr) + err = errors.Join(err, d.updateMirrorTargetPhase(ctx, updated.name, target.MirrorTargetPhaseUnknown)) } else { if cerr := d.mirr.Connect(ctx, &payload.Mirror_Target{ Host: updated.new.Host, diff --git a/pkg/gateway/mirror/service/discovery_option.go b/pkg/gateway/mirror/service/discovery_option.go index 8159bf18a1..fd6aa1262d 100644 --- a/pkg/gateway/mirror/service/discovery_option.go +++ b/pkg/gateway/mirror/service/discovery_option.go @@ -15,6 +15,7 @@ package service import ( "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/k8s" "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/sync/errgroup" "github.com/vdaas/vald/internal/timeutil" @@ -118,3 +119,14 @@ func WithDiscoverySelfMirrorAddrs(addrs ...string) DiscoveryOption { return nil } } + +// WithDiscoveryController returns the option to set the k8s controller. +func WithDiscoveryController(ctrl k8s.Controller) DiscoveryOption { + return func(d *discovery) error { + if ctrl == nil { + return errors.NewErrInvalidOption("discoveryController", ctrl) + } + d.ctrl = ctrl + return nil + } +} diff --git a/pkg/gateway/mirror/service/discovery_test.go b/pkg/gateway/mirror/service/discovery_test.go new file mode 100644 index 0000000000..c3da8f8a4a --- /dev/null +++ b/pkg/gateway/mirror/service/discovery_test.go @@ -0,0 +1,418 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package service + +import ( + "context" + "reflect" + "testing" + + "github.com/vdaas/vald/apis/grpc/v1/payload" + "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/k8s" + "github.com/vdaas/vald/internal/k8s/vald/mirror/target" + "github.com/vdaas/vald/internal/test/goleak" + k8smock "github.com/vdaas/vald/internal/test/mock/k8s" +) + +func Test_discovery_Start(t *testing.T) { + type args struct { + ctx context.Context + prev map[string]target.Target + } + type fields struct { + ctrl k8s.Controller + mirr Mirror + } + type want struct { + want map[string]target.Target + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, map[string]target.Target, error) error + beforeFunc func(*testing.T, *discovery, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, got map[string]target.Target, 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(got, w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } + return nil + } + tests := []test{ + func() test { + prev := make(map[string]target.Target) + current := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.2", + Port: 8081, + }, + } + return test{ + name: "Succeeded detecting the created resource and connecting to the new target", + args: args{ + ctx: context.Background(), + prev: prev, + }, + fields: fields{ + mirr: &MirrorMock{ + ConnectFunc: func(_ context.Context, _ ...*payload.Mirror_Target) error { + return nil + }, + }, + ctrl: &k8smock.ControllerMock{ + GetManagerFunc: func() k8s.Manager { + return k8smock.NewDefaultManagerMock() + }, + }, + }, + beforeFunc: func(t *testing.T, d *discovery, _ args) { + t.Helper() + d.onReconcile(context.Background(), current) + }, + want: want{ + want: current, + }, + } + }(), + func() test { + prev := make(map[string]target.Target) + current := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.2", + Port: 8081, + }, + } + return test{ + name: "Succeeded detecting the created resource but failed to connect to the new target", + args: args{ + ctx: context.Background(), + prev: prev, + }, + fields: fields{ + mirr: &MirrorMock{ + ConnectFunc: func(_ context.Context, _ ...*payload.Mirror_Target) error { + return errors.New("err") + }, + }, + ctrl: &k8smock.ControllerMock{ + GetManagerFunc: func() k8s.Manager { + return k8smock.NewDefaultManagerMock() + }, + }, + }, + beforeFunc: func(t *testing.T, d *discovery, _ args) { + t.Helper() + d.onReconcile(context.Background(), current) + }, + want: want{ + want: current, + err: errors.New("err"), + }, + } + }(), + func() test { + prev := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.2", + Port: 8081, + }, + } + current := make(map[string]target.Target) + return test{ + name: "Succeeded detecting the deleted resource and disconnecting the target", + args: args{ + ctx: context.Background(), + prev: prev, + }, + fields: fields{ + mirr: &MirrorMock{ + DisconnectFunc: func(_ context.Context, _ ...*payload.Mirror_Target) error { + return nil + }, + }, + ctrl: &k8smock.ControllerMock{ + GetManagerFunc: func() k8s.Manager { + return k8smock.NewDefaultManagerMock() + }, + }, + }, + beforeFunc: func(t *testing.T, d *discovery, _ args) { + t.Helper() + d.onReconcile(context.Background(), current) + }, + want: want{ + want: current, + }, + } + }(), + func() test { + prev := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.2", + Port: 8081, + }, + } + current := make(map[string]target.Target) + return test{ + name: "Succeeded detecting the deleted resource but failed to disconnect the target", + args: args{ + ctx: context.Background(), + prev: prev, + }, + fields: fields{ + mirr: &MirrorMock{ + DisconnectFunc: func(_ context.Context, _ ...*payload.Mirror_Target) error { + return errors.New("err") + }, + }, + ctrl: &k8smock.ControllerMock{ + GetManagerFunc: func() k8s.Manager { + return k8smock.NewDefaultManagerMock() + }, + }, + }, + beforeFunc: func(t *testing.T, d *discovery, _ args) { + t.Helper() + d.onReconcile(context.Background(), current) + }, + want: want{ + want: current, + err: errors.New("err"), + }, + } + }(), + func() test { + prev := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.2", + Port: 8081, + }, + } + current := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.3", + Port: 8081, + }, + } + return test{ + name: "Succeeded detecting the updated resource and updating the target connection", + args: args{ + ctx: context.Background(), + prev: prev, + }, + fields: fields{ + mirr: &MirrorMock{ + ConnectFunc: func(_ context.Context, _ ...*payload.Mirror_Target) error { + return nil + }, + DisconnectFunc: func(_ context.Context, _ ...*payload.Mirror_Target) error { + return nil + }, + }, + ctrl: &k8smock.ControllerMock{ + GetManagerFunc: func() k8s.Manager { + return k8smock.NewDefaultManagerMock() + }, + }, + }, + beforeFunc: func(t *testing.T, d *discovery, _ args) { + t.Helper() + d.onReconcile(context.Background(), current) + }, + want: want{ + want: current, + }, + } + }(), + func() test { + prev := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.2", + Port: 8081, + }, + } + current := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.3", + Port: 8081, + }, + } + return test{ + name: "Succeeded detecting the updated resource and failed to update the target connection", + args: args{ + ctx: context.Background(), + prev: prev, + }, + fields: fields{ + mirr: &MirrorMock{ + ConnectFunc: func(_ context.Context, _ ...*payload.Mirror_Target) error { + return nil + }, + DisconnectFunc: func(_ context.Context, _ ...*payload.Mirror_Target) error { + return errors.New("err") + }, + }, + ctrl: &k8smock.ControllerMock{ + GetManagerFunc: func() k8s.Manager { + return k8smock.NewDefaultManagerMock() + }, + }, + }, + beforeFunc: func(t *testing.T, d *discovery, _ args) { + t.Helper() + d.onReconcile(context.Background(), current) + }, + want: want{ + want: current, + err: errors.New("err"), + }, + } + }(), + } + + for _, tc := range tests { + test := tc + t.Run(test.name, func(tt *testing.T) { + tt.Parallel() + defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) + + d, err := NewDiscovery( + WithDiscoveryController(test.fields.ctrl), + WithDiscoveryMirror(test.fields.mirr), + ) + if err != nil { + t.Fatal(err) + } + + if dis, ok := d.(*discovery); ok { + if test.beforeFunc != nil { + test.beforeFunc(tt, dis, test.args) + } + if test.afterFunc != nil { + defer test.afterFunc(tt, test.args) + } + checkFunc := test.checkFunc + if test.checkFunc == nil { + checkFunc = defaultCheckFunc + } + + got, err := dis.startSync(test.args.ctx, test.args.prev) + if err := checkFunc(test.want, got, err); err != nil { + tt.Errorf("error = %v", err) + } + } + }) + } +} + +// NOT IMPLEMENTED BELOW +// +// func TestNewDiscovery(t *testing.T) { +// type args struct { +// opts []DiscoveryOption +// } +// type want struct { +// wantDsc Discovery +// err error +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want, Discovery, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotDsc Discovery, 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(gotDsc, w.wantDsc) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotDsc, w.wantDsc) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// opts: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 { +// opts: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 +// } +// +// gotDsc, err := NewDiscovery(test.args.opts...) +// if err := checkFunc(test.want, gotDsc, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// diff --git a/pkg/gateway/mirror/service/mirror_mock_test.go b/pkg/gateway/mirror/service/mirror_mock_test.go new file mode 100644 index 0000000000..311a5f4702 --- /dev/null +++ b/pkg/gateway/mirror/service/mirror_mock_test.go @@ -0,0 +1,36 @@ +package service + +import ( + "context" + + "github.com/vdaas/vald/apis/grpc/v1/payload" +) + +// MirrorMock represents mock struct for Gateway. +type MirrorMock struct { + Mirror + ConnectFunc func(ctx context.Context, targets ...*payload.Mirror_Target) error + DisconnectFunc func(ctx context.Context, targets ...*payload.Mirror_Target) error + IsConnectedFunc func(ctx context.Context, addr string) bool + RangeMirrorAddrFunc func(f func(addr string, _ any) bool) +} + +// Connect calls ConnectFunc object. +func (mm *MirrorMock) Connect(ctx context.Context, targets ...*payload.Mirror_Target) error { + return mm.ConnectFunc(ctx, targets...) +} + +// Disconnect calls DisconnectFunc object. +func (mm *MirrorMock) Disconnect(ctx context.Context, targets ...*payload.Mirror_Target) error { + return mm.DisconnectFunc(ctx, targets...) +} + +// IsConnected calls IsConnectedFunc object. +func (mm *MirrorMock) IsConnected(ctx context.Context, addr string) bool { + return mm.IsConnectedFunc(ctx, addr) +} + +// RangeMirrorAddr calls RangeMirrorAddrFunc object. +func (mm *MirrorMock) RangeMirrorAddr(f func(addr string, _ any) bool) { + mm.RangeMirrorAddrFunc(f) +} From 7c502f00b0bc040586b6bef7fde1eb0bd761f488 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 5 Dec 2023 19:06:10 +0900 Subject: [PATCH 59/93] fix: make format Signed-off-by: hlts2 --- pkg/gateway/mirror/service/mirror_mock_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/gateway/mirror/service/mirror_mock_test.go b/pkg/gateway/mirror/service/mirror_mock_test.go index 311a5f4702..d03eea0c12 100644 --- a/pkg/gateway/mirror/service/mirror_mock_test.go +++ b/pkg/gateway/mirror/service/mirror_mock_test.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package service import ( From 1cb666243ff405b64de0c2cc60a2f0267388f540 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 5 Dec 2023 19:39:53 +0900 Subject: [PATCH 60/93] fix: lint warnning Signed-off-by: hlts2 --- internal/test/mock/k8s/controller_runtime.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/test/mock/k8s/controller_runtime.go b/internal/test/mock/k8s/controller_runtime.go index 3cd949b9cf..10090e0a9c 100644 --- a/internal/test/mock/k8s/controller_runtime.go +++ b/internal/test/mock/k8s/controller_runtime.go @@ -53,11 +53,11 @@ func (cm *ClientMock) Create(ctx context.Context, obj client.Object, opts ...cli } func (cm *ClientMock) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error { - return cm.Delete(ctx, obj, opts...) + return cm.DeleteFunc(ctx, obj, opts...) } func (cm *ClientMock) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error { - return cm.DeleteAllOf(ctx, obj, opts...) + return cm.DeleteAllOfFunc(ctx, obj, opts...) } type ManagerMock struct { From ffa4eb64d4a98a023ad6dd73bd997431e8d22bff Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 6 Dec 2023 11:39:24 +0900 Subject: [PATCH 61/93] fix: refactor error handling Signed-off-by: hlts2 --- internal/k8s/vald/mirror/target/target.go | 6 +- pkg/gateway/mirror/service/discovery.go | 93 +++++++++++------------ 2 files changed, 47 insertions(+), 52 deletions(-) diff --git a/internal/k8s/vald/mirror/target/target.go b/internal/k8s/vald/mirror/target/target.go index f4f4edc7b9..6c6692ea5f 100644 --- a/internal/k8s/vald/mirror/target/target.go +++ b/internal/k8s/vald/mirror/target/target.go @@ -84,11 +84,7 @@ func (r *reconciler) addListOpts(opt client.ListOption) { func (r *reconciler) Reconcile(ctx context.Context, req reconcile.Request) (res reconcile.Result, err error) { ml := &mirrv1.ValdMirrorTargetList{} - if len(r.lopts) != 0 { - err = r.mgr.GetClient().List(ctx, ml, r.lopts...) - } else { - err = r.mgr.GetClient().List(ctx, ml) - } + err = r.mgr.GetClient().List(ctx, ml, r.lopts...) if err != nil { r.onError(err) if apierr.IsNotFound(err) { diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 2745953fcf..416cc58738 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -151,7 +151,7 @@ func (d *discovery) loadTargets() map[string]target.Target { if v := d.targetsByName.Load(); v != nil { return *v } - return nil + return map[string]target.Target{} } type createdTarget struct { @@ -171,9 +171,9 @@ type deletedTarget struct { port uint32 } -func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target) (current map[string]target.Target, err error) { +func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target) (current map[string]target.Target, errs error) { current = d.loadTargets() - curAddrs := make(map[string]string) // map[addr: metadata.name] + curAddrs := map[string]string{} // map[addr: metadata.name] created := map[string]*createdTarget{} // map[addr: target.Target] updated := map[string]*updatedTarget{} // map[addr: *updatedTarget] @@ -210,22 +210,29 @@ func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target if len(created) != 0 || len(deleted) != 0 || len(updated) != 0 { log.Infof("created: %#v\tupdated: %#v\tdeleted: %#v", created, updated, deleted) - err = errors.Join( - errors.Join( - d.connectTarget(ctx, created), - d.disconnectTarget(ctx, deleted)), - d.updateTarget(ctx, updated)) - return current, err + if err := d.connectTarget(ctx, created); err != nil { + errs = errors.Join(errs, err) + } + if err := d.disconnectTarget(ctx, deleted); err != nil { + errs = errors.Join(errs, err) + } + if err := d.updateTarget(ctx, updated); err != nil { + errs = errors.Join(errs, err) + } + return current, errs } return current, d.syncWithAddr(ctx, current, curAddrs) } -func (d *discovery) syncWithAddr(ctx context.Context, current map[string]target.Target, curAddrs map[string]string) (err error) { +func (d *discovery) syncWithAddr(ctx context.Context, current map[string]target.Target, curAddrs map[string]string) (errs error) { for addr, name := range curAddrs { // When the status code of a regularly running Register RPC is Unimplemented, the connection to the target will be disconnected // so the status of the resource (CR) may be misaligned. To prevent this, change the status of the resource to Disconnected. - if !d.mirr.IsConnected(ctx, addr) && current[name].Phase == target.MirrorTargetPhaseConnected { - err = errors.Join(err, d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseDisconnected)) + connected := d.mirr.IsConnected(ctx, addr) + if !connected && current[name].Phase == target.MirrorTargetPhaseConnected { + errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseDisconnected)) + } else if connected && current[name].Phase != target.MirrorTargetPhaseConnected { + errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseConnected)) } } @@ -233,43 +240,38 @@ func (d *discovery) syncWithAddr(ctx context.Context, current map[string]target. connected := d.mirr.IsConnected(ctx, addr) if name, ok := curAddrs[addr]; ok { if st := target.MirrorTargetPhaseConnected; connected && current[name].Phase != st { - err = errors.Join(err, - d.updateMirrorTargetPhase(ctx, name, st)) + errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, name, st)) } else if st := target.MirrorTargetPhaseDisconnected; !connected && current[name].Phase != st { - err = errors.Join(err, - d.updateMirrorTargetPhase(ctx, name, st)) + errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, name, st)) } } else if !ok && connected { - var ( - host string - port uint16 - ) - host, port, err = net.SplitHostPort(addr) + host, port, err := net.SplitHostPort(addr) if err != nil { log.Error(err) + return true } name := resourcePrefix + "-" + strconv.FormatUint(xxh3.HashString(d.selfMirrAddrStr+addr), 10) - err = errors.Join(err, d.createMirrorTargetResource(ctx, name, host, int(port))) + errs = errors.Join(errs, d.createMirrorTargetResource(ctx, name, host, int(port))) } return true }) - return err + return errs } -func (d *discovery) connectTarget(ctx context.Context, req map[string]*createdTarget) (err error) { +func (d *discovery) connectTarget(ctx context.Context, req map[string]*createdTarget) (errs error) { for _, created := range req { phase := target.MirrorTargetPhaseConnected - cerr := d.mirr.Connect(ctx, &payload.Mirror_Target{ + err := d.mirr.Connect(ctx, &payload.Mirror_Target{ Host: created.tgt.Host, Port: uint32(created.tgt.Port), }) - if cerr != nil { - err = errors.Join(err, cerr) + if err != nil { + errs = errors.Join(errs, err) phase = target.MirrorTargetPhaseDisconnected } - err = errors.Join(err, d.updateMirrorTargetPhase(ctx, created.name, phase)) + errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, created.name, phase)) } - return err + return errs } func (d *discovery) createMirrorTargetResource(ctx context.Context, name, host string, port int) error { @@ -290,20 +292,20 @@ func (d *discovery) createMirrorTargetResource(ctx context.Context, name, host s return d.ctrl.GetManager().GetClient().Create(ctx, mt) } -func (d *discovery) disconnectTarget(ctx context.Context, req map[string]*deletedTarget) (err error) { +func (d *discovery) disconnectTarget(ctx context.Context, req map[string]*deletedTarget) (errs error) { for _, deleted := range req { phase := target.MirrorTargetPhaseDisconnected - derr := d.mirr.Disconnect(ctx, &payload.Mirror_Target{ + err := d.mirr.Disconnect(ctx, &payload.Mirror_Target{ Host: deleted.host, Port: deleted.port, }) - if derr != nil { - err = errors.Join(err, derr) + if err != nil { + errs = errors.Join(errs, err) phase = target.MirrorTargetPhaseUnknown } - err = errors.Join(err, d.updateMirrorTargetPhase(ctx, deleted.name, phase)) + errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, deleted.name, phase)) } - return err + return errs } func (d *discovery) updateMirrorTargetPhase(ctx context.Context, name string, phase target.MirrorTargetPhase) error { @@ -324,26 +326,23 @@ func (d *discovery) updateMirrorTargetPhase(ctx context.Context, name string, ph return c.Status().Update(ctx, mt) } -func (d *discovery) updateTarget(ctx context.Context, req map[string]*updatedTarget) (err error) { +func (d *discovery) updateTarget(ctx context.Context, req map[string]*updatedTarget) (errs error) { for _, updated := range req { - derr := d.mirr.Disconnect(ctx, &payload.Mirror_Target{ + err := d.mirr.Disconnect(ctx, &payload.Mirror_Target{ Host: updated.old.Host, Port: uint32(updated.old.Port), }) - if derr != nil { - err = errors.Join(err, derr) - err = errors.Join(err, d.updateMirrorTargetPhase(ctx, updated.name, target.MirrorTargetPhaseUnknown)) + if err != nil { + errs = errors.Join(errs, err, d.updateMirrorTargetPhase(ctx, updated.name, target.MirrorTargetPhaseUnknown)) } else { - if cerr := d.mirr.Connect(ctx, &payload.Mirror_Target{ + err := d.mirr.Connect(ctx, &payload.Mirror_Target{ Host: updated.new.Host, Port: uint32(updated.new.Port), - }); cerr != nil { - err = errors.Join(cerr, err) - if uerr := d.updateMirrorTargetPhase(ctx, updated.name, target.MirrorTargetPhaseDisconnected); uerr != nil { - err = errors.Join(err, uerr) - } + }) + if err != nil { + errs = errors.Join(errs, err, d.updateMirrorTargetPhase(ctx, updated.name, target.MirrorTargetPhaseDisconnected)) } } } - return err + return errs } From 21b781f906d56c5a43df98788087ea1a15970bc8 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 6 Dec 2023 16:51:42 +0900 Subject: [PATCH 62/93] feat: add test for syncronizee based on address and small refactor Signed-off-by: hlts2 --- pkg/gateway/mirror/service/discovery.go | 24 ++- pkg/gateway/mirror/service/discovery_test.go | 179 ++++++++++++++++++- pkg/gateway/mirror/service/mirror_test.go | 10 ++ 3 files changed, 206 insertions(+), 7 deletions(-) diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 416cc58738..412d55f406 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -229,9 +229,9 @@ func (d *discovery) syncWithAddr(ctx context.Context, current map[string]target. // When the status code of a regularly running Register RPC is Unimplemented, the connection to the target will be disconnected // so the status of the resource (CR) may be misaligned. To prevent this, change the status of the resource to Disconnected. connected := d.mirr.IsConnected(ctx, addr) - if !connected && current[name].Phase == target.MirrorTargetPhaseConnected { + if !connected && isConnectedPhase(current[name].Phase) { errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseDisconnected)) - } else if connected && current[name].Phase != target.MirrorTargetPhaseConnected { + } else if connected && !isConnectedPhase(current[name].Phase) { errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseConnected)) } } @@ -239,10 +239,14 @@ func (d *discovery) syncWithAddr(ctx context.Context, current map[string]target. d.mirr.RangeMirrorAddr(func(addr string, _ any) bool { connected := d.mirr.IsConnected(ctx, addr) if name, ok := curAddrs[addr]; ok { - if st := target.MirrorTargetPhaseConnected; connected && current[name].Phase != st { - errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, name, st)) - } else if st := target.MirrorTargetPhaseDisconnected; !connected && current[name].Phase != st { - errs = errors.Join(errs, d.updateMirrorTargetPhase(ctx, name, st)) + if connected && !isConnectedPhase(current[name].Phase) { + errs = errors.Join(errs, + d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseConnected), + ) + } else if !connected && !isDisconnectedPhase(current[name].Phase) { + errs = errors.Join(errs, + d.updateMirrorTargetPhase(ctx, name, target.MirrorTargetPhaseDisconnected), + ) } } else if !ok && connected { host, port, err := net.SplitHostPort(addr) @@ -346,3 +350,11 @@ func (d *discovery) updateTarget(ctx context.Context, req map[string]*updatedTar } return errs } + +func isConnectedPhase(phase target.MirrorTargetPhase) bool { + return phase == target.MirrorTargetPhaseConnected +} + +func isDisconnectedPhase(phase target.MirrorTargetPhase) bool { + return phase == target.MirrorTargetPhaseDisconnected +} diff --git a/pkg/gateway/mirror/service/discovery_test.go b/pkg/gateway/mirror/service/discovery_test.go index c3da8f8a4a..66a4f596d1 100644 --- a/pkg/gateway/mirror/service/discovery_test.go +++ b/pkg/gateway/mirror/service/discovery_test.go @@ -26,7 +26,7 @@ import ( k8smock "github.com/vdaas/vald/internal/test/mock/k8s" ) -func Test_discovery_Start(t *testing.T) { +func Test_discovery_startSync(t *testing.T) { type args struct { ctx context.Context prev map[string]target.Target @@ -324,6 +324,183 @@ func Test_discovery_Start(t *testing.T) { } } +func Test_discovery_syncWithAddr(t *testing.T) { + type args struct { + ctx context.Context + current map[string]target.Target + curAddrs map[string]string + } + type fields struct { + ctrl k8s.Controller + mirr Mirror + } + type want struct { + err error + } + type test struct { + name string + args args + fields fields + want want + checkFunc func(want, error) error + beforeFunc func(*testing.T, *discovery, args) + afterFunc func(*testing.T, args) + } + defaultCheckFunc := func(w want, err error) error { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + } + return nil + } + tests := []test{ + func() test { + current := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.2", + Port: 8081, + Phase: target.MirrorTargetPhaseConnected, + }, + } + curAddrs := map[string]string{ + "192.168.1.2:8081": "mirror-1", + } + + return test{ + name: "Succeeded to change to disconnected phase when curAddrs are not connected", + args: args{ + ctx: context.Background(), + current: current, + curAddrs: curAddrs, + }, + fields: fields{ + mirr: &MirrorMock{ + IsConnectedFunc: func(_ context.Context, _ string) bool { + return false + }, + RangeMirrorAddrFunc: func(_ func(addr string, _ any) bool) { + // There is no connection. + }, + }, + ctrl: &k8smock.ControllerMock{ + GetManagerFunc: func() k8s.Manager { + return k8smock.NewDefaultManagerMock() + }, + }, + }, + beforeFunc: func(t *testing.T, d *discovery, _ args) { + t.Helper() + d.onReconcile(context.Background(), current) + }, + } + }(), + func() test { + current := map[string]target.Target{ + "mirror-1": { + Host: "192.168.1.2", + Port: 8081, + Phase: target.MirrorTargetPhaseDisconnected, + }, + } + curAddrs := map[string]string{ + "192.168.1.2:8081": "mirror-1", + } + + return test{ + name: "Succeeded to change to connected phase when curAddrs are connected", + args: args{ + ctx: context.Background(), + current: current, + curAddrs: curAddrs, + }, + fields: fields{ + mirr: &MirrorMock{ + IsConnectedFunc: func(_ context.Context, _ string) bool { + return true + }, + RangeMirrorAddrFunc: func(f func(addr string, _ any) bool) { + for addr := range curAddrs { + f(addr, struct{}{}) + } + }, + }, + ctrl: &k8smock.ControllerMock{ + GetManagerFunc: func() k8s.Manager { + return k8smock.NewDefaultManagerMock() + }, + }, + }, + } + }(), + func() test { + current := map[string]target.Target{} + curAddrs := map[string]string{} + newAddrs := []string{ + "192.168.1.2:8081", + } + + return test{ + name: "Succeeded to create new resource when there is a new connection", + args: args{ + ctx: context.Background(), + current: current, + curAddrs: curAddrs, + }, + fields: fields{ + mirr: &MirrorMock{ + IsConnectedFunc: func(_ context.Context, _ string) bool { + return true + }, + RangeMirrorAddrFunc: func(f func(addr string, _ any) bool) { + for _, addr := range newAddrs { + f(addr, struct{}{}) + } + }, + }, + ctrl: &k8smock.ControllerMock{ + GetManagerFunc: func() k8s.Manager { + return k8smock.NewDefaultManagerMock() + }, + }, + }, + } + }(), + } + + for _, tc := range tests { + test := tc + t.Run(test.name, func(tt *testing.T) { + tt.Parallel() + defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) + + d, err := NewDiscovery( + WithDiscoveryController(test.fields.ctrl), + WithDiscoveryMirror(test.fields.mirr), + ) + if err != nil { + t.Fatal(err) + } + + if dis, ok := d.(*discovery); ok { + if test.beforeFunc != nil { + test.beforeFunc(tt, dis, test.args) + } + if test.afterFunc != nil { + defer test.afterFunc(tt, test.args) + } + checkFunc := test.checkFunc + if test.checkFunc == nil { + checkFunc = defaultCheckFunc + } + + err := dis.syncWithAddr(test.args.ctx, test.args.current, test.args.curAddrs) + if err := checkFunc(test.want, err); err != nil { + tt.Errorf("error = %v", err) + } + } + }) + } +} + // NOT IMPLEMENTED BELOW // // func TestNewDiscovery(t *testing.T) { diff --git a/pkg/gateway/mirror/service/mirror_test.go b/pkg/gateway/mirror/service/mirror_test.go index 1648841f65..581fb4f7ff 100644 --- a/pkg/gateway/mirror/service/mirror_test.go +++ b/pkg/gateway/mirror/service/mirror_test.go @@ -16,6 +16,7 @@ package service import ( "context" "reflect" + "sort" "testing" "github.com/vdaas/vald/apis/grpc/v1/payload" @@ -318,6 +319,15 @@ func Test_mirr_MirrorTargets(t *testing.T) { if !errors.Is(err, w.err) { return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) } + if len(got) != len(w.want) { + return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) + } + sort.Slice(got, func(i, j int) bool { + return got[i].Host > got[j].Host + }) + sort.Slice(w.want, func(i, j int) bool { + return w.want[i].Host > w.want[j].Host + }) if !reflect.DeepEqual(got, w.want) { return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) } From 08a6bc1ce858a5a228d92b5ec6c394004daa3bba Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 12:05:10 +0900 Subject: [PATCH 63/93] fix: improve error handling and example image tag Signed-off-by: hlts2 --- .../multi-vald/dev-vald-with-mirror.yaml | 2 +- pkg/gateway/mirror/service/discovery.go | 4 +- pkg/gateway/mirror/service/mirror.go | 46 +++++++++++++++++-- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml index bc0f1adf48..49317fc91a 100644 --- a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml +++ b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml @@ -15,7 +15,7 @@ # defaults: image: - tag: pr-1948 # TODO: Delete it later. + tag: pr-2237 # TODO: Delete it later. server_config: metrics: pprof: diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 412d55f406..80609d8140 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -129,7 +129,7 @@ func (d *discovery) Start(ctx context.Context) (<-chan error, error) { if err != nil { select { case <-ctx.Done(): - return errors.Join(err, ctx.Err()) + return errors.Join(ctx.Err(), err) case ech <- err: } } @@ -137,7 +137,7 @@ func (d *discovery) Start(ctx context.Context) (<-chan error, error) { if err != nil { select { case <-ctx.Done(): - return errors.Join(err, ctx.Err()) + return errors.Join(ctx.Err(), err) case ech <- err: } } diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index 3185ee6efe..61c3a5e127 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -109,12 +109,13 @@ func (m *mirr) Start(ctx context.Context) <-chan error { for { select { case <-ctx.Done(): + return ctx.Err() case <-tic.C: tgt, err := m.MirrorTargets(ctx) if err != nil { select { case <-ctx.Done(): - return ctx.Err() + return errors.Join(ctx.Err(), err) case ech <- err: break } @@ -129,7 +130,7 @@ func (m *mirr) Start(ctx context.Context) <-chan error { } select { case <-ctx.Done(): - return ctx.Err() + return errors.Join(ctx.Err(), err) case ech <- err: } } @@ -137,7 +138,7 @@ func (m *mirr) Start(ctx context.Context) <-chan error { if err := m.Connect(ctx, resTgts...); err != nil { select { case <-ctx.Done(): - return ctx.Err() + return errors.Join(ctx.Err(), err) case ech <- err: } } @@ -165,6 +166,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* } resTgts := make([]*payload.Mirror_Target, 0, len(tgts.GetTargets())) exists := make(map[string]bool) + var result sync.Map[string, error] // map[target host: error] var mu sync.Mutex err := m.gateway.DoMulti(ctx, m.connectedOtherMirrorAddrs(ctx), func(ctx context.Context, target string, vc vald.ClientWithMirror, copts ...grpc.CallOption) error { @@ -194,6 +196,11 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* vald.RegisterRPCName+" API connection not found", err, reqInfo, resInfo, ) attrs = trace.StatusCodeInternal(err.Error()) + case errors.Is(err, errors.ErrTargetNotFound): + err = status.WrapWithInvalidArgument( + vald.RegisterRPCName+" API target not found", err, reqInfo, resInfo, + ) + attrs = trace.StatusCodeInvalidArgument(err.Error()) default: var ( st *status.Status @@ -226,6 +233,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* span.SetAttributes(attrs...) span.SetStatus(trace.StatusError, err.Error()) } + result.Store(target, err) return err } if res != nil && len(res.GetTargets()) > 0 { @@ -241,6 +249,37 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* } return nil }) + result.Range(func(target string, rerr error) bool { + if rerr != nil { + err = errors.Join(err, errors.Wrapf(rerr, "failed to "+vald.RegisterRPCName+" API to %s", target)) + } + return true + }) + if err != nil { + if errors.Is(err, errors.ErrGRPCClientConnNotFound("*")) { + err = status.WrapWithInternal( + vald.RegisterRPCName+" API connection not found", err, reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.StatusCodeInternal(err.Error())...) + span.SetStatus(trace.StatusError, err.Error()) + } + return nil, err + } + + st, msg, err := status.ParseError(err, codes.Internal, + "failed to parse "+vald.RegisterRPCName+" gRPC error response", reqInfo, resInfo, + ) + log.Warn(err) + if span != nil { + span.RecordError(err) + span.SetAttributes(trace.FromGRPCStatus(st.Code(), msg)...) + span.SetStatus(trace.StatusError, err.Error()) + } + return resTgts, err + } return resTgts, err } @@ -352,6 +391,7 @@ func (m *mirr) connectedOtherMirrorAddrs(ctx context.Context) (addrs []string) { return addrs } +// RangeMirrorAddr calls f sequentially for each key and value present in the connection map. If f returns false, range stops the iteration. func (m *mirr) RangeMirrorAddr(f func(addr string, _ any) bool) { m.addrl.Range(func(addr string, value any) bool { if !m.isGatewayAddr(addr) && !m.isSelfMirrorAddr(addr) { From 5bee19045e22876711e03a2996452a5734bdb57b Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 13:54:58 +0900 Subject: [PATCH 64/93] fix: schema update and format Signed-off-by: hlts2 --- charts/vald/values.schema.json | 1802 ++++++++++++++++---------------- 1 file changed, 903 insertions(+), 899 deletions(-) diff --git a/charts/vald/values.schema.json b/charts/vald/values.schema.json index c2266cd221..9b856d0625 100644 --- a/charts/vald/values.schema.json +++ b/charts/vald/values.schema.json @@ -16183,1104 +16183,1108 @@ }, "readreplica": { "type": "object", - "description": "[This feature is work in progress] readreplica agents rotation job", "properties": { - "": { "type": "object" }, - "agent_namespace": { - "type": "string", - "description": "namespace of agent pods to manage" - }, - "clusterRole": { + "rotator": { "type": "object", + "description": "[This feature is work in progress] readreplica agents rotation job", "properties": { - "enabled": { - "type": "boolean", - "description": "creates clusterRole resource" - }, - "name": { + "agent_namespace": { "type": "string", - "description": "name of clusterRole" - } - } - }, - "clusterRoleBinding": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "creates clusterRoleBinding resource" + "description": "namespace of agent pods to manage" }, - "name": { - "type": "string", - "description": "name of clusterRoleBinding" - } - } - }, - "env": { - "type": "array", - "description": "environment variables", - "items": { "type": "object" } - }, - "image": { - "type": "object", - "properties": { - "pullPolicy": { - "type": "string", - "description": "image pull policy", - "enum": ["Always", "Never", "IfNotPresent"] - }, - "repository": { - "type": "string", - "description": "image repository" - }, - "tag": { - "type": "string", - "description": "image tag (overrides defaults.image.tag)" - } - } - }, - "initContainers": { - "type": "array", - "description": "init containers", - "items": { "type": "object" } - }, - "name": { - "type": "string", - "description": "name of readreplica rotator job" - }, - "observability": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "observability features enabled" - }, - "metrics": { + "clusterRole": { "type": "object", "properties": { - "enable_cgo": { - "type": "boolean", - "description": "CGO metrics enabled" - }, - "enable_goroutine": { - "type": "boolean", - "description": "goroutine metrics enabled" - }, - "enable_memory": { - "type": "boolean", - "description": "memory metrics enabled" - }, - "enable_version_info": { + "enabled": { "type": "boolean", - "description": "version info metrics enabled" + "description": "creates clusterRole resource" }, - "version_info_labels": { - "type": "array", - "description": "enabled label names of version info", - "items": { - "type": "string", - "enum": [ - "vald_version", - "server_name", - "git_commit", - "build_time", - "go_version", - "go_os", - "go_arch", - "cgo_enabled", - "ngt_version", - "build_cpu_info_flags" - ] - } + "name": { + "type": "string", + "description": "name of clusterRole" } } }, - "otlp": { + "clusterRoleBinding": { "type": "object", "properties": { - "attribute": { - "type": "object", - "description": "default resource attribute", - "properties": { - "namespace": { - "type": "string", - "description": "namespace" - }, - "node_name": { - "type": "string", - "description": "node name" - }, - "pod_name": { - "type": "string", - "description": "pod name" - }, - "service_name": { - "type": "string", - "description": "service name" - } - } - }, - "collector_endpoint": { - "type": "string", - "description": "OpenTelemetry Collector endpoint" + "enabled": { + "type": "boolean", + "description": "creates clusterRoleBinding resource" }, - "metrics_export_interval": { + "name": { "type": "string", - "description": "metrics export interval" - }, - "metrics_export_timeout": { + "description": "name of clusterRoleBinding" + } + } + }, + "env": { + "type": "array", + "description": "environment variables", + "items": { "type": "object" } + }, + "image": { + "type": "object", + "properties": { + "pullPolicy": { "type": "string", - "description": "metrics export timeout" + "description": "image pull policy", + "enum": ["Always", "Never", "IfNotPresent"] }, - "trace_batch_timeout": { + "repository": { "type": "string", - "description": "trace batch timeout" + "description": "image repository" }, - "trace_export_timeout": { + "tag": { "type": "string", - "description": "trace export timeout" - }, - "trace_max_export_batch_size": { - "type": "integer", - "description": "trace maximum export batch size" - }, - "trace_max_queue_size": { - "type": "integer", - "description": "trace maximum queue size" + "description": "image tag (overrides defaults.image.tag)" } } }, - "trace": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "trace enabled" - } - } - } - } - }, - "read_replica_id": { - "type": "string", - "description": "read replica id to perform rotation" - }, - "server_config": { - "type": "object", - "properties": { - "full_shutdown_duration": { + "initContainers": { + "type": "array", + "description": "init containers", + "items": { "type": "object" } + }, + "name": { "type": "string", - "description": "server full shutdown duration" + "description": "name of readreplica rotator job" }, - "healths": { + "observability": { "type": "object", "properties": { - "liveness": { + "enabled": { + "type": "boolean", + "description": "observability features enabled" + }, + "metrics": { "type": "object", "properties": { - "enabled": { + "enable_cgo": { "type": "boolean", - "description": "liveness server enabled" + "description": "CGO metrics enabled" }, - "host": { - "type": "string", - "description": "liveness server host" + "enable_goroutine": { + "type": "boolean", + "description": "goroutine metrics enabled" }, - "livenessProbe": { - "type": "object", - "properties": { - "failureThreshold": { - "type": "integer", - "description": "liveness probe failure threshold" - }, - "httpGet": { - "type": "object", - "properties": { - "path": { - "type": "string", - "description": "liveness probe path" - }, - "port": { - "type": "string", - "description": "liveness probe port" - }, - "scheme": { - "type": "string", - "description": "liveness probe scheme" - } - } - }, - "initialDelaySeconds": { - "type": "integer", - "description": "liveness probe initial delay seconds" - }, - "periodSeconds": { - "type": "integer", - "description": "liveness probe period seconds" - }, - "successThreshold": { - "type": "integer", - "description": "liveness probe success threshold" - }, - "timeoutSeconds": { - "type": "integer", - "description": "liveness probe timeout seconds" - } - } + "enable_memory": { + "type": "boolean", + "description": "memory metrics enabled" }, - "port": { - "type": "integer", - "description": "liveness server port", - "maximum": 65535, - "minimum": 0 + "enable_version_info": { + "type": "boolean", + "description": "version info metrics enabled" }, - "server": { - "type": "object", - "properties": { - "http": { - "type": "object", - "properties": { - "handler_timeout": { - "type": "string", - "description": "REST server handler timeout" - }, - "idle_timeout": { - "type": "string", - "description": "REST server idle timeout" - }, - "read_header_timeout": { - "type": "string", - "description": "REST server read header timeout" - }, - "read_timeout": { - "type": "string", - "description": "REST server read timeout" - }, - "shutdown_duration": { - "type": "string", - "description": "REST server shutdown duration" - }, - "write_timeout": { - "type": "string", - "description": "REST server write timeout" - } - } - }, - "mode": { - "type": "string", - "description": "REST server server mode" - }, - "network": { - "type": "string", - "description": "mysql network", - "enum": [ - "tcp", - "tcp4", - "tcp6", - "udp", - "udp4", - "udp6", - "unix", - "unixgram", - "unixpacket" - ] - }, - "probe_wait_time": { - "type": "string", - "description": "REST server probe wait time" - }, - "socket_option": { - "type": "object", - "properties": { - "ip_recover_destination_addr": { - "type": "boolean", - "description": "server listen socket option for ip_recover_destination_addr functionality" - }, - "ip_transparent": { - "type": "boolean", - "description": "server listen socket option for ip_transparent functionality" - }, - "reuse_addr": { - "type": "boolean", - "description": "server listen socket option for reuse_addr functionality" - }, - "reuse_port": { - "type": "boolean", - "description": "server listen socket option for reuse_port functionality" - }, - "tcp_cork": { - "type": "boolean", - "description": "server listen socket option for tcp_cork functionality" - }, - "tcp_defer_accept": { - "type": "boolean", - "description": "server listen socket option for tcp_defer_accept functionality" - }, - "tcp_fast_open": { - "type": "boolean", - "description": "server listen socket option for tcp_fast_open functionality" - }, - "tcp_no_delay": { - "type": "boolean", - "description": "server listen socket option for tcp_no_delay functionality" - }, - "tcp_quick_ack": { - "type": "boolean", - "description": "server listen socket option for tcp_quick_ack functionality" - } - } - }, - "socket_path": { - "type": "string", - "description": "mysql socket_path" - } + "version_info_labels": { + "type": "array", + "description": "enabled label names of version info", + "items": { + "type": "string", + "enum": [ + "vald_version", + "server_name", + "git_commit", + "build_time", + "go_version", + "go_os", + "go_arch", + "cgo_enabled", + "ngt_version", + "build_cpu_info_flags" + ] } - }, - "servicePort": { - "type": "integer", - "description": "liveness server service port", - "maximum": 65535, - "minimum": 0 } } }, - "readiness": { + "otlp": { "type": "object", "properties": { - "enabled": { - "type": "boolean", - "description": "readiness server enabled" - }, - "host": { - "type": "string", - "description": "readiness server host" - }, - "port": { - "type": "integer", - "description": "readiness server port", - "maximum": 65535, - "minimum": 0 - }, - "readinessProbe": { - "type": "object", - "properties": { - "failureThreshold": { - "type": "integer", - "description": "readiness probe failure threshold" - }, - "httpGet": { - "type": "object", - "properties": { - "path": { - "type": "string", - "description": "readiness probe path" - }, - "port": { - "type": "string", - "description": "readiness probe port" - }, - "scheme": { - "type": "string", - "description": "readiness probe scheme" - } - } - }, - "initialDelaySeconds": { - "type": "integer", - "description": "readiness probe initial delay seconds" - }, - "periodSeconds": { - "type": "integer", - "description": "readiness probe period seconds" - }, - "successThreshold": { - "type": "integer", - "description": "readiness probe success threshold" - }, - "timeoutSeconds": { - "type": "integer", - "description": "readiness probe timeout seconds" - } - } - }, - "server": { + "attribute": { "type": "object", + "description": "default resource attribute", "properties": { - "http": { - "type": "object", - "properties": { - "handler_timeout": { - "type": "string", - "description": "REST server handler timeout" - }, - "idle_timeout": { - "type": "string", - "description": "REST server idle timeout" - }, - "read_header_timeout": { - "type": "string", - "description": "REST server read header timeout" - }, - "read_timeout": { - "type": "string", - "description": "REST server read timeout" - }, - "shutdown_duration": { - "type": "string", - "description": "REST server shutdown duration" - }, - "write_timeout": { - "type": "string", - "description": "REST server write timeout" - } - } - }, - "mode": { + "namespace": { "type": "string", - "description": "REST server server mode" + "description": "namespace" }, - "network": { + "node_name": { "type": "string", - "description": "mysql network", - "enum": [ - "tcp", - "tcp4", - "tcp6", - "udp", - "udp4", - "udp6", - "unix", - "unixgram", - "unixpacket" - ] + "description": "node name" }, - "probe_wait_time": { + "pod_name": { "type": "string", - "description": "REST server probe wait time" - }, - "socket_option": { - "type": "object", - "properties": { - "ip_recover_destination_addr": { - "type": "boolean", - "description": "server listen socket option for ip_recover_destination_addr functionality" - }, - "ip_transparent": { - "type": "boolean", - "description": "server listen socket option for ip_transparent functionality" - }, - "reuse_addr": { - "type": "boolean", - "description": "server listen socket option for reuse_addr functionality" - }, - "reuse_port": { - "type": "boolean", - "description": "server listen socket option for reuse_port functionality" - }, - "tcp_cork": { - "type": "boolean", - "description": "server listen socket option for tcp_cork functionality" - }, - "tcp_defer_accept": { - "type": "boolean", - "description": "server listen socket option for tcp_defer_accept functionality" - }, - "tcp_fast_open": { - "type": "boolean", - "description": "server listen socket option for tcp_fast_open functionality" - }, - "tcp_no_delay": { - "type": "boolean", - "description": "server listen socket option for tcp_no_delay functionality" - }, - "tcp_quick_ack": { - "type": "boolean", - "description": "server listen socket option for tcp_quick_ack functionality" - } - } + "description": "pod name" }, - "socket_path": { + "service_name": { "type": "string", - "description": "mysql socket_path" + "description": "service name" } } }, - "servicePort": { + "collector_endpoint": { + "type": "string", + "description": "OpenTelemetry Collector endpoint" + }, + "metrics_export_interval": { + "type": "string", + "description": "metrics export interval" + }, + "metrics_export_timeout": { + "type": "string", + "description": "metrics export timeout" + }, + "trace_batch_timeout": { + "type": "string", + "description": "trace batch timeout" + }, + "trace_export_timeout": { + "type": "string", + "description": "trace export timeout" + }, + "trace_max_export_batch_size": { "type": "integer", - "description": "readiness server service port", - "maximum": 65535, - "minimum": 0 + "description": "trace maximum export batch size" + }, + "trace_max_queue_size": { + "type": "integer", + "description": "trace maximum queue size" } } }, - "startup": { + "trace": { "type": "object", "properties": { "enabled": { "type": "boolean", - "description": "startup server enabled" - }, - "port": { - "type": "integer", - "description": "startup server port", - "maximum": 65535, - "minimum": 0 - }, - "startupProbe": { - "type": "object", - "properties": { - "failureThreshold": { - "type": "integer", - "description": "startup probe failure threshold" - }, - "httpGet": { - "type": "object", - "properties": { - "path": { - "type": "string", - "description": "startup probe path" - }, - "port": { - "type": "string", - "description": "startup probe port" - }, - "scheme": { - "type": "string", - "description": "startup probe scheme" - } - } - }, - "initialDelaySeconds": { - "type": "integer", - "description": "startup probe initial delay seconds" - }, - "periodSeconds": { - "type": "integer", - "description": "startup probe period seconds" - }, - "successThreshold": { - "type": "integer", - "description": "startup probe success threshold" - }, - "timeoutSeconds": { - "type": "integer", - "description": "startup probe timeout seconds" - } - } + "description": "trace enabled" } } } } }, - "metrics": { + "read_replica_id": { + "type": "string", + "description": "read replica id to perform rotation" + }, + "server_config": { "type": "object", "properties": { - "pprof": { + "full_shutdown_duration": { + "type": "string", + "description": "server full shutdown duration" + }, + "healths": { "type": "object", "properties": { - "enabled": { - "type": "boolean", - "description": "pprof server enabled" - }, - "host": { - "type": "string", - "description": "pprof server host" - }, - "port": { - "type": "integer", - "description": "pprof server port", - "maximum": 65535, - "minimum": 0 - }, - "server": { + "liveness": { "type": "object", "properties": { - "http": { + "enabled": { + "type": "boolean", + "description": "liveness server enabled" + }, + "host": { + "type": "string", + "description": "liveness server host" + }, + "livenessProbe": { "type": "object", "properties": { - "handler_timeout": { - "type": "string", - "description": "REST server handler timeout" + "failureThreshold": { + "type": "integer", + "description": "liveness probe failure threshold" }, - "idle_timeout": { - "type": "string", - "description": "REST server idle timeout" + "httpGet": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "liveness probe path" + }, + "port": { + "type": "string", + "description": "liveness probe port" + }, + "scheme": { + "type": "string", + "description": "liveness probe scheme" + } + } }, - "read_header_timeout": { - "type": "string", - "description": "REST server read header timeout" + "initialDelaySeconds": { + "type": "integer", + "description": "liveness probe initial delay seconds" }, - "read_timeout": { - "type": "string", - "description": "REST server read timeout" + "periodSeconds": { + "type": "integer", + "description": "liveness probe period seconds" }, - "shutdown_duration": { - "type": "string", - "description": "REST server shutdown duration" + "successThreshold": { + "type": "integer", + "description": "liveness probe success threshold" }, - "write_timeout": { - "type": "string", - "description": "REST server write timeout" + "timeoutSeconds": { + "type": "integer", + "description": "liveness probe timeout seconds" } } }, - "mode": { - "type": "string", - "description": "REST server server mode" - }, - "network": { - "type": "string", - "description": "mysql network", - "enum": [ - "tcp", - "tcp4", - "tcp6", - "udp", - "udp4", - "udp6", - "unix", - "unixgram", - "unixpacket" - ] - }, - "probe_wait_time": { - "type": "string", - "description": "REST server probe wait time" + "port": { + "type": "integer", + "description": "liveness server port", + "maximum": 65535, + "minimum": 0 }, - "socket_option": { + "server": { "type": "object", "properties": { - "ip_recover_destination_addr": { - "type": "boolean", - "description": "server listen socket option for ip_recover_destination_addr functionality" - }, - "ip_transparent": { - "type": "boolean", - "description": "server listen socket option for ip_transparent functionality" - }, - "reuse_addr": { - "type": "boolean", - "description": "server listen socket option for reuse_addr functionality" - }, - "reuse_port": { - "type": "boolean", - "description": "server listen socket option for reuse_port functionality" - }, - "tcp_cork": { - "type": "boolean", - "description": "server listen socket option for tcp_cork functionality" + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } }, - "tcp_defer_accept": { - "type": "boolean", - "description": "server listen socket option for tcp_defer_accept functionality" + "mode": { + "type": "string", + "description": "REST server server mode" }, - "tcp_fast_open": { - "type": "boolean", - "description": "server listen socket option for tcp_fast_open functionality" + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" }, - "tcp_no_delay": { - "type": "boolean", - "description": "server listen socket option for tcp_no_delay functionality" + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } }, - "tcp_quick_ack": { - "type": "boolean", - "description": "server listen socket option for tcp_quick_ack functionality" + "socket_path": { + "type": "string", + "description": "mysql socket_path" } } }, - "socket_path": { - "type": "string", - "description": "mysql socket_path" + "servicePort": { + "type": "integer", + "description": "liveness server service port", + "maximum": 65535, + "minimum": 0 } } }, - "servicePort": { - "type": "integer", - "description": "pprof server service port", - "maximum": 65535, - "minimum": 0 - } - } - } - } - }, - "servers": { - "type": "object", - "properties": { - "grpc": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "gRPC server enabled" - }, - "host": { - "type": "string", - "description": "gRPC server host" - }, - "port": { - "type": "integer", - "description": "gRPC server port", - "maximum": 65535, - "minimum": 0 - }, - "server": { + "readiness": { "type": "object", "properties": { - "grpc": { + "enabled": { + "type": "boolean", + "description": "readiness server enabled" + }, + "host": { + "type": "string", + "description": "readiness server host" + }, + "port": { + "type": "integer", + "description": "readiness server port", + "maximum": 65535, + "minimum": 0 + }, + "readinessProbe": { "type": "object", "properties": { - "bidirectional_stream_concurrency": { + "failureThreshold": { "type": "integer", - "description": "gRPC server bidirectional stream concurrency" - }, - "connection_timeout": { - "type": "string", - "description": "gRPC server connection timeout" + "description": "readiness probe failure threshold" }, - "enable_reflection": { - "type": "boolean", - "description": "gRPC server reflection option" + "httpGet": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "readiness probe path" + }, + "port": { + "type": "string", + "description": "readiness probe port" + }, + "scheme": { + "type": "string", + "description": "readiness probe scheme" + } + } }, - "header_table_size": { + "initialDelaySeconds": { "type": "integer", - "description": "gRPC server header table size" + "description": "readiness probe initial delay seconds" }, - "initial_conn_window_size": { + "periodSeconds": { "type": "integer", - "description": "gRPC server initial connection window size" + "description": "readiness probe period seconds" }, - "initial_window_size": { + "successThreshold": { "type": "integer", - "description": "gRPC server initial window size" - }, - "interceptors": { - "type": "array", - "description": "gRPC server interceptors", - "items": { - "type": "string", - "enum": [ - "RecoverInterceptor", - "AccessLogInterceptor", - "TraceInterceptor", - "MetricInterceptor" - ] - } + "description": "readiness probe success threshold" }, - "keepalive": { + "timeoutSeconds": { + "type": "integer", + "description": "readiness probe timeout seconds" + } + } + }, + "server": { + "type": "object", + "properties": { + "http": { "type": "object", "properties": { - "max_conn_age": { + "handler_timeout": { "type": "string", - "description": "gRPC server keep alive max connection age" + "description": "REST server handler timeout" }, - "max_conn_age_grace": { + "idle_timeout": { "type": "string", - "description": "gRPC server keep alive max connection age grace" + "description": "REST server idle timeout" }, - "max_conn_idle": { + "read_header_timeout": { "type": "string", - "description": "gRPC server keep alive max connection idle" + "description": "REST server read header timeout" }, - "min_time": { + "read_timeout": { "type": "string", - "description": "gRPC server keep alive min_time" - }, - "permit_without_stream": { - "type": "boolean", - "description": "gRPC server keep alive permit_without_stream" + "description": "REST server read timeout" }, - "time": { + "shutdown_duration": { "type": "string", - "description": "gRPC server keep alive time" + "description": "REST server shutdown duration" }, - "timeout": { + "write_timeout": { "type": "string", - "description": "gRPC server keep alive timeout" + "description": "REST server write timeout" } } }, - "max_header_list_size": { + "mode": { + "type": "string", + "description": "REST server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "readiness server service port", + "maximum": 65535, + "minimum": 0 + } + } + }, + "startup": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "startup server enabled" + }, + "port": { + "type": "integer", + "description": "startup server port", + "maximum": 65535, + "minimum": 0 + }, + "startupProbe": { + "type": "object", + "properties": { + "failureThreshold": { "type": "integer", - "description": "gRPC server max header list size" + "description": "startup probe failure threshold" }, - "max_receive_message_size": { + "httpGet": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "startup probe path" + }, + "port": { + "type": "string", + "description": "startup probe port" + }, + "scheme": { + "type": "string", + "description": "startup probe scheme" + } + } + }, + "initialDelaySeconds": { "type": "integer", - "description": "gRPC server max receive message size" + "description": "startup probe initial delay seconds" }, - "max_send_message_size": { + "periodSeconds": { "type": "integer", - "description": "gRPC server max send message size" + "description": "startup probe period seconds" }, - "read_buffer_size": { + "successThreshold": { "type": "integer", - "description": "gRPC server read buffer size" + "description": "startup probe success threshold" }, - "write_buffer_size": { + "timeoutSeconds": { "type": "integer", - "description": "gRPC server write buffer size" + "description": "startup probe timeout seconds" } } + } + } + } + } + }, + "metrics": { + "type": "object", + "properties": { + "pprof": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "pprof server enabled" }, - "mode": { - "type": "string", - "description": "gRPC server server mode" - }, - "network": { - "type": "string", - "description": "mysql network", - "enum": [ - "tcp", - "tcp4", - "tcp6", - "udp", - "udp4", - "udp6", - "unix", - "unixgram", - "unixpacket" - ] - }, - "probe_wait_time": { + "host": { "type": "string", - "description": "gRPC server probe wait time" + "description": "pprof server host" }, - "restart": { - "type": "boolean", - "description": "gRPC server restart" + "port": { + "type": "integer", + "description": "pprof server port", + "maximum": 65535, + "minimum": 0 }, - "socket_option": { + "server": { "type": "object", "properties": { - "ip_recover_destination_addr": { - "type": "boolean", - "description": "server listen socket option for ip_recover_destination_addr functionality" - }, - "ip_transparent": { - "type": "boolean", - "description": "server listen socket option for ip_transparent functionality" - }, - "reuse_addr": { - "type": "boolean", - "description": "server listen socket option for reuse_addr functionality" - }, - "reuse_port": { - "type": "boolean", - "description": "server listen socket option for reuse_port functionality" - }, - "tcp_cork": { - "type": "boolean", - "description": "server listen socket option for tcp_cork functionality" + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } }, - "tcp_defer_accept": { - "type": "boolean", - "description": "server listen socket option for tcp_defer_accept functionality" + "mode": { + "type": "string", + "description": "REST server server mode" }, - "tcp_fast_open": { - "type": "boolean", - "description": "server listen socket option for tcp_fast_open functionality" + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" }, - "tcp_no_delay": { - "type": "boolean", - "description": "server listen socket option for tcp_no_delay functionality" + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } }, - "tcp_quick_ack": { - "type": "boolean", - "description": "server listen socket option for tcp_quick_ack functionality" + "socket_path": { + "type": "string", + "description": "mysql socket_path" } - } - }, - "socket_path": { - "type": "string", - "description": "mysql socket_path" - } - } - }, - "servicePort": { - "type": "integer", - "description": "gRPC server service port", - "maximum": 65535, - "minimum": 0 + } + }, + "servicePort": { + "type": "integer", + "description": "pprof server service port", + "maximum": 65535, + "minimum": 0 + } + } } } }, - "rest": { + "servers": { "type": "object", "properties": { - "enabled": { - "type": "boolean", - "description": "REST server enabled" - }, - "host": { - "type": "string", - "description": "REST server host" - }, - "port": { - "type": "integer", - "description": "REST server port", - "maximum": 65535, - "minimum": 0 - }, - "server": { + "grpc": { "type": "object", "properties": { - "http": { + "enabled": { + "type": "boolean", + "description": "gRPC server enabled" + }, + "host": { + "type": "string", + "description": "gRPC server host" + }, + "port": { + "type": "integer", + "description": "gRPC server port", + "maximum": 65535, + "minimum": 0 + }, + "server": { "type": "object", "properties": { - "handler_timeout": { - "type": "string", - "description": "REST server handler timeout" + "grpc": { + "type": "object", + "properties": { + "bidirectional_stream_concurrency": { + "type": "integer", + "description": "gRPC server bidirectional stream concurrency" + }, + "connection_timeout": { + "type": "string", + "description": "gRPC server connection timeout" + }, + "enable_reflection": { + "type": "boolean", + "description": "gRPC server reflection option" + }, + "header_table_size": { + "type": "integer", + "description": "gRPC server header table size" + }, + "initial_conn_window_size": { + "type": "integer", + "description": "gRPC server initial connection window size" + }, + "initial_window_size": { + "type": "integer", + "description": "gRPC server initial window size" + }, + "interceptors": { + "type": "array", + "description": "gRPC server interceptors", + "items": { + "type": "string", + "enum": [ + "RecoverInterceptor", + "AccessLogInterceptor", + "TraceInterceptor", + "MetricInterceptor" + ] + } + }, + "keepalive": { + "type": "object", + "properties": { + "max_conn_age": { + "type": "string", + "description": "gRPC server keep alive max connection age" + }, + "max_conn_age_grace": { + "type": "string", + "description": "gRPC server keep alive max connection age grace" + }, + "max_conn_idle": { + "type": "string", + "description": "gRPC server keep alive max connection idle" + }, + "min_time": { + "type": "string", + "description": "gRPC server keep alive min_time" + }, + "permit_without_stream": { + "type": "boolean", + "description": "gRPC server keep alive permit_without_stream" + }, + "time": { + "type": "string", + "description": "gRPC server keep alive time" + }, + "timeout": { + "type": "string", + "description": "gRPC server keep alive timeout" + } + } + }, + "max_header_list_size": { + "type": "integer", + "description": "gRPC server max header list size" + }, + "max_receive_message_size": { + "type": "integer", + "description": "gRPC server max receive message size" + }, + "max_send_message_size": { + "type": "integer", + "description": "gRPC server max send message size" + }, + "read_buffer_size": { + "type": "integer", + "description": "gRPC server read buffer size" + }, + "write_buffer_size": { + "type": "integer", + "description": "gRPC server write buffer size" + } + } }, - "idle_timeout": { + "mode": { "type": "string", - "description": "REST server idle timeout" + "description": "gRPC server server mode" }, - "read_header_timeout": { + "network": { "type": "string", - "description": "REST server read header timeout" - }, - "read_timeout": { + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { "type": "string", - "description": "REST server read timeout" + "description": "gRPC server probe wait time" }, - "shutdown_duration": { - "type": "string", - "description": "REST server shutdown duration" + "restart": { + "type": "boolean", + "description": "gRPC server restart" }, - "write_timeout": { + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { "type": "string", - "description": "REST server write timeout" + "description": "mysql socket_path" } } }, - "mode": { - "type": "string", - "description": "REST server server mode" + "servicePort": { + "type": "integer", + "description": "gRPC server service port", + "maximum": 65535, + "minimum": 0 + } + } + }, + "rest": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "REST server enabled" }, - "network": { + "host": { "type": "string", - "description": "mysql network", - "enum": [ - "tcp", - "tcp4", - "tcp6", - "udp", - "udp4", - "udp6", - "unix", - "unixgram", - "unixpacket" - ] + "description": "REST server host" }, - "probe_wait_time": { - "type": "string", - "description": "REST server probe wait time" + "port": { + "type": "integer", + "description": "REST server port", + "maximum": 65535, + "minimum": 0 }, - "socket_option": { + "server": { "type": "object", "properties": { - "ip_recover_destination_addr": { - "type": "boolean", - "description": "server listen socket option for ip_recover_destination_addr functionality" - }, - "ip_transparent": { - "type": "boolean", - "description": "server listen socket option for ip_transparent functionality" - }, - "reuse_addr": { - "type": "boolean", - "description": "server listen socket option for reuse_addr functionality" - }, - "reuse_port": { - "type": "boolean", - "description": "server listen socket option for reuse_port functionality" - }, - "tcp_cork": { - "type": "boolean", - "description": "server listen socket option for tcp_cork functionality" + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } }, - "tcp_defer_accept": { - "type": "boolean", - "description": "server listen socket option for tcp_defer_accept functionality" + "mode": { + "type": "string", + "description": "REST server server mode" }, - "tcp_fast_open": { - "type": "boolean", - "description": "server listen socket option for tcp_fast_open functionality" + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" }, - "tcp_no_delay": { - "type": "boolean", - "description": "server listen socket option for tcp_no_delay functionality" + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } }, - "tcp_quick_ack": { - "type": "boolean", - "description": "server listen socket option for tcp_quick_ack functionality" + "socket_path": { + "type": "string", + "description": "mysql socket_path" } } }, - "socket_path": { - "type": "string", - "description": "mysql socket_path" + "servicePort": { + "type": "integer", + "description": "REST server service port", + "maximum": 65535, + "minimum": 0 } } + } + } + }, + "tls": { + "type": "object", + "properties": { + "ca": { + "type": "string", + "description": "TLS ca path" }, - "servicePort": { - "type": "integer", - "description": "REST server service port", - "maximum": 65535, - "minimum": 0 + "cert": { + "type": "string", + "description": "TLS cert path" + }, + "enabled": { + "type": "boolean", + "description": "TLS enabled" + }, + "insecure_skip_verify": { + "type": "boolean", + "description": "enable/disable skip SSL certificate verification" + }, + "key": { + "type": "string", + "description": "TLS key path" } } } } }, - "tls": { + "serviceAccount": { "type": "object", "properties": { - "ca": { - "type": "string", - "description": "TLS ca path" - }, - "cert": { - "type": "string", - "description": "TLS cert path" - }, "enabled": { "type": "boolean", - "description": "TLS enabled" - }, - "insecure_skip_verify": { - "type": "boolean", - "description": "enable/disable skip SSL certificate verification" + "description": "creates service account" }, - "key": { + "name": { "type": "string", - "description": "TLS key path" + "description": "name of service account" } } - } - } - }, - "serviceAccount": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "creates service account" }, - "name": { + "ttlSecondsAfterFinished": { + "type": "integer", + "description": "ttl setting for K8s completed jobs" + }, + "version": { "type": "string", - "description": "name of service account" + "description": "version of gateway config", + "pattern": "^v[0-9]+\\.[0-9]+\\.[0-9]$" } } - }, - "ttlSecondsAfterFinished": { - "type": "integer", - "description": "ttl setting for K8s completed jobs" - }, - "version": { - "type": "string", - "description": "version of gateway config", - "pattern": "^v[0-9]+\\.[0-9]+\\.[0-9]$" } } }, From 8192f11310d9d1955c0a55f678e69bbf81b5f356 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Thu, 7 Dec 2023 14:11:17 +0900 Subject: [PATCH 65/93] Update charts/vald/values/multi-vald/dev-vald-with-mirror.yaml --- charts/vald/values/multi-vald/dev-vald-with-mirror.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml index 49317fc91a..acc148dc1d 100644 --- a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml +++ b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml @@ -15,7 +15,7 @@ # defaults: image: - tag: pr-2237 # TODO: Delete it later. + tag: pr-2262 # TODO: Delete it later. server_config: metrics: pprof: From 4c11568687067753451653f9a6398fe02f70cbb2 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 14:36:24 +0900 Subject: [PATCH 66/93] fix: lint warnning Signed-off-by: hlts2 --- cmd/gateway/mirror/main.go | 6 +++++- docs/tutorial/vald-multicluster-on-k8s.md | 4 ++-- internal/k8s/reconciler.go | 22 ++++++---------------- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/cmd/gateway/mirror/main.go b/cmd/gateway/mirror/main.go index a8bdbad9c5..78a04611a4 100644 --- a/cmd/gateway/mirror/main.go +++ b/cmd/gateway/mirror/main.go @@ -45,7 +45,11 @@ func main() { return cfg, &cfg.GlobalConfig, nil }), runner.WithDaemonInitializer(func(cfg interface{}) (runner.Runner, error) { - return usecase.New(cfg.(*config.Data)) + c, ok := cfg.(*config.Data) + if !ok { + return nil, errors.ErrInvalidConfig + } + return usecase.New(c) }), ) })(); err != nil { diff --git a/docs/tutorial/vald-multicluster-on-k8s.md b/docs/tutorial/vald-multicluster-on-k8s.md index 110c75e43a..a73a1e0c37 100644 --- a/docs/tutorial/vald-multicluster-on-k8s.md +++ b/docs/tutorial/vald-multicluster-on-k8s.md @@ -4,7 +4,7 @@ This article shows how to deploy multiple Vald clusters on your Kubernetes clust ## Overview -Vald cluster consists of multiple micro-services. +Vald cluster consists of multiple microservices. In [Get Started](https://vald.vdaas.org/docs/tutorial/get-started), you may use 4 kinds of components to deploy the Vald cluster. @@ -120,7 +120,7 @@ In this section, you will deploy three Vald clusters consisting of `vald-agent-n If success deployment, the Vald cluster’s components should run on each Kubernetes Namespace.
    vald-01 Namespace
    - + ```bash kubectl get pods -n vald-01 NAME READY STATUS RESTARTS AGE diff --git a/internal/k8s/reconciler.go b/internal/k8s/reconciler.go index 51ecc54800..ddcfc193cd 100644 --- a/internal/k8s/reconciler.go +++ b/internal/k8s/reconciler.go @@ -29,36 +29,29 @@ import ( "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" - cli "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" ) -// TODO delete <<<--- - type ( Manager = manager.Manager OwnerReference = v1.OwnerReference ) type ( - Object = cli.Object - ObjectKey = cli.ObjectKey - DeleteAllOfOptions = cli.DeleteAllOfOptions - ListOptions = cli.ListOptions - MatchingLabels = cli.MatchingLabels - InNamespace = cli.InNamespace + Object = client.Object + ObjectKey = client.ObjectKey + DeleteAllOfOptions = client.DeleteAllOfOptions + ListOptions = client.ListOptions + MatchingLabels = client.MatchingLabels + InNamespace = client.InNamespace ) -// TODO delete --->>> - type Controller interface { Start(ctx context.Context) (<-chan error, error) - // TODO delete <<<--- GetManager() Manager - // TODO delete --->>> } var Now = v1.Now @@ -161,9 +154,6 @@ func (c *controller) Start(ctx context.Context) (<-chan error, error) { return ech, nil } -// TODO delete <<<--- func (c *controller) GetManager() Manager { return c.mgr } - -// TODO delete --->>> From 6e786f22b356df2b18d3dd5c86b1a9b026fd61e0 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:36:53 +0000 Subject: [PATCH 67/93] style: format code with Gofumpt and Prettier This commit fixes the style issues introduced in 4c11568 according to the output from Gofumpt and Prettier. Details: https://github.com/vdaas/vald/pull/2262 --- docs/tutorial/vald-multicluster-on-k8s.md | 36 +++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/tutorial/vald-multicluster-on-k8s.md b/docs/tutorial/vald-multicluster-on-k8s.md index a73a1e0c37..2664cdfc88 100644 --- a/docs/tutorial/vald-multicluster-on-k8s.md +++ b/docs/tutorial/vald-multicluster-on-k8s.md @@ -121,24 +121,24 @@ In this section, you will deploy three Vald clusters consisting of `vald-agent-n
    vald-01 Namespace
    - ```bash - kubectl get pods -n vald-01 - NAME READY STATUS RESTARTS AGE - vald-agent-ngt-0 1/1 Running 0 2m41s - vald-agent-ngt-2 1/1 Running 0 2m41s - vald-agent-ngt-3 1/1 Running 0 2m41s - vald-agent-ngt-4 1/1 Running 0 2m41s - vald-agent-ngt-5 1/1 Running 0 2m41s - vald-agent-ngt-1 1/1 Running 0 2m41s - vald-discoverer-77967c9697-brbsp 1/1 Running 0 2m41s - vald-lb-gateway-587879d598-xmws7 1/1 Running 0 2m41s - vald-lb-gateway-587879d598-dzn9c 1/1 Running 0 2m41s - vald-manager-index-56d474c848-wkh6b 1/1 Running 0 2m41s - vald-lb-gateway-587879d598-9wb5q 1/1 Running 0 2m41s - vald-mirror-gateway-6df75cf7cf-gzcr4 1/1 Running 0 2m26s - vald-mirror-gateway-6df75cf7cf-vjbqx 1/1 Running 0 2m26s - vald-mirror-gateway-6df75cf7cf-c2g7t 1/1 Running 0 2m41s - ``` + ```bash + kubectl get pods -n vald-01 + NAME READY STATUS RESTARTS AGE + vald-agent-ngt-0 1/1 Running 0 2m41s + vald-agent-ngt-2 1/1 Running 0 2m41s + vald-agent-ngt-3 1/1 Running 0 2m41s + vald-agent-ngt-4 1/1 Running 0 2m41s + vald-agent-ngt-5 1/1 Running 0 2m41s + vald-agent-ngt-1 1/1 Running 0 2m41s + vald-discoverer-77967c9697-brbsp 1/1 Running 0 2m41s + vald-lb-gateway-587879d598-xmws7 1/1 Running 0 2m41s + vald-lb-gateway-587879d598-dzn9c 1/1 Running 0 2m41s + vald-manager-index-56d474c848-wkh6b 1/1 Running 0 2m41s + vald-lb-gateway-587879d598-9wb5q 1/1 Running 0 2m41s + vald-mirror-gateway-6df75cf7cf-gzcr4 1/1 Running 0 2m26s + vald-mirror-gateway-6df75cf7cf-vjbqx 1/1 Running 0 2m26s + vald-mirror-gateway-6df75cf7cf-c2g7t 1/1 Running 0 2m41s + ```
    From af35bef7dcfa8b55a0b2f91b12c72947bad0fce5 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 15:10:23 +0900 Subject: [PATCH 68/93] fix: reviewdog warning and deepsource warning Signed-off-by: hlts2 --- .../k8s/vald/mirror/api/v1/target_types.go | 10 ++---- internal/k8s/vald/mirror/target/option.go | 2 +- internal/k8s/vald/mirror/target/target.go | 4 +-- .../mirror/target/target_template_option.go | 8 ++--- pkg/gateway/mirror/handler/grpc/handler.go | 10 +++--- pkg/gateway/mirror/handler/grpc/option.go | 6 ++-- pkg/gateway/mirror/service/discovery.go | 14 ++++---- .../mirror/service/discovery_option.go | 6 ++-- pkg/gateway/mirror/service/discovery_test.go | 36 +++++-------------- pkg/gateway/mirror/service/gateway.go | 2 +- pkg/gateway/mirror/service/mirror_option.go | 2 +- pkg/gateway/mirror/service/option.go | 2 +- 12 files changed, 38 insertions(+), 64 deletions(-) diff --git a/internal/k8s/vald/mirror/api/v1/target_types.go b/internal/k8s/vald/mirror/api/v1/target_types.go index d1edb34156..cb3b16230d 100644 --- a/internal/k8s/vald/mirror/api/v1/target_types.go +++ b/internal/k8s/vald/mirror/api/v1/target_types.go @@ -68,10 +68,7 @@ func (in *ValdMirrorTarget) DeepCopy() *ValdMirrorTarget { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ValdMirrorTarget) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil + return in.DeepCopy() } // MirrorTargetSpec is a description of a ValdMirrorTarget. @@ -174,8 +171,5 @@ func (in *ValdMirrorTargetList) DeepCopy() *ValdMirrorTargetList { // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *ValdMirrorTargetList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil + return in.DeepCopy() } diff --git a/internal/k8s/vald/mirror/target/option.go b/internal/k8s/vald/mirror/target/option.go index e83a7edbca..db84f37a7c 100644 --- a/internal/k8s/vald/mirror/target/option.go +++ b/internal/k8s/vald/mirror/target/option.go @@ -29,7 +29,7 @@ var defaultOptions = []Option{} // WithControllerName returns the option to set the name of controller. func WithControllerName(name string) Option { return func(r *reconciler) error { - if len(name) == 0 { + if name == "" { return errors.NewErrInvalidOption("controllerName", name) } r.name = name diff --git a/internal/k8s/vald/mirror/target/target.go b/internal/k8s/vald/mirror/target/target.go index 6c6692ea5f..e7ae94934a 100644 --- a/internal/k8s/vald/mirror/target/target.go +++ b/internal/k8s/vald/mirror/target/target.go @@ -82,7 +82,7 @@ func (r *reconciler) addListOpts(opt client.ListOption) { r.lopts = append(r.lopts, opt) } -func (r *reconciler) Reconcile(ctx context.Context, req reconcile.Request) (res reconcile.Result, err error) { +func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res reconcile.Result, err error) { ml := &mirrv1.ValdMirrorTargetList{} err = r.mgr.GetClient().List(ctx, ml, r.lopts...) if err != nil { @@ -117,7 +117,7 @@ func (r *reconciler) GetName() string { return r.name } -func (r *reconciler) NewReconciler(ctx context.Context, mgr manager.Manager) reconcile.Reconciler { +func (r *reconciler) NewReconciler(_ context.Context, mgr manager.Manager) reconcile.Reconciler { if r.mgr == nil && mgr != nil { r.mgr = mgr } diff --git a/internal/k8s/vald/mirror/target/target_template_option.go b/internal/k8s/vald/mirror/target/target_template_option.go index 43d5e4f8b3..7f064289db 100644 --- a/internal/k8s/vald/mirror/target/target_template_option.go +++ b/internal/k8s/vald/mirror/target/target_template_option.go @@ -26,7 +26,7 @@ var defaultMirrorTargetOptions = []MirrorTargetOption{ func WithMirrorTargetNamespace(ns string) MirrorTargetOption { return func(mt *MirrorTarget) error { - if len(ns) != 0 { + if ns != "" { mt.ObjectMeta.Namespace = ns } return nil @@ -35,7 +35,7 @@ func WithMirrorTargetNamespace(ns string) MirrorTargetOption { func WithMirrorTargetName(name string) MirrorTargetOption { return func(mt *MirrorTarget) error { - if len(name) == 0 { + if name == "" { return errors.NewErrCriticalOption("name", name) } mt.ObjectMeta.Name = name @@ -61,7 +61,7 @@ func WithMirrorTargetLabels(labels map[string]string) MirrorTargetOption { func WithMirrorTargetColocation(n string) MirrorTargetOption { return func(mt *MirrorTarget) error { - if len(n) == 0 { + if n == "" { return errors.NewErrCriticalOption("colocation", n) } mt.Spec.Colocation = n @@ -71,7 +71,7 @@ func WithMirrorTargetColocation(n string) MirrorTargetOption { func WithMirrorTargetHost(n string) MirrorTargetOption { return func(mt *MirrorTarget) error { - if len(n) == 0 { + if n == "" { return errors.NewErrCriticalOption("host", n) } mt.Spec.Target.Host = n diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 7f1bd598f1..73d9549bb0 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -3133,7 +3133,7 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald. if err != nil { return nil, err } - return obj, s.streamListObject(ctx, client, stream) + return obj, s.doStreamListObject(ctx, client, stream) }) if err != nil { st, msg, err := status.ParseError(err, codes.Internal, "failed to parse "+vald.StreamListObjectRPCName+" gRPC error response") @@ -3147,7 +3147,7 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald. return nil } -func (s *server) streamListObject(ctx context.Context, clientS vald.Object_StreamListObjectClient, serverS vald.Object_StreamListObjectServer) (err error) { +func (s *server) doStreamListObject(ctx context.Context, client vald.Object_StreamListObjectClient, server vald.Object_StreamListObjectServer) (err error) { cctx, cancel := context.WithCancel(ctx) defer cancel() eg, egctx := errgroup.WithContext(cctx) @@ -3177,7 +3177,7 @@ func (s *server) streamListObject(ctx context.Context, clientS vald.Object_Strea }() rmu.Lock() - res, err := clientS.Recv() + res, err := client.Recv() rmu.Unlock() if err != nil { if errors.Is(err, io.EOF) { @@ -3216,7 +3216,7 @@ func (s *server) streamListObject(ctx context.Context, clientS vald.Object_Strea } mu.Lock() - err = serverS.Send(res) + err = server.Send(res) mu.Unlock() if err != nil { if errors.Is(err, io.EOF) { @@ -3257,7 +3257,7 @@ func (s *server) streamListObject(ctx context.Context, clientS vald.Object_Strea } func (s *server) isProxied(ctx context.Context) bool { - return len(s.gateway.FromForwardedContext(ctx)) != 0 + return s.gateway.FromForwardedContext(ctx) != "" } type errorState struct { diff --git a/pkg/gateway/mirror/handler/grpc/option.go b/pkg/gateway/mirror/handler/grpc/option.go index 13a09cad25..be9acc9e16 100644 --- a/pkg/gateway/mirror/handler/grpc/option.go +++ b/pkg/gateway/mirror/handler/grpc/option.go @@ -42,7 +42,7 @@ var defaultOptions = []Option{ // WithIP returns the option to set the IP for server. func WithIP(ip string) Option { return func(s *server) error { - if len(ip) != 0 { + if ip != "" { s.ip = ip } return nil @@ -52,7 +52,7 @@ func WithIP(ip string) Option { // WithName returns the option to set the name for server. func WithName(name string) Option { return func(s *server) error { - if len(name) != 0 { + if name != "" { s.name = name } return nil @@ -97,7 +97,7 @@ func WithStreamConcurrency(c int) Option { func WithValdAddr(addr string) Option { return func(s *server) error { - if len(addr) == 0 { + if addr == "" { return errors.NewErrCriticalOption("valdAddr", addr) } s.vAddr = addr diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 80609d8140..74088e0ee7 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -101,7 +101,7 @@ func NewDiscovery(opts ...DiscoveryOption) (dsc Discovery, err error) { return d, err } -func (d *discovery) onReconcile(ctx context.Context, list map[string]target.Target) { +func (d *discovery) onReconcile(_ context.Context, list map[string]target.Target) { log.Debugf("mirror reconciled\t%#v", list) d.targetsByName.Store(&list) } @@ -185,13 +185,11 @@ func (d *discovery) startSync(ctx context.Context, prev map[string]target.Target name: name, tgt: ctgt, } - } else { - if ptgt.Host != ctgt.Host || ptgt.Port != ctgt.Port { - updated[addr] = &updatedTarget{ - name: name, - old: ptgt, - new: ctgt, - } + } else if ptgt.Host != ctgt.Host || ptgt.Port != ctgt.Port { + updated[addr] = &updatedTarget{ + name: name, + old: ptgt, + new: ctgt, } } } diff --git a/pkg/gateway/mirror/service/discovery_option.go b/pkg/gateway/mirror/service/discovery_option.go index fd6aa1262d..632a0e97df 100644 --- a/pkg/gateway/mirror/service/discovery_option.go +++ b/pkg/gateway/mirror/service/discovery_option.go @@ -54,7 +54,7 @@ func WithDiscoveryDialer(der net.Dialer) DiscoveryOption { // WithDiscoveryNamespace returns the option to set the namespace for discovery. func WithDiscoveryNamespace(ns string) DiscoveryOption { return func(d *discovery) error { - if len(ns) != 0 { + if ns != "" { d.namespace = ns } return nil @@ -64,7 +64,7 @@ func WithDiscoveryNamespace(ns string) DiscoveryOption { // WithDiscoveryGroup returns the option to set the Mirror group for discovery. func WithDiscoveryGroup(g string) DiscoveryOption { return func(d *discovery) error { - if len(g) != 0 { + if g != "" { if d.labels == nil { d.labels = make(map[string]string) } @@ -77,7 +77,7 @@ func WithDiscoveryGroup(g string) DiscoveryOption { // WithDiscoveryColocation returns the option to set the colocation name of datacenter. func WithDiscoveryColocation(loc string) DiscoveryOption { return func(d *discovery) error { - if len(loc) != 0 { + if loc != "" { d.colocation = loc } return nil diff --git a/pkg/gateway/mirror/service/discovery_test.go b/pkg/gateway/mirror/service/discovery_test.go index 66a4f596d1..5ecffe5843 100644 --- a/pkg/gateway/mirror/service/discovery_test.go +++ b/pkg/gateway/mirror/service/discovery_test.go @@ -79,9 +79,7 @@ func Test_discovery_startSync(t *testing.T) { }, }, ctrl: &k8smock.ControllerMock{ - GetManagerFunc: func() k8s.Manager { - return k8smock.NewDefaultManagerMock() - }, + GetManagerFunc: k8smock.NewDefaultManagerMock, }, }, beforeFunc: func(t *testing.T, d *discovery, _ args) { @@ -114,9 +112,7 @@ func Test_discovery_startSync(t *testing.T) { }, }, ctrl: &k8smock.ControllerMock{ - GetManagerFunc: func() k8s.Manager { - return k8smock.NewDefaultManagerMock() - }, + GetManagerFunc: k8smock.NewDefaultManagerMock, }, }, beforeFunc: func(t *testing.T, d *discovery, _ args) { @@ -150,9 +146,7 @@ func Test_discovery_startSync(t *testing.T) { }, }, ctrl: &k8smock.ControllerMock{ - GetManagerFunc: func() k8s.Manager { - return k8smock.NewDefaultManagerMock() - }, + GetManagerFunc: k8smock.NewDefaultManagerMock, }, }, beforeFunc: func(t *testing.T, d *discovery, _ args) { @@ -185,9 +179,7 @@ func Test_discovery_startSync(t *testing.T) { }, }, ctrl: &k8smock.ControllerMock{ - GetManagerFunc: func() k8s.Manager { - return k8smock.NewDefaultManagerMock() - }, + GetManagerFunc: k8smock.NewDefaultManagerMock, }, }, beforeFunc: func(t *testing.T, d *discovery, _ args) { @@ -229,9 +221,7 @@ func Test_discovery_startSync(t *testing.T) { }, }, ctrl: &k8smock.ControllerMock{ - GetManagerFunc: func() k8s.Manager { - return k8smock.NewDefaultManagerMock() - }, + GetManagerFunc: k8smock.NewDefaultManagerMock, }, }, beforeFunc: func(t *testing.T, d *discovery, _ args) { @@ -272,9 +262,7 @@ func Test_discovery_startSync(t *testing.T) { }, }, ctrl: &k8smock.ControllerMock{ - GetManagerFunc: func() k8s.Manager { - return k8smock.NewDefaultManagerMock() - }, + GetManagerFunc: k8smock.NewDefaultManagerMock, }, }, beforeFunc: func(t *testing.T, d *discovery, _ args) { @@ -382,9 +370,7 @@ func Test_discovery_syncWithAddr(t *testing.T) { }, }, ctrl: &k8smock.ControllerMock{ - GetManagerFunc: func() k8s.Manager { - return k8smock.NewDefaultManagerMock() - }, + GetManagerFunc: k8smock.NewDefaultManagerMock, }, }, beforeFunc: func(t *testing.T, d *discovery, _ args) { @@ -424,9 +410,7 @@ func Test_discovery_syncWithAddr(t *testing.T) { }, }, ctrl: &k8smock.ControllerMock{ - GetManagerFunc: func() k8s.Manager { - return k8smock.NewDefaultManagerMock() - }, + GetManagerFunc: k8smock.NewDefaultManagerMock, }, }, } @@ -457,9 +441,7 @@ func Test_discovery_syncWithAddr(t *testing.T) { }, }, ctrl: &k8smock.ControllerMock{ - GetManagerFunc: func() k8s.Manager { - return k8smock.NewDefaultManagerMock() - }, + GetManagerFunc: k8smock.NewDefaultManagerMock, }, }, } diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index 9699bc4f96..714869d413 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -142,7 +142,7 @@ func (g *gateway) Do(ctx context.Context, target string, } }() - if len(target) == 0 { + if target == "" { return nil, errors.ErrTargetNotFound } return g.client.GRPCClient().Do(g.ForwardedContext(ctx, g.podName), target, diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go index 2cc1998d0b..f39d5a65c1 100644 --- a/pkg/gateway/mirror/service/mirror_option.go +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -76,7 +76,7 @@ func WithGateway(g Gateway) MirrorOption { // WithRegisterDuration returns the option to set the register duration. func WithRegisterDuration(s string) MirrorOption { return func(m *mirr) error { - if len(s) == 0 { + if s == "" { return errors.NewErrInvalidOption("registerDuration", s) } dur, err := time.ParseDuration(s) diff --git a/pkg/gateway/mirror/service/option.go b/pkg/gateway/mirror/service/option.go index 979a23ce58..59067d2b43 100644 --- a/pkg/gateway/mirror/service/option.go +++ b/pkg/gateway/mirror/service/option.go @@ -49,7 +49,7 @@ func WithErrGroup(eg errgroup.Group) Option { // WithErrGroup returns the option to set the pod name. func WithPodName(s string) Option { return func(g *gateway) error { - if len(s) == 0 { + if s == "" { return errors.NewErrCriticalOption("podName", s) } g.podName = s From 42b1175a1cfabb3f53b41b8dbb0204dc2fa78776 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 15:40:09 +0900 Subject: [PATCH 69/93] feat: use new command to docker build Signed-off-by: hlts2 --- Makefile.d/docker.mk | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Makefile.d/docker.mk b/Makefile.d/docker.mk index 0f2a161f7d..cf595285f0 100644 --- a/Makefile.d/docker.mk +++ b/Makefile.d/docker.mk @@ -133,13 +133,9 @@ docker/name/gateway-mirror: .PHONY: docker/build/gateway-mirror ## build gateway-mirror image docker/build/gateway-mirror: - $(DOCKER) build \ - $(DOCKER_OPTS) \ - -f dockers/gateway/mirror/Dockerfile \ - -t $(ORG)/$(MIRROR_GATEWAY_IMAGE):$(TAG) . \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg DISTROLESS_IMAGE=$(DISTROLESS_IMAGE) \ - --build-arg DISTROLESS_IMAGE_TAG=$(DISTROLESS_IMAGE_TAG) + @make DOCKERFILE="$(ROOTDIR)/dockers/gateway/mirror/Dockerfile" \ + IMAGE=$(MIRROR_GATEWAY_IMAGE) \ + docker/build/image .PHONY: docker/name/manager-index docker/name/manager-index: From 08f79dac0cee56e3e6d57a7dda0a6ce8e92b13b4 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 15:52:53 +0900 Subject: [PATCH 70/93] fix: make format Signed-off-by: hlts2 --- dockers/gateway/mirror/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index 6d118fb69f..adeb5910eb 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -1,3 +1,4 @@ +# syntax = docker/dockerfile:latest # # Copyright (C) 2019-2023 vdaas.org vald team # From 8de1bacd089cc907c0a581c6a227213788a4b094 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 17:12:13 +0900 Subject: [PATCH 71/93] fix: update schema and format Signed-off-by: hlts2 --- charts/vald/values.schema.json | 1779 ++++++++++++++++++++++++++++++++ 1 file changed, 1779 insertions(+) diff --git a/charts/vald/values.schema.json b/charts/vald/values.schema.json index 99e70097af..eed76a1b21 100644 --- a/charts/vald/values.schema.json +++ b/charts/vald/values.schema.json @@ -10042,6 +10042,1785 @@ "items": { "type": "object" } } } + }, + "mirror": { + "type": "object", + "properties": { + "affinity": { + "type": "object", + "properties": { + "nodeAffinity": { + "type": "object", + "properties": { + "preferredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "node affinity preferred scheduling terms", + "items": { "type": "object" } + }, + "requiredDuringSchedulingIgnoredDuringExecution": { + "type": "object", + "properties": { + "nodeSelectorTerms": { + "type": "array", + "description": "node affinity required node selectors", + "items": { "type": "object" } + } + } + } + } + }, + "podAffinity": { + "type": "object", + "properties": { + "preferredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "pod affinity preferred scheduling terms", + "items": { "type": "object" } + }, + "requiredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "pod affinity required scheduling terms", + "items": { "type": "object" } + } + } + }, + "podAntiAffinity": { + "type": "object", + "properties": { + "preferredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "pod anti-affinity preferred scheduling terms", + "items": { "type": "object" } + }, + "requiredDuringSchedulingIgnoredDuringExecution": { + "type": "array", + "description": "pod anti-affinity required scheduling terms", + "items": { "type": "object" } + } + } + } + } + }, + "annotations": { + "type": "object", + "description": "deployment annotations" + }, + "clusterRole": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "creates clusterRole resource" + }, + "name": { + "type": "string", + "description": "name of clusterRole" + } + } + }, + "clusterRoleBinding": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "creates clusterRoleBinding resource" + }, + "name": { + "type": "string", + "description": "name of clusterRoleBinding" + } + } + }, + "enabled": { "type": "boolean", "description": "gateway enabled" }, + "env": { + "type": "array", + "description": "environment variables", + "items": { "type": "object" } + }, + "externalTrafficPolicy": { + "type": "string", + "description": "external traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local" + }, + "gateway_config": { + "type": "object", + "properties": { + "client": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "description": "gRPC client addresses", + "items": { "type": "string" } + }, + "backoff": { + "type": "object", + "properties": { + "backoff_factor": { + "type": "number", + "description": "gRPC client backoff factor" + }, + "backoff_time_limit": { + "type": "string", + "description": "gRPC client backoff time limit" + }, + "enable_error_log": { + "type": "boolean", + "description": "gRPC client backoff log enabled" + }, + "initial_duration": { + "type": "string", + "description": "gRPC client backoff initial duration" + }, + "jitter_limit": { + "type": "string", + "description": "gRPC client backoff jitter limit" + }, + "maximum_duration": { + "type": "string", + "description": "gRPC client backoff maximum duration" + }, + "retry_count": { + "type": "integer", + "description": "gRPC client backoff retry count" + } + } + }, + "call_option": { "type": "object" }, + "circuit_breaker": { + "type": "object", + "properties": { + "closed_error_rate": { + "type": "number", + "description": "gRPC client circuitbreaker closed error rate" + }, + "closed_refresh_timeout": { + "type": "string", + "description": "gRPC client circuitbreaker closed refresh timeout" + }, + "half_open_error_rate": { + "type": "number", + "description": "gRPC client circuitbreaker half-open error rate" + }, + "min_samples": { + "type": "integer", + "description": "gRPC client circuitbreaker minimum sampling count" + }, + "open_timeout": { + "type": "string", + "description": "gRPC client circuitbreaker open timeout" + } + } + }, + "connection_pool": { + "type": "object", + "properties": { + "enable_dns_resolver": { + "type": "boolean", + "description": "enables gRPC client connection pool dns resolver, when enabled vald uses ip handshake exclude dns discovery which improves network performance" + }, + "enable_rebalance": { + "type": "boolean", + "description": "enables gRPC client connection pool rebalance" + }, + "old_conn_close_duration": { + "type": "string", + "description": "makes delay before gRPC client connection closing during connection pool rebalance" + }, + "rebalance_duration": { + "type": "string", + "description": "gRPC client connection pool rebalance duration" + }, + "size": { + "type": "integer", + "description": "gRPC client connection pool size" + } + } + }, + "dial_option": { + "type": "object", + "properties": { + "backoff_base_delay": { + "type": "string", + "description": "gRPC client dial option base backoff delay" + }, + "backoff_jitter": { + "type": "number", + "description": "gRPC client dial option base backoff delay" + }, + "backoff_max_delay": { + "type": "string", + "description": "gRPC client dial option max backoff delay" + }, + "backoff_multiplier": { + "type": "number", + "description": "gRPC client dial option base backoff delay" + }, + "enable_backoff": { + "type": "boolean", + "description": "gRPC client dial option backoff enabled" + }, + "initial_connection_window_size": { + "type": "integer", + "description": "gRPC client dial option initial connection window size" + }, + "initial_window_size": { + "type": "integer", + "description": "gRPC client dial option initial window size" + }, + "insecure": { + "type": "boolean", + "description": "gRPC client dial option insecure enabled" + }, + "interceptors": { + "type": "array", + "description": "gRPC client interceptors", + "items": { + "type": "string", + "enum": ["TraceInterceptor"] + } + }, + "keepalive": { + "type": "object", + "properties": { + "permit_without_stream": { + "type": "boolean", + "description": "gRPC client keep alive permit without stream" + }, + "time": { + "type": "string", + "description": "gRPC client keep alive time" + }, + "timeout": { + "type": "string", + "description": "gRPC client keep alive timeout" + } + } + }, + "max_msg_size": { + "type": "integer", + "description": "gRPC client dial option max message size" + }, + "min_connection_timeout": { + "type": "string", + "description": "gRPC client dial option minimum connection timeout" + }, + "net": { + "type": "object", + "properties": { + "dialer": { + "type": "object", + "properties": { + "dual_stack_enabled": { + "type": "boolean", + "description": "gRPC client TCP dialer dual stack enabled" + }, + "keepalive": { + "type": "string", + "description": "gRPC client TCP dialer keep alive" + }, + "timeout": { + "type": "string", + "description": "gRPC client TCP dialer timeout" + } + } + }, + "dns": { + "type": "object", + "properties": { + "cache_enabled": { + "type": "boolean", + "description": "gRPC client TCP DNS cache enabled" + }, + "cache_expiration": { + "type": "string", + "description": "gRPC client TCP DNS cache expiration" + }, + "refresh_duration": { + "type": "string", + "description": "gRPC client TCP DNS cache refresh duration" + } + } + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "tls": { + "type": "object", + "properties": { + "ca": { + "type": "string", + "description": "TLS ca path" + }, + "cert": { + "type": "string", + "description": "TLS cert path" + }, + "enabled": { + "type": "boolean", + "description": "TLS enabled" + }, + "insecure_skip_verify": { + "type": "boolean", + "description": "enable/disable skip SSL certificate verification" + }, + "key": { + "type": "string", + "description": "TLS key path" + } + } + } + } + }, + "read_buffer_size": { + "type": "integer", + "description": "gRPC client dial option read buffer size" + }, + "timeout": { + "type": "string", + "description": "gRPC client dial option timeout" + }, + "write_buffer_size": { + "type": "integer", + "description": "gRPC client dial option write buffer size" + } + } + }, + "health_check_duration": { + "type": "string", + "description": "gRPC client health check duration" + }, + "max_recv_msg_size": { "type": "integer" }, + "max_retry_rpc_buffer_size": { "type": "integer" }, + "max_send_msg_size": { "type": "integer" }, + "tls": { + "type": "object", + "properties": { + "ca": { + "type": "string", + "description": "TLS ca path" + }, + "cert": { + "type": "string", + "description": "TLS cert path" + }, + "enabled": { + "type": "boolean", + "description": "TLS enabled" + }, + "insecure_skip_verify": { + "type": "boolean", + "description": "enable/disable skip SSL certificate verification" + }, + "key": { + "type": "string", + "description": "TLS key path" + } + } + }, + "wait_for_ready": { "type": "boolean" } + } + }, + "colocation": { + "type": "string", + "description": "colocation name" + }, + "discovery_duration": { + "type": "string", + "description": "duration to discovery" + }, + "gateway_addr": { + "type": "string", + "description": "address for lb-gateway" + }, + "group": { + "type": "string", + "description": "mirror group name" + }, + "namespace": { + "type": "string", + "description": "namespace to discovery" + }, + "net": { + "type": "object", + "properties": { + "dialer": { + "type": "object", + "properties": { + "dual_stack_enabled": { + "type": "boolean", + "description": "gRPC client TCP dialer dual stack enabled" + }, + "keepalive": { + "type": "string", + "description": "gRPC client TCP dialer keep alive" + }, + "timeout": { + "type": "string", + "description": "gRPC client TCP dialer timeout" + } + } + }, + "dns": { + "type": "object", + "properties": { + "cache_enabled": { + "type": "boolean", + "description": "gRPC client TCP DNS cache enabled" + }, + "cache_expiration": { + "type": "string", + "description": "gRPC client TCP DNS cache expiration" + }, + "refresh_duration": { + "type": "string", + "description": "gRPC client TCP DNS cache refresh duration" + } + } + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "tls": { + "type": "object", + "properties": { + "ca": { + "type": "string", + "description": "TLS ca path" + }, + "cert": { + "type": "string", + "description": "TLS cert path" + }, + "enabled": { + "type": "boolean", + "description": "TLS enabled" + }, + "insecure_skip_verify": { + "type": "boolean", + "description": "enable/disable skip SSL certificate verification" + }, + "key": { + "type": "string", + "description": "TLS key path" + } + } + } + } + }, + "pod_name": { + "type": "string", + "description": "self mirror gateway pod name" + }, + "register_duration": { + "type": "string", + "description": "duration to register mirror-gateway." + }, + "self_mirror_addr": { + "type": "string", + "description": "address for self mirror-gateway" + } + } + }, + "hpa": { + "type": "object", + "properties": { + "enabled": { "type": "boolean", "description": "HPA enabled" }, + "targetCPUUtilizationPercentage": { + "type": "integer", + "description": "HPA CPU utilization percentage" + } + } + }, + "image": { + "type": "object", + "properties": { + "pullPolicy": { + "type": "string", + "description": "image pull policy", + "enum": ["Always", "Never", "IfNotPresent"] + }, + "repository": { + "type": "string", + "description": "image repository" + }, + "tag": { + "type": "string", + "description": "image tag (overrides defaults.image.tag)" + } + } + }, + "ingress": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "description": "annotations for ingress" + }, + "enabled": { + "type": "boolean", + "description": "gateway ingress enabled" + }, + "host": { "type": "string", "description": "ingress hostname" }, + "pathType": { + "type": "string", + "description": "gateway ingress pathType" + }, + "servicePort": { + "type": "string", + "description": "service port to be exposed by ingress" + } + } + }, + "initContainers": { + "type": "array", + "description": "init containers", + "items": { "type": "object" } + }, + "internalTrafficPolicy": { + "type": "string", + "description": "internal traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local" + }, + "kind": { + "type": "string", + "description": "deployment kind: Deployment or DaemonSet", + "enum": ["Deployment", "DaemonSet"] + }, + "logging": { + "type": "object", + "properties": { + "format": { + "type": "string", + "description": "logging format. logging format must be `raw` or `json`", + "enum": ["raw", "json"] + }, + "level": { + "type": "string", + "description": "logging level. logging level must be `debug`, `info`, `warn`, `error` or `fatal`.", + "enum": ["debug", "info", "warn", "error", "fatal"] + }, + "logger": { + "type": "string", + "description": "logger name. currently logger must be `glg` or `zap`.", + "enum": ["glg", "zap"] + } + } + }, + "maxReplicas": { + "type": "integer", + "description": "maximum number of replicas. if HPA is disabled, this value will be ignored.", + "minimum": 0 + }, + "maxUnavailable": { + "type": "string", + "description": "maximum number of unavailable replicas" + }, + "minReplicas": { + "type": "integer", + "description": "minimum number of replicas. if HPA is disabled, the replicas will be set to this value", + "minimum": 0 + }, + "name": { + "type": "string", + "description": "name of gateway deployment" + }, + "nodeName": { "type": "string", "description": "node name" }, + "nodeSelector": { + "type": "object", + "description": "node selector" + }, + "observability": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "observability features enabled" + }, + "metrics": { + "type": "object", + "properties": { + "enable_cgo": { + "type": "boolean", + "description": "CGO metrics enabled" + }, + "enable_goroutine": { + "type": "boolean", + "description": "goroutine metrics enabled" + }, + "enable_memory": { + "type": "boolean", + "description": "memory metrics enabled" + }, + "enable_version_info": { + "type": "boolean", + "description": "version info metrics enabled" + }, + "version_info_labels": { + "type": "array", + "description": "enabled label names of version info", + "items": { + "type": "string", + "enum": [ + "vald_version", + "server_name", + "git_commit", + "build_time", + "go_version", + "go_os", + "go_arch", + "cgo_enabled", + "ngt_version", + "build_cpu_info_flags" + ] + } + } + } + }, + "otlp": { + "type": "object", + "properties": { + "attribute": { + "type": "object", + "description": "default resource attribute", + "properties": { + "namespace": { + "type": "string", + "description": "namespace" + }, + "node_name": { + "type": "string", + "description": "node name" + }, + "pod_name": { + "type": "string", + "description": "pod name" + }, + "service_name": { + "type": "string", + "description": "service name" + } + } + }, + "collector_endpoint": { + "type": "string", + "description": "OpenTelemetry Collector endpoint" + }, + "metrics_export_interval": { + "type": "string", + "description": "metrics export interval" + }, + "metrics_export_timeout": { + "type": "string", + "description": "metrics export timeout" + }, + "trace_batch_timeout": { + "type": "string", + "description": "trace batch timeout" + }, + "trace_export_timeout": { + "type": "string", + "description": "trace export timeout" + }, + "trace_max_export_batch_size": { + "type": "integer", + "description": "trace maximum export batch size" + }, + "trace_max_queue_size": { + "type": "integer", + "description": "trace maximum queue size" + } + } + }, + "trace": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "trace enabled" + } + } + } + } + }, + "podAnnotations": { + "type": "object", + "description": "pod annotations" + }, + "podPriority": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "gateway pod PriorityClass enabled" + }, + "value": { + "type": "integer", + "description": "gateway pod PriorityClass value" + } + } + }, + "podSecurityContext": { + "type": "object", + "description": "security context for pod" + }, + "progressDeadlineSeconds": { + "type": "integer", + "description": "progress deadline seconds" + }, + "resources": { + "type": "object", + "description": "compute resources", + "properties": { + "limits": { "type": "object" }, + "requests": { "type": "object" } + } + }, + "revisionHistoryLimit": { + "type": "integer", + "description": "number of old history to retain to allow rollback", + "minimum": 0 + }, + "rollingUpdate": { + "type": "object", + "properties": { + "maxSurge": { + "type": "string", + "description": "max surge of rolling update" + }, + "maxUnavailable": { + "type": "string", + "description": "max unavailable of rolling update" + } + } + }, + "securityContext": { + "type": "object", + "description": "security context for container" + }, + "server_config": { + "type": "object", + "properties": { + "full_shutdown_duration": { + "type": "string", + "description": "server full shutdown duration" + }, + "healths": { + "type": "object", + "properties": { + "liveness": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "liveness server enabled" + }, + "host": { + "type": "string", + "description": "liveness server host" + }, + "livenessProbe": { + "type": "object", + "properties": { + "failureThreshold": { + "type": "integer", + "description": "liveness probe failure threshold" + }, + "httpGet": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "liveness probe path" + }, + "port": { + "type": "string", + "description": "liveness probe port" + }, + "scheme": { + "type": "string", + "description": "liveness probe scheme" + } + } + }, + "initialDelaySeconds": { + "type": "integer", + "description": "liveness probe initial delay seconds" + }, + "periodSeconds": { + "type": "integer", + "description": "liveness probe period seconds" + }, + "successThreshold": { + "type": "integer", + "description": "liveness probe success threshold" + }, + "timeoutSeconds": { + "type": "integer", + "description": "liveness probe timeout seconds" + } + } + }, + "port": { + "type": "integer", + "description": "liveness server port", + "maximum": 65535, + "minimum": 0 + }, + "server": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } + }, + "mode": { + "type": "string", + "description": "REST server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "liveness server service port", + "maximum": 65535, + "minimum": 0 + } + } + }, + "readiness": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "readiness server enabled" + }, + "host": { + "type": "string", + "description": "readiness server host" + }, + "port": { + "type": "integer", + "description": "readiness server port", + "maximum": 65535, + "minimum": 0 + }, + "readinessProbe": { + "type": "object", + "properties": { + "failureThreshold": { + "type": "integer", + "description": "readiness probe failure threshold" + }, + "httpGet": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "readiness probe path" + }, + "port": { + "type": "string", + "description": "readiness probe port" + }, + "scheme": { + "type": "string", + "description": "readiness probe scheme" + } + } + }, + "initialDelaySeconds": { + "type": "integer", + "description": "readiness probe initial delay seconds" + }, + "periodSeconds": { + "type": "integer", + "description": "readiness probe period seconds" + }, + "successThreshold": { + "type": "integer", + "description": "readiness probe success threshold" + }, + "timeoutSeconds": { + "type": "integer", + "description": "readiness probe timeout seconds" + } + } + }, + "server": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } + }, + "mode": { + "type": "string", + "description": "REST server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "readiness server service port", + "maximum": 65535, + "minimum": 0 + } + } + }, + "startup": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "startup server enabled" + }, + "port": { + "type": "integer", + "description": "startup server port", + "maximum": 65535, + "minimum": 0 + }, + "startupProbe": { + "type": "object", + "properties": { + "failureThreshold": { + "type": "integer", + "description": "startup probe failure threshold" + }, + "httpGet": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "startup probe path" + }, + "port": { + "type": "string", + "description": "startup probe port" + }, + "scheme": { + "type": "string", + "description": "startup probe scheme" + } + } + }, + "initialDelaySeconds": { + "type": "integer", + "description": "startup probe initial delay seconds" + }, + "periodSeconds": { + "type": "integer", + "description": "startup probe period seconds" + }, + "successThreshold": { + "type": "integer", + "description": "startup probe success threshold" + }, + "timeoutSeconds": { + "type": "integer", + "description": "startup probe timeout seconds" + } + } + } + } + } + } + }, + "metrics": { + "type": "object", + "properties": { + "pprof": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "pprof server enabled" + }, + "host": { + "type": "string", + "description": "pprof server host" + }, + "port": { + "type": "integer", + "description": "pprof server port", + "maximum": 65535, + "minimum": 0 + }, + "server": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } + }, + "mode": { + "type": "string", + "description": "REST server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "pprof server service port", + "maximum": 65535, + "minimum": 0 + } + } + } + } + }, + "servers": { + "type": "object", + "properties": { + "grpc": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "gRPC server enabled" + }, + "host": { + "type": "string", + "description": "gRPC server host" + }, + "port": { + "type": "integer", + "description": "gRPC server port", + "maximum": 65535, + "minimum": 0 + }, + "server": { + "type": "object", + "properties": { + "grpc": { + "type": "object", + "properties": { + "bidirectional_stream_concurrency": { + "type": "integer", + "description": "gRPC server bidirectional stream concurrency" + }, + "connection_timeout": { + "type": "string", + "description": "gRPC server connection timeout" + }, + "enable_reflection": { + "type": "boolean", + "description": "gRPC server reflection option" + }, + "header_table_size": { + "type": "integer", + "description": "gRPC server header table size" + }, + "initial_conn_window_size": { + "type": "integer", + "description": "gRPC server initial connection window size" + }, + "initial_window_size": { + "type": "integer", + "description": "gRPC server initial window size" + }, + "interceptors": { + "type": "array", + "description": "gRPC server interceptors", + "items": { + "type": "string", + "enum": [ + "RecoverInterceptor", + "AccessLogInterceptor", + "TraceInterceptor", + "MetricInterceptor" + ] + } + }, + "keepalive": { + "type": "object", + "properties": { + "max_conn_age": { + "type": "string", + "description": "gRPC server keep alive max connection age" + }, + "max_conn_age_grace": { + "type": "string", + "description": "gRPC server keep alive max connection age grace" + }, + "max_conn_idle": { + "type": "string", + "description": "gRPC server keep alive max connection idle" + }, + "min_time": { + "type": "string", + "description": "gRPC server keep alive min_time" + }, + "permit_without_stream": { + "type": "boolean", + "description": "gRPC server keep alive permit_without_stream" + }, + "time": { + "type": "string", + "description": "gRPC server keep alive time" + }, + "timeout": { + "type": "string", + "description": "gRPC server keep alive timeout" + } + } + }, + "max_header_list_size": { + "type": "integer", + "description": "gRPC server max header list size" + }, + "max_receive_message_size": { + "type": "integer", + "description": "gRPC server max receive message size" + }, + "max_send_message_size": { + "type": "integer", + "description": "gRPC server max send message size" + }, + "read_buffer_size": { + "type": "integer", + "description": "gRPC server read buffer size" + }, + "write_buffer_size": { + "type": "integer", + "description": "gRPC server write buffer size" + } + } + }, + "mode": { + "type": "string", + "description": "gRPC server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "gRPC server probe wait time" + }, + "restart": { + "type": "boolean", + "description": "gRPC server restart" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "gRPC server service port", + "maximum": 65535, + "minimum": 0 + } + } + }, + "rest": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "REST server enabled" + }, + "host": { + "type": "string", + "description": "REST server host" + }, + "port": { + "type": "integer", + "description": "REST server port", + "maximum": 65535, + "minimum": 0 + }, + "server": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "handler_timeout": { + "type": "string", + "description": "REST server handler timeout" + }, + "idle_timeout": { + "type": "string", + "description": "REST server idle timeout" + }, + "read_header_timeout": { + "type": "string", + "description": "REST server read header timeout" + }, + "read_timeout": { + "type": "string", + "description": "REST server read timeout" + }, + "shutdown_duration": { + "type": "string", + "description": "REST server shutdown duration" + }, + "write_timeout": { + "type": "string", + "description": "REST server write timeout" + } + } + }, + "mode": { + "type": "string", + "description": "REST server server mode" + }, + "network": { + "type": "string", + "description": "mysql network", + "enum": [ + "tcp", + "tcp4", + "tcp6", + "udp", + "udp4", + "udp6", + "unix", + "unixgram", + "unixpacket" + ] + }, + "probe_wait_time": { + "type": "string", + "description": "REST server probe wait time" + }, + "socket_option": { + "type": "object", + "properties": { + "ip_recover_destination_addr": { + "type": "boolean", + "description": "server listen socket option for ip_recover_destination_addr functionality" + }, + "ip_transparent": { + "type": "boolean", + "description": "server listen socket option for ip_transparent functionality" + }, + "reuse_addr": { + "type": "boolean", + "description": "server listen socket option for reuse_addr functionality" + }, + "reuse_port": { + "type": "boolean", + "description": "server listen socket option for reuse_port functionality" + }, + "tcp_cork": { + "type": "boolean", + "description": "server listen socket option for tcp_cork functionality" + }, + "tcp_defer_accept": { + "type": "boolean", + "description": "server listen socket option for tcp_defer_accept functionality" + }, + "tcp_fast_open": { + "type": "boolean", + "description": "server listen socket option for tcp_fast_open functionality" + }, + "tcp_no_delay": { + "type": "boolean", + "description": "server listen socket option for tcp_no_delay functionality" + }, + "tcp_quick_ack": { + "type": "boolean", + "description": "server listen socket option for tcp_quick_ack functionality" + } + } + }, + "socket_path": { + "type": "string", + "description": "mysql socket_path" + } + } + }, + "servicePort": { + "type": "integer", + "description": "REST server service port", + "maximum": 65535, + "minimum": 0 + } + } + } + } + }, + "tls": { + "type": "object", + "properties": { + "ca": { "type": "string", "description": "TLS ca path" }, + "cert": { + "type": "string", + "description": "TLS cert path" + }, + "enabled": { + "type": "boolean", + "description": "TLS enabled" + }, + "insecure_skip_verify": { + "type": "boolean", + "description": "enable/disable skip SSL certificate verification" + }, + "key": { "type": "string", "description": "TLS key path" } + } + } + } + }, + "service": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "description": "service annotations" + }, + "labels": { "type": "object", "description": "service labels" } + } + }, + "serviceAccount": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "creates service account" + }, + "name": { + "type": "string", + "description": "name of service account" + } + } + }, + "serviceType": { + "type": "string", + "description": "service type: ClusterIP, LoadBalancer or NodePort", + "enum": ["ClusterIP", "LoadBalancer", "NodePort"] + }, + "terminationGracePeriodSeconds": { + "type": "integer", + "description": "duration in seconds pod needs to terminate gracefully", + "minimum": 0 + }, + "time_zone": { "type": "string", "description": "Time zone" }, + "tolerations": { + "type": "array", + "description": "tolerations", + "items": { "type": "object" } + }, + "topologySpreadConstraints": { + "type": "array", + "description": "topology spread constraints of gateway pods", + "items": { "type": "object" } + }, + "version": { + "type": "string", + "description": "version of gateway config", + "pattern": "^v[0-9]+\\.[0-9]+\\.[0-9]$" + }, + "volumeMounts": { + "type": "array", + "description": "volume mounts", + "items": { "type": "object" } + }, + "volumes": { + "type": "array", + "description": "volumes", + "items": { "type": "object" } + } + } } } }, From 2de16f668988b7d4d09fcaa7003ea8e5934a0fc0 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 17:25:40 +0900 Subject: [PATCH 72/93] fix: deleted unnecessary RPCs due to failure of previous rebasing Signed-off-by: hlts2 --- apis/docs/v1/docs.md | 7 +- apis/grpc/v1/mirror/mirror.pb.go | 41 +++--- apis/grpc/v1/mirror/mirror_vtproto.pb.go | 38 ----- apis/grpc/v1/vald/vald.go | 3 +- apis/proto/v1/mirror/mirror.proto | 8 -- .../apis/proto/v1/mirror/mirror.swagger.json | 31 ---- internal/client/v1/client/mirror/mirror.go | 21 --- .../mirror/handler/grpc/handler_test.go | 133 ------------------ pkg/gateway/mirror/handler/rest/handler.go | 8 -- pkg/gateway/mirror/router/router.go | 8 -- 10 files changed, 20 insertions(+), 278 deletions(-) diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index d67b989a75..cedd03663f 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -1483,10 +1483,9 @@ limitations under the License. Represent the mirror service. -| Method Name | Request Type | Response Type | Description | -| ----------- | -------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------- | -| Register | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Register is the RPC to register other mirror servers. | -| Advertise | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Advertise is the RPC to advertise other mirror servers. | +| Method Name | Request Type | Response Type | Description | +| ----------- | -------------------------------------------------------- | -------------------------------------------------------- | ----------------------------------------------------- | +| Register | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Register is the RPC to register other mirror servers. | ## Scalar Value Types diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index 0a45dfc725..d1dba7ae17 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -50,26 +50,19 @@ var file_apis_proto_v1_mirror_mirror_proto_rawDesc = []byte{ 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, 0xcc, 0x01, 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x5f, 0x0a, - 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x73, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x6d, - 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x61, - 0x0a, 0x09, 0x41, 0x64, 0x76, 0x65, 0x72, 0x74, 0x69, 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x73, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, - 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x61, 0x64, 0x76, 0x65, 0x72, 0x74, 0x69, 0x73, - 0x65, 0x42, 0x57, 0x0a, 0x1c, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x69, 0x72, 0x72, 0x6f, - 0x72, 0x42, 0x0a, 0x56, 0x61, 0x6c, 0x64, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x50, 0x01, 0x5a, - 0x29, 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, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x74, 0x6f, 0x32, 0x69, 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x5f, 0x0a, 0x08, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, + 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x6d, 0x69, + 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x42, 0x57, 0x0a, + 0x1c, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x56, + 0x61, 0x6c, 0x64, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x50, 0x01, 0x5a, 0x29, 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, + 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_apis_proto_v1_mirror_mirror_proto_goTypes = []interface{}{ @@ -77,11 +70,9 @@ var file_apis_proto_v1_mirror_mirror_proto_goTypes = []interface{}{ } var file_apis_proto_v1_mirror_mirror_proto_depIdxs = []int32{ 0, // 0: mirror.v1.Mirror.Register:input_type -> payload.v1.Mirror.Targets - 0, // 1: mirror.v1.Mirror.Advertise:input_type -> payload.v1.Mirror.Targets - 0, // 2: mirror.v1.Mirror.Register:output_type -> payload.v1.Mirror.Targets - 0, // 3: mirror.v1.Mirror.Advertise:output_type -> payload.v1.Mirror.Targets - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type + 0, // 1: mirror.v1.Mirror.Register:output_type -> payload.v1.Mirror.Targets + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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/mirror/mirror_vtproto.pb.go b/apis/grpc/v1/mirror/mirror_vtproto.pb.go index 50c5f167c2..49ae0856e7 100644 --- a/apis/grpc/v1/mirror/mirror_vtproto.pb.go +++ b/apis/grpc/v1/mirror/mirror_vtproto.pb.go @@ -44,8 +44,6 @@ const _ = grpc.SupportPackageIsVersion7 type MirrorClient interface { // Register is the RPC to register other mirror servers. Register(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) - // Advertise is the RPC to advertise other mirror servers. - Advertise(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) } type mirrorClient struct { @@ -65,23 +63,12 @@ func (c *mirrorClient) Register(ctx context.Context, in *payload.Mirror_Targets, return out, nil } -func (c *mirrorClient) Advertise(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (*payload.Mirror_Targets, error) { - out := new(payload.Mirror_Targets) - err := c.cc.Invoke(ctx, "/mirror.v1.Mirror/Advertise", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MirrorServer is the server API for Mirror service. // All implementations must embed UnimplementedMirrorServer // for forward compatibility type MirrorServer interface { // Register is the RPC to register other mirror servers. Register(context.Context, *payload.Mirror_Targets) (*payload.Mirror_Targets, error) - // Advertise is the RPC to advertise other mirror servers. - Advertise(context.Context, *payload.Mirror_Targets) (*payload.Mirror_Targets, error) mustEmbedUnimplementedMirrorServer() } @@ -92,9 +79,6 @@ type UnimplementedMirrorServer struct { func (UnimplementedMirrorServer) Register(context.Context, *payload.Mirror_Targets) (*payload.Mirror_Targets, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } -func (UnimplementedMirrorServer) Advertise(context.Context, *payload.Mirror_Targets) (*payload.Mirror_Targets, error) { - return nil, status.Errorf(codes.Unimplemented, "method Advertise not implemented") -} func (UnimplementedMirrorServer) mustEmbedUnimplementedMirrorServer() {} // UnsafeMirrorServer may be embedded to opt out of forward compatibility for this service. @@ -126,24 +110,6 @@ func _Mirror_Register_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _Mirror_Advertise_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(payload.Mirror_Targets) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MirrorServer).Advertise(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/mirror.v1.Mirror/Advertise", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MirrorServer).Advertise(ctx, req.(*payload.Mirror_Targets)) - } - return interceptor(ctx, in, info, handler) -} - // Mirror_ServiceDesc is the grpc.ServiceDesc for Mirror service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -155,10 +121,6 @@ var Mirror_ServiceDesc = grpc.ServiceDesc{ MethodName: "Register", Handler: _Mirror_Register_Handler, }, - { - MethodName: "Advertise", - Handler: _Mirror_Advertise_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "apis/proto/v1/mirror/mirror.proto", diff --git a/apis/grpc/v1/vald/vald.go b/apis/grpc/v1/vald/vald.go index 7c256111ab..56000a48e0 100644 --- a/apis/grpc/v1/vald/vald.go +++ b/apis/grpc/v1/vald/vald.go @@ -144,8 +144,7 @@ const ( StreamGetObjectRPCName = "StreamGetObject" StreamListObjectRPCName = "StreamListObject" - RegisterRPCName = "Register" - AdvertiseRPCName = "Advertise" + RegisterRPCName = "Register" ) type client struct { diff --git a/apis/proto/v1/mirror/mirror.proto b/apis/proto/v1/mirror/mirror.proto index aa0ddcc747..3c1959440f 100644 --- a/apis/proto/v1/mirror/mirror.proto +++ b/apis/proto/v1/mirror/mirror.proto @@ -34,12 +34,4 @@ service Mirror { body: "*" }; } - - // Advertise is the RPC to advertise other mirror servers. - rpc Advertise(payload.v1.Mirror.Targets) returns (payload.v1.Mirror.Targets) { - option (google.api.http) = { - post: "/mirror/advertise" - body: "*" - }; - } } diff --git a/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json index ef686b137c..ea66b1c572 100644 --- a/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json +++ b/apis/swagger/v1/mirror/apis/proto/v1/mirror/mirror.swagger.json @@ -7,37 +7,6 @@ "consumes": ["application/json"], "produces": ["application/json"], "paths": { - "/mirror/advertise": { - "post": { - "summary": "Advertise is the RPC to advertise other mirror servers.", - "operationId": "Mirror_Advertise", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/MirrorTargets" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MirrorTargets" - } - } - ], - "tags": ["Mirror"] - } - }, "/mirror/register": { "post": { "summary": "Register is the RPC to register other mirror servers.", diff --git a/internal/client/v1/client/mirror/mirror.go b/internal/client/v1/client/mirror/mirror.go index 1c9216a809..c82befc7a6 100644 --- a/internal/client/v1/client/mirror/mirror.go +++ b/internal/client/v1/client/mirror/mirror.go @@ -88,24 +88,3 @@ func (c *client) Register(ctx context.Context, in *payload.Mirror_Targets, opts } return res, nil } - -func (c *client) Advertise(ctx context.Context, in *payload.Mirror_Targets, opts ...grpc.CallOption) (res *payload.Mirror_Targets, err error) { - ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+vald.AdvertiseRPCName), apiName+"/"+vald.AdvertiseRPCName) - defer func() { - if span != nil { - span.End() - } - }() - - _, err = c.c.RoundRobin(ctx, func(ctx context.Context, conn *grpc.ClientConn, copts ...grpc.CallOption) (interface{}, error) { - res, err = mirror.NewMirrorClient(conn).Advertise(ctx, in, append(copts, opts...)...) - if err != nil { - return nil, err - } - return res, nil - }) - if err != nil { - return nil, err - } - return res, nil -} diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index 8b7fd25b90..64e69bb85f 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -2547,139 +2547,6 @@ func Test_server_Register(t *testing.T) { } } -func Test_server_Advertise(t *testing.T) { - type args struct { - ctx context.Context - req *payload.Mirror_Targets - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Mirror_Targets - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Mirror_Targets, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Mirror_Targets, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.Advertise(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - func Test_server_Exists(t *testing.T) { type args struct { ctx context.Context diff --git a/pkg/gateway/mirror/handler/rest/handler.go b/pkg/gateway/mirror/handler/rest/handler.go index 5f1666fbf9..5be7f785eb 100644 --- a/pkg/gateway/mirror/handler/rest/handler.go +++ b/pkg/gateway/mirror/handler/rest/handler.go @@ -24,7 +24,6 @@ import ( type Handler interface { Register(w http.ResponseWriter, r *http.Request) (int, error) - Advertise(w http.ResponseWriter, r *http.Request) (int, error) Index(w http.ResponseWriter, r *http.Request) (int, error) Exists(w http.ResponseWriter, r *http.Request) (int, error) Search(w http.ResponseWriter, r *http.Request) (int, error) @@ -66,13 +65,6 @@ func (h *handler) Register(w http.ResponseWriter, r *http.Request) (code int, er }) } -func (h *handler) Advertise(w http.ResponseWriter, r *http.Request) (code int, err error) { - var req *payload.Mirror_Targets - return json.Handler(w, r, &req, func() (interface{}, error) { - return h.vald.Advertise(r.Context(), req) - }) -} - func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { diff --git a/pkg/gateway/mirror/router/router.go b/pkg/gateway/mirror/router/router.go index f2452b44b1..811cf6e4f4 100644 --- a/pkg/gateway/mirror/router/router.go +++ b/pkg/gateway/mirror/router/router.go @@ -53,14 +53,6 @@ func New(opts ...Option) http.Handler { "/register", h.Register, }, - { - "Advertise", - []string{ - http.MethodPost, - }, - "/register", - h.Advertise, - }, { "Search", []string{ From 76309fdcb98ae5133ec4024c1c0b2a1679b2fa87 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 18:03:42 +0900 Subject: [PATCH 73/93] fix: proto and execute make proto/all format Signed-off-by: hlts2 --- apis/docs/v1/docs.md | 63 ++ apis/grpc/v1/mirror/mirror.pb.go | 73 +- apis/grpc/v1/mirror/mirror_vtproto.pb.go | 2 +- apis/grpc/v1/payload/payload.pb.go | 897 +++++++++++++-------- apis/proto/v1/mirror/mirror.proto | 4 +- apis/swagger/v1/mirror/mirror.swagger.json | 113 +++ apis/swagger/v1/vald/filter.swagger.json | 40 +- apis/swagger/v1/vald/insert.swagger.json | 32 +- apis/swagger/v1/vald/object.swagger.json | 32 +- apis/swagger/v1/vald/search.swagger.json | 32 +- apis/swagger/v1/vald/update.swagger.json | 32 +- apis/swagger/v1/vald/upsert.swagger.json | 32 +- 12 files changed, 859 insertions(+), 493 deletions(-) create mode 100644 apis/swagger/v1/mirror/mirror.swagger.json diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index 243a35d5f0..99b6f6ba2c 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -33,6 +33,9 @@ - [Insert.MultiRequest](#payload-v1-Insert-MultiRequest) - [Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest) - [Insert.Request](#payload-v1-Insert-Request) + - [Mirror](#payload-v1-Mirror) + - [Mirror.Target](#payload-v1-Mirror-Target) + - [Mirror.Targets](#payload-v1-Mirror-Targets) - [Object](#payload-v1-Object) - [Object.Blob](#payload-v1-Object-Blob) - [Object.Distance](#payload-v1-Object-Distance) @@ -82,6 +85,7 @@ - [Upsert.MultiRequest](#payload-v1-Upsert-MultiRequest) - [Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) - [Upsert.Request](#payload-v1-Upsert-Request) + - [Remove.Timestamp.Operator](#payload-v1-Remove-Timestamp-Operator) - [Search.AggregationAlgorithm](#payload-v1-Search-AggregationAlgorithm) @@ -97,6 +101,8 @@ - [Filter](#filter-ingress-v1-Filter) - [v1/manager/index/index_manager.proto](#v1_manager_index_index_manager-proto) - [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) - [BadRequest](#rpc-v1-BadRequest) - [BadRequest.FieldViolation](#rpc-v1-BadRequest-FieldViolation) @@ -399,6 +405,33 @@ Represent the insert request. | vector | [Object.Vector](#payload-v1-Object-Vector) | | The vector to be inserted. | | config | [Insert.Config](#payload-v1-Insert-Config) | | The configuration of the insert request. | + + +### Mirror + +Mirror related messages. + + + +### Mirror.Target + +Represent server information. + +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | -------------------- | +| host | [string](#string) | | The target hostname. | +| port | [uint32](#uint32) | | The target port. | + + + +### Mirror.Targets + +Represent the multiple Target message. + +| Field | Type | Label | Description | +| ------- | ------------------------------------------ | -------- | -------------------------------- | +| targets | [Mirror.Target](#payload-v1-Mirror-Target) | repeated | The multiple target information. | + ### Object @@ -1031,6 +1064,36 @@ Represent the index manager service. | ----------- | -------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------- | | 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. | + + +

    Top

    + +## v1/mirror/mirror.proto + +Copyright (C) 2019-2023 vdaas.org vald team <vald@vdaas.org> + +Licensed under the Apache License, Version 2.0 (the "License"); +You may not use this file except in compliance with the License. +You may obtain a copy of the License at + +https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + + +### Mirror + +Represent the mirror service. + +| Method Name | Request Type | Response Type | Description | +| ----------- | -------------------------------------------------------- | -------------------------------------------------------- | ----------------------------------------------------- | +| Register | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | [.payload.v1.Mirror.Targets](#payload-v1-Mirror-Targets) | Register is the RPC to register other mirror servers. | +

    Top

    diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index d1dba7ae17..540552e87a 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.25.0 -// source: apis/proto/v1/mirror/mirror.proto +// protoc (unknown) +// source: v1/mirror/mirror.proto package mirror @@ -38,37 +38,34 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -var File_apis_proto_v1_mirror_mirror_proto protoreflect.FileDescriptor +var File_v1_mirror_mirror_proto protoreflect.FileDescriptor -var file_apis_proto_v1_mirror_mirror_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 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, 0x69, 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x5f, 0x0a, 0x08, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, - 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x6d, 0x69, - 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x42, 0x57, 0x0a, - 0x1c, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x56, - 0x61, 0x6c, 0x64, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x50, 0x01, 0x5a, 0x29, 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, - 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var file_v1_mirror_mirror_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x6d, 0x69, 0x72, 0x72, + 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, + 0x2e, 0x76, 0x31, 0x1a, 0x1c, 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, 0x69, 0x0a, 0x06, 0x4d, + 0x69, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x5f, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1a, 0x2e, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, + 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x42, 0x57, 0x0a, 0x1c, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, + 0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x56, 0x61, 0x6c, 0x64, 0x4d, 0x69, 0x72, 0x72, + 0x6f, 0x72, 0x50, 0x01, 0x5a, 0x29, 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, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_apis_proto_v1_mirror_mirror_proto_goTypes = []interface{}{ +var file_v1_mirror_mirror_proto_goTypes = []interface{}{ (*payload.Mirror_Targets)(nil), // 0: payload.v1.Mirror.Targets } -var file_apis_proto_v1_mirror_mirror_proto_depIdxs = []int32{ +var file_v1_mirror_mirror_proto_depIdxs = []int32{ 0, // 0: mirror.v1.Mirror.Register:input_type -> payload.v1.Mirror.Targets 0, // 1: mirror.v1.Mirror.Register:output_type -> payload.v1.Mirror.Targets 1, // [1:2] is the sub-list for method output_type @@ -78,26 +75,26 @@ var file_apis_proto_v1_mirror_mirror_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_apis_proto_v1_mirror_mirror_proto_init() } -func file_apis_proto_v1_mirror_mirror_proto_init() { - if File_apis_proto_v1_mirror_mirror_proto != nil { +func init() { file_v1_mirror_mirror_proto_init() } +func file_v1_mirror_mirror_proto_init() { + if File_v1_mirror_mirror_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_apis_proto_v1_mirror_mirror_proto_rawDesc, + RawDescriptor: file_v1_mirror_mirror_proto_rawDesc, NumEnums: 0, NumMessages: 0, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_apis_proto_v1_mirror_mirror_proto_goTypes, - DependencyIndexes: file_apis_proto_v1_mirror_mirror_proto_depIdxs, + GoTypes: file_v1_mirror_mirror_proto_goTypes, + DependencyIndexes: file_v1_mirror_mirror_proto_depIdxs, }.Build() - File_apis_proto_v1_mirror_mirror_proto = out.File - file_apis_proto_v1_mirror_mirror_proto_rawDesc = nil - file_apis_proto_v1_mirror_mirror_proto_goTypes = nil - file_apis_proto_v1_mirror_mirror_proto_depIdxs = nil + File_v1_mirror_mirror_proto = out.File + file_v1_mirror_mirror_proto_rawDesc = nil + file_v1_mirror_mirror_proto_goTypes = nil + file_v1_mirror_mirror_proto_depIdxs = nil } diff --git a/apis/grpc/v1/mirror/mirror_vtproto.pb.go b/apis/grpc/v1/mirror/mirror_vtproto.pb.go index 49ae0856e7..9b2d08f302 100644 --- a/apis/grpc/v1/mirror/mirror_vtproto.pb.go +++ b/apis/grpc/v1/mirror/mirror_vtproto.pb.go @@ -123,5 +123,5 @@ var Mirror_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "apis/proto/v1/mirror/mirror.proto", + Metadata: "v1/mirror/mirror.proto", } diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index 8ee0d9b00b..bfed7b2ead 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -550,6 +550,45 @@ func (*Info) Descriptor() ([]byte, []int) { return file_v1_payload_payload_proto_rawDescGZIP(), []int{9} } +// Mirror related messages. +type Mirror struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Mirror) Reset() { + *x = Mirror{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_payload_payload_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror) ProtoMessage() {} + +func (x *Mirror) ProtoReflect() protoreflect.Message { + mi := &file_v1_payload_payload_proto_msgTypes[10] + 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 Mirror.ProtoReflect.Descriptor instead. +func (*Mirror) Descriptor() ([]byte, []int) { + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10} +} + // Represent an empty message. type Empty struct { state protoimpl.MessageState @@ -560,7 +599,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[10] + mi := &file_v1_payload_payload_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -573,7 +612,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[10] + mi := &file_v1_payload_payload_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -586,7 +625,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_v1_payload_payload_proto_rawDescGZIP(), []int{10} + return file_v1_payload_payload_proto_rawDescGZIP(), []int{11} } // Represent a search request. @@ -604,7 +643,7 @@ type Search_Request struct { func (x *Search_Request) Reset() { *x = Search_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[11] + mi := &file_v1_payload_payload_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -617,7 +656,7 @@ func (x *Search_Request) String() string { func (*Search_Request) ProtoMessage() {} func (x *Search_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[11] + mi := &file_v1_payload_payload_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -660,7 +699,7 @@ type Search_MultiRequest struct { func (x *Search_MultiRequest) Reset() { *x = Search_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[12] + mi := &file_v1_payload_payload_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -673,7 +712,7 @@ func (x *Search_MultiRequest) String() string { func (*Search_MultiRequest) ProtoMessage() {} func (x *Search_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[12] + mi := &file_v1_payload_payload_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -711,7 +750,7 @@ type Search_IDRequest struct { func (x *Search_IDRequest) Reset() { *x = Search_IDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[13] + mi := &file_v1_payload_payload_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -724,7 +763,7 @@ func (x *Search_IDRequest) String() string { func (*Search_IDRequest) ProtoMessage() {} func (x *Search_IDRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[13] + mi := &file_v1_payload_payload_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -767,7 +806,7 @@ type Search_MultiIDRequest struct { func (x *Search_MultiIDRequest) Reset() { *x = Search_MultiIDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[14] + mi := &file_v1_payload_payload_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -780,7 +819,7 @@ func (x *Search_MultiIDRequest) String() string { func (*Search_MultiIDRequest) ProtoMessage() {} func (x *Search_MultiIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[14] + mi := &file_v1_payload_payload_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -820,7 +859,7 @@ type Search_ObjectRequest struct { func (x *Search_ObjectRequest) Reset() { *x = Search_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[15] + mi := &file_v1_payload_payload_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -833,7 +872,7 @@ func (x *Search_ObjectRequest) String() string { func (*Search_ObjectRequest) ProtoMessage() {} func (x *Search_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[15] + mi := &file_v1_payload_payload_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -883,7 +922,7 @@ type Search_MultiObjectRequest struct { func (x *Search_MultiObjectRequest) Reset() { *x = Search_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[16] + mi := &file_v1_payload_payload_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -896,7 +935,7 @@ func (x *Search_MultiObjectRequest) String() string { func (*Search_MultiObjectRequest) ProtoMessage() {} func (x *Search_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[16] + mi := &file_v1_payload_payload_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -948,7 +987,7 @@ type Search_Config struct { func (x *Search_Config) Reset() { *x = Search_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[17] + mi := &file_v1_payload_payload_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -961,7 +1000,7 @@ func (x *Search_Config) String() string { func (*Search_Config) ProtoMessage() {} func (x *Search_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[17] + mi := &file_v1_payload_payload_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1055,7 +1094,7 @@ type Search_Response struct { func (x *Search_Response) Reset() { *x = Search_Response{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[18] + mi := &file_v1_payload_payload_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1068,7 +1107,7 @@ func (x *Search_Response) String() string { func (*Search_Response) ProtoMessage() {} func (x *Search_Response) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[18] + mi := &file_v1_payload_payload_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1111,7 +1150,7 @@ type Search_Responses struct { func (x *Search_Responses) Reset() { *x = Search_Responses{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[19] + mi := &file_v1_payload_payload_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1124,7 +1163,7 @@ func (x *Search_Responses) String() string { func (*Search_Responses) ProtoMessage() {} func (x *Search_Responses) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[19] + mi := &file_v1_payload_payload_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1163,7 +1202,7 @@ type Search_StreamResponse struct { func (x *Search_StreamResponse) Reset() { *x = Search_StreamResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[20] + mi := &file_v1_payload_payload_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1176,7 +1215,7 @@ func (x *Search_StreamResponse) String() string { func (*Search_StreamResponse) ProtoMessage() {} func (x *Search_StreamResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[20] + mi := &file_v1_payload_payload_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1246,7 +1285,7 @@ type Filter_Target struct { func (x *Filter_Target) Reset() { *x = Filter_Target{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[21] + mi := &file_v1_payload_payload_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1259,7 +1298,7 @@ func (x *Filter_Target) String() string { func (*Filter_Target) ProtoMessage() {} func (x *Filter_Target) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[21] + mi := &file_v1_payload_payload_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1302,7 +1341,7 @@ type Filter_Config struct { func (x *Filter_Config) Reset() { *x = Filter_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[22] + mi := &file_v1_payload_payload_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1315,7 +1354,7 @@ func (x *Filter_Config) String() string { func (*Filter_Config) ProtoMessage() {} func (x *Filter_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[22] + mi := &file_v1_payload_payload_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1353,7 +1392,7 @@ type Insert_Request struct { func (x *Insert_Request) Reset() { *x = Insert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[23] + mi := &file_v1_payload_payload_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1366,7 +1405,7 @@ func (x *Insert_Request) String() string { func (*Insert_Request) ProtoMessage() {} func (x *Insert_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[23] + mi := &file_v1_payload_payload_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1409,7 +1448,7 @@ type Insert_MultiRequest struct { func (x *Insert_MultiRequest) Reset() { *x = Insert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[24] + mi := &file_v1_payload_payload_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1422,7 +1461,7 @@ func (x *Insert_MultiRequest) String() string { func (*Insert_MultiRequest) ProtoMessage() {} func (x *Insert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[24] + mi := &file_v1_payload_payload_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1462,7 +1501,7 @@ type Insert_ObjectRequest struct { func (x *Insert_ObjectRequest) Reset() { *x = Insert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[25] + mi := &file_v1_payload_payload_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1475,7 +1514,7 @@ func (x *Insert_ObjectRequest) String() string { func (*Insert_ObjectRequest) ProtoMessage() {} func (x *Insert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[25] + mi := &file_v1_payload_payload_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1525,7 +1564,7 @@ type Insert_MultiObjectRequest struct { func (x *Insert_MultiObjectRequest) Reset() { *x = Insert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[26] + mi := &file_v1_payload_payload_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1538,7 +1577,7 @@ func (x *Insert_MultiObjectRequest) String() string { func (*Insert_MultiObjectRequest) ProtoMessage() {} func (x *Insert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[26] + mi := &file_v1_payload_payload_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1578,7 +1617,7 @@ type Insert_Config struct { func (x *Insert_Config) Reset() { *x = Insert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[27] + mi := &file_v1_payload_payload_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1591,7 +1630,7 @@ func (x *Insert_Config) String() string { func (*Insert_Config) ProtoMessage() {} func (x *Insert_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[27] + mi := &file_v1_payload_payload_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1643,7 +1682,7 @@ type Update_Request struct { func (x *Update_Request) Reset() { *x = Update_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[28] + mi := &file_v1_payload_payload_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1656,7 +1695,7 @@ func (x *Update_Request) String() string { func (*Update_Request) ProtoMessage() {} func (x *Update_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[28] + mi := &file_v1_payload_payload_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1699,7 +1738,7 @@ type Update_MultiRequest struct { func (x *Update_MultiRequest) Reset() { *x = Update_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[29] + mi := &file_v1_payload_payload_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1712,7 +1751,7 @@ func (x *Update_MultiRequest) String() string { func (*Update_MultiRequest) ProtoMessage() {} func (x *Update_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[29] + mi := &file_v1_payload_payload_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1752,7 +1791,7 @@ type Update_ObjectRequest struct { func (x *Update_ObjectRequest) Reset() { *x = Update_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[30] + mi := &file_v1_payload_payload_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1765,7 +1804,7 @@ func (x *Update_ObjectRequest) String() string { func (*Update_ObjectRequest) ProtoMessage() {} func (x *Update_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[30] + mi := &file_v1_payload_payload_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1815,7 +1854,7 @@ type Update_MultiObjectRequest struct { func (x *Update_MultiObjectRequest) Reset() { *x = Update_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[31] + mi := &file_v1_payload_payload_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1828,7 +1867,7 @@ func (x *Update_MultiObjectRequest) String() string { func (*Update_MultiObjectRequest) ProtoMessage() {} func (x *Update_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[31] + mi := &file_v1_payload_payload_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1871,7 +1910,7 @@ type Update_Config struct { func (x *Update_Config) Reset() { *x = Update_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[32] + mi := &file_v1_payload_payload_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1884,7 +1923,7 @@ func (x *Update_Config) String() string { func (*Update_Config) ProtoMessage() {} func (x *Update_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[32] + mi := &file_v1_payload_payload_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1943,7 +1982,7 @@ type Upsert_Request struct { func (x *Upsert_Request) Reset() { *x = Upsert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[33] + mi := &file_v1_payload_payload_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1956,7 +1995,7 @@ func (x *Upsert_Request) String() string { func (*Upsert_Request) ProtoMessage() {} func (x *Upsert_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[33] + mi := &file_v1_payload_payload_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1999,7 +2038,7 @@ type Upsert_MultiRequest struct { func (x *Upsert_MultiRequest) Reset() { *x = Upsert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[34] + mi := &file_v1_payload_payload_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2012,7 +2051,7 @@ func (x *Upsert_MultiRequest) String() string { func (*Upsert_MultiRequest) ProtoMessage() {} func (x *Upsert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[34] + mi := &file_v1_payload_payload_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2052,7 +2091,7 @@ type Upsert_ObjectRequest struct { func (x *Upsert_ObjectRequest) Reset() { *x = Upsert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[35] + mi := &file_v1_payload_payload_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2065,7 +2104,7 @@ func (x *Upsert_ObjectRequest) String() string { func (*Upsert_ObjectRequest) ProtoMessage() {} func (x *Upsert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[35] + mi := &file_v1_payload_payload_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2115,7 +2154,7 @@ type Upsert_MultiObjectRequest struct { func (x *Upsert_MultiObjectRequest) Reset() { *x = Upsert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[36] + mi := &file_v1_payload_payload_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2128,7 +2167,7 @@ func (x *Upsert_MultiObjectRequest) String() string { func (*Upsert_MultiObjectRequest) ProtoMessage() {} func (x *Upsert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[36] + mi := &file_v1_payload_payload_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2171,7 +2210,7 @@ type Upsert_Config struct { func (x *Upsert_Config) Reset() { *x = Upsert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[37] + mi := &file_v1_payload_payload_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2184,7 +2223,7 @@ func (x *Upsert_Config) String() string { func (*Upsert_Config) ProtoMessage() {} func (x *Upsert_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[37] + mi := &file_v1_payload_payload_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2243,7 +2282,7 @@ type Remove_Request struct { func (x *Remove_Request) Reset() { *x = Remove_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[38] + mi := &file_v1_payload_payload_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2256,7 +2295,7 @@ func (x *Remove_Request) String() string { func (*Remove_Request) ProtoMessage() {} func (x *Remove_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[38] + mi := &file_v1_payload_payload_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2299,7 +2338,7 @@ type Remove_MultiRequest struct { func (x *Remove_MultiRequest) Reset() { *x = Remove_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[39] + mi := &file_v1_payload_payload_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2312,7 +2351,7 @@ func (x *Remove_MultiRequest) String() string { func (*Remove_MultiRequest) ProtoMessage() {} func (x *Remove_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[39] + mi := &file_v1_payload_payload_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2348,7 +2387,7 @@ type Remove_TimestampRequest struct { func (x *Remove_TimestampRequest) Reset() { *x = Remove_TimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[40] + mi := &file_v1_payload_payload_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2361,7 +2400,7 @@ func (x *Remove_TimestampRequest) String() string { func (*Remove_TimestampRequest) ProtoMessage() {} func (x *Remove_TimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[40] + mi := &file_v1_payload_payload_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2399,7 +2438,7 @@ type Remove_Timestamp struct { func (x *Remove_Timestamp) Reset() { *x = Remove_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[41] + mi := &file_v1_payload_payload_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2412,7 +2451,7 @@ func (x *Remove_Timestamp) String() string { func (*Remove_Timestamp) ProtoMessage() {} func (x *Remove_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[41] + mi := &file_v1_payload_payload_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2457,7 +2496,7 @@ type Remove_Config struct { func (x *Remove_Config) Reset() { *x = Remove_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[42] + mi := &file_v1_payload_payload_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2470,7 +2509,7 @@ func (x *Remove_Config) String() string { func (*Remove_Config) ProtoMessage() {} func (x *Remove_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[42] + mi := &file_v1_payload_payload_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2515,7 +2554,7 @@ type Object_VectorRequest struct { func (x *Object_VectorRequest) Reset() { *x = Object_VectorRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[43] + mi := &file_v1_payload_payload_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2528,7 +2567,7 @@ func (x *Object_VectorRequest) String() string { func (*Object_VectorRequest) ProtoMessage() {} func (x *Object_VectorRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[43] + mi := &file_v1_payload_payload_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2573,7 +2612,7 @@ type Object_Distance struct { func (x *Object_Distance) Reset() { *x = Object_Distance{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[44] + mi := &file_v1_payload_payload_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2586,7 +2625,7 @@ func (x *Object_Distance) String() string { func (*Object_Distance) ProtoMessage() {} func (x *Object_Distance) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[44] + mi := &file_v1_payload_payload_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2632,7 +2671,7 @@ type Object_StreamDistance struct { func (x *Object_StreamDistance) Reset() { *x = Object_StreamDistance{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[45] + mi := &file_v1_payload_payload_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2645,7 +2684,7 @@ func (x *Object_StreamDistance) String() string { func (*Object_StreamDistance) ProtoMessage() {} func (x *Object_StreamDistance) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[45] + mi := &file_v1_payload_payload_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2712,7 +2751,7 @@ type Object_ID struct { func (x *Object_ID) Reset() { *x = Object_ID{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[46] + mi := &file_v1_payload_payload_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2725,7 +2764,7 @@ func (x *Object_ID) String() string { func (*Object_ID) ProtoMessage() {} func (x *Object_ID) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[46] + mi := &file_v1_payload_payload_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2760,7 +2799,7 @@ type Object_IDs struct { func (x *Object_IDs) Reset() { *x = Object_IDs{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[47] + mi := &file_v1_payload_payload_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2773,7 +2812,7 @@ func (x *Object_IDs) String() string { func (*Object_IDs) ProtoMessage() {} func (x *Object_IDs) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[47] + mi := &file_v1_payload_payload_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2813,7 +2852,7 @@ type Object_Vector struct { func (x *Object_Vector) Reset() { *x = Object_Vector{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[48] + mi := &file_v1_payload_payload_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2826,7 +2865,7 @@ func (x *Object_Vector) String() string { func (*Object_Vector) ProtoMessage() {} func (x *Object_Vector) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[48] + mi := &file_v1_payload_payload_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2876,7 +2915,7 @@ type Object_GetTimestampRequest struct { func (x *Object_GetTimestampRequest) Reset() { *x = Object_GetTimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[49] + mi := &file_v1_payload_payload_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2889,7 +2928,7 @@ func (x *Object_GetTimestampRequest) String() string { func (*Object_GetTimestampRequest) ProtoMessage() {} func (x *Object_GetTimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[49] + mi := &file_v1_payload_payload_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2927,7 +2966,7 @@ type Object_Timestamp struct { func (x *Object_Timestamp) Reset() { *x = Object_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[50] + mi := &file_v1_payload_payload_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2940,7 +2979,7 @@ func (x *Object_Timestamp) String() string { func (*Object_Timestamp) ProtoMessage() {} func (x *Object_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[50] + mi := &file_v1_payload_payload_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2982,7 +3021,7 @@ type Object_Vectors struct { func (x *Object_Vectors) Reset() { *x = Object_Vectors{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[51] + mi := &file_v1_payload_payload_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2995,7 +3034,7 @@ func (x *Object_Vectors) String() string { func (*Object_Vectors) ProtoMessage() {} func (x *Object_Vectors) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[51] + mi := &file_v1_payload_payload_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3034,7 +3073,7 @@ type Object_StreamVector struct { func (x *Object_StreamVector) Reset() { *x = Object_StreamVector{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[52] + mi := &file_v1_payload_payload_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3047,7 +3086,7 @@ func (x *Object_StreamVector) String() string { func (*Object_StreamVector) ProtoMessage() {} func (x *Object_StreamVector) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[52] + mi := &file_v1_payload_payload_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3117,7 +3156,7 @@ type Object_ReshapeVector struct { func (x *Object_ReshapeVector) Reset() { *x = Object_ReshapeVector{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[53] + mi := &file_v1_payload_payload_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3130,7 +3169,7 @@ func (x *Object_ReshapeVector) String() string { func (*Object_ReshapeVector) ProtoMessage() {} func (x *Object_ReshapeVector) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[53] + mi := &file_v1_payload_payload_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3175,7 +3214,7 @@ type Object_Blob struct { func (x *Object_Blob) Reset() { *x = Object_Blob{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[54] + mi := &file_v1_payload_payload_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3188,7 +3227,7 @@ func (x *Object_Blob) String() string { func (*Object_Blob) ProtoMessage() {} func (x *Object_Blob) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[54] + mi := &file_v1_payload_payload_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3234,7 +3273,7 @@ type Object_StreamBlob struct { func (x *Object_StreamBlob) Reset() { *x = Object_StreamBlob{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[55] + mi := &file_v1_payload_payload_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3247,7 +3286,7 @@ func (x *Object_StreamBlob) String() string { func (*Object_StreamBlob) ProtoMessage() {} func (x *Object_StreamBlob) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[55] + mi := &file_v1_payload_payload_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3319,7 +3358,7 @@ type Object_Location struct { func (x *Object_Location) Reset() { *x = Object_Location{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[56] + mi := &file_v1_payload_payload_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3332,7 +3371,7 @@ func (x *Object_Location) String() string { func (*Object_Location) ProtoMessage() {} func (x *Object_Location) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[56] + mi := &file_v1_payload_payload_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3385,7 +3424,7 @@ type Object_StreamLocation struct { func (x *Object_StreamLocation) Reset() { *x = Object_StreamLocation{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[57] + mi := &file_v1_payload_payload_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3398,7 +3437,7 @@ func (x *Object_StreamLocation) String() string { func (*Object_StreamLocation) ProtoMessage() {} func (x *Object_StreamLocation) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[57] + mi := &file_v1_payload_payload_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3465,7 +3504,7 @@ type Object_Locations struct { func (x *Object_Locations) Reset() { *x = Object_Locations{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[58] + mi := &file_v1_payload_payload_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3478,7 +3517,7 @@ func (x *Object_Locations) String() string { func (*Object_Locations) ProtoMessage() {} func (x *Object_Locations) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[58] + mi := &file_v1_payload_payload_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3511,7 +3550,7 @@ type Object_List struct { func (x *Object_List) Reset() { *x = Object_List{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[59] + mi := &file_v1_payload_payload_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3524,7 +3563,7 @@ func (x *Object_List) String() string { func (*Object_List) ProtoMessage() {} func (x *Object_List) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[59] + mi := &file_v1_payload_payload_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3549,7 +3588,7 @@ type Object_List_Request struct { func (x *Object_List_Request) Reset() { *x = Object_List_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[60] + mi := &file_v1_payload_payload_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3562,7 +3601,7 @@ func (x *Object_List_Request) String() string { func (*Object_List_Request) ProtoMessage() {} func (x *Object_List_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[60] + mi := &file_v1_payload_payload_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3593,7 +3632,7 @@ type Object_List_Response struct { func (x *Object_List_Response) Reset() { *x = Object_List_Response{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[61] + mi := &file_v1_payload_payload_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3606,7 +3645,7 @@ func (x *Object_List_Response) String() string { func (*Object_List_Response) ProtoMessage() {} func (x *Object_List_Response) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[61] + mi := &file_v1_payload_payload_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3674,7 +3713,7 @@ type Control_CreateIndexRequest struct { func (x *Control_CreateIndexRequest) Reset() { *x = Control_CreateIndexRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[62] + mi := &file_v1_payload_payload_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3687,7 +3726,7 @@ func (x *Control_CreateIndexRequest) String() string { func (*Control_CreateIndexRequest) ProtoMessage() {} func (x *Control_CreateIndexRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[62] + mi := &file_v1_payload_payload_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3727,7 +3766,7 @@ type Discoverer_Request struct { func (x *Discoverer_Request) Reset() { *x = Discoverer_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[63] + mi := &file_v1_payload_payload_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3740,7 +3779,7 @@ func (x *Discoverer_Request) String() string { func (*Discoverer_Request) ProtoMessage() {} func (x *Discoverer_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[63] + mi := &file_v1_payload_payload_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3787,7 +3826,7 @@ type Info_Index struct { func (x *Info_Index) Reset() { *x = Info_Index{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[64] + mi := &file_v1_payload_payload_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3800,7 +3839,7 @@ func (x *Info_Index) String() string { func (*Info_Index) ProtoMessage() {} func (x *Info_Index) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[64] + mi := &file_v1_payload_payload_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3841,7 +3880,7 @@ type Info_Pod struct { func (x *Info_Pod) Reset() { *x = Info_Pod{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[65] + mi := &file_v1_payload_payload_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3854,7 +3893,7 @@ func (x *Info_Pod) String() string { func (*Info_Pod) ProtoMessage() {} func (x *Info_Pod) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[65] + mi := &file_v1_payload_payload_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3942,7 +3981,7 @@ type Info_Node struct { func (x *Info_Node) Reset() { *x = Info_Node{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[66] + mi := &file_v1_payload_payload_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3955,7 +3994,7 @@ func (x *Info_Node) String() string { func (*Info_Node) ProtoMessage() {} func (x *Info_Node) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[66] + mi := &file_v1_payload_payload_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4030,7 +4069,7 @@ type Info_CPU struct { func (x *Info_CPU) Reset() { *x = Info_CPU{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[67] + mi := &file_v1_payload_payload_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4043,7 +4082,7 @@ func (x *Info_CPU) String() string { func (*Info_CPU) ProtoMessage() {} func (x *Info_CPU) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[67] + mi := &file_v1_payload_payload_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4097,7 +4136,7 @@ type Info_Memory struct { func (x *Info_Memory) Reset() { *x = Info_Memory{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[68] + mi := &file_v1_payload_payload_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4110,7 +4149,7 @@ func (x *Info_Memory) String() string { func (*Info_Memory) ProtoMessage() {} func (x *Info_Memory) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[68] + mi := &file_v1_payload_payload_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4160,7 +4199,7 @@ type Info_Pods struct { func (x *Info_Pods) Reset() { *x = Info_Pods{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[69] + mi := &file_v1_payload_payload_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4173,7 +4212,7 @@ func (x *Info_Pods) String() string { func (*Info_Pods) ProtoMessage() {} func (x *Info_Pods) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[69] + mi := &file_v1_payload_payload_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4209,7 +4248,7 @@ type Info_Nodes struct { func (x *Info_Nodes) Reset() { *x = Info_Nodes{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[70] + mi := &file_v1_payload_payload_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4222,7 +4261,7 @@ func (x *Info_Nodes) String() string { func (*Info_Nodes) ProtoMessage() {} func (x *Info_Nodes) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[70] + mi := &file_v1_payload_payload_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4257,7 +4296,7 @@ type Info_IPs struct { func (x *Info_IPs) Reset() { *x = Info_IPs{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[71] + mi := &file_v1_payload_payload_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4270,7 +4309,7 @@ func (x *Info_IPs) String() string { func (*Info_IPs) ProtoMessage() {} func (x *Info_IPs) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[71] + mi := &file_v1_payload_payload_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4312,7 +4351,7 @@ type Info_Index_Count struct { func (x *Info_Index_Count) Reset() { *x = Info_Index_Count{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[72] + mi := &file_v1_payload_payload_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4325,7 +4364,7 @@ func (x *Info_Index_Count) String() string { func (*Info_Index_Count) ProtoMessage() {} func (x *Info_Index_Count) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[72] + mi := &file_v1_payload_payload_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4379,7 +4418,7 @@ type Info_Index_UUID struct { func (x *Info_Index_UUID) Reset() { *x = Info_Index_UUID{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[73] + mi := &file_v1_payload_payload_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4392,7 +4431,7 @@ func (x *Info_Index_UUID) String() string { func (*Info_Index_UUID) ProtoMessage() {} func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[73] + mi := &file_v1_payload_payload_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4420,7 +4459,7 @@ type Info_Index_UUID_Committed struct { func (x *Info_Index_UUID_Committed) Reset() { *x = Info_Index_UUID_Committed{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[74] + mi := &file_v1_payload_payload_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4433,7 +4472,7 @@ func (x *Info_Index_UUID_Committed) String() string { func (*Info_Index_UUID_Committed) ProtoMessage() {} func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[74] + mi := &file_v1_payload_payload_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4468,7 +4507,7 @@ type Info_Index_UUID_Uncommitted struct { func (x *Info_Index_UUID_Uncommitted) Reset() { *x = Info_Index_UUID_Uncommitted{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[75] + mi := &file_v1_payload_payload_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4481,7 +4520,7 @@ func (x *Info_Index_UUID_Uncommitted) String() string { func (*Info_Index_UUID_Uncommitted) ProtoMessage() {} func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[75] + mi := &file_v1_payload_payload_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4504,6 +4543,113 @@ func (x *Info_Index_UUID_Uncommitted) GetUuid() string { return "" } +// Represent server information. +type Mirror_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The target hostname. + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + // The target port. + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *Mirror_Target) Reset() { + *x = Mirror_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_payload_payload_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Target) ProtoMessage() {} + +func (x *Mirror_Target) ProtoReflect() protoreflect.Message { + mi := &file_v1_payload_payload_proto_msgTypes[77] + 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 Mirror_Target.ProtoReflect.Descriptor instead. +func (*Mirror_Target) Descriptor() ([]byte, []int) { + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *Mirror_Target) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Mirror_Target) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +// Represent the multiple Target message. +type Mirror_Targets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The multiple target information. + Targets []*Mirror_Target `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *Mirror_Targets) Reset() { + *x = Mirror_Targets{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_payload_payload_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Targets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Targets) ProtoMessage() {} + +func (x *Mirror_Targets) ProtoReflect() protoreflect.Message { + mi := &file_v1_payload_payload_proto_msgTypes[78] + 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 Mirror_Targets.ProtoReflect.Descriptor instead. +func (*Mirror_Targets) Descriptor() ([]byte, []int) { + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 1} +} + +func (x *Mirror_Targets) GetTargets() []*Mirror_Target { + if x != nil { + return x.Targets + } + return nil +} + var File_v1_payload_payload_proto protoreflect.FileDescriptor var file_v1_payload_payload_proto_rawDesc = []byte{ @@ -4927,15 +5073,22 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x42, 0x08, 0xba, 0x48, 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, + 0x69, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x7a, 0x0a, 0x06, + 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x3e, 0x0a, 0x07, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, + 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 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, } var ( @@ -4951,7 +5104,7 @@ func file_v1_payload_payload_proto_rawDescGZIP() []byte { } var file_v1_payload_payload_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 76) +var file_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 79) var file_v1_payload_payload_proto_goTypes = []interface{}{ (Search_AggregationAlgorithm)(0), // 0: payload.v1.Search.AggregationAlgorithm (Remove_Timestamp_Operator)(0), // 1: payload.v1.Remove.Timestamp.Operator @@ -4965,147 +5118,151 @@ var file_v1_payload_payload_proto_goTypes = []interface{}{ (*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_GetTimestampRequest)(nil), // 51: payload.v1.Object.GetTimestampRequest - (*Object_Timestamp)(nil), // 52: payload.v1.Object.Timestamp - (*Object_Vectors)(nil), // 53: payload.v1.Object.Vectors - (*Object_StreamVector)(nil), // 54: payload.v1.Object.StreamVector - (*Object_ReshapeVector)(nil), // 55: payload.v1.Object.ReshapeVector - (*Object_Blob)(nil), // 56: payload.v1.Object.Blob - (*Object_StreamBlob)(nil), // 57: payload.v1.Object.StreamBlob - (*Object_Location)(nil), // 58: payload.v1.Object.Location - (*Object_StreamLocation)(nil), // 59: payload.v1.Object.StreamLocation - (*Object_Locations)(nil), // 60: payload.v1.Object.Locations - (*Object_List)(nil), // 61: payload.v1.Object.List - (*Object_List_Request)(nil), // 62: payload.v1.Object.List.Request - (*Object_List_Response)(nil), // 63: payload.v1.Object.List.Response - (*Control_CreateIndexRequest)(nil), // 64: payload.v1.Control.CreateIndexRequest - (*Discoverer_Request)(nil), // 65: payload.v1.Discoverer.Request - (*Info_Index)(nil), // 66: payload.v1.Info.Index - (*Info_Pod)(nil), // 67: payload.v1.Info.Pod - (*Info_Node)(nil), // 68: payload.v1.Info.Node - (*Info_CPU)(nil), // 69: payload.v1.Info.CPU - (*Info_Memory)(nil), // 70: payload.v1.Info.Memory - (*Info_Pods)(nil), // 71: payload.v1.Info.Pods - (*Info_Nodes)(nil), // 72: payload.v1.Info.Nodes - (*Info_IPs)(nil), // 73: payload.v1.Info.IPs - (*Info_Index_Count)(nil), // 74: payload.v1.Info.Index.Count - (*Info_Index_UUID)(nil), // 75: payload.v1.Info.Index.UUID - (*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 + (*Mirror)(nil), // 12: payload.v1.Mirror + (*Empty)(nil), // 13: payload.v1.Empty + (*Search_Request)(nil), // 14: payload.v1.Search.Request + (*Search_MultiRequest)(nil), // 15: payload.v1.Search.MultiRequest + (*Search_IDRequest)(nil), // 16: payload.v1.Search.IDRequest + (*Search_MultiIDRequest)(nil), // 17: payload.v1.Search.MultiIDRequest + (*Search_ObjectRequest)(nil), // 18: payload.v1.Search.ObjectRequest + (*Search_MultiObjectRequest)(nil), // 19: payload.v1.Search.MultiObjectRequest + (*Search_Config)(nil), // 20: payload.v1.Search.Config + (*Search_Response)(nil), // 21: payload.v1.Search.Response + (*Search_Responses)(nil), // 22: payload.v1.Search.Responses + (*Search_StreamResponse)(nil), // 23: payload.v1.Search.StreamResponse + (*Filter_Target)(nil), // 24: payload.v1.Filter.Target + (*Filter_Config)(nil), // 25: payload.v1.Filter.Config + (*Insert_Request)(nil), // 26: payload.v1.Insert.Request + (*Insert_MultiRequest)(nil), // 27: payload.v1.Insert.MultiRequest + (*Insert_ObjectRequest)(nil), // 28: payload.v1.Insert.ObjectRequest + (*Insert_MultiObjectRequest)(nil), // 29: payload.v1.Insert.MultiObjectRequest + (*Insert_Config)(nil), // 30: payload.v1.Insert.Config + (*Update_Request)(nil), // 31: payload.v1.Update.Request + (*Update_MultiRequest)(nil), // 32: payload.v1.Update.MultiRequest + (*Update_ObjectRequest)(nil), // 33: payload.v1.Update.ObjectRequest + (*Update_MultiObjectRequest)(nil), // 34: payload.v1.Update.MultiObjectRequest + (*Update_Config)(nil), // 35: payload.v1.Update.Config + (*Upsert_Request)(nil), // 36: payload.v1.Upsert.Request + (*Upsert_MultiRequest)(nil), // 37: payload.v1.Upsert.MultiRequest + (*Upsert_ObjectRequest)(nil), // 38: payload.v1.Upsert.ObjectRequest + (*Upsert_MultiObjectRequest)(nil), // 39: payload.v1.Upsert.MultiObjectRequest + (*Upsert_Config)(nil), // 40: payload.v1.Upsert.Config + (*Remove_Request)(nil), // 41: payload.v1.Remove.Request + (*Remove_MultiRequest)(nil), // 42: payload.v1.Remove.MultiRequest + (*Remove_TimestampRequest)(nil), // 43: payload.v1.Remove.TimestampRequest + (*Remove_Timestamp)(nil), // 44: payload.v1.Remove.Timestamp + (*Remove_Config)(nil), // 45: payload.v1.Remove.Config + (*Object_VectorRequest)(nil), // 46: payload.v1.Object.VectorRequest + (*Object_Distance)(nil), // 47: payload.v1.Object.Distance + (*Object_StreamDistance)(nil), // 48: payload.v1.Object.StreamDistance + (*Object_ID)(nil), // 49: payload.v1.Object.ID + (*Object_IDs)(nil), // 50: payload.v1.Object.IDs + (*Object_Vector)(nil), // 51: payload.v1.Object.Vector + (*Object_GetTimestampRequest)(nil), // 52: payload.v1.Object.GetTimestampRequest + (*Object_Timestamp)(nil), // 53: payload.v1.Object.Timestamp + (*Object_Vectors)(nil), // 54: payload.v1.Object.Vectors + (*Object_StreamVector)(nil), // 55: payload.v1.Object.StreamVector + (*Object_ReshapeVector)(nil), // 56: payload.v1.Object.ReshapeVector + (*Object_Blob)(nil), // 57: payload.v1.Object.Blob + (*Object_StreamBlob)(nil), // 58: payload.v1.Object.StreamBlob + (*Object_Location)(nil), // 59: payload.v1.Object.Location + (*Object_StreamLocation)(nil), // 60: payload.v1.Object.StreamLocation + (*Object_Locations)(nil), // 61: payload.v1.Object.Locations + (*Object_List)(nil), // 62: payload.v1.Object.List + (*Object_List_Request)(nil), // 63: payload.v1.Object.List.Request + (*Object_List_Response)(nil), // 64: payload.v1.Object.List.Response + (*Control_CreateIndexRequest)(nil), // 65: payload.v1.Control.CreateIndexRequest + (*Discoverer_Request)(nil), // 66: payload.v1.Discoverer.Request + (*Info_Index)(nil), // 67: payload.v1.Info.Index + (*Info_Pod)(nil), // 68: payload.v1.Info.Pod + (*Info_Node)(nil), // 69: payload.v1.Info.Node + (*Info_CPU)(nil), // 70: payload.v1.Info.CPU + (*Info_Memory)(nil), // 71: payload.v1.Info.Memory + (*Info_Pods)(nil), // 72: payload.v1.Info.Pods + (*Info_Nodes)(nil), // 73: payload.v1.Info.Nodes + (*Info_IPs)(nil), // 74: payload.v1.Info.IPs + (*Info_Index_Count)(nil), // 75: payload.v1.Info.Index.Count + (*Info_Index_UUID)(nil), // 76: payload.v1.Info.Index.UUID + (*Info_Index_UUID_Committed)(nil), // 77: payload.v1.Info.Index.UUID.Committed + (*Info_Index_UUID_Uncommitted)(nil), // 78: payload.v1.Info.Index.UUID.Uncommitted + (*Mirror_Target)(nil), // 79: payload.v1.Mirror.Target + (*Mirror_Targets)(nil), // 80: payload.v1.Mirror.Targets + (*status.Status)(nil), // 81: google.rpc.Status } var file_v1_payload_payload_proto_depIdxs = []int32{ - 19, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config - 13, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request - 19, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config - 15, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest - 19, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config - 23, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target - 17, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest - 24, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config - 24, // 8: payload.v1.Search.Config.egress_filters:type_name -> payload.v1.Filter.Config + 20, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config + 14, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request + 20, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config + 16, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest + 20, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config + 24, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 18, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest + 25, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config + 25, // 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 - 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 - 56, // 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 - 56, // 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 - 56, // 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 + 47, // 10: payload.v1.Search.Response.results:type_name -> payload.v1.Object.Distance + 21, // 11: payload.v1.Search.Responses.responses:type_name -> payload.v1.Search.Response + 21, // 12: payload.v1.Search.StreamResponse.response:type_name -> payload.v1.Search.Response + 81, // 13: payload.v1.Search.StreamResponse.status:type_name -> google.rpc.Status + 24, // 14: payload.v1.Filter.Config.targets:type_name -> payload.v1.Filter.Target + 51, // 15: payload.v1.Insert.Request.vector:type_name -> payload.v1.Object.Vector + 30, // 16: payload.v1.Insert.Request.config:type_name -> payload.v1.Insert.Config + 26, // 17: payload.v1.Insert.MultiRequest.requests:type_name -> payload.v1.Insert.Request + 57, // 18: payload.v1.Insert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 30, // 19: payload.v1.Insert.ObjectRequest.config:type_name -> payload.v1.Insert.Config + 24, // 20: payload.v1.Insert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 28, // 21: payload.v1.Insert.MultiObjectRequest.requests:type_name -> payload.v1.Insert.ObjectRequest + 25, // 22: payload.v1.Insert.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 23: payload.v1.Update.Request.vector:type_name -> payload.v1.Object.Vector + 35, // 24: payload.v1.Update.Request.config:type_name -> payload.v1.Update.Config + 31, // 25: payload.v1.Update.MultiRequest.requests:type_name -> payload.v1.Update.Request + 57, // 26: payload.v1.Update.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 35, // 27: payload.v1.Update.ObjectRequest.config:type_name -> payload.v1.Update.Config + 24, // 28: payload.v1.Update.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 33, // 29: payload.v1.Update.MultiObjectRequest.requests:type_name -> payload.v1.Update.ObjectRequest + 25, // 30: payload.v1.Update.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 31: payload.v1.Upsert.Request.vector:type_name -> payload.v1.Object.Vector + 40, // 32: payload.v1.Upsert.Request.config:type_name -> payload.v1.Upsert.Config + 36, // 33: payload.v1.Upsert.MultiRequest.requests:type_name -> payload.v1.Upsert.Request + 57, // 34: payload.v1.Upsert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 40, // 35: payload.v1.Upsert.ObjectRequest.config:type_name -> payload.v1.Upsert.Config + 24, // 36: payload.v1.Upsert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 38, // 37: payload.v1.Upsert.MultiObjectRequest.requests:type_name -> payload.v1.Upsert.ObjectRequest + 25, // 38: payload.v1.Upsert.Config.filters:type_name -> payload.v1.Filter.Config + 49, // 39: payload.v1.Remove.Request.id:type_name -> payload.v1.Object.ID + 45, // 40: payload.v1.Remove.Request.config:type_name -> payload.v1.Remove.Config + 41, // 41: payload.v1.Remove.MultiRequest.requests:type_name -> payload.v1.Remove.Request + 44, // 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 - 48, // 48: payload.v1.Object.GetTimestampRequest.id:type_name -> payload.v1.Object.ID - 50, // 49: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector - 50, // 50: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector - 78, // 51: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status - 56, // 52: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob - 78, // 53: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status - 58, // 54: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location - 78, // 55: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status - 58, // 56: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location - 50, // 57: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector - 78, // 58: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status - 69, // 59: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU - 70, // 60: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory - 68, // 61: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node - 69, // 62: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU - 70, // 63: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory - 71, // 64: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods - 67, // 65: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod - 68, // 66: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node - 67, // [67:67] is the sub-list for method output_type - 67, // [67:67] is the sub-list for method input_type - 67, // [67:67] is the sub-list for extension type_name - 67, // [67:67] is the sub-list for extension extendee - 0, // [0:67] is the sub-list for field type_name + 49, // 44: payload.v1.Object.VectorRequest.id:type_name -> payload.v1.Object.ID + 25, // 45: payload.v1.Object.VectorRequest.filters:type_name -> payload.v1.Filter.Config + 47, // 46: payload.v1.Object.StreamDistance.distance:type_name -> payload.v1.Object.Distance + 81, // 47: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status + 49, // 48: payload.v1.Object.GetTimestampRequest.id:type_name -> payload.v1.Object.ID + 51, // 49: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector + 51, // 50: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector + 81, // 51: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status + 57, // 52: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob + 81, // 53: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status + 59, // 54: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location + 81, // 55: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status + 59, // 56: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location + 51, // 57: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector + 81, // 58: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status + 70, // 59: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU + 71, // 60: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory + 69, // 61: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node + 70, // 62: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU + 71, // 63: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory + 72, // 64: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods + 68, // 65: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod + 69, // 66: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node + 79, // 67: payload.v1.Mirror.Targets.targets:type_name -> payload.v1.Mirror.Target + 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 } func init() { file_v1_payload_payload_proto_init() } @@ -5235,7 +5392,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { + switch v := v.(*Mirror); i { case 0: return &v.state case 1: @@ -5247,7 +5404,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Request); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -5259,7 +5416,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiRequest); i { + switch v := v.(*Search_Request); i { case 0: return &v.state case 1: @@ -5271,7 +5428,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_IDRequest); i { + switch v := v.(*Search_MultiRequest); i { case 0: return &v.state case 1: @@ -5283,7 +5440,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiIDRequest); i { + switch v := v.(*Search_IDRequest); i { case 0: return &v.state case 1: @@ -5295,7 +5452,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_ObjectRequest); i { + switch v := v.(*Search_MultiIDRequest); i { case 0: return &v.state case 1: @@ -5307,7 +5464,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiObjectRequest); i { + switch v := v.(*Search_ObjectRequest); i { case 0: return &v.state case 1: @@ -5319,7 +5476,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Config); i { + switch v := v.(*Search_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5331,7 +5488,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Response); i { + switch v := v.(*Search_Config); i { case 0: return &v.state case 1: @@ -5343,7 +5500,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Responses); i { + switch v := v.(*Search_Response); i { case 0: return &v.state case 1: @@ -5355,7 +5512,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_StreamResponse); i { + switch v := v.(*Search_Responses); i { case 0: return &v.state case 1: @@ -5367,7 +5524,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Target); i { + switch v := v.(*Search_StreamResponse); i { case 0: return &v.state case 1: @@ -5379,7 +5536,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Config); i { + switch v := v.(*Filter_Target); i { case 0: return &v.state case 1: @@ -5391,7 +5548,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Request); i { + switch v := v.(*Filter_Config); i { case 0: return &v.state case 1: @@ -5403,7 +5560,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiRequest); i { + switch v := v.(*Insert_Request); i { case 0: return &v.state case 1: @@ -5415,7 +5572,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_ObjectRequest); i { + switch v := v.(*Insert_MultiRequest); i { case 0: return &v.state case 1: @@ -5427,7 +5584,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiObjectRequest); i { + switch v := v.(*Insert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5439,7 +5596,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Config); i { + switch v := v.(*Insert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5451,7 +5608,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Request); i { + switch v := v.(*Insert_Config); i { case 0: return &v.state case 1: @@ -5463,7 +5620,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiRequest); i { + switch v := v.(*Update_Request); i { case 0: return &v.state case 1: @@ -5475,7 +5632,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_ObjectRequest); i { + switch v := v.(*Update_MultiRequest); i { case 0: return &v.state case 1: @@ -5487,7 +5644,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiObjectRequest); i { + switch v := v.(*Update_ObjectRequest); i { case 0: return &v.state case 1: @@ -5499,7 +5656,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Config); i { + switch v := v.(*Update_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5511,7 +5668,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Request); i { + switch v := v.(*Update_Config); i { case 0: return &v.state case 1: @@ -5523,7 +5680,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiRequest); i { + switch v := v.(*Upsert_Request); i { case 0: return &v.state case 1: @@ -5535,7 +5692,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_ObjectRequest); i { + switch v := v.(*Upsert_MultiRequest); i { case 0: return &v.state case 1: @@ -5547,7 +5704,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiObjectRequest); i { + switch v := v.(*Upsert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5559,7 +5716,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Config); i { + switch v := v.(*Upsert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5571,7 +5728,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Request); i { + switch v := v.(*Upsert_Config); i { case 0: return &v.state case 1: @@ -5583,7 +5740,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_MultiRequest); i { + switch v := v.(*Remove_Request); i { case 0: return &v.state case 1: @@ -5595,7 +5752,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_TimestampRequest); i { + switch v := v.(*Remove_MultiRequest); i { case 0: return &v.state case 1: @@ -5607,7 +5764,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Timestamp); i { + switch v := v.(*Remove_TimestampRequest); i { case 0: return &v.state case 1: @@ -5619,7 +5776,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Config); i { + switch v := v.(*Remove_Timestamp); i { case 0: return &v.state case 1: @@ -5631,7 +5788,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_VectorRequest); i { + switch v := v.(*Remove_Config); i { case 0: return &v.state case 1: @@ -5643,7 +5800,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Distance); i { + switch v := v.(*Object_VectorRequest); i { case 0: return &v.state case 1: @@ -5655,7 +5812,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamDistance); i { + switch v := v.(*Object_Distance); i { case 0: return &v.state case 1: @@ -5667,7 +5824,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ID); i { + switch v := v.(*Object_StreamDistance); i { case 0: return &v.state case 1: @@ -5679,7 +5836,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_IDs); i { + switch v := v.(*Object_ID); i { case 0: return &v.state case 1: @@ -5691,7 +5848,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vector); i { + switch v := v.(*Object_IDs); i { case 0: return &v.state case 1: @@ -5703,7 +5860,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_GetTimestampRequest); i { + switch v := v.(*Object_Vector); i { case 0: return &v.state case 1: @@ -5715,7 +5872,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Timestamp); i { + switch v := v.(*Object_GetTimestampRequest); i { case 0: return &v.state case 1: @@ -5727,7 +5884,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vectors); i { + switch v := v.(*Object_Timestamp); i { case 0: return &v.state case 1: @@ -5739,7 +5896,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamVector); i { + switch v := v.(*Object_Vectors); i { case 0: return &v.state case 1: @@ -5751,7 +5908,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ReshapeVector); i { + switch v := v.(*Object_StreamVector); i { case 0: return &v.state case 1: @@ -5763,7 +5920,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Blob); i { + switch v := v.(*Object_ReshapeVector); i { case 0: return &v.state case 1: @@ -5775,7 +5932,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamBlob); i { + switch v := v.(*Object_Blob); i { case 0: return &v.state case 1: @@ -5787,7 +5944,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Location); i { + switch v := v.(*Object_StreamBlob); i { case 0: return &v.state case 1: @@ -5799,7 +5956,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamLocation); i { + switch v := v.(*Object_Location); i { case 0: return &v.state case 1: @@ -5811,7 +5968,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Locations); i { + switch v := v.(*Object_StreamLocation); i { case 0: return &v.state case 1: @@ -5823,7 +5980,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List); i { + switch v := v.(*Object_Locations); i { case 0: return &v.state case 1: @@ -5835,7 +5992,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Request); i { + switch v := v.(*Object_List); i { case 0: return &v.state case 1: @@ -5847,7 +6004,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Response); i { + switch v := v.(*Object_List_Request); i { case 0: return &v.state case 1: @@ -5859,7 +6016,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Control_CreateIndexRequest); i { + switch v := v.(*Object_List_Response); i { case 0: return &v.state case 1: @@ -5871,7 +6028,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Discoverer_Request); i { + switch v := v.(*Control_CreateIndexRequest); i { case 0: return &v.state case 1: @@ -5883,7 +6040,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index); i { + switch v := v.(*Discoverer_Request); i { case 0: return &v.state case 1: @@ -5895,7 +6052,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pod); i { + switch v := v.(*Info_Index); i { case 0: return &v.state case 1: @@ -5907,7 +6064,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Node); i { + switch v := v.(*Info_Pod); i { case 0: return &v.state case 1: @@ -5919,7 +6076,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_CPU); i { + switch v := v.(*Info_Node); i { case 0: return &v.state case 1: @@ -5931,7 +6088,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Memory); i { + switch v := v.(*Info_CPU); i { case 0: return &v.state case 1: @@ -5943,7 +6100,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pods); i { + switch v := v.(*Info_Memory); i { case 0: return &v.state case 1: @@ -5955,7 +6112,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Nodes); i { + switch v := v.(*Info_Pods); i { case 0: return &v.state case 1: @@ -5967,7 +6124,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_IPs); i { + switch v := v.(*Info_Nodes); i { case 0: return &v.state case 1: @@ -5979,7 +6136,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_Count); i { + switch v := v.(*Info_IPs); i { case 0: return &v.state case 1: @@ -5991,7 +6148,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID); i { + switch v := v.(*Info_Index_Count); i { case 0: return &v.state case 1: @@ -6003,7 +6160,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID_Committed); i { + switch v := v.(*Info_Index_UUID); i { case 0: return &v.state case 1: @@ -6015,6 +6172,18 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info_Index_UUID_Committed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_payload_payload_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Info_Index_UUID_Uncommitted); i { case 0: return &v.state @@ -6026,28 +6195,52 @@ func file_v1_payload_payload_proto_init() { return nil } } + file_v1_payload_payload_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Target); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_payload_payload_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Targets); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } - file_v1_payload_payload_proto_msgTypes[20].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[21].OneofWrappers = []interface{}{ (*Search_StreamResponse_Response)(nil), (*Search_StreamResponse_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[45].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[46].OneofWrappers = []interface{}{ (*Object_StreamDistance_Distance)(nil), (*Object_StreamDistance_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[52].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[53].OneofWrappers = []interface{}{ (*Object_StreamVector_Vector)(nil), (*Object_StreamVector_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[55].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[56].OneofWrappers = []interface{}{ (*Object_StreamBlob_Blob)(nil), (*Object_StreamBlob_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[57].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[58].OneofWrappers = []interface{}{ (*Object_StreamLocation_Location)(nil), (*Object_StreamLocation_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[61].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[62].OneofWrappers = []interface{}{ (*Object_List_Response_Vector)(nil), (*Object_List_Response_Status)(nil), } @@ -6057,7 +6250,7 @@ func file_v1_payload_payload_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_v1_payload_payload_proto_rawDesc, NumEnums: 2, - NumMessages: 76, + NumMessages: 79, NumExtensions: 0, NumServices: 0, }, diff --git a/apis/proto/v1/mirror/mirror.proto b/apis/proto/v1/mirror/mirror.proto index 3c1959440f..3d8aa63b82 100644 --- a/apis/proto/v1/mirror/mirror.proto +++ b/apis/proto/v1/mirror/mirror.proto @@ -17,8 +17,8 @@ syntax = "proto3"; package mirror.v1; -import "apis/proto/v1/payload/payload.proto"; -import "github.com/googleapis/googleapis/google/api/annotations.proto"; +import "google/api/annotations.proto"; +import "v1/payload/payload.proto"; option go_package = "github.com/vdaas/vald/apis/grpc/v1/mirror"; option java_multiple_files = true; diff --git a/apis/swagger/v1/mirror/mirror.swagger.json b/apis/swagger/v1/mirror/mirror.swagger.json new file mode 100644 index 0000000000..8c2fea2bb4 --- /dev/null +++ b/apis/swagger/v1/mirror/mirror.swagger.json @@ -0,0 +1,113 @@ +{ + "swagger": "2.0", + "info": { + "title": "v1/mirror/mirror.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "Mirror" + } + ], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/mirror/register": { + "post": { + "summary": "Register is the RPC to register other mirror servers.", + "operationId": "Mirror_Register", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/MirrorTargets" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "Represent the multiple Target message.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MirrorTargets" + } + } + ], + "tags": ["Mirror"] + } + } + }, + "definitions": { + "MirrorTargets": { + "type": "object", + "properties": { + "targets": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1MirrorTarget" + }, + "description": "The multiple target information." + } + }, + "description": "Represent the multiple Target message." + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + } + }, + "additionalProperties": {}, + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]." + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client." + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + }, + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." + } + }, + "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." + }, + "v1MirrorTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent server information." + } + } +} diff --git a/apis/swagger/v1/vald/filter.swagger.json b/apis/swagger/v1/vald/filter.swagger.json index d4993d784e..0e060ee5d3 100644 --- a/apis/swagger/v1/vald/filter.swagger.json +++ b/apis/swagger/v1/vald/filter.swagger.json @@ -270,21 +270,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectBlob": { "type": "object", "properties": { @@ -423,13 +408,28 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1InsertConfig": { "type": "object", "properties": { @@ -475,7 +475,7 @@ "description": "The configuration of the insert request." }, "vectorizer": { - "$ref": "#/definitions/FilterTarget", + "$ref": "#/definitions/v1FilterTarget", "description": "Filter configurations." } }, @@ -576,7 +576,7 @@ "description": "The configuration of the search request." }, "vectorizer": { - "$ref": "#/definitions/FilterTarget", + "$ref": "#/definitions/v1FilterTarget", "description": "Filter configuration." } }, @@ -649,7 +649,7 @@ "description": "The configuration of the update request." }, "vectorizer": { - "$ref": "#/definitions/FilterTarget", + "$ref": "#/definitions/v1FilterTarget", "description": "Filter target." } }, @@ -704,7 +704,7 @@ "description": "The configuration of the upsert request." }, "vectorizer": { - "$ref": "#/definitions/FilterTarget", + "$ref": "#/definitions/v1FilterTarget", "description": "Filter target." } }, diff --git a/apis/swagger/v1/vald/insert.swagger.json b/apis/swagger/v1/vald/insert.swagger.json index 8b47bbcdde..6b76719382 100644 --- a/apis/swagger/v1/vald/insert.swagger.json +++ b/apis/swagger/v1/vald/insert.swagger.json @@ -78,21 +78,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectLocations": { "type": "object", "properties": { @@ -184,13 +169,28 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1InsertConfig": { "type": "object", "properties": { diff --git a/apis/swagger/v1/vald/object.swagger.json b/apis/swagger/v1/vald/object.swagger.json index b0ca410f12..de87f3948e 100644 --- a/apis/swagger/v1/vald/object.swagger.json +++ b/apis/swagger/v1/vald/object.swagger.json @@ -102,21 +102,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectID": { "type": "object", "properties": { @@ -217,12 +202,27 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." + }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." } } } diff --git a/apis/swagger/v1/vald/search.swagger.json b/apis/swagger/v1/vald/search.swagger.json index 3a0dafd252..b131377f51 100644 --- a/apis/swagger/v1/vald/search.swagger.json +++ b/apis/swagger/v1/vald/search.swagger.json @@ -270,21 +270,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectDistance": { "type": "object", "properties": { @@ -409,13 +394,28 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1SearchConfig": { "type": "object", "properties": { diff --git a/apis/swagger/v1/vald/update.swagger.json b/apis/swagger/v1/vald/update.swagger.json index 1b256710d6..d295febc19 100644 --- a/apis/swagger/v1/vald/update.swagger.json +++ b/apis/swagger/v1/vald/update.swagger.json @@ -78,21 +78,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectLocations": { "type": "object", "properties": { @@ -184,13 +169,28 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1ObjectLocation": { "type": "object", "properties": { diff --git a/apis/swagger/v1/vald/upsert.swagger.json b/apis/swagger/v1/vald/upsert.swagger.json index d4f429b6f3..b36801bc74 100644 --- a/apis/swagger/v1/vald/upsert.swagger.json +++ b/apis/swagger/v1/vald/upsert.swagger.json @@ -78,21 +78,6 @@ } }, "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, "ObjectLocations": { "type": "object", "properties": { @@ -184,13 +169,28 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/FilterTarget" + "$ref": "#/definitions/v1FilterTarget" }, "description": "Represent the filter target configuration." } }, "description": "Represent filter configuration." }, + "v1FilterTarget": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "The target hostname." + }, + "port": { + "type": "integer", + "format": "int64", + "description": "The target port." + } + }, + "description": "Represent the target filter server." + }, "v1ObjectLocation": { "type": "object", "properties": { From b9ae28cd7130023e39b70f827163ed3a254e1f87 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 7 Dec 2023 18:13:21 +0900 Subject: [PATCH 74/93] fix: revert unnecessary changes Signed-off-by: hlts2 --- internal/circuitbreaker/manager.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/circuitbreaker/manager.go b/internal/circuitbreaker/manager.go index 4aa155580e..0b7c0c60e5 100644 --- a/internal/circuitbreaker/manager.go +++ b/internal/circuitbreaker/manager.go @@ -86,8 +86,7 @@ func (bm *breakerManager) Do(ctx context.Context, key string, fn func(ctx contex if err != nil { switch st { case StateClosed: - cerr := errors.Wrapf(err, "circuitbreaker state is %s, this error is not caused by circuitbreaker", st.String()) - log.Debug(cerr) + err = errors.Wrapf(err, "circuitbreaker state is %s, this error is not caused by circuitbreaker", st.String()) case StateOpen: if !errors.Is(err, errors.ErrCircuitBreakerOpenState) { err = errors.Join(err, errors.ErrCircuitBreakerOpenState) From e06ef8fc3108f8ec0f5d3735d8ca1a89cd796ac4 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 12 Dec 2023 18:46:44 +0900 Subject: [PATCH 75/93] fix: make proto/all format Signed-off-by: hlts2 --- apis/docs/v1/docs.md | 1 - apis/swagger/v1/agent/core/agent.swagger.json | 4 ++-- apis/swagger/v1/agent/sidecar/sidecar.swagger.json | 4 ++-- apis/swagger/v1/discoverer/discoverer.swagger.json | 4 ++-- apis/swagger/v1/filter/egress/egress_filter.swagger.json | 4 ++-- apis/swagger/v1/filter/ingress/ingress_filter.swagger.json | 4 ++-- apis/swagger/v1/manager/index/index_manager.swagger.json | 4 ++-- apis/swagger/v1/payload/payload.swagger.json | 4 ++-- apis/swagger/v1/rpc/errdetails/error_details.swagger.json | 4 ++-- apis/swagger/v1/vald/filter.swagger.json | 4 ++-- apis/swagger/v1/vald/insert.swagger.json | 4 ++-- apis/swagger/v1/vald/object.swagger.json | 4 ++-- apis/swagger/v1/vald/remove.swagger.json | 4 ++-- apis/swagger/v1/vald/search.swagger.json | 4 ++-- apis/swagger/v1/vald/update.swagger.json | 4 ++-- apis/swagger/v1/vald/upsert.swagger.json | 4 ++-- 16 files changed, 30 insertions(+), 31 deletions(-) diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index 99b6f6ba2c..89e9faeaff 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -85,7 +85,6 @@ - [Upsert.MultiRequest](#payload-v1-Upsert-MultiRequest) - [Upsert.ObjectRequest](#payload-v1-Upsert-ObjectRequest) - [Upsert.Request](#payload-v1-Upsert-Request) - - [Remove.Timestamp.Operator](#payload-v1-Remove-Timestamp-Operator) - [Search.AggregationAlgorithm](#payload-v1-Search-AggregationAlgorithm) diff --git a/apis/swagger/v1/agent/core/agent.swagger.json b/apis/swagger/v1/agent/core/agent.swagger.json index 82e99b0fdf..a3c2fda39b 100644 --- a/apis/swagger/v1/agent/core/agent.swagger.json +++ b/apis/swagger/v1/agent/core/agent.swagger.json @@ -185,11 +185,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/agent/sidecar/sidecar.swagger.json b/apis/swagger/v1/agent/sidecar/sidecar.swagger.json index a044f2a146..c3f84e0170 100644 --- a/apis/swagger/v1/agent/sidecar/sidecar.swagger.json +++ b/apis/swagger/v1/agent/sidecar/sidecar.swagger.json @@ -13,11 +13,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/discoverer/discoverer.swagger.json b/apis/swagger/v1/discoverer/discoverer.swagger.json index 2a7e3b1d43..a187737dea 100644 --- a/apis/swagger/v1/discoverer/discoverer.swagger.json +++ b/apis/swagger/v1/discoverer/discoverer.swagger.json @@ -217,11 +217,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/filter/egress/egress_filter.swagger.json b/apis/swagger/v1/filter/egress/egress_filter.swagger.json index b368572f94..395887d8e2 100644 --- a/apis/swagger/v1/filter/egress/egress_filter.swagger.json +++ b/apis/swagger/v1/filter/egress/egress_filter.swagger.json @@ -121,11 +121,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/filter/ingress/ingress_filter.swagger.json b/apis/swagger/v1/filter/ingress/ingress_filter.swagger.json index 38a6028dbd..ae3504a56b 100644 --- a/apis/swagger/v1/filter/ingress/ingress_filter.swagger.json +++ b/apis/swagger/v1/filter/ingress/ingress_filter.swagger.json @@ -121,11 +121,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/manager/index/index_manager.swagger.json b/apis/swagger/v1/manager/index/index_manager.swagger.json index 80dba65478..73a3c346cf 100644 --- a/apis/swagger/v1/manager/index/index_manager.swagger.json +++ b/apis/swagger/v1/manager/index/index_manager.swagger.json @@ -64,11 +64,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/payload/payload.swagger.json b/apis/swagger/v1/payload/payload.swagger.json index 66c9631809..345c401edd 100644 --- a/apis/swagger/v1/payload/payload.swagger.json +++ b/apis/swagger/v1/payload/payload.swagger.json @@ -13,11 +13,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/rpc/errdetails/error_details.swagger.json b/apis/swagger/v1/rpc/errdetails/error_details.swagger.json index 8e12730af2..50d969b871 100644 --- a/apis/swagger/v1/rpc/errdetails/error_details.swagger.json +++ b/apis/swagger/v1/rpc/errdetails/error_details.swagger.json @@ -13,11 +13,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/vald/filter.swagger.json b/apis/swagger/v1/vald/filter.swagger.json index b0c87e1a7f..0e060ee5d3 100644 --- a/apis/swagger/v1/vald/filter.swagger.json +++ b/apis/swagger/v1/vald/filter.swagger.json @@ -372,11 +372,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/vald/insert.swagger.json b/apis/swagger/v1/vald/insert.swagger.json index 05901204e0..6b76719382 100644 --- a/apis/swagger/v1/vald/insert.swagger.json +++ b/apis/swagger/v1/vald/insert.swagger.json @@ -133,11 +133,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/vald/object.swagger.json b/apis/swagger/v1/vald/object.swagger.json index b47ff789de..de87f3948e 100644 --- a/apis/swagger/v1/vald/object.swagger.json +++ b/apis/swagger/v1/vald/object.swagger.json @@ -166,11 +166,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/vald/remove.swagger.json b/apis/swagger/v1/vald/remove.swagger.json index ada5d12c65..b68f220b47 100644 --- a/apis/swagger/v1/vald/remove.swagger.json +++ b/apis/swagger/v1/vald/remove.swagger.json @@ -171,11 +171,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/vald/search.swagger.json b/apis/swagger/v1/vald/search.swagger.json index 3639c873cb..b131377f51 100644 --- a/apis/swagger/v1/vald/search.swagger.json +++ b/apis/swagger/v1/vald/search.swagger.json @@ -358,11 +358,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/vald/update.swagger.json b/apis/swagger/v1/vald/update.swagger.json index ab335c2980..d295febc19 100644 --- a/apis/swagger/v1/vald/update.swagger.json +++ b/apis/swagger/v1/vald/update.swagger.json @@ -133,11 +133,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/apis/swagger/v1/vald/upsert.swagger.json b/apis/swagger/v1/vald/upsert.swagger.json index 7d7758e1e9..b36801bc74 100644 --- a/apis/swagger/v1/vald/upsert.swagger.json +++ b/apis/swagger/v1/vald/upsert.swagger.json @@ -133,11 +133,11 @@ "properties": { "@type": { "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", From 628008bd26e82aa04ebd69b6d8de8ea9e18ad8c7 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 14 Dec 2023 12:31:40 +0900 Subject: [PATCH 76/93] fix: deepsource warning Signed-off-by: hlts2 --- .../k8s/vald/mirror/api/v1/target_types.go | 4 +- internal/k8s/vald/mirror/target/target.go | 6 +- pkg/gateway/mirror/config/config.go | 2 +- pkg/gateway/mirror/handler/grpc/handler.go | 16 +-- .../mirror/handler/grpc/handler_test.go | 34 ++++- pkg/gateway/mirror/handler/rest/handler.go | 10 +- pkg/gateway/mirror/router/router.go | 128 ++++++++++-------- pkg/gateway/mirror/service/discovery_test.go | 2 + pkg/gateway/mirror/service/gateway.go | 8 +- pkg/gateway/mirror/service/mirror.go | 4 +- pkg/gateway/mirror/service/mirror_option.go | 2 +- pkg/gateway/mirror/service/mirror_test.go | 4 + pkg/gateway/mirror/service/option.go | 2 +- pkg/gateway/mirror/usecase/vald.go | 2 +- 14 files changed, 136 insertions(+), 88 deletions(-) diff --git a/internal/k8s/vald/mirror/api/v1/target_types.go b/internal/k8s/vald/mirror/api/v1/target_types.go index cb3b16230d..0129d3560c 100644 --- a/internal/k8s/vald/mirror/api/v1/target_types.go +++ b/internal/k8s/vald/mirror/api/v1/target_types.go @@ -66,7 +66,7 @@ func (in *ValdMirrorTarget) DeepCopy() *ValdMirrorTarget { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ValdMirrorTarget) DeepCopyObject() runtime.Object { return in.DeepCopy() } @@ -138,7 +138,7 @@ const ( MirrorTargetUnknown = MirrorTargetPhase("Unknown") ) -// ValdMirrorList is the whole list of all ValdMirror which have been registered with master. +// ValdMirrorTargetList is the whole list of all ValdMirror which have been registered with master. type ValdMirrorTargetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/internal/k8s/vald/mirror/target/target.go b/internal/k8s/vald/mirror/target/target.go index e7ae94934a..a34e64a1fc 100644 --- a/internal/k8s/vald/mirror/target/target.go +++ b/internal/k8s/vald/mirror/target/target.go @@ -125,14 +125,14 @@ func (r *reconciler) NewReconciler(_ context.Context, mgr manager.Manager) recon return r } -func (r *reconciler) For() (client.Object, []builder.ForOption) { +func (_ *reconciler) For() (client.Object, []builder.ForOption) { return new(mirrv1.ValdMirrorTarget), nil } -func (r *reconciler) Owns() (client.Object, []builder.OwnsOption) { +func (_ *reconciler) Owns() (client.Object, []builder.OwnsOption) { return nil, nil } -func (r *reconciler) Watches() (client.Object, handler.EventHandler, []builder.WatchesOption) { +func (_ *reconciler) Watches() (client.Object, handler.EventHandler, []builder.WatchesOption) { return nil, nil, nil } diff --git a/pkg/gateway/mirror/config/config.go b/pkg/gateway/mirror/config/config.go index c4d9a970e4..07bd4238b2 100644 --- a/pkg/gateway/mirror/config/config.go +++ b/pkg/gateway/mirror/config/config.go @@ -26,7 +26,7 @@ type ( Server = config.Server ) -// Config represent a application setting data content (config.yaml). +// Data represent a application setting data content (config.yaml). // In K8s environment, this configuration is stored in K8s ConfigMap. type Data struct { config.GlobalConfig `json:",inline" yaml:",inline"` diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 73d9549bb0..09aea31294 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -981,7 +981,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * return s.handleInsert(ctx, req) } -func (s *server) handleInsert(ctx context.Context, req *payload.Insert_Request) (loc *payload.Object_Location, err error) { +func (s *server) handleInsert(ctx context.Context, req *payload.Insert_Request) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleInsert"), apiName+"/handleInsert") defer func() { if span != nil { @@ -1140,7 +1140,7 @@ func (s *server) handleInsert(ctx context.Context, req *payload.Insert_Request) return loc, nil } -func (s *server) handleInsertResult(ctx context.Context, alreadyExistsTgts []string, req *payload.Update_Request, result *sync.Map[string, *errorState]) (loc *payload.Object_Location, err error) { +func (s *server) handleInsertResult(ctx context.Context, alreadyExistsTgts []string, req *payload.Update_Request, result *sync.Map[string, *errorState]) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleInsertResult"), apiName+"/handleInsertResult") defer func() { if span != nil { @@ -1509,7 +1509,7 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * return s.handleUpdate(ctx, req) } -func (s *server) handleUpdate(ctx context.Context, req *payload.Update_Request) (loc *payload.Object_Location, err error) { +func (s *server) handleUpdate(ctx context.Context, req *payload.Update_Request) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpdate"), apiName+"/handleUpdate") defer func() { if span != nil { @@ -1683,7 +1683,7 @@ func (s *server) handleUpdate(ctx context.Context, req *payload.Update_Request) return loc, nil } -func (s *server) handleUpdateResult(ctx context.Context, notFoundTgts []string, req *payload.Insert_Request, result *sync.Map[string, *errorState]) (loc *payload.Object_Location, err error) { +func (s *server) handleUpdateResult(ctx context.Context, notFoundTgts []string, req *payload.Insert_Request, result *sync.Map[string, *errorState]) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpdateResult"), apiName+"/handleUpdateResult") defer func() { if span != nil { @@ -2068,7 +2068,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * return s.handleUpsert(ctx, req) } -func (s *server) handleUpsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) { +func (s *server) handleUpsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpsert"), apiName+"/handleUpsert") defer func() { if span != nil { @@ -2436,7 +2436,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * return s.handleRemove(ctx, req) } -func (s *server) handleRemove(ctx context.Context, req *payload.Remove_Request) (loc *payload.Object_Location, err error) { +func (s *server) handleRemove(ctx context.Context, req *payload.Remove_Request) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleRemove"), apiName+"/handleRemove") defer func() { if span != nil { @@ -2800,7 +2800,7 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time return s.handleRemoveByTimestamp(ctx, req) } -func (s *server) handleRemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, err error) { +func (s *server) handleRemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, err error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleRemoveByTimestamp"), apiName+"/handleRemoveByTimestamp") defer func() { if span != nil { @@ -3147,7 +3147,7 @@ func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald. return nil } -func (s *server) doStreamListObject(ctx context.Context, client vald.Object_StreamListObjectClient, server vald.Object_StreamListObjectServer) (err error) { +func (s *server) doStreamListObject(ctx context.Context, client vald.Object_StreamListObjectClient, server vald.Object_StreamListObjectServer) (err error) { // skipcq: GO-R1005 cctx, cancel := context.WithCancel(ctx) defer cancel() eg, egctx := errgroup.WithContext(cctx) diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index 64e69bb85f..74364ffa50 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -31,7 +31,8 @@ import ( "github.com/vdaas/vald/pkg/gateway/mirror/service" ) -func Test_server_Insert(t *testing.T) { +func Test_server_Insert(t *testing.T) { // skipcq: GO-R1005 + t.Parallel() const dimension = 128 defaultInsertConfig := &payload.Insert_Config{ SkipStrictExistCheck: true, @@ -570,7 +571,8 @@ func Test_server_Insert(t *testing.T) { } } -func Test_server_Update(t *testing.T) { +func Test_server_Update(t *testing.T) { // skipcq: GO-R1005 + t.Parallel() const dimension = 128 defaultUpdateConfig := &payload.Update_Config{ SkipStrictExistCheck: true, @@ -1263,6 +1265,7 @@ func Test_server_Update(t *testing.T) { } func Test_server_Upsert(t *testing.T) { + t.Parallel() const dimension = 128 defaultUpsertConfig := &payload.Upsert_Config{ SkipStrictExistCheck: true, @@ -1638,6 +1641,7 @@ func Test_server_Upsert(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() const dimension = 128 defaultRemoveConfig := &payload.Remove_Config{ SkipStrictExistCheck: true, @@ -2008,6 +2012,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_RemoveByTimestamp(t *testing.T) { + t.Parallel() defaultRemoveByTimestampReq := &payload.Remove_TimestampRequest{ Timestamps: []*payload.Remove_Timestamp{}, } @@ -2326,6 +2331,7 @@ func Test_server_RemoveByTimestamp(t *testing.T) { // NOT IMPLEMENTED BELOW func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -2415,6 +2421,7 @@ func TestNew(t *testing.T) { } func Test_server_Register(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Mirror_Targets @@ -2548,6 +2555,7 @@ func Test_server_Register(t *testing.T) { } func Test_server_Exists(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Object_ID @@ -2681,6 +2689,7 @@ func Test_server_Exists(t *testing.T) { } func Test_server_Search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_Request @@ -2814,6 +2823,7 @@ func Test_server_Search(t *testing.T) { } func Test_server_SearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_IDRequest @@ -2947,6 +2957,7 @@ func Test_server_SearchByID(t *testing.T) { } func Test_server_StreamSearch(t *testing.T) { + t.Parallel() type args struct { stream vald.Search_StreamSearchServer } @@ -3073,6 +3084,7 @@ func Test_server_StreamSearch(t *testing.T) { } func Test_server_StreamSearchByID(t *testing.T) { + t.Parallel() type args struct { stream vald.Search_StreamSearchByIDServer } @@ -3199,6 +3211,7 @@ func Test_server_StreamSearchByID(t *testing.T) { } func Test_server_MultiSearch(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_MultiRequest @@ -3332,6 +3345,7 @@ func Test_server_MultiSearch(t *testing.T) { } func Test_server_MultiSearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_MultiIDRequest @@ -3465,6 +3479,7 @@ func Test_server_MultiSearchByID(t *testing.T) { } func Test_server_LinearSearch(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_Request @@ -3598,6 +3613,7 @@ func Test_server_LinearSearch(t *testing.T) { } func Test_server_LinearSearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_IDRequest @@ -3731,6 +3747,7 @@ func Test_server_LinearSearchByID(t *testing.T) { } func Test_server_StreamLinearSearch(t *testing.T) { + t.Parallel() type args struct { stream vald.Search_StreamLinearSearchServer } @@ -3857,6 +3874,7 @@ func Test_server_StreamLinearSearch(t *testing.T) { } func Test_server_StreamLinearSearchByID(t *testing.T) { + t.Parallel() type args struct { stream vald.Search_StreamLinearSearchByIDServer } @@ -3983,6 +4001,7 @@ func Test_server_StreamLinearSearchByID(t *testing.T) { } func Test_server_MultiLinearSearch(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_MultiRequest @@ -4116,6 +4135,7 @@ func Test_server_MultiLinearSearch(t *testing.T) { } func Test_server_MultiLinearSearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_MultiIDRequest @@ -4249,6 +4269,7 @@ func Test_server_MultiLinearSearchByID(t *testing.T) { } func Test_server_StreamInsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Insert_StreamInsertServer } @@ -4375,6 +4396,7 @@ func Test_server_StreamInsert(t *testing.T) { } func Test_server_MultiInsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context reqs *payload.Insert_MultiRequest @@ -4508,6 +4530,7 @@ func Test_server_MultiInsert(t *testing.T) { } func Test_server_StreamUpdate(t *testing.T) { + t.Parallel() type args struct { stream vald.Update_StreamUpdateServer } @@ -4634,6 +4657,7 @@ func Test_server_StreamUpdate(t *testing.T) { } func Test_server_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { ctx context.Context reqs *payload.Update_MultiRequest @@ -4767,6 +4791,7 @@ func Test_server_MultiUpdate(t *testing.T) { } func Test_server_StreamUpsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Upsert_StreamUpsertServer } @@ -4893,6 +4918,7 @@ func Test_server_StreamUpsert(t *testing.T) { } func Test_server_MultiUpsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context reqs *payload.Upsert_MultiRequest @@ -5026,6 +5052,7 @@ func Test_server_MultiUpsert(t *testing.T) { } func Test_server_StreamRemove(t *testing.T) { + t.Parallel() type args struct { stream vald.Remove_StreamRemoveServer } @@ -5152,6 +5179,7 @@ func Test_server_StreamRemove(t *testing.T) { } func Test_server_MultiRemove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context reqs *payload.Remove_MultiRequest @@ -5285,6 +5313,7 @@ func Test_server_MultiRemove(t *testing.T) { } func Test_server_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Object_VectorRequest @@ -5418,6 +5447,7 @@ func Test_server_GetObject(t *testing.T) { } func Test_server_StreamGetObject(t *testing.T) { + t.Parallel() type args struct { stream vald.Object_StreamGetObjectServer } diff --git a/pkg/gateway/mirror/handler/rest/handler.go b/pkg/gateway/mirror/handler/rest/handler.go index 5be7f785eb..c25645b0aa 100644 --- a/pkg/gateway/mirror/handler/rest/handler.go +++ b/pkg/gateway/mirror/handler/rest/handler.go @@ -41,6 +41,7 @@ type Handler interface { Upsert(w http.ResponseWriter, r *http.Request) (int, error) MultiUpsert(w http.ResponseWriter, r *http.Request) (int, error) Remove(w http.ResponseWriter, r *http.Request) (int, error) + RemoveByTimestamp(w http.ResponseWriter, r *http.Request) (int, error) MultiRemove(w http.ResponseWriter, r *http.Request) (int, error) GetObject(w http.ResponseWriter, r *http.Request) (int, error) } @@ -65,7 +66,7 @@ func (h *handler) Register(w http.ResponseWriter, r *http.Request) (code int, er }) } -func (h *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { +func (_ *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { return dump.Request(nil, data, r) @@ -177,6 +178,13 @@ func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err }) } +func (h *handler) RemoveByTimestamp(w http.ResponseWriter, r *http.Request) (int, error) { + var req *payload.Remove_TimestampRequest + return json.Handler(w, r, &req, func() (interface{}, error) { + return h.vald.RemoveByTimestamp(r.Context(), req) + }) +} + func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Remove_MultiRequest return json.Handler(w, r, &req, func() (interface{}, error) { diff --git a/pkg/gateway/mirror/router/router.go b/pkg/gateway/mirror/router/router.go index 811cf6e4f4..d84864b7b8 100644 --- a/pkg/gateway/mirror/router/router.go +++ b/pkg/gateway/mirror/router/router.go @@ -38,134 +38,142 @@ func New(opts ...Option) http.Handler { return routing.New( routing.WithRoutes([]routing.Route{ { - "Index", - []string{ + Name: "Index", + Methods: []string{ http.MethodGet, }, - "/", - h.Index, + Pattern: "/", + HandlerFunc: h.Index, }, { - "Register", - []string{ + Name: "Register", + Methods: []string{ http.MethodPost, }, - "/register", - h.Register, + Pattern: "/register", + HandlerFunc: h.Register, }, { - "Search", - []string{ + Name: "Search", + Methods: []string{ http.MethodPost, }, - "/search", - h.Search, + Pattern: "/search", + HandlerFunc: h.Search, }, { - "Search By ID", - []string{ + Name: "Search By ID", + Methods: []string{ http.MethodGet, }, - "/search/{id}", - h.SearchByID, + Pattern: "/search/{id}", + HandlerFunc: h.SearchByID, }, { - "Multi Search", - []string{ + Name: "Multi Search", + Methods: []string{ http.MethodPost, }, - "/search/multi", - h.MultiSearch, + Pattern: "/search/multi", + HandlerFunc: h.MultiSearch, }, { - "Multi Search By ID", - []string{ + Name: "Multi Search By ID", + Methods: []string{ http.MethodGet, }, - "/search/multi/{id}", - h.MultiSearchByID, + Pattern: "/search/multi/{id}", + HandlerFunc: h.MultiSearchByID, }, { - "Insert", - []string{ + Name: "Insert", + Methods: []string{ http.MethodPost, }, - "/insert", - h.Insert, + Pattern: "/insert", + HandlerFunc: h.Insert, }, { - "Multiple Insert", - []string{ + Name: "Multiple Insert", + Methods: []string{ http.MethodPost, }, - "/insert/multi", - h.MultiInsert, + Pattern: "/insert/multi", + HandlerFunc: h.MultiInsert, }, { - "Update", - []string{ + Name: "Update", + Methods: []string{ http.MethodPost, http.MethodPatch, http.MethodPut, }, - "/update", - h.Update, + Pattern: "/update", + HandlerFunc: h.Update, }, { - "Multiple Update", - []string{ + Name: "Multiple Update", + Methods: []string{ http.MethodPost, http.MethodPatch, http.MethodPut, }, - "/update/multi", - h.MultiUpdate, + Pattern: "/update/multi", + HandlerFunc: h.MultiUpdate, }, { - "Upsert", - []string{ + Name: "Upsert", + Methods: []string{ http.MethodPost, http.MethodPatch, http.MethodPut, }, - "/upsert", - h.Upsert, + Pattern: "/upsert", + HandlerFunc: h.Upsert, }, { - "Multiple Upsert", - []string{ + Name: "Multiple Upsert", + Methods: []string{ http.MethodPost, http.MethodPatch, http.MethodPut, }, - "/upsert/multi", - h.MultiUpsert, + Pattern: "/upsert/multi", + HandlerFunc: h.MultiUpsert, }, { - "Remove", - []string{ + Name: "Remove", + Methods: []string{ http.MethodDelete, }, - "/delete/{id}", - h.Remove, + Pattern: "/delete/{id}", + HandlerFunc: h.Remove, }, { - "Multiple Remove", - []string{ + Name: "RemoveByTimestamp", + Methods: []string{ + http.MethodDelete, + }, + Pattern: "/delete/timestamp", + HandlerFunc: h.RemoveByTimestamp, + }, + { + Name: "Multiple Remove", + Methods: []string{ http.MethodDelete, http.MethodPost, }, - "/delete/multi", - h.MultiRemove, + Pattern: "/delete/multi", + HandlerFunc: h.MultiRemove, }, { - "GetObject", - []string{ + Name: "GetObject", + Methods: []string{ http.MethodGet, }, - "/object/{id}", - h.GetObject, + Pattern: "/object/{id}", + HandlerFunc: h.GetObject, }, }...)) } diff --git a/pkg/gateway/mirror/service/discovery_test.go b/pkg/gateway/mirror/service/discovery_test.go index 5ecffe5843..ca9e930efc 100644 --- a/pkg/gateway/mirror/service/discovery_test.go +++ b/pkg/gateway/mirror/service/discovery_test.go @@ -27,6 +27,7 @@ import ( ) func Test_discovery_startSync(t *testing.T) { + t.Parallel() type args struct { ctx context.Context prev map[string]target.Target @@ -313,6 +314,7 @@ func Test_discovery_startSync(t *testing.T) { } func Test_discovery_syncWithAddr(t *testing.T) { + t.Parallel() type args struct { ctx context.Context current map[string]target.Target diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index 714869d413..c707d96ac5 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -29,10 +29,6 @@ import ( const ( // forwardedContextKey is the key used to store forwarding-related information in a context. forwardedContextKey = "forwarded-for" - - // forwardedContextValue is the value associated with the forwardedContextKey - // to indicate that the context is related to forwarding through the mirror gateway. - forwardedContextValue = "gateway mirror" ) // Gateway represents an interface for interacting with gRPC clients. @@ -80,7 +76,7 @@ func (g *gateway) GRPCClient() grpc.Client { // ForwardedContext takes a context and a podName, returning a new context // with additional information related to forwarding. -func (g *gateway) ForwardedContext(ctx context.Context, podName string) context.Context { +func (_ *gateway) ForwardedContext(ctx context.Context, podName string) context.Context { return grpc.NewOutgoingContext(ctx, grpc.MD{ forwardedContextKey: []string{ podName, @@ -90,7 +86,7 @@ func (g *gateway) ForwardedContext(ctx context.Context, podName string) context. // FromForwardedContext extracts information from the forwarded context // and returns the podName associated with it. -func (g *gateway) FromForwardedContext(ctx context.Context) string { +func (_ *gateway) FromForwardedContext(ctx context.Context) string { md, ok := grpc.FromIncomingContext(ctx) if !ok { return "" diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index 61c3a5e127..cd35e13ee3 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -92,7 +92,7 @@ func NewMirror(opts ...MirrorOption) (_ Mirror, err error) { // Start starts the mirroring service. // It returns a channel for receiving errors during the mirroring process. -func (m *mirr) Start(ctx context.Context) <-chan error { +func (m *mirr) Start(ctx context.Context) <-chan error { // skipcq: GO-R1005 ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.Start") defer func() { if span != nil { @@ -150,7 +150,7 @@ func (m *mirr) Start(ctx context.Context) <-chan error { return ech } -func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]*payload.Mirror_Target, error) { +func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]*payload.Mirror_Target, error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.MirrorRPCServiceName+"/"+vald.RegisterRPCName), "vald/gateway/mirror/service/Mirror.registers") defer func() { if span != nil { diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go index f39d5a65c1..5342773f03 100644 --- a/pkg/gateway/mirror/service/mirror_option.go +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -63,7 +63,7 @@ func WithSelfMirrorAddrs(addrs ...string) MirrorOption { } } -// WithGatewayAddrs returns the option to set the Gateway service. +// WithGateway returns the option to set the Gateway service. func WithGateway(g Gateway) MirrorOption { return func(m *mirr) error { if g != nil { diff --git a/pkg/gateway/mirror/service/mirror_test.go b/pkg/gateway/mirror/service/mirror_test.go index 581fb4f7ff..2ac692ef1f 100644 --- a/pkg/gateway/mirror/service/mirror_test.go +++ b/pkg/gateway/mirror/service/mirror_test.go @@ -28,6 +28,7 @@ import ( ) func Test_mirr_Connect(t *testing.T) { + t.Parallel() type args struct { ctx context.Context targets []*payload.Mirror_Target @@ -161,6 +162,7 @@ func Test_mirr_Connect(t *testing.T) { } func Test_mirr_Disconnect(t *testing.T) { + t.Parallel() type args struct { ctx context.Context targets []*payload.Mirror_Target @@ -294,6 +296,7 @@ func Test_mirr_Disconnect(t *testing.T) { } func Test_mirr_MirrorTargets(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -435,6 +438,7 @@ func Test_mirr_MirrorTargets(t *testing.T) { } func Test_mirr_connectedOtherMirrorAddrs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } diff --git a/pkg/gateway/mirror/service/option.go b/pkg/gateway/mirror/service/option.go index 59067d2b43..1c80092be5 100644 --- a/pkg/gateway/mirror/service/option.go +++ b/pkg/gateway/mirror/service/option.go @@ -46,7 +46,7 @@ func WithErrGroup(eg errgroup.Group) Option { } } -// WithErrGroup returns the option to set the pod name. +// WithPodName returns the option to set the pod name. func WithPodName(s string) Option { return func(g *gateway) error { if s == "" { diff --git a/pkg/gateway/mirror/usecase/vald.go b/pkg/gateway/mirror/usecase/vald.go index cb2caad851..808224a38e 100644 --- a/pkg/gateway/mirror/usecase/vald.go +++ b/pkg/gateway/mirror/usecase/vald.go @@ -191,7 +191,7 @@ func (r *run) PreStart(ctx context.Context) error { // Start is a method used to initiate an operation in the run, and it returns a channel for receiving errors // during the operation and an error representing any initialization errors. -func (r *run) Start(ctx context.Context) (_ <-chan error, err error) { +func (r *run) Start(ctx context.Context) (_ <-chan error, err error) { // skipcq: GO-R1005 ech := make(chan error, 6) var mech, dech, cech, sech, oech <-chan error From 8a6ac6e73625805c5672fe4fe0b7a1d25335a22c Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 14 Dec 2023 12:38:29 +0900 Subject: [PATCH 77/93] fix: deleted unnecessary code Signed-off-by: hlts2 --- internal/k8s/reconciler.go | 14 +------------- pkg/gateway/mirror/service/discovery.go | 3 ++- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/internal/k8s/reconciler.go b/internal/k8s/reconciler.go index ddcfc193cd..cdbed01edd 100644 --- a/internal/k8s/reconciler.go +++ b/internal/k8s/reconciler.go @@ -35,19 +35,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" ) -type ( - Manager = manager.Manager - OwnerReference = v1.OwnerReference -) - -type ( - Object = client.Object - ObjectKey = client.ObjectKey - DeleteAllOfOptions = client.DeleteAllOfOptions - ListOptions = client.ListOptions - MatchingLabels = client.MatchingLabels - InNamespace = client.InNamespace -) +type Manager = manager.Manager type Controller interface { Start(ctx context.Context) (<-chan error, error) diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 74088e0ee7..86d99c6262 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -23,6 +23,7 @@ import ( "github.com/vdaas/vald/apis/grpc/v1/payload" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/k8s" + k8sclient "github.com/vdaas/vald/internal/k8s/client" "github.com/vdaas/vald/internal/k8s/vald/mirror/target" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net" @@ -313,7 +314,7 @@ func (d *discovery) disconnectTarget(ctx context.Context, req map[string]*delete func (d *discovery) updateMirrorTargetPhase(ctx context.Context, name string, phase target.MirrorTargetPhase) error { c := d.ctrl.GetManager().GetClient() mt := &target.MirrorTarget{} - err := c.Get(ctx, k8s.ObjectKey{ + err := c.Get(ctx, k8sclient.ObjectKey{ Namespace: d.namespace, Name: name, }, mt) From 385cee585f0c6ad1f63f563d07d4b3df0a302886 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 14 Dec 2023 12:46:15 +0900 Subject: [PATCH 78/93] fix: deepsource warning Signed-off-by: hlts2 --- internal/k8s/vald/mirror/target/target.go | 6 +- .../mirror/handler/grpc/handler_test.go | 6484 ++++++++--------- pkg/gateway/mirror/handler/rest/handler.go | 2 +- pkg/gateway/mirror/service/gateway.go | 2 +- 4 files changed, 3247 insertions(+), 3247 deletions(-) diff --git a/internal/k8s/vald/mirror/target/target.go b/internal/k8s/vald/mirror/target/target.go index a34e64a1fc..58846900e6 100644 --- a/internal/k8s/vald/mirror/target/target.go +++ b/internal/k8s/vald/mirror/target/target.go @@ -125,14 +125,14 @@ func (r *reconciler) NewReconciler(_ context.Context, mgr manager.Manager) recon return r } -func (_ *reconciler) For() (client.Object, []builder.ForOption) { +func (*reconciler) For() (client.Object, []builder.ForOption) { return new(mirrv1.ValdMirrorTarget), nil } -func (_ *reconciler) Owns() (client.Object, []builder.OwnsOption) { +func (*reconciler) Owns() (client.Object, []builder.OwnsOption) { return nil, nil } -func (_ *reconciler) Watches() (client.Object, handler.EventHandler, []builder.WatchesOption) { +func (*reconciler) Watches() (client.Object, handler.EventHandler, []builder.WatchesOption) { return nil, nil, nil } diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index 74364ffa50..1066c72ba7 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -2330,3245 +2330,3245 @@ func Test_server_RemoveByTimestamp(t *testing.T) { // NOT IMPLEMENTED BELOW -func TestNew(t *testing.T) { - t.Parallel() - type args struct { - opts []Option - } - type want struct { - want vald.ServerWithMirror - err error - } - type test struct { - name string - args args - want want - checkFunc func(want, vald.Server, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, got vald.Server, 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(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - opts: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 { - opts: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 - } - - got, err := New(test.args.opts...) - if err := checkFunc(test.want, got, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_Register(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Mirror_Targets - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - want *payload.Mirror_Targets - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Mirror_Targets, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, got *payload.Mirror_Targets, 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(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - ctx:nil, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - got, err := s.Register(test.args.ctx, test.args.req) - if err := checkFunc(test.want, got, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_Exists(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - meta *payload.Object_ID - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantId *payload.Object_ID - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Object_ID, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotID *payload.Object_ID, 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(gotID, w.wantId) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotID, w.wantId) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - ctx:nil, - meta:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - meta:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotID, err := s.Exists(test.args.ctx, test.args.meta) - if err := checkFunc(test.want, gotID, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_Search(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Search_Request - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Search_Response - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Search_Response, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.Search(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_SearchByID(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Search_IDRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Search_Response - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Search_Response, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.SearchByID(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_StreamSearch(t *testing.T) { - t.Parallel() - type args struct { - stream vald.Search_StreamSearchServer - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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 { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - err := s.StreamSearch(test.args.stream) - if err := checkFunc(test.want, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_StreamSearchByID(t *testing.T) { - t.Parallel() - type args struct { - stream vald.Search_StreamSearchByIDServer - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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 { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - err := s.StreamSearchByID(test.args.stream) - if err := checkFunc(test.want, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_MultiSearch(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Search_MultiRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Search_Responses - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Search_Responses, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.MultiSearch(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_MultiSearchByID(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Search_MultiIDRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Search_Responses - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Search_Responses, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.MultiSearchByID(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_LinearSearch(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Search_Request - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Search_Response - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Search_Response, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.LinearSearch(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_LinearSearchByID(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Search_IDRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Search_Response - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Search_Response, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.LinearSearchByID(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_StreamLinearSearch(t *testing.T) { - t.Parallel() - type args struct { - stream vald.Search_StreamLinearSearchServer - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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 { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - err := s.StreamLinearSearch(test.args.stream) - if err := checkFunc(test.want, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_StreamLinearSearchByID(t *testing.T) { - t.Parallel() - type args struct { - stream vald.Search_StreamLinearSearchByIDServer - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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 { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - err := s.StreamLinearSearchByID(test.args.stream) - if err := checkFunc(test.want, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_MultiLinearSearch(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Search_MultiRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Search_Responses - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Search_Responses, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.MultiLinearSearch(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_MultiLinearSearchByID(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Search_MultiIDRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Search_Responses - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Search_Responses, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.MultiLinearSearchByID(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_StreamInsert(t *testing.T) { - t.Parallel() - type args struct { - stream vald.Insert_StreamInsertServer - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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 { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - err := s.StreamInsert(test.args.stream) - if err := checkFunc(test.want, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_MultiInsert(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - reqs *payload.Insert_MultiRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Object_Locations - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Object_Locations, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, - reqs:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - reqs:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.MultiInsert(test.args.ctx, test.args.reqs) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_StreamUpdate(t *testing.T) { - t.Parallel() - type args struct { - stream vald.Update_StreamUpdateServer - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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 { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - err := s.StreamUpdate(test.args.stream) - if err := checkFunc(test.want, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_MultiUpdate(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - reqs *payload.Update_MultiRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Object_Locations - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Object_Locations, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, - reqs:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - reqs:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.MultiUpdate(test.args.ctx, test.args.reqs) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_StreamUpsert(t *testing.T) { - t.Parallel() - type args struct { - stream vald.Upsert_StreamUpsertServer - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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 { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - err := s.StreamUpsert(test.args.stream) - if err := checkFunc(test.want, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_MultiUpsert(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - reqs *payload.Upsert_MultiRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Object_Locations - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Object_Locations, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, - reqs:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - reqs:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.MultiUpsert(test.args.ctx, test.args.reqs) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_StreamRemove(t *testing.T) { - t.Parallel() - type args struct { - stream vald.Remove_StreamRemoveServer - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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 { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - err := s.StreamRemove(test.args.stream) - if err := checkFunc(test.want, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_MultiRemove(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - reqs *payload.Remove_MultiRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantRes *payload.Object_Locations - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Object_Locations, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, - reqs:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - reqs:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotRes, err := s.MultiRemove(test.args.ctx, test.args.reqs) - if err := checkFunc(test.want, gotRes, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_GetObject(t *testing.T) { - t.Parallel() - type args struct { - ctx context.Context - req *payload.Object_VectorRequest - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - wantVec *payload.Object_Vector - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, *payload.Object_Vector, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, gotVec *payload.Object_Vector, 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(gotVec, w.wantVec) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotVec, w.wantVec) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - ctx:nil, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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, - req:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - gotVec, err := s.GetObject(test.args.ctx, test.args.req) - if err := checkFunc(test.want, gotVec, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func Test_server_StreamGetObject(t *testing.T) { - t.Parallel() - type args struct { - stream vald.Object_StreamGetObjectServer - } - type fields struct { - eg errgroup.Group - gateway service.Gateway - mirror service.Mirror - vAddr string - streamConcurrency int - name string - ip string - UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror - } - type want struct { - err error - } - type test struct { - name string - args args - fields fields - want want - checkFunc func(want, error) error - beforeFunc func(*testing.T, args) - afterFunc func(*testing.T, args) - } - defaultCheckFunc := func(w want, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) - } - return nil - } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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 { - stream:nil, - }, - fields: fields { - eg:nil, - gateway:nil, - mirror:nil, - vAddr:"", - streamConcurrency:0, - name:"", - ip:"", - UnimplementedValdServerWithMirror: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{ - eg: test.fields.eg, - gateway: test.fields.gateway, - mirror: test.fields.mirror, - vAddr: test.fields.vAddr, - streamConcurrency: test.fields.streamConcurrency, - name: test.fields.name, - ip: test.fields.ip, - UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, - } - - err := s.StreamGetObject(test.args.stream) - if err := checkFunc(test.want, err); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} +// func TestNew(t *testing.T) { +// t.Parallel() +// type args struct { +// opts []Option +// } +// type want struct { +// want vald.ServerWithMirror +// err error +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want, vald.Server, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got vald.Server, 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(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// opts: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 { +// opts: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 +// } +// +// got, err := New(test.args.opts...) +// if err := checkFunc(test.want, got, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_Register(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Mirror_Targets +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// want *payload.Mirror_Targets +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Mirror_Targets, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got *payload.Mirror_Targets, 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(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// got, err := s.Register(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, got, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_Exists(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// meta *payload.Object_ID +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantId *payload.Object_ID +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Object_ID, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotID *payload.Object_ID, 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(gotID, w.wantId) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotID, w.wantId) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// meta:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// meta:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotID, err := s.Exists(test.args.ctx, test.args.meta) +// if err := checkFunc(test.want, gotID, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_Search(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Search_Request +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Search_Response +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Search_Response, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.Search(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_SearchByID(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Search_IDRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Search_Response +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Search_Response, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.SearchByID(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_StreamSearch(t *testing.T) { +// t.Parallel() +// type args struct { +// stream vald.Search_StreamSearchServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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 { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// err := s.StreamSearch(test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_StreamSearchByID(t *testing.T) { +// t.Parallel() +// type args struct { +// stream vald.Search_StreamSearchByIDServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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 { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// err := s.StreamSearchByID(test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_MultiSearch(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Search_MultiRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Search_Responses +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Search_Responses, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.MultiSearch(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_MultiSearchByID(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Search_MultiIDRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Search_Responses +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Search_Responses, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.MultiSearchByID(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_LinearSearch(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Search_Request +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Search_Response +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Search_Response, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.LinearSearch(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_LinearSearchByID(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Search_IDRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Search_Response +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Search_Response, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Search_Response, 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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.LinearSearchByID(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_StreamLinearSearch(t *testing.T) { +// t.Parallel() +// type args struct { +// stream vald.Search_StreamLinearSearchServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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 { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// err := s.StreamLinearSearch(test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_StreamLinearSearchByID(t *testing.T) { +// t.Parallel() +// type args struct { +// stream vald.Search_StreamLinearSearchByIDServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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 { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// err := s.StreamLinearSearchByID(test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_MultiLinearSearch(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Search_MultiRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Search_Responses +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Search_Responses, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.MultiLinearSearch(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_MultiLinearSearchByID(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Search_MultiIDRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Search_Responses +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Search_Responses, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Search_Responses, 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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.MultiLinearSearchByID(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_StreamInsert(t *testing.T) { +// t.Parallel() +// type args struct { +// stream vald.Insert_StreamInsertServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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 { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// err := s.StreamInsert(test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_MultiInsert(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// reqs *payload.Insert_MultiRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Object_Locations +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Object_Locations, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, +// reqs:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// reqs:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.MultiInsert(test.args.ctx, test.args.reqs) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_StreamUpdate(t *testing.T) { +// t.Parallel() +// type args struct { +// stream vald.Update_StreamUpdateServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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 { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// err := s.StreamUpdate(test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_MultiUpdate(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// reqs *payload.Update_MultiRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Object_Locations +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Object_Locations, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, +// reqs:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// reqs:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.MultiUpdate(test.args.ctx, test.args.reqs) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_StreamUpsert(t *testing.T) { +// t.Parallel() +// type args struct { +// stream vald.Upsert_StreamUpsertServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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 { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// err := s.StreamUpsert(test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_MultiUpsert(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// reqs *payload.Upsert_MultiRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Object_Locations +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Object_Locations, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, +// reqs:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// reqs:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.MultiUpsert(test.args.ctx, test.args.reqs) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_StreamRemove(t *testing.T) { +// t.Parallel() +// type args struct { +// stream vald.Remove_StreamRemoveServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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 { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// err := s.StreamRemove(test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_MultiRemove(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// reqs *payload.Remove_MultiRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantRes *payload.Object_Locations +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Object_Locations, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, 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, +// reqs:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// reqs:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotRes, err := s.MultiRemove(test.args.ctx, test.args.reqs) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_GetObject(t *testing.T) { +// t.Parallel() +// type args struct { +// ctx context.Context +// req *payload.Object_VectorRequest +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// wantVec *payload.Object_Vector +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *payload.Object_Vector, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotVec *payload.Object_Vector, 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(gotVec, w.wantVec) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotVec, w.wantVec) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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, +// req:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// gotVec, err := s.GetObject(test.args.ctx, test.args.req) +// if err := checkFunc(test.want, gotVec, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_server_StreamGetObject(t *testing.T) { +// t.Parallel() +// type args struct { +// stream vald.Object_StreamGetObjectServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// mirror service.Mirror +// vAddr string +// streamConcurrency int +// name string +// ip string +// UnimplementedValdServerWithMirror vald.UnimplementedValdServerWithMirror +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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 { +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// mirror:nil, +// vAddr:"", +// streamConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServerWithMirror: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{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// mirror: test.fields.mirror, +// vAddr: test.fields.vAddr, +// streamConcurrency: test.fields.streamConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServerWithMirror: test.fields.UnimplementedValdServerWithMirror, +// } +// +// err := s.StreamGetObject(test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } diff --git a/pkg/gateway/mirror/handler/rest/handler.go b/pkg/gateway/mirror/handler/rest/handler.go index c25645b0aa..4d32769d56 100644 --- a/pkg/gateway/mirror/handler/rest/handler.go +++ b/pkg/gateway/mirror/handler/rest/handler.go @@ -66,7 +66,7 @@ func (h *handler) Register(w http.ResponseWriter, r *http.Request) (code int, er }) } -func (_ *handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { +func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { return dump.Request(nil, data, r) diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index c707d96ac5..e7a8f66ad6 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -76,7 +76,7 @@ func (g *gateway) GRPCClient() grpc.Client { // ForwardedContext takes a context and a podName, returning a new context // with additional information related to forwarding. -func (_ *gateway) ForwardedContext(ctx context.Context, podName string) context.Context { +func (*gateway) ForwardedContext(ctx context.Context, podName string) context.Context { return grpc.NewOutgoingContext(ctx, grpc.MD{ forwardedContextKey: []string{ podName, From 41f54f847f6ef8c2aea29ecceea9293a07d907eb Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 14 Dec 2023 12:51:57 +0900 Subject: [PATCH 79/93] fix: deepsource warning Signed-off-by: hlts2 --- pkg/gateway/mirror/service/gateway.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index e7a8f66ad6..d5bad4fe46 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -86,7 +86,7 @@ func (*gateway) ForwardedContext(ctx context.Context, podName string) context.Co // FromForwardedContext extracts information from the forwarded context // and returns the podName associated with it. -func (_ *gateway) FromForwardedContext(ctx context.Context) string { +func (*gateway) FromForwardedContext(ctx context.Context) string { md, ok := grpc.FromIncomingContext(ctx) if !ok { return "" From 515441b99c905f049cec3273753d51836840a161 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 21 Dec 2023 15:19:16 +0900 Subject: [PATCH 80/93] fix: make proto/all format Signed-off-by: hlts2 --- apis/grpc/v1/payload/payload.pb.go | 952 +++++++++++++-------- pkg/gateway/mirror/handler/grpc/handler.go | 14 +- 2 files changed, 585 insertions(+), 381 deletions(-) diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index 5950868f82..b1e861c19f 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -550,6 +550,45 @@ func (*Info) Descriptor() ([]byte, []int) { return file_v1_payload_payload_proto_rawDescGZIP(), []int{9} } +// Mirror related messages. +type Mirror struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Mirror) Reset() { + *x = Mirror{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_payload_payload_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror) ProtoMessage() {} + +func (x *Mirror) ProtoReflect() protoreflect.Message { + mi := &file_v1_payload_payload_proto_msgTypes[10] + 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 Mirror.ProtoReflect.Descriptor instead. +func (*Mirror) Descriptor() ([]byte, []int) { + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10} +} + // Represent an empty message. type Empty struct { state protoimpl.MessageState @@ -560,7 +599,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[10] + mi := &file_v1_payload_payload_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -573,7 +612,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[10] + mi := &file_v1_payload_payload_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -586,7 +625,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_v1_payload_payload_proto_rawDescGZIP(), []int{10} + return file_v1_payload_payload_proto_rawDescGZIP(), []int{11} } // Represent a search request. @@ -604,7 +643,7 @@ type Search_Request struct { func (x *Search_Request) Reset() { *x = Search_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[11] + mi := &file_v1_payload_payload_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -617,7 +656,7 @@ func (x *Search_Request) String() string { func (*Search_Request) ProtoMessage() {} func (x *Search_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[11] + mi := &file_v1_payload_payload_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -660,7 +699,7 @@ type Search_MultiRequest struct { func (x *Search_MultiRequest) Reset() { *x = Search_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[12] + mi := &file_v1_payload_payload_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -673,7 +712,7 @@ func (x *Search_MultiRequest) String() string { func (*Search_MultiRequest) ProtoMessage() {} func (x *Search_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[12] + mi := &file_v1_payload_payload_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -711,7 +750,7 @@ type Search_IDRequest struct { func (x *Search_IDRequest) Reset() { *x = Search_IDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[13] + mi := &file_v1_payload_payload_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -724,7 +763,7 @@ func (x *Search_IDRequest) String() string { func (*Search_IDRequest) ProtoMessage() {} func (x *Search_IDRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[13] + mi := &file_v1_payload_payload_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -767,7 +806,7 @@ type Search_MultiIDRequest struct { func (x *Search_MultiIDRequest) Reset() { *x = Search_MultiIDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[14] + mi := &file_v1_payload_payload_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -780,7 +819,7 @@ func (x *Search_MultiIDRequest) String() string { func (*Search_MultiIDRequest) ProtoMessage() {} func (x *Search_MultiIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[14] + mi := &file_v1_payload_payload_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -820,7 +859,7 @@ type Search_ObjectRequest struct { func (x *Search_ObjectRequest) Reset() { *x = Search_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[15] + mi := &file_v1_payload_payload_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -833,7 +872,7 @@ func (x *Search_ObjectRequest) String() string { func (*Search_ObjectRequest) ProtoMessage() {} func (x *Search_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[15] + mi := &file_v1_payload_payload_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -883,7 +922,7 @@ type Search_MultiObjectRequest struct { func (x *Search_MultiObjectRequest) Reset() { *x = Search_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[16] + mi := &file_v1_payload_payload_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -896,7 +935,7 @@ func (x *Search_MultiObjectRequest) String() string { func (*Search_MultiObjectRequest) ProtoMessage() {} func (x *Search_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[16] + mi := &file_v1_payload_payload_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -948,7 +987,7 @@ type Search_Config struct { func (x *Search_Config) Reset() { *x = Search_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[17] + mi := &file_v1_payload_payload_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -961,7 +1000,7 @@ func (x *Search_Config) String() string { func (*Search_Config) ProtoMessage() {} func (x *Search_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[17] + mi := &file_v1_payload_payload_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1055,7 +1094,7 @@ type Search_Response struct { func (x *Search_Response) Reset() { *x = Search_Response{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[18] + mi := &file_v1_payload_payload_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1068,7 +1107,7 @@ func (x *Search_Response) String() string { func (*Search_Response) ProtoMessage() {} func (x *Search_Response) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[18] + mi := &file_v1_payload_payload_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1111,7 +1150,7 @@ type Search_Responses struct { func (x *Search_Responses) Reset() { *x = Search_Responses{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[19] + mi := &file_v1_payload_payload_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1124,7 +1163,7 @@ func (x *Search_Responses) String() string { func (*Search_Responses) ProtoMessage() {} func (x *Search_Responses) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[19] + mi := &file_v1_payload_payload_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1163,7 +1202,7 @@ type Search_StreamResponse struct { func (x *Search_StreamResponse) Reset() { *x = Search_StreamResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[20] + mi := &file_v1_payload_payload_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1176,7 +1215,7 @@ func (x *Search_StreamResponse) String() string { func (*Search_StreamResponse) ProtoMessage() {} func (x *Search_StreamResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[20] + mi := &file_v1_payload_payload_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1246,7 +1285,7 @@ type Filter_Target struct { func (x *Filter_Target) Reset() { *x = Filter_Target{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[21] + mi := &file_v1_payload_payload_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1259,7 +1298,7 @@ func (x *Filter_Target) String() string { func (*Filter_Target) ProtoMessage() {} func (x *Filter_Target) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[21] + mi := &file_v1_payload_payload_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1302,7 +1341,7 @@ type Filter_Config struct { func (x *Filter_Config) Reset() { *x = Filter_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[22] + mi := &file_v1_payload_payload_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1315,7 +1354,7 @@ func (x *Filter_Config) String() string { func (*Filter_Config) ProtoMessage() {} func (x *Filter_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[22] + mi := &file_v1_payload_payload_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1353,7 +1392,7 @@ type Insert_Request struct { func (x *Insert_Request) Reset() { *x = Insert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[23] + mi := &file_v1_payload_payload_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1366,7 +1405,7 @@ func (x *Insert_Request) String() string { func (*Insert_Request) ProtoMessage() {} func (x *Insert_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[23] + mi := &file_v1_payload_payload_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1409,7 +1448,7 @@ type Insert_MultiRequest struct { func (x *Insert_MultiRequest) Reset() { *x = Insert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[24] + mi := &file_v1_payload_payload_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1422,7 +1461,7 @@ func (x *Insert_MultiRequest) String() string { func (*Insert_MultiRequest) ProtoMessage() {} func (x *Insert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[24] + mi := &file_v1_payload_payload_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1462,7 +1501,7 @@ type Insert_ObjectRequest struct { func (x *Insert_ObjectRequest) Reset() { *x = Insert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[25] + mi := &file_v1_payload_payload_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1475,7 +1514,7 @@ func (x *Insert_ObjectRequest) String() string { func (*Insert_ObjectRequest) ProtoMessage() {} func (x *Insert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[25] + mi := &file_v1_payload_payload_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1525,7 +1564,7 @@ type Insert_MultiObjectRequest struct { func (x *Insert_MultiObjectRequest) Reset() { *x = Insert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[26] + mi := &file_v1_payload_payload_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1538,7 +1577,7 @@ func (x *Insert_MultiObjectRequest) String() string { func (*Insert_MultiObjectRequest) ProtoMessage() {} func (x *Insert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[26] + mi := &file_v1_payload_payload_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1578,7 +1617,7 @@ type Insert_Config struct { func (x *Insert_Config) Reset() { *x = Insert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[27] + mi := &file_v1_payload_payload_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1591,7 +1630,7 @@ func (x *Insert_Config) String() string { func (*Insert_Config) ProtoMessage() {} func (x *Insert_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[27] + mi := &file_v1_payload_payload_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1643,7 +1682,7 @@ type Update_Request struct { func (x *Update_Request) Reset() { *x = Update_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[28] + mi := &file_v1_payload_payload_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1656,7 +1695,7 @@ func (x *Update_Request) String() string { func (*Update_Request) ProtoMessage() {} func (x *Update_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[28] + mi := &file_v1_payload_payload_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1699,7 +1738,7 @@ type Update_MultiRequest struct { func (x *Update_MultiRequest) Reset() { *x = Update_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[29] + mi := &file_v1_payload_payload_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1712,7 +1751,7 @@ func (x *Update_MultiRequest) String() string { func (*Update_MultiRequest) ProtoMessage() {} func (x *Update_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[29] + mi := &file_v1_payload_payload_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1752,7 +1791,7 @@ type Update_ObjectRequest struct { func (x *Update_ObjectRequest) Reset() { *x = Update_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[30] + mi := &file_v1_payload_payload_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1765,7 +1804,7 @@ func (x *Update_ObjectRequest) String() string { func (*Update_ObjectRequest) ProtoMessage() {} func (x *Update_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[30] + mi := &file_v1_payload_payload_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1815,7 +1854,7 @@ type Update_MultiObjectRequest struct { func (x *Update_MultiObjectRequest) Reset() { *x = Update_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[31] + mi := &file_v1_payload_payload_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1828,7 +1867,7 @@ func (x *Update_MultiObjectRequest) String() string { func (*Update_MultiObjectRequest) ProtoMessage() {} func (x *Update_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[31] + mi := &file_v1_payload_payload_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1871,7 +1910,7 @@ type Update_Config struct { func (x *Update_Config) Reset() { *x = Update_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[32] + mi := &file_v1_payload_payload_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1884,7 +1923,7 @@ func (x *Update_Config) String() string { func (*Update_Config) ProtoMessage() {} func (x *Update_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[32] + mi := &file_v1_payload_payload_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1943,7 +1982,7 @@ type Upsert_Request struct { func (x *Upsert_Request) Reset() { *x = Upsert_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[33] + mi := &file_v1_payload_payload_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1956,7 +1995,7 @@ func (x *Upsert_Request) String() string { func (*Upsert_Request) ProtoMessage() {} func (x *Upsert_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[33] + mi := &file_v1_payload_payload_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1999,7 +2038,7 @@ type Upsert_MultiRequest struct { func (x *Upsert_MultiRequest) Reset() { *x = Upsert_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[34] + mi := &file_v1_payload_payload_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2012,7 +2051,7 @@ func (x *Upsert_MultiRequest) String() string { func (*Upsert_MultiRequest) ProtoMessage() {} func (x *Upsert_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[34] + mi := &file_v1_payload_payload_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2052,7 +2091,7 @@ type Upsert_ObjectRequest struct { func (x *Upsert_ObjectRequest) Reset() { *x = Upsert_ObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[35] + mi := &file_v1_payload_payload_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2065,7 +2104,7 @@ func (x *Upsert_ObjectRequest) String() string { func (*Upsert_ObjectRequest) ProtoMessage() {} func (x *Upsert_ObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[35] + mi := &file_v1_payload_payload_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2115,7 +2154,7 @@ type Upsert_MultiObjectRequest struct { func (x *Upsert_MultiObjectRequest) Reset() { *x = Upsert_MultiObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[36] + mi := &file_v1_payload_payload_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2128,7 +2167,7 @@ func (x *Upsert_MultiObjectRequest) String() string { func (*Upsert_MultiObjectRequest) ProtoMessage() {} func (x *Upsert_MultiObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[36] + mi := &file_v1_payload_payload_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2171,7 +2210,7 @@ type Upsert_Config struct { func (x *Upsert_Config) Reset() { *x = Upsert_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[37] + mi := &file_v1_payload_payload_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2184,7 +2223,7 @@ func (x *Upsert_Config) String() string { func (*Upsert_Config) ProtoMessage() {} func (x *Upsert_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[37] + mi := &file_v1_payload_payload_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2243,7 +2282,7 @@ type Remove_Request struct { func (x *Remove_Request) Reset() { *x = Remove_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[38] + mi := &file_v1_payload_payload_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2256,7 +2295,7 @@ func (x *Remove_Request) String() string { func (*Remove_Request) ProtoMessage() {} func (x *Remove_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[38] + mi := &file_v1_payload_payload_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2299,7 +2338,7 @@ type Remove_MultiRequest struct { func (x *Remove_MultiRequest) Reset() { *x = Remove_MultiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[39] + mi := &file_v1_payload_payload_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2312,7 +2351,7 @@ func (x *Remove_MultiRequest) String() string { func (*Remove_MultiRequest) ProtoMessage() {} func (x *Remove_MultiRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[39] + mi := &file_v1_payload_payload_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2348,7 +2387,7 @@ type Remove_TimestampRequest struct { func (x *Remove_TimestampRequest) Reset() { *x = Remove_TimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[40] + mi := &file_v1_payload_payload_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2361,7 +2400,7 @@ func (x *Remove_TimestampRequest) String() string { func (*Remove_TimestampRequest) ProtoMessage() {} func (x *Remove_TimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[40] + mi := &file_v1_payload_payload_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2399,7 +2438,7 @@ type Remove_Timestamp struct { func (x *Remove_Timestamp) Reset() { *x = Remove_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[41] + mi := &file_v1_payload_payload_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2412,7 +2451,7 @@ func (x *Remove_Timestamp) String() string { func (*Remove_Timestamp) ProtoMessage() {} func (x *Remove_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[41] + mi := &file_v1_payload_payload_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2457,7 +2496,7 @@ type Remove_Config struct { func (x *Remove_Config) Reset() { *x = Remove_Config{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[42] + mi := &file_v1_payload_payload_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2470,7 +2509,7 @@ func (x *Remove_Config) String() string { func (*Remove_Config) ProtoMessage() {} func (x *Remove_Config) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[42] + mi := &file_v1_payload_payload_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2515,7 +2554,7 @@ type Object_VectorRequest struct { func (x *Object_VectorRequest) Reset() { *x = Object_VectorRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[43] + mi := &file_v1_payload_payload_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2528,7 +2567,7 @@ func (x *Object_VectorRequest) String() string { func (*Object_VectorRequest) ProtoMessage() {} func (x *Object_VectorRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[43] + mi := &file_v1_payload_payload_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2573,7 +2612,7 @@ type Object_Distance struct { func (x *Object_Distance) Reset() { *x = Object_Distance{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[44] + mi := &file_v1_payload_payload_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2586,7 +2625,7 @@ func (x *Object_Distance) String() string { func (*Object_Distance) ProtoMessage() {} func (x *Object_Distance) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[44] + mi := &file_v1_payload_payload_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2632,7 +2671,7 @@ type Object_StreamDistance struct { func (x *Object_StreamDistance) Reset() { *x = Object_StreamDistance{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[45] + mi := &file_v1_payload_payload_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2645,7 +2684,7 @@ func (x *Object_StreamDistance) String() string { func (*Object_StreamDistance) ProtoMessage() {} func (x *Object_StreamDistance) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[45] + mi := &file_v1_payload_payload_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2712,7 +2751,7 @@ type Object_ID struct { func (x *Object_ID) Reset() { *x = Object_ID{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[46] + mi := &file_v1_payload_payload_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2725,7 +2764,7 @@ func (x *Object_ID) String() string { func (*Object_ID) ProtoMessage() {} func (x *Object_ID) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[46] + mi := &file_v1_payload_payload_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2760,7 +2799,7 @@ type Object_IDs struct { func (x *Object_IDs) Reset() { *x = Object_IDs{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[47] + mi := &file_v1_payload_payload_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2773,7 +2812,7 @@ func (x *Object_IDs) String() string { func (*Object_IDs) ProtoMessage() {} func (x *Object_IDs) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[47] + mi := &file_v1_payload_payload_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2813,7 +2852,7 @@ type Object_Vector struct { func (x *Object_Vector) Reset() { *x = Object_Vector{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[48] + mi := &file_v1_payload_payload_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2826,7 +2865,7 @@ func (x *Object_Vector) String() string { func (*Object_Vector) ProtoMessage() {} func (x *Object_Vector) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[48] + mi := &file_v1_payload_payload_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2876,7 +2915,7 @@ type Object_GetTimestampRequest struct { func (x *Object_GetTimestampRequest) Reset() { *x = Object_GetTimestampRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[49] + mi := &file_v1_payload_payload_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2889,7 +2928,7 @@ func (x *Object_GetTimestampRequest) String() string { func (*Object_GetTimestampRequest) ProtoMessage() {} func (x *Object_GetTimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[49] + mi := &file_v1_payload_payload_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2927,7 +2966,7 @@ type Object_Timestamp struct { func (x *Object_Timestamp) Reset() { *x = Object_Timestamp{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[50] + mi := &file_v1_payload_payload_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2940,7 +2979,7 @@ func (x *Object_Timestamp) String() string { func (*Object_Timestamp) ProtoMessage() {} func (x *Object_Timestamp) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[50] + mi := &file_v1_payload_payload_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2982,7 +3021,7 @@ type Object_Vectors struct { func (x *Object_Vectors) Reset() { *x = Object_Vectors{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[51] + mi := &file_v1_payload_payload_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2995,7 +3034,7 @@ func (x *Object_Vectors) String() string { func (*Object_Vectors) ProtoMessage() {} func (x *Object_Vectors) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[51] + mi := &file_v1_payload_payload_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3034,7 +3073,7 @@ type Object_StreamVector struct { func (x *Object_StreamVector) Reset() { *x = Object_StreamVector{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[52] + mi := &file_v1_payload_payload_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3047,7 +3086,7 @@ func (x *Object_StreamVector) String() string { func (*Object_StreamVector) ProtoMessage() {} func (x *Object_StreamVector) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[52] + mi := &file_v1_payload_payload_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3117,7 +3156,7 @@ type Object_ReshapeVector struct { func (x *Object_ReshapeVector) Reset() { *x = Object_ReshapeVector{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[53] + mi := &file_v1_payload_payload_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3130,7 +3169,7 @@ func (x *Object_ReshapeVector) String() string { func (*Object_ReshapeVector) ProtoMessage() {} func (x *Object_ReshapeVector) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[53] + mi := &file_v1_payload_payload_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3175,7 +3214,7 @@ type Object_Blob struct { func (x *Object_Blob) Reset() { *x = Object_Blob{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[54] + mi := &file_v1_payload_payload_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3188,7 +3227,7 @@ func (x *Object_Blob) String() string { func (*Object_Blob) ProtoMessage() {} func (x *Object_Blob) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[54] + mi := &file_v1_payload_payload_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3234,7 +3273,7 @@ type Object_StreamBlob struct { func (x *Object_StreamBlob) Reset() { *x = Object_StreamBlob{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[55] + mi := &file_v1_payload_payload_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3247,7 +3286,7 @@ func (x *Object_StreamBlob) String() string { func (*Object_StreamBlob) ProtoMessage() {} func (x *Object_StreamBlob) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[55] + mi := &file_v1_payload_payload_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3319,7 +3358,7 @@ type Object_Location struct { func (x *Object_Location) Reset() { *x = Object_Location{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[56] + mi := &file_v1_payload_payload_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3332,7 +3371,7 @@ func (x *Object_Location) String() string { func (*Object_Location) ProtoMessage() {} func (x *Object_Location) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[56] + mi := &file_v1_payload_payload_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3385,7 +3424,7 @@ type Object_StreamLocation struct { func (x *Object_StreamLocation) Reset() { *x = Object_StreamLocation{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[57] + mi := &file_v1_payload_payload_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3398,7 +3437,7 @@ func (x *Object_StreamLocation) String() string { func (*Object_StreamLocation) ProtoMessage() {} func (x *Object_StreamLocation) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[57] + mi := &file_v1_payload_payload_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3465,7 +3504,7 @@ type Object_Locations struct { func (x *Object_Locations) Reset() { *x = Object_Locations{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[58] + mi := &file_v1_payload_payload_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3478,7 +3517,7 @@ func (x *Object_Locations) String() string { func (*Object_Locations) ProtoMessage() {} func (x *Object_Locations) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[58] + mi := &file_v1_payload_payload_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3511,7 +3550,7 @@ type Object_List struct { func (x *Object_List) Reset() { *x = Object_List{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[59] + mi := &file_v1_payload_payload_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3524,7 +3563,7 @@ func (x *Object_List) String() string { func (*Object_List) ProtoMessage() {} func (x *Object_List) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[59] + mi := &file_v1_payload_payload_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3549,7 +3588,7 @@ type Object_List_Request struct { func (x *Object_List_Request) Reset() { *x = Object_List_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[60] + mi := &file_v1_payload_payload_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3562,7 +3601,7 @@ func (x *Object_List_Request) String() string { func (*Object_List_Request) ProtoMessage() {} func (x *Object_List_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[60] + mi := &file_v1_payload_payload_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3593,7 +3632,7 @@ type Object_List_Response struct { func (x *Object_List_Response) Reset() { *x = Object_List_Response{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[61] + mi := &file_v1_payload_payload_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3606,7 +3645,7 @@ func (x *Object_List_Response) String() string { func (*Object_List_Response) ProtoMessage() {} func (x *Object_List_Response) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[61] + mi := &file_v1_payload_payload_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3674,7 +3713,7 @@ type Control_CreateIndexRequest struct { func (x *Control_CreateIndexRequest) Reset() { *x = Control_CreateIndexRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[62] + mi := &file_v1_payload_payload_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3687,7 +3726,7 @@ func (x *Control_CreateIndexRequest) String() string { func (*Control_CreateIndexRequest) ProtoMessage() {} func (x *Control_CreateIndexRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[62] + mi := &file_v1_payload_payload_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3727,7 +3766,7 @@ type Discoverer_Request struct { func (x *Discoverer_Request) Reset() { *x = Discoverer_Request{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[63] + mi := &file_v1_payload_payload_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3740,7 +3779,7 @@ func (x *Discoverer_Request) String() string { func (*Discoverer_Request) ProtoMessage() {} func (x *Discoverer_Request) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[63] + mi := &file_v1_payload_payload_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3787,7 +3826,7 @@ type Info_Index struct { func (x *Info_Index) Reset() { *x = Info_Index{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[64] + mi := &file_v1_payload_payload_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3800,7 +3839,7 @@ func (x *Info_Index) String() string { func (*Info_Index) ProtoMessage() {} func (x *Info_Index) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[64] + mi := &file_v1_payload_payload_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3841,7 +3880,7 @@ type Info_Pod struct { func (x *Info_Pod) Reset() { *x = Info_Pod{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[65] + mi := &file_v1_payload_payload_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3854,7 +3893,7 @@ func (x *Info_Pod) String() string { func (*Info_Pod) ProtoMessage() {} func (x *Info_Pod) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[65] + mi := &file_v1_payload_payload_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3942,7 +3981,7 @@ type Info_Node struct { func (x *Info_Node) Reset() { *x = Info_Node{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[66] + mi := &file_v1_payload_payload_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3955,7 +3994,7 @@ func (x *Info_Node) String() string { func (*Info_Node) ProtoMessage() {} func (x *Info_Node) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[66] + mi := &file_v1_payload_payload_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4036,7 +4075,7 @@ type Info_Service struct { func (x *Info_Service) Reset() { *x = Info_Service{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[67] + mi := &file_v1_payload_payload_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4049,7 +4088,7 @@ func (x *Info_Service) String() string { func (*Info_Service) ProtoMessage() {} func (x *Info_Service) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[67] + mi := &file_v1_payload_payload_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4122,7 +4161,7 @@ type Info_ServicePort struct { func (x *Info_ServicePort) Reset() { *x = Info_ServicePort{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[68] + mi := &file_v1_payload_payload_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4135,7 +4174,7 @@ func (x *Info_ServicePort) String() string { func (*Info_ServicePort) ProtoMessage() {} func (x *Info_ServicePort) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[68] + mi := &file_v1_payload_payload_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4177,7 +4216,7 @@ type Info_Labels struct { func (x *Info_Labels) Reset() { *x = Info_Labels{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[69] + mi := &file_v1_payload_payload_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4190,7 +4229,7 @@ func (x *Info_Labels) String() string { func (*Info_Labels) ProtoMessage() {} func (x *Info_Labels) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[69] + mi := &file_v1_payload_payload_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4225,7 +4264,7 @@ type Info_Annotations struct { func (x *Info_Annotations) Reset() { *x = Info_Annotations{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[70] + mi := &file_v1_payload_payload_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4238,7 +4277,7 @@ func (x *Info_Annotations) String() string { func (*Info_Annotations) ProtoMessage() {} func (x *Info_Annotations) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[70] + mi := &file_v1_payload_payload_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4278,7 +4317,7 @@ type Info_CPU struct { func (x *Info_CPU) Reset() { *x = Info_CPU{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[71] + mi := &file_v1_payload_payload_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4291,7 +4330,7 @@ func (x *Info_CPU) String() string { func (*Info_CPU) ProtoMessage() {} func (x *Info_CPU) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[71] + mi := &file_v1_payload_payload_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4345,7 +4384,7 @@ type Info_Memory struct { func (x *Info_Memory) Reset() { *x = Info_Memory{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[72] + mi := &file_v1_payload_payload_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4358,7 +4397,7 @@ func (x *Info_Memory) String() string { func (*Info_Memory) ProtoMessage() {} func (x *Info_Memory) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[72] + mi := &file_v1_payload_payload_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4408,7 +4447,7 @@ type Info_Pods struct { func (x *Info_Pods) Reset() { *x = Info_Pods{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[73] + mi := &file_v1_payload_payload_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4421,7 +4460,7 @@ func (x *Info_Pods) String() string { func (*Info_Pods) ProtoMessage() {} func (x *Info_Pods) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[73] + mi := &file_v1_payload_payload_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4457,7 +4496,7 @@ type Info_Nodes struct { func (x *Info_Nodes) Reset() { *x = Info_Nodes{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[74] + mi := &file_v1_payload_payload_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4470,7 +4509,7 @@ func (x *Info_Nodes) String() string { func (*Info_Nodes) ProtoMessage() {} func (x *Info_Nodes) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[74] + mi := &file_v1_payload_payload_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4506,7 +4545,7 @@ type Info_Services struct { func (x *Info_Services) Reset() { *x = Info_Services{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[75] + mi := &file_v1_payload_payload_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4519,7 +4558,7 @@ func (x *Info_Services) String() string { func (*Info_Services) ProtoMessage() {} func (x *Info_Services) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[75] + mi := &file_v1_payload_payload_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4554,7 +4593,7 @@ type Info_IPs struct { func (x *Info_IPs) Reset() { *x = Info_IPs{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[76] + mi := &file_v1_payload_payload_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4567,7 +4606,7 @@ func (x *Info_IPs) String() string { func (*Info_IPs) ProtoMessage() {} func (x *Info_IPs) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[76] + mi := &file_v1_payload_payload_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4609,7 +4648,7 @@ type Info_Index_Count struct { func (x *Info_Index_Count) Reset() { *x = Info_Index_Count{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[77] + mi := &file_v1_payload_payload_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4622,7 +4661,7 @@ func (x *Info_Index_Count) String() string { func (*Info_Index_Count) ProtoMessage() {} func (x *Info_Index_Count) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[77] + mi := &file_v1_payload_payload_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4676,7 +4715,7 @@ type Info_Index_UUID struct { func (x *Info_Index_UUID) Reset() { *x = Info_Index_UUID{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[78] + mi := &file_v1_payload_payload_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4689,7 +4728,7 @@ func (x *Info_Index_UUID) String() string { func (*Info_Index_UUID) ProtoMessage() {} func (x *Info_Index_UUID) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[78] + mi := &file_v1_payload_payload_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4717,7 +4756,7 @@ type Info_Index_UUID_Committed struct { func (x *Info_Index_UUID_Committed) Reset() { *x = Info_Index_UUID_Committed{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[79] + mi := &file_v1_payload_payload_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4730,7 +4769,7 @@ func (x *Info_Index_UUID_Committed) String() string { func (*Info_Index_UUID_Committed) ProtoMessage() {} func (x *Info_Index_UUID_Committed) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[79] + mi := &file_v1_payload_payload_proto_msgTypes[80] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4765,7 +4804,7 @@ type Info_Index_UUID_Uncommitted struct { func (x *Info_Index_UUID_Uncommitted) Reset() { *x = Info_Index_UUID_Uncommitted{} if protoimpl.UnsafeEnabled { - mi := &file_v1_payload_payload_proto_msgTypes[80] + mi := &file_v1_payload_payload_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4778,7 +4817,7 @@ func (x *Info_Index_UUID_Uncommitted) String() string { func (*Info_Index_UUID_Uncommitted) ProtoMessage() {} func (x *Info_Index_UUID_Uncommitted) ProtoReflect() protoreflect.Message { - mi := &file_v1_payload_payload_proto_msgTypes[80] + mi := &file_v1_payload_payload_proto_msgTypes[81] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4801,6 +4840,113 @@ func (x *Info_Index_UUID_Uncommitted) GetUuid() string { return "" } +// Represent server information. +type Mirror_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The target hostname. + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + // The target port. + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *Mirror_Target) Reset() { + *x = Mirror_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_payload_payload_proto_msgTypes[84] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Target) ProtoMessage() {} + +func (x *Mirror_Target) ProtoReflect() protoreflect.Message { + mi := &file_v1_payload_payload_proto_msgTypes[84] + 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 Mirror_Target.ProtoReflect.Descriptor instead. +func (*Mirror_Target) Descriptor() ([]byte, []int) { + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *Mirror_Target) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Mirror_Target) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +// Represent the multiple Target message. +type Mirror_Targets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The multiple target information. + Targets []*Mirror_Target `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *Mirror_Targets) Reset() { + *x = Mirror_Targets{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_payload_payload_proto_msgTypes[85] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mirror_Targets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mirror_Targets) ProtoMessage() {} + +func (x *Mirror_Targets) ProtoReflect() protoreflect.Message { + mi := &file_v1_payload_payload_proto_msgTypes[85] + 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 Mirror_Targets.ProtoReflect.Descriptor instead. +func (*Mirror_Targets) Descriptor() ([]byte, []int) { + return file_v1_payload_payload_proto_rawDescGZIP(), []int{10, 1} +} + +func (x *Mirror_Targets) GetTargets() []*Mirror_Target { + if x != nil { + return x.Targets + } + return nil +} + var File_v1_payload_payload_proto protoreflect.FileDescriptor var file_v1_payload_payload_proto_rawDesc = []byte{ @@ -5267,14 +5413,22 @@ var file_v1_payload_payload_proto_rawDesc = []byte{ 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x08, 0xba, 0x48, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 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, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x7a, 0x0a, 0x06, 0x4d, 0x69, 0x72, 0x72, + 0x6f, 0x72, 0x1a, 0x30, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, + 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x3e, 0x0a, 0x07, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, + 0x33, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, + 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x73, 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, } var ( @@ -5290,7 +5444,7 @@ func file_v1_payload_payload_proto_rawDescGZIP() []byte { } var file_v1_payload_payload_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 83) +var file_v1_payload_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 86) var file_v1_payload_payload_proto_goTypes = []interface{}{ (Search_AggregationAlgorithm)(0), // 0: payload.v1.Search.AggregationAlgorithm (Remove_Timestamp_Operator)(0), // 1: payload.v1.Remove.Timestamp.Operator @@ -5304,160 +5458,164 @@ var file_v1_payload_payload_proto_goTypes = []interface{}{ (*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_GetTimestampRequest)(nil), // 51: payload.v1.Object.GetTimestampRequest - (*Object_Timestamp)(nil), // 52: payload.v1.Object.Timestamp - (*Object_Vectors)(nil), // 53: payload.v1.Object.Vectors - (*Object_StreamVector)(nil), // 54: payload.v1.Object.StreamVector - (*Object_ReshapeVector)(nil), // 55: payload.v1.Object.ReshapeVector - (*Object_Blob)(nil), // 56: payload.v1.Object.Blob - (*Object_StreamBlob)(nil), // 57: payload.v1.Object.StreamBlob - (*Object_Location)(nil), // 58: payload.v1.Object.Location - (*Object_StreamLocation)(nil), // 59: payload.v1.Object.StreamLocation - (*Object_Locations)(nil), // 60: payload.v1.Object.Locations - (*Object_List)(nil), // 61: payload.v1.Object.List - (*Object_List_Request)(nil), // 62: payload.v1.Object.List.Request - (*Object_List_Response)(nil), // 63: payload.v1.Object.List.Response - (*Control_CreateIndexRequest)(nil), // 64: payload.v1.Control.CreateIndexRequest - (*Discoverer_Request)(nil), // 65: payload.v1.Discoverer.Request - (*Info_Index)(nil), // 66: payload.v1.Info.Index - (*Info_Pod)(nil), // 67: payload.v1.Info.Pod - (*Info_Node)(nil), // 68: payload.v1.Info.Node - (*Info_Service)(nil), // 69: payload.v1.Info.Service - (*Info_ServicePort)(nil), // 70: payload.v1.Info.ServicePort - (*Info_Labels)(nil), // 71: payload.v1.Info.Labels - (*Info_Annotations)(nil), // 72: payload.v1.Info.Annotations - (*Info_CPU)(nil), // 73: payload.v1.Info.CPU - (*Info_Memory)(nil), // 74: payload.v1.Info.Memory - (*Info_Pods)(nil), // 75: payload.v1.Info.Pods - (*Info_Nodes)(nil), // 76: payload.v1.Info.Nodes - (*Info_Services)(nil), // 77: payload.v1.Info.Services - (*Info_IPs)(nil), // 78: payload.v1.Info.IPs - (*Info_Index_Count)(nil), // 79: payload.v1.Info.Index.Count - (*Info_Index_UUID)(nil), // 80: payload.v1.Info.Index.UUID - (*Info_Index_UUID_Committed)(nil), // 81: payload.v1.Info.Index.UUID.Committed - (*Info_Index_UUID_Uncommitted)(nil), // 82: payload.v1.Info.Index.UUID.Uncommitted - nil, // 83: payload.v1.Info.Labels.LabelsEntry - nil, // 84: payload.v1.Info.Annotations.AnnotationsEntry - (*status.Status)(nil), // 85: google.rpc.Status + (*Mirror)(nil), // 12: payload.v1.Mirror + (*Empty)(nil), // 13: payload.v1.Empty + (*Search_Request)(nil), // 14: payload.v1.Search.Request + (*Search_MultiRequest)(nil), // 15: payload.v1.Search.MultiRequest + (*Search_IDRequest)(nil), // 16: payload.v1.Search.IDRequest + (*Search_MultiIDRequest)(nil), // 17: payload.v1.Search.MultiIDRequest + (*Search_ObjectRequest)(nil), // 18: payload.v1.Search.ObjectRequest + (*Search_MultiObjectRequest)(nil), // 19: payload.v1.Search.MultiObjectRequest + (*Search_Config)(nil), // 20: payload.v1.Search.Config + (*Search_Response)(nil), // 21: payload.v1.Search.Response + (*Search_Responses)(nil), // 22: payload.v1.Search.Responses + (*Search_StreamResponse)(nil), // 23: payload.v1.Search.StreamResponse + (*Filter_Target)(nil), // 24: payload.v1.Filter.Target + (*Filter_Config)(nil), // 25: payload.v1.Filter.Config + (*Insert_Request)(nil), // 26: payload.v1.Insert.Request + (*Insert_MultiRequest)(nil), // 27: payload.v1.Insert.MultiRequest + (*Insert_ObjectRequest)(nil), // 28: payload.v1.Insert.ObjectRequest + (*Insert_MultiObjectRequest)(nil), // 29: payload.v1.Insert.MultiObjectRequest + (*Insert_Config)(nil), // 30: payload.v1.Insert.Config + (*Update_Request)(nil), // 31: payload.v1.Update.Request + (*Update_MultiRequest)(nil), // 32: payload.v1.Update.MultiRequest + (*Update_ObjectRequest)(nil), // 33: payload.v1.Update.ObjectRequest + (*Update_MultiObjectRequest)(nil), // 34: payload.v1.Update.MultiObjectRequest + (*Update_Config)(nil), // 35: payload.v1.Update.Config + (*Upsert_Request)(nil), // 36: payload.v1.Upsert.Request + (*Upsert_MultiRequest)(nil), // 37: payload.v1.Upsert.MultiRequest + (*Upsert_ObjectRequest)(nil), // 38: payload.v1.Upsert.ObjectRequest + (*Upsert_MultiObjectRequest)(nil), // 39: payload.v1.Upsert.MultiObjectRequest + (*Upsert_Config)(nil), // 40: payload.v1.Upsert.Config + (*Remove_Request)(nil), // 41: payload.v1.Remove.Request + (*Remove_MultiRequest)(nil), // 42: payload.v1.Remove.MultiRequest + (*Remove_TimestampRequest)(nil), // 43: payload.v1.Remove.TimestampRequest + (*Remove_Timestamp)(nil), // 44: payload.v1.Remove.Timestamp + (*Remove_Config)(nil), // 45: payload.v1.Remove.Config + (*Object_VectorRequest)(nil), // 46: payload.v1.Object.VectorRequest + (*Object_Distance)(nil), // 47: payload.v1.Object.Distance + (*Object_StreamDistance)(nil), // 48: payload.v1.Object.StreamDistance + (*Object_ID)(nil), // 49: payload.v1.Object.ID + (*Object_IDs)(nil), // 50: payload.v1.Object.IDs + (*Object_Vector)(nil), // 51: payload.v1.Object.Vector + (*Object_GetTimestampRequest)(nil), // 52: payload.v1.Object.GetTimestampRequest + (*Object_Timestamp)(nil), // 53: payload.v1.Object.Timestamp + (*Object_Vectors)(nil), // 54: payload.v1.Object.Vectors + (*Object_StreamVector)(nil), // 55: payload.v1.Object.StreamVector + (*Object_ReshapeVector)(nil), // 56: payload.v1.Object.ReshapeVector + (*Object_Blob)(nil), // 57: payload.v1.Object.Blob + (*Object_StreamBlob)(nil), // 58: payload.v1.Object.StreamBlob + (*Object_Location)(nil), // 59: payload.v1.Object.Location + (*Object_StreamLocation)(nil), // 60: payload.v1.Object.StreamLocation + (*Object_Locations)(nil), // 61: payload.v1.Object.Locations + (*Object_List)(nil), // 62: payload.v1.Object.List + (*Object_List_Request)(nil), // 63: payload.v1.Object.List.Request + (*Object_List_Response)(nil), // 64: payload.v1.Object.List.Response + (*Control_CreateIndexRequest)(nil), // 65: payload.v1.Control.CreateIndexRequest + (*Discoverer_Request)(nil), // 66: payload.v1.Discoverer.Request + (*Info_Index)(nil), // 67: payload.v1.Info.Index + (*Info_Pod)(nil), // 68: payload.v1.Info.Pod + (*Info_Node)(nil), // 69: payload.v1.Info.Node + (*Info_Service)(nil), // 70: payload.v1.Info.Service + (*Info_ServicePort)(nil), // 71: payload.v1.Info.ServicePort + (*Info_Labels)(nil), // 72: payload.v1.Info.Labels + (*Info_Annotations)(nil), // 73: payload.v1.Info.Annotations + (*Info_CPU)(nil), // 74: payload.v1.Info.CPU + (*Info_Memory)(nil), // 75: payload.v1.Info.Memory + (*Info_Pods)(nil), // 76: payload.v1.Info.Pods + (*Info_Nodes)(nil), // 77: payload.v1.Info.Nodes + (*Info_Services)(nil), // 78: payload.v1.Info.Services + (*Info_IPs)(nil), // 79: payload.v1.Info.IPs + (*Info_Index_Count)(nil), // 80: payload.v1.Info.Index.Count + (*Info_Index_UUID)(nil), // 81: payload.v1.Info.Index.UUID + (*Info_Index_UUID_Committed)(nil), // 82: payload.v1.Info.Index.UUID.Committed + (*Info_Index_UUID_Uncommitted)(nil), // 83: payload.v1.Info.Index.UUID.Uncommitted + nil, // 84: payload.v1.Info.Labels.LabelsEntry + nil, // 85: payload.v1.Info.Annotations.AnnotationsEntry + (*Mirror_Target)(nil), // 86: payload.v1.Mirror.Target + (*Mirror_Targets)(nil), // 87: payload.v1.Mirror.Targets + (*status.Status)(nil), // 88: google.rpc.Status } var file_v1_payload_payload_proto_depIdxs = []int32{ - 19, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config - 13, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request - 19, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config - 15, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest - 19, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config - 23, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target - 17, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest - 24, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config - 24, // 8: payload.v1.Search.Config.egress_filters:type_name -> payload.v1.Filter.Config + 20, // 0: payload.v1.Search.Request.config:type_name -> payload.v1.Search.Config + 14, // 1: payload.v1.Search.MultiRequest.requests:type_name -> payload.v1.Search.Request + 20, // 2: payload.v1.Search.IDRequest.config:type_name -> payload.v1.Search.Config + 16, // 3: payload.v1.Search.MultiIDRequest.requests:type_name -> payload.v1.Search.IDRequest + 20, // 4: payload.v1.Search.ObjectRequest.config:type_name -> payload.v1.Search.Config + 24, // 5: payload.v1.Search.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 18, // 6: payload.v1.Search.MultiObjectRequest.requests:type_name -> payload.v1.Search.ObjectRequest + 25, // 7: payload.v1.Search.Config.ingress_filters:type_name -> payload.v1.Filter.Config + 25, // 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 - 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 - 85, // 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 - 56, // 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 - 56, // 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 - 56, // 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 + 47, // 10: payload.v1.Search.Response.results:type_name -> payload.v1.Object.Distance + 21, // 11: payload.v1.Search.Responses.responses:type_name -> payload.v1.Search.Response + 21, // 12: payload.v1.Search.StreamResponse.response:type_name -> payload.v1.Search.Response + 88, // 13: payload.v1.Search.StreamResponse.status:type_name -> google.rpc.Status + 24, // 14: payload.v1.Filter.Config.targets:type_name -> payload.v1.Filter.Target + 51, // 15: payload.v1.Insert.Request.vector:type_name -> payload.v1.Object.Vector + 30, // 16: payload.v1.Insert.Request.config:type_name -> payload.v1.Insert.Config + 26, // 17: payload.v1.Insert.MultiRequest.requests:type_name -> payload.v1.Insert.Request + 57, // 18: payload.v1.Insert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 30, // 19: payload.v1.Insert.ObjectRequest.config:type_name -> payload.v1.Insert.Config + 24, // 20: payload.v1.Insert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 28, // 21: payload.v1.Insert.MultiObjectRequest.requests:type_name -> payload.v1.Insert.ObjectRequest + 25, // 22: payload.v1.Insert.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 23: payload.v1.Update.Request.vector:type_name -> payload.v1.Object.Vector + 35, // 24: payload.v1.Update.Request.config:type_name -> payload.v1.Update.Config + 31, // 25: payload.v1.Update.MultiRequest.requests:type_name -> payload.v1.Update.Request + 57, // 26: payload.v1.Update.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 35, // 27: payload.v1.Update.ObjectRequest.config:type_name -> payload.v1.Update.Config + 24, // 28: payload.v1.Update.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 33, // 29: payload.v1.Update.MultiObjectRequest.requests:type_name -> payload.v1.Update.ObjectRequest + 25, // 30: payload.v1.Update.Config.filters:type_name -> payload.v1.Filter.Config + 51, // 31: payload.v1.Upsert.Request.vector:type_name -> payload.v1.Object.Vector + 40, // 32: payload.v1.Upsert.Request.config:type_name -> payload.v1.Upsert.Config + 36, // 33: payload.v1.Upsert.MultiRequest.requests:type_name -> payload.v1.Upsert.Request + 57, // 34: payload.v1.Upsert.ObjectRequest.object:type_name -> payload.v1.Object.Blob + 40, // 35: payload.v1.Upsert.ObjectRequest.config:type_name -> payload.v1.Upsert.Config + 24, // 36: payload.v1.Upsert.ObjectRequest.vectorizer:type_name -> payload.v1.Filter.Target + 38, // 37: payload.v1.Upsert.MultiObjectRequest.requests:type_name -> payload.v1.Upsert.ObjectRequest + 25, // 38: payload.v1.Upsert.Config.filters:type_name -> payload.v1.Filter.Config + 49, // 39: payload.v1.Remove.Request.id:type_name -> payload.v1.Object.ID + 45, // 40: payload.v1.Remove.Request.config:type_name -> payload.v1.Remove.Config + 41, // 41: payload.v1.Remove.MultiRequest.requests:type_name -> payload.v1.Remove.Request + 44, // 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 - 85, // 47: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status - 48, // 48: payload.v1.Object.GetTimestampRequest.id:type_name -> payload.v1.Object.ID - 50, // 49: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector - 50, // 50: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector - 85, // 51: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status - 56, // 52: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob - 85, // 53: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status - 58, // 54: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location - 85, // 55: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status - 58, // 56: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location - 50, // 57: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector - 85, // 58: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status - 73, // 59: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU - 74, // 60: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory - 68, // 61: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node - 73, // 62: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU - 74, // 63: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory - 75, // 64: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods - 70, // 65: payload.v1.Info.Service.ports:type_name -> payload.v1.Info.ServicePort - 71, // 66: payload.v1.Info.Service.labels:type_name -> payload.v1.Info.Labels - 72, // 67: payload.v1.Info.Service.annotations:type_name -> payload.v1.Info.Annotations - 83, // 68: payload.v1.Info.Labels.labels:type_name -> payload.v1.Info.Labels.LabelsEntry - 84, // 69: payload.v1.Info.Annotations.annotations:type_name -> payload.v1.Info.Annotations.AnnotationsEntry - 67, // 70: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod - 68, // 71: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node - 69, // 72: payload.v1.Info.Services.services:type_name -> payload.v1.Info.Service - 73, // [73:73] is the sub-list for method output_type - 73, // [73:73] is the sub-list for method input_type - 73, // [73:73] is the sub-list for extension type_name - 73, // [73:73] is the sub-list for extension extendee - 0, // [0:73] is the sub-list for field type_name + 49, // 44: payload.v1.Object.VectorRequest.id:type_name -> payload.v1.Object.ID + 25, // 45: payload.v1.Object.VectorRequest.filters:type_name -> payload.v1.Filter.Config + 47, // 46: payload.v1.Object.StreamDistance.distance:type_name -> payload.v1.Object.Distance + 88, // 47: payload.v1.Object.StreamDistance.status:type_name -> google.rpc.Status + 49, // 48: payload.v1.Object.GetTimestampRequest.id:type_name -> payload.v1.Object.ID + 51, // 49: payload.v1.Object.Vectors.vectors:type_name -> payload.v1.Object.Vector + 51, // 50: payload.v1.Object.StreamVector.vector:type_name -> payload.v1.Object.Vector + 88, // 51: payload.v1.Object.StreamVector.status:type_name -> google.rpc.Status + 57, // 52: payload.v1.Object.StreamBlob.blob:type_name -> payload.v1.Object.Blob + 88, // 53: payload.v1.Object.StreamBlob.status:type_name -> google.rpc.Status + 59, // 54: payload.v1.Object.StreamLocation.location:type_name -> payload.v1.Object.Location + 88, // 55: payload.v1.Object.StreamLocation.status:type_name -> google.rpc.Status + 59, // 56: payload.v1.Object.Locations.locations:type_name -> payload.v1.Object.Location + 51, // 57: payload.v1.Object.List.Response.vector:type_name -> payload.v1.Object.Vector + 88, // 58: payload.v1.Object.List.Response.status:type_name -> google.rpc.Status + 74, // 59: payload.v1.Info.Pod.cpu:type_name -> payload.v1.Info.CPU + 75, // 60: payload.v1.Info.Pod.memory:type_name -> payload.v1.Info.Memory + 69, // 61: payload.v1.Info.Pod.node:type_name -> payload.v1.Info.Node + 74, // 62: payload.v1.Info.Node.cpu:type_name -> payload.v1.Info.CPU + 75, // 63: payload.v1.Info.Node.memory:type_name -> payload.v1.Info.Memory + 76, // 64: payload.v1.Info.Node.Pods:type_name -> payload.v1.Info.Pods + 71, // 65: payload.v1.Info.Service.ports:type_name -> payload.v1.Info.ServicePort + 72, // 66: payload.v1.Info.Service.labels:type_name -> payload.v1.Info.Labels + 73, // 67: payload.v1.Info.Service.annotations:type_name -> payload.v1.Info.Annotations + 84, // 68: payload.v1.Info.Labels.labels:type_name -> payload.v1.Info.Labels.LabelsEntry + 85, // 69: payload.v1.Info.Annotations.annotations:type_name -> payload.v1.Info.Annotations.AnnotationsEntry + 68, // 70: payload.v1.Info.Pods.pods:type_name -> payload.v1.Info.Pod + 69, // 71: payload.v1.Info.Nodes.nodes:type_name -> payload.v1.Info.Node + 70, // 72: payload.v1.Info.Services.services:type_name -> payload.v1.Info.Service + 86, // 73: payload.v1.Mirror.Targets.targets:type_name -> payload.v1.Mirror.Target + 74, // [74:74] is the sub-list for method output_type + 74, // [74:74] is the sub-list for method input_type + 74, // [74:74] is the sub-list for extension type_name + 74, // [74:74] is the sub-list for extension extendee + 0, // [0:74] is the sub-list for field type_name } func init() { file_v1_payload_payload_proto_init() } @@ -5587,7 +5745,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { + switch v := v.(*Mirror); i { case 0: return &v.state case 1: @@ -5599,7 +5757,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Request); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -5611,7 +5769,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiRequest); i { + switch v := v.(*Search_Request); i { case 0: return &v.state case 1: @@ -5623,7 +5781,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_IDRequest); i { + switch v := v.(*Search_MultiRequest); i { case 0: return &v.state case 1: @@ -5635,7 +5793,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiIDRequest); i { + switch v := v.(*Search_IDRequest); i { case 0: return &v.state case 1: @@ -5647,7 +5805,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_ObjectRequest); i { + switch v := v.(*Search_MultiIDRequest); i { case 0: return &v.state case 1: @@ -5659,7 +5817,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_MultiObjectRequest); i { + switch v := v.(*Search_ObjectRequest); i { case 0: return &v.state case 1: @@ -5671,7 +5829,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Config); i { + switch v := v.(*Search_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5683,7 +5841,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Response); i { + switch v := v.(*Search_Config); i { case 0: return &v.state case 1: @@ -5695,7 +5853,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_Responses); i { + switch v := v.(*Search_Response); i { case 0: return &v.state case 1: @@ -5707,7 +5865,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Search_StreamResponse); i { + switch v := v.(*Search_Responses); i { case 0: return &v.state case 1: @@ -5719,7 +5877,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Target); i { + switch v := v.(*Search_StreamResponse); i { case 0: return &v.state case 1: @@ -5731,7 +5889,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter_Config); i { + switch v := v.(*Filter_Target); i { case 0: return &v.state case 1: @@ -5743,7 +5901,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Request); i { + switch v := v.(*Filter_Config); i { case 0: return &v.state case 1: @@ -5755,7 +5913,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiRequest); i { + switch v := v.(*Insert_Request); i { case 0: return &v.state case 1: @@ -5767,7 +5925,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_ObjectRequest); i { + switch v := v.(*Insert_MultiRequest); i { case 0: return &v.state case 1: @@ -5779,7 +5937,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_MultiObjectRequest); i { + switch v := v.(*Insert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5791,7 +5949,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Insert_Config); i { + switch v := v.(*Insert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5803,7 +5961,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Request); i { + switch v := v.(*Insert_Config); i { case 0: return &v.state case 1: @@ -5815,7 +5973,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiRequest); i { + switch v := v.(*Update_Request); i { case 0: return &v.state case 1: @@ -5827,7 +5985,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_ObjectRequest); i { + switch v := v.(*Update_MultiRequest); i { case 0: return &v.state case 1: @@ -5839,7 +5997,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_MultiObjectRequest); i { + switch v := v.(*Update_ObjectRequest); i { case 0: return &v.state case 1: @@ -5851,7 +6009,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Update_Config); i { + switch v := v.(*Update_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5863,7 +6021,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Request); i { + switch v := v.(*Update_Config); i { case 0: return &v.state case 1: @@ -5875,7 +6033,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiRequest); i { + switch v := v.(*Upsert_Request); i { case 0: return &v.state case 1: @@ -5887,7 +6045,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_ObjectRequest); i { + switch v := v.(*Upsert_MultiRequest); i { case 0: return &v.state case 1: @@ -5899,7 +6057,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_MultiObjectRequest); i { + switch v := v.(*Upsert_ObjectRequest); i { case 0: return &v.state case 1: @@ -5911,7 +6069,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Upsert_Config); i { + switch v := v.(*Upsert_MultiObjectRequest); i { case 0: return &v.state case 1: @@ -5923,7 +6081,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Request); i { + switch v := v.(*Upsert_Config); i { case 0: return &v.state case 1: @@ -5935,7 +6093,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_MultiRequest); i { + switch v := v.(*Remove_Request); i { case 0: return &v.state case 1: @@ -5947,7 +6105,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_TimestampRequest); i { + switch v := v.(*Remove_MultiRequest); i { case 0: return &v.state case 1: @@ -5959,7 +6117,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Timestamp); i { + switch v := v.(*Remove_TimestampRequest); i { case 0: return &v.state case 1: @@ -5971,7 +6129,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Remove_Config); i { + switch v := v.(*Remove_Timestamp); i { case 0: return &v.state case 1: @@ -5983,7 +6141,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_VectorRequest); i { + switch v := v.(*Remove_Config); i { case 0: return &v.state case 1: @@ -5995,7 +6153,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Distance); i { + switch v := v.(*Object_VectorRequest); i { case 0: return &v.state case 1: @@ -6007,7 +6165,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamDistance); i { + switch v := v.(*Object_Distance); i { case 0: return &v.state case 1: @@ -6019,7 +6177,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ID); i { + switch v := v.(*Object_StreamDistance); i { case 0: return &v.state case 1: @@ -6031,7 +6189,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_IDs); i { + switch v := v.(*Object_ID); i { case 0: return &v.state case 1: @@ -6043,7 +6201,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vector); i { + switch v := v.(*Object_IDs); i { case 0: return &v.state case 1: @@ -6055,7 +6213,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_GetTimestampRequest); i { + switch v := v.(*Object_Vector); i { case 0: return &v.state case 1: @@ -6067,7 +6225,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Timestamp); i { + switch v := v.(*Object_GetTimestampRequest); i { case 0: return &v.state case 1: @@ -6079,7 +6237,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Vectors); i { + switch v := v.(*Object_Timestamp); i { case 0: return &v.state case 1: @@ -6091,7 +6249,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamVector); i { + switch v := v.(*Object_Vectors); i { case 0: return &v.state case 1: @@ -6103,7 +6261,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_ReshapeVector); i { + switch v := v.(*Object_StreamVector); i { case 0: return &v.state case 1: @@ -6115,7 +6273,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Blob); i { + switch v := v.(*Object_ReshapeVector); i { case 0: return &v.state case 1: @@ -6127,7 +6285,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamBlob); i { + switch v := v.(*Object_Blob); i { case 0: return &v.state case 1: @@ -6139,7 +6297,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Location); i { + switch v := v.(*Object_StreamBlob); i { case 0: return &v.state case 1: @@ -6151,7 +6309,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_StreamLocation); i { + switch v := v.(*Object_Location); i { case 0: return &v.state case 1: @@ -6163,7 +6321,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_Locations); i { + switch v := v.(*Object_StreamLocation); i { case 0: return &v.state case 1: @@ -6175,7 +6333,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List); i { + switch v := v.(*Object_Locations); i { case 0: return &v.state case 1: @@ -6187,7 +6345,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Request); i { + switch v := v.(*Object_List); i { case 0: return &v.state case 1: @@ -6199,7 +6357,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object_List_Response); i { + switch v := v.(*Object_List_Request); i { case 0: return &v.state case 1: @@ -6211,7 +6369,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Control_CreateIndexRequest); i { + switch v := v.(*Object_List_Response); i { case 0: return &v.state case 1: @@ -6223,7 +6381,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Discoverer_Request); i { + switch v := v.(*Control_CreateIndexRequest); i { case 0: return &v.state case 1: @@ -6235,7 +6393,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index); i { + switch v := v.(*Discoverer_Request); i { case 0: return &v.state case 1: @@ -6247,7 +6405,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pod); i { + switch v := v.(*Info_Index); i { case 0: return &v.state case 1: @@ -6259,7 +6417,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Node); i { + switch v := v.(*Info_Pod); i { case 0: return &v.state case 1: @@ -6271,7 +6429,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Service); i { + switch v := v.(*Info_Node); i { case 0: return &v.state case 1: @@ -6283,7 +6441,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_ServicePort); i { + switch v := v.(*Info_Service); i { case 0: return &v.state case 1: @@ -6295,7 +6453,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Labels); i { + switch v := v.(*Info_ServicePort); i { case 0: return &v.state case 1: @@ -6307,7 +6465,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Annotations); i { + switch v := v.(*Info_Labels); i { case 0: return &v.state case 1: @@ -6319,7 +6477,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_CPU); i { + switch v := v.(*Info_Annotations); i { case 0: return &v.state case 1: @@ -6331,7 +6489,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Memory); i { + switch v := v.(*Info_CPU); i { case 0: return &v.state case 1: @@ -6343,7 +6501,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Pods); i { + switch v := v.(*Info_Memory); i { case 0: return &v.state case 1: @@ -6355,7 +6513,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Nodes); i { + switch v := v.(*Info_Pods); i { case 0: return &v.state case 1: @@ -6367,7 +6525,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Services); i { + switch v := v.(*Info_Nodes); i { case 0: return &v.state case 1: @@ -6379,7 +6537,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_IPs); i { + switch v := v.(*Info_Services); i { case 0: return &v.state case 1: @@ -6391,7 +6549,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_Count); i { + switch v := v.(*Info_IPs); i { case 0: return &v.state case 1: @@ -6403,7 +6561,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID); i { + switch v := v.(*Info_Index_Count); i { case 0: return &v.state case 1: @@ -6415,7 +6573,7 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info_Index_UUID_Committed); i { + switch v := v.(*Info_Index_UUID); i { case 0: return &v.state case 1: @@ -6427,6 +6585,18 @@ func file_v1_payload_payload_proto_init() { } } file_v1_payload_payload_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info_Index_UUID_Committed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_payload_payload_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Info_Index_UUID_Uncommitted); i { case 0: return &v.state @@ -6438,28 +6608,52 @@ func file_v1_payload_payload_proto_init() { return nil } } + file_v1_payload_payload_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Target); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_payload_payload_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mirror_Targets); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } - file_v1_payload_payload_proto_msgTypes[20].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[21].OneofWrappers = []interface{}{ (*Search_StreamResponse_Response)(nil), (*Search_StreamResponse_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[45].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[46].OneofWrappers = []interface{}{ (*Object_StreamDistance_Distance)(nil), (*Object_StreamDistance_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[52].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[53].OneofWrappers = []interface{}{ (*Object_StreamVector_Vector)(nil), (*Object_StreamVector_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[55].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[56].OneofWrappers = []interface{}{ (*Object_StreamBlob_Blob)(nil), (*Object_StreamBlob_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[57].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[58].OneofWrappers = []interface{}{ (*Object_StreamLocation_Location)(nil), (*Object_StreamLocation_Status)(nil), } - file_v1_payload_payload_proto_msgTypes[61].OneofWrappers = []interface{}{ + file_v1_payload_payload_proto_msgTypes[62].OneofWrappers = []interface{}{ (*Object_List_Response_Vector)(nil), (*Object_List_Response_Status)(nil), } @@ -6469,7 +6663,7 @@ func file_v1_payload_payload_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_v1_payload_payload_proto_rawDesc, NumEnums: 2, - NumMessages: 83, + NumMessages: 86, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 09aea31294..0996616de2 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -1140,7 +1140,12 @@ func (s *server) handleInsert(ctx context.Context, req *payload.Insert_Request) return loc, nil } -func (s *server) handleInsertResult(ctx context.Context, alreadyExistsTgts []string, req *payload.Update_Request, result *sync.Map[string, *errorState]) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 +func (s *server) handleInsertResult( + ctx context.Context, + alreadyExistsTgts []string, + req *payload.Update_Request, + result *sync.Map[string, *errorState], +) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleInsertResult"), apiName+"/handleInsertResult") defer func() { if span != nil { @@ -1683,7 +1688,12 @@ func (s *server) handleUpdate(ctx context.Context, req *payload.Update_Request) return loc, nil } -func (s *server) handleUpdateResult(ctx context.Context, notFoundTgts []string, req *payload.Insert_Request, result *sync.Map[string, *errorState]) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 +func (s *server) handleUpdateResult( + ctx context.Context, + notFoundTgts []string, + req *payload.Insert_Request, + result *sync.Map[string, *errorState], +) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpdateResult"), apiName+"/handleUpdateResult") defer func() { if span != nil { From 62326006d0abc37fadfc8ee06aae98804226880f Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 21 Dec 2023 15:27:46 +0900 Subject: [PATCH 81/93] fix: apply feedback for comment Signed-off-by: hlts2 --- internal/k8s/reconciler.go | 4 ++-- internal/k8s/vald/mirror/target/target.go | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/internal/k8s/reconciler.go b/internal/k8s/reconciler.go index cdbed01edd..21b3093a78 100644 --- a/internal/k8s/reconciler.go +++ b/internal/k8s/reconciler.go @@ -25,7 +25,7 @@ import ( "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/safety" "github.com/vdaas/vald/internal/sync/errgroup" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" @@ -42,7 +42,7 @@ type Controller interface { GetManager() Manager } -var Now = v1.Now +var Now = metav1.Now type ResourceController interface { GetName() string diff --git a/internal/k8s/vald/mirror/target/target.go b/internal/k8s/vald/mirror/target/target.go index 58846900e6..17c7164196 100644 --- a/internal/k8s/vald/mirror/target/target.go +++ b/internal/k8s/vald/mirror/target/target.go @@ -44,6 +44,11 @@ const ( MirrorTargetPhaseUnknown = mirrv1.MirrorTargetUnknown ) +const ( + reconcileRequeueDurationForInvalidError = 100 * time.Millisecond + reconcileRequeueDurationForNotFoundError = time.Second +) + type reconciler struct { mgr manager.Manager name string @@ -86,17 +91,18 @@ func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res re ml := &mirrv1.ValdMirrorTargetList{} err = r.mgr.GetClient().List(ctx, ml, r.lopts...) if err != nil { - r.onError(err) + if r.onError != nil { + r.onError(err) + } if apierr.IsNotFound(err) { - log.Errorf("not found: %s", err) return reconcile.Result{ Requeue: true, - RequeueAfter: time.Second, + RequeueAfter: reconcileRequeueDurationForNotFoundError, }, nil } return reconcile.Result{ Requeue: true, - RequeueAfter: 100 * time.Millisecond, + RequeueAfter: reconcileRequeueDurationForInvalidError, }, err } tm := make(map[string]Target) From 596d4cbf0d840c814fe615a949b91c8c75892a90 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Dec 2023 11:22:36 +0900 Subject: [PATCH 82/93] feat: add internal hash package to generate hash value Signed-off-by: hlts2 --- internal/hash/hash.go | 24 ++++++ internal/hash/hash_test.go | 105 ++++++++++++++++++++++++ pkg/gateway/mirror/service/discovery.go | 4 +- 3 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 internal/hash/hash.go create mode 100644 internal/hash/hash_test.go diff --git a/internal/hash/hash.go b/internal/hash/hash.go new file mode 100644 index 0000000000..9b5e3254e7 --- /dev/null +++ b/internal/hash/hash.go @@ -0,0 +1,24 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package info provides hash functionality +package hash + +import "github.com/zeebo/xxh3" + +// String returns the hash of the string. +func String(s string) uint64 { + return xxh3.HashString(s) +} diff --git a/internal/hash/hash_test.go b/internal/hash/hash_test.go new file mode 100644 index 0000000000..85c29c03b6 --- /dev/null +++ b/internal/hash/hash_test.go @@ -0,0 +1,105 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Package info provides hash functionality +package hash + +// NOT IMPLEMENTED BELOW + +// func TestString(t *testing.T) { +// type args struct { +// s string +// } +// type want struct { +// want uint64 +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want, uint64) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got uint64) error { +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// s:"", +// }, +// 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 { +// s:"", +// }, +// 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 +// } +// +// got := String(test.args.s) +// if err := checkFunc(test.want, got); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 86d99c6262..1b4009a231 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -22,6 +22,7 @@ import ( "github.com/vdaas/vald/apis/grpc/v1/payload" "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/hash" "github.com/vdaas/vald/internal/k8s" k8sclient "github.com/vdaas/vald/internal/k8s/client" "github.com/vdaas/vald/internal/k8s/vald/mirror/target" @@ -29,7 +30,6 @@ import ( "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/strings" "github.com/vdaas/vald/internal/sync/errgroup" - "github.com/zeebo/xxh3" ) const ( @@ -253,7 +253,7 @@ func (d *discovery) syncWithAddr(ctx context.Context, current map[string]target. log.Error(err) return true } - name := resourcePrefix + "-" + strconv.FormatUint(xxh3.HashString(d.selfMirrAddrStr+addr), 10) + name := resourcePrefix + "-" + strconv.FormatUint(hash.String(d.selfMirrAddrStr+addr), 10) errs = errors.Join(errs, d.createMirrorTargetResource(ctx, name, host, int(port))) } return true From 2491ec9de59697f5a52c87379dffaa9db5c3f683 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Dec 2023 11:59:17 +0900 Subject: [PATCH 83/93] fix: ignore deepsource warning Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 0996616de2..0ca047b59a 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -1140,12 +1140,12 @@ func (s *server) handleInsert(ctx context.Context, req *payload.Insert_Request) return loc, nil } -func (s *server) handleInsertResult( +func (s *server) handleInsertResult( // skipcq: GO-R1005 ctx context.Context, alreadyExistsTgts []string, req *payload.Update_Request, result *sync.Map[string, *errorState], -) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 +) (loc *payload.Object_Location, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleInsertResult"), apiName+"/handleInsertResult") defer func() { if span != nil { @@ -1688,12 +1688,12 @@ func (s *server) handleUpdate(ctx context.Context, req *payload.Update_Request) return loc, nil } -func (s *server) handleUpdateResult( +func (s *server) handleUpdateResult( // skipcq: GO-R1005 ctx context.Context, notFoundTgts []string, req *payload.Insert_Request, result *sync.Map[string, *errorState], -) (loc *payload.Object_Location, err error) { // skipcq: GO-R1005 +) (loc *payload.Object_Location, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, "handleUpdateResult"), apiName+"/handleUpdateResult") defer func() { if span != nil { From 06793626ca44b0d74f8f03b04b9ba231d2048161 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 26 Dec 2023 16:35:23 +0900 Subject: [PATCH 84/93] feat: add function and method comment Signed-off-by: hlts2 --- pkg/gateway/mirror/handler/grpc/handler.go | 82 +++++++++++++++++++-- pkg/gateway/mirror/handler/rest/handler.go | 66 +++++++++++++++++ pkg/gateway/mirror/service/gateway.go | 2 +- pkg/gateway/mirror/service/mirror.go | 8 +- pkg/gateway/mirror/service/mirror_option.go | 2 +- 5 files changed, 147 insertions(+), 13 deletions(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 0ca047b59a..9666d978c8 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -37,9 +37,9 @@ import ( type server struct { eg errgroup.Group - gateway service.Gateway // Mirror Gateway client service. + gateway service.Gateway // Mirror gateway client service. mirror service.Mirror - vAddr string // Vald Gateway address (lb-gateway). + vAddr string // Vald gateway address (LB gateway). streamConcurrency int name string ip string @@ -48,6 +48,7 @@ type server struct { const apiName = "vald/gateway/mirror" +// New returns a Vald server as as gRPC handler with mirror using the provided options. func New(opts ...Option) (vald.ServerWithMirror, error) { s := new(server) for _, opt := range append(defaultOptions, opts...) { @@ -64,6 +65,9 @@ func New(opts ...Option) (vald.ServerWithMirror, error) { return s, nil } +// Register handles the registration of mirror targets. +// The function connects to the mirror using the provided targets, and if successful, +// returns the addresses of connected Mirror gateways. func (s *server) Register(ctx context.Context, req *payload.Mirror_Targets) (*payload.Mirror_Targets, error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.MirrorRPCServiceName+"/"+vald.RegisterRPCName), apiName+"/"+vald.RegisterRPCName) defer func() { @@ -152,6 +156,7 @@ func (s *server) Register(ctx context.Context, req *payload.Mirror_Targets) (*pa }, nil } +// Exists bypasses the incoming Exist request to Vald gateway (LB gateway) in its own cluster. func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *payload.Object_ID, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.ExistsRPCName), apiName+"/"+vald.ExistsRPCName) defer func() { @@ -216,6 +221,7 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo return id, nil } +// Search bypasses the incoming Search request to Vald gateway (LB gateway) in its own cluster. func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.SearchRPCName), apiName+"/"+vald.SearchRPCName) defer func() { @@ -281,6 +287,7 @@ func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res * return res, nil } +// SearchByID bypasses the incoming SearchByID request to Vald gateway (LB gateway) in its own cluster. func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) ( res *payload.Search_Response, err error, ) { @@ -348,6 +355,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) return res, nil } +// StreamSearch bypasses it as a Search request to Vald gateway (LB gateway) in its own cluster. func (s *server) StreamSearch(stream vald.Search_StreamSearchServer) (err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamSearchRPCName), apiName+"/"+vald.StreamSearchRPCName) defer func() { @@ -397,6 +405,7 @@ func (s *server) StreamSearch(stream vald.Search_StreamSearchServer) (err error) return nil } +// StreamSearchByID bypasses it as a SearchByID request to Vald gateway (LB gateway) in its own cluster. func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamSearchByIDRPCName), apiName+"/"+vald.StreamSearchByIDRPCName) defer func() { @@ -446,6 +455,7 @@ func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (er return nil } +// MultiSearch bypasses the incoming MultiSearch request to Vald gateway (LB gateway) in its own cluster. func (s *server) MultiSearch(ctx context.Context, req *payload.Search_MultiRequest) (res *payload.Search_Responses, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiSearchRPCName), apiName+"/"+vald.MultiSearchRPCName) defer func() { @@ -510,6 +520,7 @@ func (s *server) MultiSearch(ctx context.Context, req *payload.Search_MultiReque return res, nil } +// MultiSearchByID bypasses the incoming MultiSearchByID request to Vald gateway (LB gateway) in its own cluster. func (s *server) MultiSearchByID(ctx context.Context, req *payload.Search_MultiIDRequest) (res *payload.Search_Responses, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiSearchByIDRPCName), apiName+"/"+vald.MultiSearchByIDRPCName) defer func() { @@ -574,6 +585,7 @@ func (s *server) MultiSearchByID(ctx context.Context, req *payload.Search_MultiI return res, nil } +// LinearSearch bypasses the incoming LinearSearch request to Vald gateway (LB gateway) in its own cluster. func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.LinearSearchRPCName), apiName+"/"+vald.LinearSearchRPCName) defer func() { @@ -639,6 +651,7 @@ func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) return res, nil } +// LinearSearchByID bypasses the incoming LinearSearchByID request to Vald gateway (LB gateway) in its own cluster. func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDRequest) ( res *payload.Search_Response, err error, ) { @@ -706,6 +719,7 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq return res, nil } +// StreamLinearSearch bypasses it as a LinearSearch request to Vald gateway (LB gateway) in its own cluster. func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer) (err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamLinearSearchRPCName), apiName+"/"+vald.StreamLinearSearchRPCName) defer func() { @@ -755,6 +769,7 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer) return nil } +// StreamLinearSearchByID bypasses it as a LinearSearchByID request to Vald gateway (LB gateway) in its own cluster. func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByIDServer) (err error) { ctx, span := trace.StartSpan( grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.StreamLinearSearchByIDRPCName), @@ -807,6 +822,7 @@ func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByI return nil } +// MultiLinearSearch bypasses the incoming MultiLinearSearch request to Vald gateway (LB gateway) in its own cluster. func (s *server) MultiLinearSearch(ctx context.Context, req *payload.Search_MultiRequest) (res *payload.Search_Responses, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiLinearSearchRPCName), apiName+"/"+vald.MultiLinearSearchRPCName) defer func() { @@ -871,6 +887,7 @@ func (s *server) MultiLinearSearch(ctx context.Context, req *payload.Search_Mult return res, nil } +// MultiLinearSearchByID bypasses the incoming MultiLinearSearchByID request to Vald gateway (LB gateway) in its own cluster. func (s *server) MultiLinearSearchByID(ctx context.Context, req *payload.Search_MultiIDRequest) (res *payload.Search_Responses, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.SearchRPCServiceName+"/"+vald.MultiLinearSearchByIDRPCName), apiName+"/"+vald.MultiLinearSearchByIDRPCName) defer func() { @@ -935,6 +952,10 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, req *payload.Search_ return res, nil } +// Insert handles the insertion of an object with the given request. +// If the request is proxied from another Mirror gateway, the request is forwarded to the Vald gateway (LB gateway) of its own cluster. +// If the request is from a user, it is sent to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. +// The result is a location of the inserted object. func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc *payload.Object_Location, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.InsertRPCName), apiName+"/"+vald.InsertRPCName) defer func() { @@ -943,7 +964,7 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc * } }() - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. + // If this condition is matched, it means that the request was proxied from another Mirror gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if s.isProxied(ctx) { loc, err = s.doInsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { @@ -1352,6 +1373,10 @@ func (s *server) doInsert(ctx context.Context, req *payload.Insert_Request, f fu return loc, nil } +// StreamInsert handles bidirectional streaming for inserting objects. +// It wraps the bidirectional stream logic for the Insert RPC method. +// For each incoming request in the bidirectional stream, it calls the Insert function. +// The response is then sent back through the stream with the corresponding status or location information. func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.StreamInsertRPCName), apiName+"/"+vald.StreamInsertRPCName) defer func() { @@ -1400,6 +1425,9 @@ func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error) return nil } +// MultiInsert handles the insertion of multiple objects with the given requests. +// For each request in parallel, it calls the Insert function to insert an object. +// If an error occurs during any of the insertions, it accumulates the errors and returns them along with the successfully inserted locations. func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequest) (res *payload.Object_Locations, errs error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.InsertRPCServiceName+"/"+vald.MultiInsertRPCName), apiName+"/"+vald.MultiInsertRPCName) defer func() { @@ -1468,6 +1496,10 @@ func (s *server) MultiInsert(ctx context.Context, reqs *payload.Insert_MultiRequ return res, nil } +// Update handles the update of an object with the given request. +// If the request is proxied from another Mirror gateway, it sends the request only to the Vald gateway (LB gateway) of its own cluster. +// If the request is from a user, it sends requests to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. +// The result is a location of the updated object. func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc *payload.Object_Location, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.UpdateRPCName), apiName+"/"+vald.UpdateRPCName) defer func() { @@ -1476,7 +1508,7 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc * } }() - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. + // If this condition is matched, it means that the request was proxied from another Mirror gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if s.isProxied(ctx) { loc, err = s.doUpdate(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { @@ -1915,6 +1947,10 @@ func (s *server) doUpdate(ctx context.Context, req *payload.Update_Request, f fu return loc, nil } +// StreamUpdate handles bidirectional streaming for updating objects. +// It wraps the bidirectional stream logic for the Update RPC method. +// For each incoming request in the bidirectional stream, it calls the Update function. +// The response is then sent back through the stream with the corresponding status or location information. func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.StreamUpdateRPCName), apiName+"/"+vald.StreamUpdateRPCName) defer func() { @@ -1963,6 +1999,9 @@ func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error) return nil } +// MultiUpdate handles the update of multiple objects with the given requests. +// For each request in parallel, it calls the Update function to update an object. +// If an error occurs during any of the insertions, it accumulates the errors and returns them along with the successfully updated locations. func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequest) (res *payload.Object_Locations, errs error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpdateRPCServiceName+"/"+vald.MultiUpdateRPCName), apiName+"/"+vald.MultiUpdateRPCName) defer func() { @@ -2031,6 +2070,10 @@ func (s *server) MultiUpdate(ctx context.Context, reqs *payload.Update_MultiRequ return res, nil } +// Upsert handles the upsert of an object with the given request. +// If the request is proxied from another Mirror gateway, the request is forwarded to the Vald gateway (LB gateway) of its own cluster. +// If the request is from a user, it is sent to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. +// The result is a location of the upserted object. func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.UpsertRPCName), apiName+"/"+vald.UpsertRPCName) defer func() { @@ -2039,7 +2082,7 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * } }() - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. + // If this condition is matched, it means that the request was proxied from another Mirror gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if s.isProxied(ctx) { loc, err = s.doUpsert(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { @@ -2284,6 +2327,10 @@ func (s *server) doUpsert(ctx context.Context, req *payload.Upsert_Request, f fu return loc, nil } +// StreamUpsert handles bidirectional streaming for upserting objects. +// It wraps the bidirectional stream logic for the Upsert RPC method. +// For each incoming request in the bidirectional stream, it calls the Upsert function. +// The response is then sent back through the stream with the corresponding status or location information. func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.StreamUpsertRPCName), apiName+"/"+vald.StreamUpsertRPCName) defer func() { @@ -2332,6 +2379,9 @@ func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error) return nil } +// MultiUpsert handles the upsert of multiple objects with the given requests. +// For each request in parallel, it calls the Upsert function to upsert an object. +// If an error occurs during any of the insertions, it accumulates the errors and returns them along with the successfully upserted locations. func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequest) (res *payload.Object_Locations, errs error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.UpsertRPCServiceName+"/"+vald.MultiUpsertRPCName), apiName+"/"+vald.MultiUpsertRPCName) defer func() { @@ -2400,6 +2450,10 @@ func (s *server) MultiUpsert(ctx context.Context, reqs *payload.Upsert_MultiRequ return res, nil } +// Remove handles the remove of an object with the given request. +// If the request is proxied from another Mirror gateway, the request is forwarded to the Vald gateway (LB gateway) of its own cluster. +// If the request is from a user, it is sent to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. +// The result is a location of the removed object. func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc *payload.Object_Location, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.RemoveRPCName), apiName+"/"+vald.RemoveRPCName) defer func() { @@ -2408,7 +2462,7 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (loc * } }() - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. + // If this condition is matched, it means that the request was proxied from another Mirror gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if s.isProxied(ctx) { loc, err = s.doRemove(ctx, req, func(ctx context.Context) (*payload.Object_Location, error) { @@ -2648,6 +2702,10 @@ func (s *server) doRemove(ctx context.Context, req *payload.Remove_Request, f fu return loc, nil } +// StreamRemove handles bidirectional streaming for removing objects. +// It wraps the bidirectional stream logic for the Remove RPC method. +// For each incoming request in the bidirectional stream, it calls the Remove function. +// The response is then sent back through the stream with the corresponding status or location information. func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.StreamRemoveRPCName), apiName+"/"+vald.StreamRemoveRPCName) defer func() { @@ -2696,6 +2754,9 @@ func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error) return nil } +// MultiRemove handles the remove of multiple objects with the given requests. +// For each request in parallel, it calls the Remove function to insert an object. +// If an error occurs during any of the insertions, it accumulates the errors and returns them along with the successfully removed locations. func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequest) (res *payload.Object_Locations, errs error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.MultiRemoveRPCName), apiName+"/"+vald.MultiRemoveRPCName) defer func() { @@ -2764,6 +2825,10 @@ func (s *server) MultiRemove(ctx context.Context, reqs *payload.Remove_MultiRequ return res, nil } +// RemoveByTimestamp handles the remove of an object with the given request. +// If the request is proxied from another Mirror gateway, the request is forwarded to the Vald gateway (LB gateway) of its own cluster. +// If the request is from a user, it is sent to other Mirror gateways and the Vald gateway (LB gateway) of its own cluster. +// The result is a location of the removed object. func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_TimestampRequest) (locs *payload.Object_Locations, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.RemoveRPCServiceName+"/"+vald.RemoveByTimestampRPCName), apiName+"/"+vald.RemoveByTimestampRPCName) defer func() { @@ -2772,7 +2837,7 @@ func (s *server) RemoveByTimestamp(ctx context.Context, req *payload.Remove_Time } }() - // If this condition is matched, it means that the request was proxied from another Mirror Gateway. + // If this condition is matched, it means that the request was proxied from another Mirror gateway. // So this component sends requests only to the Vald gateway (LB gateway) of its own cluster. if s.isProxied(ctx) { locs, err = s.doRemoveByTimestamp(ctx, req, func(ctx context.Context) (*payload.Object_Locations, error) { @@ -3011,6 +3076,7 @@ func (s *server) doRemoveByTimestamp( return locs, nil } +// GetObject bypasses the incoming GetObject request to Vald LB gateway in its own cluster. func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorRequest) (vec *payload.Object_Vector, err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.GetObjectRPCName), apiName+"/"+vald.GetObjectRPCName) defer func() { @@ -3076,6 +3142,7 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques return vec, nil } +// StreamGetObject bypasses it as a GetObject request to the Vald LB gateway in its own cluster. func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err error) { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.StreamGetObjectRPCName), apiName+"/"+vald.StreamGetObjectRPCName) defer func() { @@ -3124,6 +3191,7 @@ func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err return nil } +// StreamListObject bypasses it as a StreamListObject request to the Vald gateway (LB gateway) in its own cluster. func (s *server) StreamListObject(req *payload.Object_List_Request, stream vald.Object_StreamListObjectServer) error { ctx, span := trace.StartSpan(grpc.WithGRPCMethod(stream.Context(), vald.PackageName+"."+vald.ObjectRPCServiceName+"/"+vald.StreamListObjectRPCName), apiName+"/"+vald.StreamListObjectRPCName) defer func() { diff --git a/pkg/gateway/mirror/handler/rest/handler.go b/pkg/gateway/mirror/handler/rest/handler.go index 4d32769d56..6134bf0124 100644 --- a/pkg/gateway/mirror/handler/rest/handler.go +++ b/pkg/gateway/mirror/handler/rest/handler.go @@ -22,6 +22,7 @@ import ( "github.com/vdaas/vald/internal/net/http/json" ) +// Handler represents an interface for rest handler. type Handler interface { Register(w http.ResponseWriter, r *http.Request) (int, error) Index(w http.ResponseWriter, r *http.Request) (int, error) @@ -50,6 +51,7 @@ type handler struct { vald vald.ServerWithMirror } +// New returns a Vald server as rest handler with mirror using the provided options. func New(opts ...Option) Handler { h := new(handler) @@ -59,6 +61,10 @@ func New(opts ...Option) Handler { return h } +// Register is an HTTP handler function that processes registration requests. +// It decodes the incoming JSON payload into a payload.Mirror_Targets struct, +// then invokes the vald.Register method to handle the registration logic. +// The response is written to the http.ResponseWriter. func (h *handler) Register(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Mirror_Targets return json.Handler(w, r, &req, func() (interface{}, error) { @@ -66,6 +72,9 @@ func (h *handler) Register(w http.ResponseWriter, r *http.Request) (code int, er }) } +// Index is an HTTP handler function that handles requests to the index endpoint. +// It returns an HTTP status code and an error. It creates a map to store data, +// then uses json.Handler to process the request, extract data, and log the request using dump.Request. func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { data := make(map[string]interface{}) return json.Handler(w, r, &data, func() (interface{}, error) { @@ -73,6 +82,9 @@ func (*handler) Index(w http.ResponseWriter, r *http.Request) (int, error) { }) } +// Search is an HTTP handler function that processes search requests. +// It decodes the incoming JSON payload into a payload.Search_Request struct, +// then invokes the vald.Search method to handle the search logic. func (h *handler) Search(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Search_Request return json.Handler(w, r, &req, func() (interface{}, error) { @@ -80,6 +92,9 @@ func (h *handler) Search(w http.ResponseWriter, r *http.Request) (code int, err }) } +// SearchByID is an HTTP handler function that processes search by ID requests. +// It decodes the incoming JSON payload into a payload.Search_IDRequest struct, +// then invokes the vald.SearchByID method to handle the search by ID logic. func (h *handler) SearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Search_IDRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -87,6 +102,9 @@ func (h *handler) SearchByID(w http.ResponseWriter, r *http.Request) (code int, }) } +// MultiSearch is an HTTP handler function that processes multi-search requests. +// It decodes the incoming JSON payload into a payload.Search_MultiRequest struct, +// then invokes the vald.MultiSearch method to handle the multi-search logic. func (h *handler) MultiSearch(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Search_MultiRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -94,6 +112,9 @@ func (h *handler) MultiSearch(w http.ResponseWriter, r *http.Request) (code int, }) } +// MultiSearchByID is an HTTP handler function that processes multi-search by ID requests. +// It decodes the incoming JSON payload into a payload.Search_MultiIDRequest struct, +// then invokes the vald.MultiSearchByID method to handle the multi-search by ID logic. func (h *handler) MultiSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Search_MultiIDRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -101,6 +122,9 @@ func (h *handler) MultiSearchByID(w http.ResponseWriter, r *http.Request) (code }) } +// LinearSearch is an HTTP handler function that processes linear search requests. +// It decodes the incoming JSON payload into a payload.Search_Request struct, +// then invokes the vald.LinearSearch method to handle the linear search logic. func (h *handler) LinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Search_Request return json.Handler(w, r, &req, func() (interface{}, error) { @@ -108,6 +132,9 @@ func (h *handler) LinearSearch(w http.ResponseWriter, r *http.Request) (code int }) } +// LinearSearchByID is an HTTP handler function that processes linear search by ID requests. +// It decodes the incoming JSON payload into a payload.Search_IDRequest struct, +// then invokes the vald.LinearSearchByID method to handle the linear search by ID logic. func (h *handler) LinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Search_IDRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -115,6 +142,9 @@ func (h *handler) LinearSearchByID(w http.ResponseWriter, r *http.Request) (code }) } +// MultiLinearSearch is an HTTP handler function that processes multi-linear search requests. +// It decodes the incoming JSON payload into a payload.Search_MultiRequest struct, +// then invokes the vald.MultiLinearSearch method to handle the multi-linear search logic. func (h *handler) MultiLinearSearch(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Search_MultiRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -122,6 +152,9 @@ func (h *handler) MultiLinearSearch(w http.ResponseWriter, r *http.Request) (cod }) } +// MultiLinearSearchByID is an HTTP handler function that processes multi-linear search by ID requests. +// It decodes the incoming JSON payload into a payload.Search_MultiIDRequest struct, +// then invokes the vald.MultiLinearSearchByID method to handle the multi-linear search by ID logic. func (h *handler) MultiLinearSearchByID(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Search_MultiIDRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -129,6 +162,9 @@ func (h *handler) MultiLinearSearchByID(w http.ResponseWriter, r *http.Request) }) } +// Insert is an HTTP handler function that processes insert requests. +// It decodes the incoming JSON payload into a payload.Insert_Request struct, +// then invokes the vald.Insert method to handle the insert logic. func (h *handler) Insert(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Insert_Request return json.Handler(w, r, &req, func() (interface{}, error) { @@ -136,6 +172,9 @@ func (h *handler) Insert(w http.ResponseWriter, r *http.Request) (code int, err }) } +// MultiInsert is an HTTP handler function that processes multi-insert requests. +// It decodes the incoming JSON payload into a payload.Insert_MultiRequest struct, +// then invokes the vald.MultiInsert method to handle the multi-insert logic. func (h *handler) MultiInsert(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Insert_MultiRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -143,6 +182,9 @@ func (h *handler) MultiInsert(w http.ResponseWriter, r *http.Request) (code int, }) } +// Update is an HTTP handler function that processes update requests. +// It decodes the incoming JSON payload into a payload.Update_Request struct, +// then invokes the vald.Update method to handle the update logic. func (h *handler) Update(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Update_Request return json.Handler(w, r, &req, func() (interface{}, error) { @@ -150,6 +192,9 @@ func (h *handler) Update(w http.ResponseWriter, r *http.Request) (code int, err }) } +// MultiUpdate is an HTTP handler function that processes multi-update requests. +// It decodes the incoming JSON payload into a payload.Update_MultiRequest struct, +// then invokes the vald.MultiUpdate method to handle the multi-update logic. func (h *handler) MultiUpdate(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Update_MultiRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -157,6 +202,9 @@ func (h *handler) MultiUpdate(w http.ResponseWriter, r *http.Request) (code int, }) } +// Upsert is an HTTP handler function that processes upsert requests. +// It decodes the incoming JSON payload into a payload.Upsert_Request struct, +// then invokes the vald.Upsert method to handle the upsert logic. func (h *handler) Upsert(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Upsert_Request return json.Handler(w, r, &req, func() (interface{}, error) { @@ -164,6 +212,9 @@ func (h *handler) Upsert(w http.ResponseWriter, r *http.Request) (code int, err }) } +// MultiUpsert is an HTTP handler function that processes multi-upsert requests. +// It decodes the incoming JSON payload into a payload.Upsert_MultiRequest struct, +// then invokes the vald.MultiUpsert method to handle the multi-upsert logic. func (h *handler) MultiUpsert(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Upsert_MultiRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -171,6 +222,9 @@ func (h *handler) MultiUpsert(w http.ResponseWriter, r *http.Request) (code int, }) } +// Remove is an HTTP handler function that processes remove requests. +// It decodes the incoming JSON payload into a payload.Remove_Request struct, +// then invokes the vald.Remove method to handle the remove logic. func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Remove_Request return json.Handler(w, r, &req, func() (interface{}, error) { @@ -178,6 +232,9 @@ func (h *handler) Remove(w http.ResponseWriter, r *http.Request) (code int, err }) } +// RemoveByTimestamp is an HTTP handler function that processes remove-by-timestamp requests. +// It decodes the incoming JSON payload into a payload.Remove_TimestampRequest struct, +// then invokes the vald.RemoveByTimestamp method to handle the remove-by-timestamp logic. func (h *handler) RemoveByTimestamp(w http.ResponseWriter, r *http.Request) (int, error) { var req *payload.Remove_TimestampRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -185,6 +242,9 @@ func (h *handler) RemoveByTimestamp(w http.ResponseWriter, r *http.Request) (int }) } +// MultiRemove is an HTTP handler function that processes multi-remove requests. +// It decodes the incoming JSON payload into a payload.Remove_MultiRequest struct, +// then invokes the vald.MultiRemove method to handle the multi-remove logic. func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Remove_MultiRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -192,6 +252,9 @@ func (h *handler) MultiRemove(w http.ResponseWriter, r *http.Request) (code int, }) } +// GetObject is an HTTP handler function that processes get-object requests. +// It decodes the incoming JSON payload into a payload.Object_VectorRequest struct, +// then invokes the vald.GetObject method to handle the get-object logic. func (h *handler) GetObject(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Object_VectorRequest return json.Handler(w, r, &req, func() (interface{}, error) { @@ -199,6 +262,9 @@ func (h *handler) GetObject(w http.ResponseWriter, r *http.Request) (code int, e }) } +// Exists is an HTTP handler function that processes exists requests. +// It decodes the incoming JSON payload into a payload.Object_ID struct, +// then invokes the vald.Exists method to handle the exists logic. func (h *handler) Exists(w http.ResponseWriter, r *http.Request) (code int, err error) { var req *payload.Object_ID return json.Handler(w, r, &req, func() (interface{}, error) { diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index d5bad4fe46..90067e9161 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -45,7 +45,7 @@ type Gateway interface { } type gateway struct { - // client is the Mirror Gateway client for other clusters and the Vald gateway (e.g. LB gateway) client for the own cluster. + // client is the Mirror gateway client for other clusters and the Vald gateway (e.g. LB gateway) client for the own cluster. client mirror.Client eg errgroup.Group podName string diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index cd35e13ee3..6cb9c29cb5 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -49,7 +49,7 @@ type mirr struct { addrl sync.Map[string, any] // List of all connected addresses selfMirrTgts []*payload.Mirror_Target // Targets of self mirror gateway selfMirrAddrl sync.Map[string, any] // List of self Mirror gateway addresses - gwAddrl sync.Map[string, any] // List of Vald Gateway addresses + gwAddrl sync.Map[string, any] // List of Vald gateway (LB gateway) addresses eg errgroup.Group registerDur time.Duration gateway Gateway @@ -283,7 +283,7 @@ func (m *mirr) registers(ctx context.Context, tgts *payload.Mirror_Targets) ([]* return resTgts, err } -// Connect establishes gRPC connections to the specified Mirror targets, excluding this gateway and the LB Gateway. +// Connect establishes gRPC connections to the specified Mirror targets, excluding this gateway and the Vald gateway (LB gateway). func (m *mirr) Connect(ctx context.Context, targets ...*payload.Mirror_Target) error { ctx, span := trace.StartSpan(ctx, "vald/gateway/mirror/service/Mirror.Connect") defer func() { @@ -343,7 +343,7 @@ func (m *mirr) IsConnected(ctx context.Context, addr string) bool { return m.gateway.GRPCClient().IsConnected(ctx, addr) } -// MirrorTargets returns the Mirror targets, including the address of this gateway and the addresses of other Mirror Gateways +// MirrorTargets returns the Mirror targets, including the address of this gateway and the addresses of other Mirror gateways // to which this gateway is currently connected. func (m *mirr) MirrorTargets(ctx context.Context) (tgts []*payload.Mirror_Target, err error) { tgts = make([]*payload.Mirror_Target, 0, m.addrl.Len()) @@ -380,7 +380,7 @@ func (m *mirr) isGatewayAddr(addr string) bool { return ok } -// connectedOtherMirrorAddrs returns the addresses of other Mirror Gateways to which this gateway is currently connected. +// connectedOtherMirrorAddrs returns the addresses of other Mirror gateways to which this gateway is currently connected. func (m *mirr) connectedOtherMirrorAddrs(ctx context.Context) (addrs []string) { m.RangeMirrorAddr(func(addr string, _ any) bool { if m.IsConnected(ctx, addr) { diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go index 5342773f03..e23db56aa1 100644 --- a/pkg/gateway/mirror/service/mirror_option.go +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -50,7 +50,7 @@ func WithGatewayAddrs(addrs ...string) MirrorOption { } } -// WithSelfMirrorAddrs returns the option to set the self Mirror Gateway addresses. +// WithSelfMirrorAddrs returns the option to set the self Mirror gateway addresses. func WithSelfMirrorAddrs(addrs ...string) MirrorOption { return func(m *mirr) error { if len(addrs) == 0 { From d69dddba119a71217de8227b0bb4067ee3898723 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Tue, 26 Dec 2023 16:40:20 +0900 Subject: [PATCH 85/93] Update pkg/gateway/mirror/handler/grpc/handler.go --- pkg/gateway/mirror/handler/grpc/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 9666d978c8..86c7d9ad46 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -48,7 +48,7 @@ type server struct { const apiName = "vald/gateway/mirror" -// New returns a Vald server as as gRPC handler with mirror using the provided options. +// New returns a Vald server as gRPC handler with mirror using the provided options. func New(opts ...Option) (vald.ServerWithMirror, error) { s := new(server) for _, opt := range append(defaultOptions, opts...) { From e7a6ab9c0084e0ede1e68ea9cf8bb392ffd3f773 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 9 Jan 2024 11:00:19 +0900 Subject: [PATCH 86/93] fix: schema and proto update and format Signed-off-by: hlts2 --- .github/helm/values/vald-mirror-target.yaml | 2 +- .github/helm/values/values-mirror-01.yaml | 2 +- .github/helm/values/values-mirror-02.yaml | 2 +- .../dockers-gateway-mirror-image.yaml | 2 +- apis/grpc/v1/agent/core/agent.pb.go | 2 +- apis/grpc/v1/agent/sidecar/sidecar.pb.go | 2 +- apis/grpc/v1/discoverer/discoverer.pb.go | 2 +- .../grpc/v1/filter/egress/egress_filter.pb.go | 2 +- .../v1/filter/ingress/ingress_filter.pb.go | 2 +- .../grpc/v1/manager/index/index_manager.pb.go | 2 +- apis/grpc/v1/mirror/mirror.pb.go | 4 +- apis/grpc/v1/mirror/mirror_vtproto.pb.go | 2 +- apis/grpc/v1/payload/payload.pb.go | 2 +- .../v1/rpc/errdetails/error_details.pb.go | 2 +- apis/grpc/v1/vald/filter.pb.go | 2 +- apis/grpc/v1/vald/insert.pb.go | 2 +- apis/grpc/v1/vald/object.pb.go | 2 +- apis/grpc/v1/vald/remove.pb.go | 2 +- apis/grpc/v1/vald/search.pb.go | 2 +- apis/grpc/v1/vald/update.pb.go | 2 +- apis/grpc/v1/vald/upsert.pb.go | 2 +- apis/proto/v1/mirror/mirror.proto | 2 +- .../v1/discoverer/discoverer.swagger.json | 92 +++++++++---------- charts/vald/crds/valdmirrortarget.yaml | 2 +- charts/vald/schemas/mirror-target-values.yaml | 2 +- .../templates/gateway/mirror/clusterrole.yaml | 2 +- .../gateway/mirror/clusterrolebinding.yaml | 2 +- .../templates/gateway/mirror/configmap.yaml | 2 +- .../templates/gateway/mirror/daemonset.yaml | 2 +- .../templates/gateway/mirror/deployment.yaml | 2 +- charts/vald/templates/gateway/mirror/hpa.yaml | 2 +- charts/vald/templates/gateway/mirror/ing.yaml | 2 +- .../gateway/mirror/networkpolicy.yaml | 2 +- charts/vald/templates/gateway/mirror/pdb.yaml | 2 +- .../gateway/mirror/priorityclass.yaml | 2 +- .../gateway/mirror/serviceaccount.yaml | 2 +- charts/vald/templates/gateway/mirror/svc.yaml | 2 +- .../vald/values/multi-vald/dev-vald-01.yaml | 2 +- .../vald/values/multi-vald/dev-vald-02.yaml | 2 +- .../vald/values/multi-vald/dev-vald-03.yaml | 2 +- .../multi-vald/dev-vald-with-mirror.yaml | 2 +- .../vald/values/multi-vald/mirror-target.yaml | 2 +- cmd/gateway/mirror/main.go | 2 +- cmd/gateway/mirror/sample.yaml | 2 +- dockers/gateway/mirror/Dockerfile | 2 +- example/client/mirror/main.go | 2 +- internal/client/v1/client/mirror/mirror.go | 2 +- internal/client/v1/client/mirror/option.go | 2 +- internal/config/mirror.go | 2 +- internal/hash/hash.go | 5 +- internal/hash/hash_test.go | 5 +- .../k8s/vald/mirror/api/v1/target_types.go | 2 +- internal/k8s/vald/mirror/target/option.go | 2 +- internal/k8s/vald/mirror/target/target.go | 2 +- .../k8s/vald/mirror/target/target_template.go | 2 +- .../mirror/target/target_template_option.go | 2 +- internal/net/grpc/metadata.go | 2 +- .../metrics/gateway/mirror/mirror.go | 2 +- .../test/mock/client/mirror_client_mock.go | 2 +- internal/test/mock/k8s/controller_runtime.go | 2 +- internal/test/mock/k8s/reconciler.go | 2 +- pkg/gateway/mirror/config/config.go | 2 +- pkg/gateway/mirror/handler/doc.go | 2 +- pkg/gateway/mirror/handler/grpc/handler.go | 2 +- .../mirror/handler/grpc/handler_test.go | 2 +- pkg/gateway/mirror/handler/grpc/mock_test.go | 2 +- pkg/gateway/mirror/handler/grpc/option.go | 2 +- pkg/gateway/mirror/handler/rest/handler.go | 2 +- pkg/gateway/mirror/handler/rest/option.go | 2 +- pkg/gateway/mirror/router/option.go | 2 +- pkg/gateway/mirror/router/router.go | 2 +- pkg/gateway/mirror/service/discovery.go | 2 +- .../mirror/service/discovery_option.go | 2 +- pkg/gateway/mirror/service/discovery_test.go | 2 +- pkg/gateway/mirror/service/doc.go | 2 +- pkg/gateway/mirror/service/gateway.go | 2 +- .../mirror/service/gateway_mock_test.go | 2 +- pkg/gateway/mirror/service/mirror.go | 2 +- .../mirror/service/mirror_mock_test.go | 2 +- pkg/gateway/mirror/service/mirror_option.go | 2 +- pkg/gateway/mirror/service/mirror_test.go | 2 +- pkg/gateway/mirror/service/option.go | 2 +- pkg/gateway/mirror/usecase/vald.go | 2 +- 83 files changed, 133 insertions(+), 131 deletions(-) diff --git a/.github/helm/values/vald-mirror-target.yaml b/.github/helm/values/vald-mirror-target.yaml index fdd2ef9c0e..48f24eaaac 100644 --- a/.github/helm/values/vald-mirror-target.yaml +++ b/.github/helm/values/vald-mirror-target.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/.github/helm/values/values-mirror-01.yaml b/.github/helm/values/values-mirror-01.yaml index 75eb71f435..69a336cd58 100644 --- a/.github/helm/values/values-mirror-01.yaml +++ b/.github/helm/values/values-mirror-01.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/.github/helm/values/values-mirror-02.yaml b/.github/helm/values/values-mirror-02.yaml index 79dc479e88..29b0990b09 100644 --- a/.github/helm/values/values-mirror-02.yaml +++ b/.github/helm/values/values-mirror-02.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/.github/workflows/dockers-gateway-mirror-image.yaml b/.github/workflows/dockers-gateway-mirror-image.yaml index dbb6743b27..e3e137e3e8 100644 --- a/.github/workflows/dockers-gateway-mirror-image.yaml +++ b/.github/workflows/dockers-gateway-mirror-image.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/apis/grpc/v1/agent/core/agent.pb.go b/apis/grpc/v1/agent/core/agent.pb.go index ce90f86ffa..3541c8b8f0 100644 --- a/apis/grpc/v1/agent/core/agent.pb.go +++ b/apis/grpc/v1/agent/core/agent.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/agent/core/agent.proto diff --git a/apis/grpc/v1/agent/sidecar/sidecar.pb.go b/apis/grpc/v1/agent/sidecar/sidecar.pb.go index 421f6a8a55..b6b3ad1053 100644 --- a/apis/grpc/v1/agent/sidecar/sidecar.pb.go +++ b/apis/grpc/v1/agent/sidecar/sidecar.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/agent/sidecar/sidecar.proto diff --git a/apis/grpc/v1/discoverer/discoverer.pb.go b/apis/grpc/v1/discoverer/discoverer.pb.go index 851f665368..fe6cc80593 100644 --- a/apis/grpc/v1/discoverer/discoverer.pb.go +++ b/apis/grpc/v1/discoverer/discoverer.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/discoverer/discoverer.proto diff --git a/apis/grpc/v1/filter/egress/egress_filter.pb.go b/apis/grpc/v1/filter/egress/egress_filter.pb.go index 607517e3e1..fa0e9725a4 100644 --- a/apis/grpc/v1/filter/egress/egress_filter.pb.go +++ b/apis/grpc/v1/filter/egress/egress_filter.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/filter/egress/egress_filter.proto diff --git a/apis/grpc/v1/filter/ingress/ingress_filter.pb.go b/apis/grpc/v1/filter/ingress/ingress_filter.pb.go index d223b6de6c..ee4a3a302b 100644 --- a/apis/grpc/v1/filter/ingress/ingress_filter.pb.go +++ b/apis/grpc/v1/filter/ingress/ingress_filter.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/filter/ingress/ingress_filter.proto diff --git a/apis/grpc/v1/manager/index/index_manager.pb.go b/apis/grpc/v1/manager/index/index_manager.pb.go index 5c239f8a28..2ddc40a16b 100644 --- a/apis/grpc/v1/manager/index/index_manager.pb.go +++ b/apis/grpc/v1/manager/index/index_manager.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/manager/index/index_manager.proto diff --git a/apis/grpc/v1/mirror/mirror.pb.go b/apis/grpc/v1/mirror/mirror.pb.go index 540552e87a..69f1516db7 100644 --- a/apis/grpc/v1/mirror/mirror.pb.go +++ b/apis/grpc/v1/mirror/mirror.pb.go @@ -1,5 +1,5 @@ // -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/mirror/mirror.proto diff --git a/apis/grpc/v1/mirror/mirror_vtproto.pb.go b/apis/grpc/v1/mirror/mirror_vtproto.pb.go index 9b2d08f302..399c385d4b 100644 --- a/apis/grpc/v1/mirror/mirror_vtproto.pb.go +++ b/apis/grpc/v1/mirror/mirror_vtproto.pb.go @@ -1,5 +1,5 @@ // -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/apis/grpc/v1/payload/payload.pb.go b/apis/grpc/v1/payload/payload.pb.go index 531cb878c8..5e94a4f000 100644 --- a/apis/grpc/v1/payload/payload.pb.go +++ b/apis/grpc/v1/payload/payload.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/payload/payload.proto diff --git a/apis/grpc/v1/rpc/errdetails/error_details.pb.go b/apis/grpc/v1/rpc/errdetails/error_details.pb.go index 2d91f3a121..c1b22e2cbc 100644 --- a/apis/grpc/v1/rpc/errdetails/error_details.pb.go +++ b/apis/grpc/v1/rpc/errdetails/error_details.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/rpc/errdetails/error_details.proto diff --git a/apis/grpc/v1/vald/filter.pb.go b/apis/grpc/v1/vald/filter.pb.go index 21e3f2a553..51baa71dbd 100644 --- a/apis/grpc/v1/vald/filter.pb.go +++ b/apis/grpc/v1/vald/filter.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/vald/filter.proto diff --git a/apis/grpc/v1/vald/insert.pb.go b/apis/grpc/v1/vald/insert.pb.go index c650fcb0bb..1523003a54 100644 --- a/apis/grpc/v1/vald/insert.pb.go +++ b/apis/grpc/v1/vald/insert.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/vald/insert.proto diff --git a/apis/grpc/v1/vald/object.pb.go b/apis/grpc/v1/vald/object.pb.go index 3479429db1..16ed2f94cf 100644 --- a/apis/grpc/v1/vald/object.pb.go +++ b/apis/grpc/v1/vald/object.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/vald/object.proto diff --git a/apis/grpc/v1/vald/remove.pb.go b/apis/grpc/v1/vald/remove.pb.go index d09508c71f..21a057dc8a 100644 --- a/apis/grpc/v1/vald/remove.pb.go +++ b/apis/grpc/v1/vald/remove.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/vald/remove.proto diff --git a/apis/grpc/v1/vald/search.pb.go b/apis/grpc/v1/vald/search.pb.go index a26a97b8bb..9ffb9435ce 100644 --- a/apis/grpc/v1/vald/search.pb.go +++ b/apis/grpc/v1/vald/search.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/vald/search.proto diff --git a/apis/grpc/v1/vald/update.pb.go b/apis/grpc/v1/vald/update.pb.go index a2346cff03..673a078d24 100644 --- a/apis/grpc/v1/vald/update.pb.go +++ b/apis/grpc/v1/vald/update.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/vald/update.proto diff --git a/apis/grpc/v1/vald/upsert.pb.go b/apis/grpc/v1/vald/upsert.pb.go index 7eaf492f15..8ad5eb4345 100644 --- a/apis/grpc/v1/vald/upsert.pb.go +++ b/apis/grpc/v1/vald/upsert.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/vald/upsert.proto diff --git a/apis/proto/v1/mirror/mirror.proto b/apis/proto/v1/mirror/mirror.proto index 3d8aa63b82..5275ceb2eb 100644 --- a/apis/proto/v1/mirror/mirror.proto +++ b/apis/proto/v1/mirror/mirror.proto @@ -1,5 +1,5 @@ // -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/apis/swagger/v1/discoverer/discoverer.swagger.json b/apis/swagger/v1/discoverer/discoverer.swagger.json index b6df1227c3..915d82ab71 100644 --- a/apis/swagger/v1/discoverer/discoverer.swagger.json +++ b/apis/swagger/v1/discoverer/discoverer.swagger.json @@ -20,7 +20,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/InfoNodes" + "$ref": "#/definitions/v1InfoNodes" } }, "default": { @@ -52,7 +52,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/InfoPods" + "$ref": "#/definitions/v1InfoPods" } }, "default": { @@ -84,7 +84,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/InfoServices" + "$ref": "#/definitions/v1InfoServices" } }, "default": { @@ -200,26 +200,12 @@ "description": "The memory information of the node." }, "Pods": { - "$ref": "#/definitions/InfoPods", + "$ref": "#/definitions/v1InfoPods", "description": "The pod information of the node." } }, "description": "Represent the node information message." }, - "InfoNodes": { - "type": "object", - "properties": { - "nodes": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/InfoNode" - }, - "description": "The multiple node information." - } - }, - "description": "Represent the multiple node information message." - }, "InfoPod": { "type": "object", "properties": { @@ -254,20 +240,6 @@ }, "description": "Represent the pod information message." }, - "InfoPods": { - "type": "object", - "properties": { - "pods": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/InfoPod" - }, - "description": "The multiple pod information." - } - }, - "description": "Represent the multiple pod information message." - }, "InfoService": { "type": "object", "properties": { @@ -320,20 +292,6 @@ }, "description": "Represets the service port information message." }, - "InfoServices": { - "type": "object", - "properties": { - "services": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/InfoService" - }, - "description": "The multiple service information." - } - }, - "description": "Represent the multiple service information message." - }, "protobufAny": { "type": "object", "properties": { @@ -385,6 +343,48 @@ } }, "description": "Represent the dicoverer request." + }, + "v1InfoNodes": { + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/InfoNode" + }, + "description": "The multiple node information." + } + }, + "description": "Represent the multiple node information message." + }, + "v1InfoPods": { + "type": "object", + "properties": { + "pods": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/InfoPod" + }, + "description": "The multiple pod information." + } + }, + "description": "Represent the multiple pod information message." + }, + "v1InfoServices": { + "type": "object", + "properties": { + "services": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/InfoService" + }, + "description": "The multiple service information." + } + }, + "description": "Represent the multiple service information message." } } } diff --git a/charts/vald/crds/valdmirrortarget.yaml b/charts/vald/crds/valdmirrortarget.yaml index b6f47e9091..39d0b385ef 100644 --- a/charts/vald/crds/valdmirrortarget.yaml +++ b/charts/vald/crds/valdmirrortarget.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/schemas/mirror-target-values.yaml b/charts/vald/schemas/mirror-target-values.yaml index 7885ac85bf..ded00b6136 100644 --- a/charts/vald/schemas/mirror-target-values.yaml +++ b/charts/vald/schemas/mirror-target-values.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/clusterrole.yaml b/charts/vald/templates/gateway/mirror/clusterrole.yaml index 287e47752f..e72ce4eaf1 100644 --- a/charts/vald/templates/gateway/mirror/clusterrole.yaml +++ b/charts/vald/templates/gateway/mirror/clusterrole.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml b/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml index 9129355c72..7495b799df 100644 --- a/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml +++ b/charts/vald/templates/gateway/mirror/clusterrolebinding.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/configmap.yaml b/charts/vald/templates/gateway/mirror/configmap.yaml index ca7ccedff5..0a5dc5fdee 100644 --- a/charts/vald/templates/gateway/mirror/configmap.yaml +++ b/charts/vald/templates/gateway/mirror/configmap.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/daemonset.yaml b/charts/vald/templates/gateway/mirror/daemonset.yaml index db8d032f4a..e9aa3de0c9 100644 --- a/charts/vald/templates/gateway/mirror/daemonset.yaml +++ b/charts/vald/templates/gateway/mirror/daemonset.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/deployment.yaml b/charts/vald/templates/gateway/mirror/deployment.yaml index 10b137b22f..524675d2a1 100644 --- a/charts/vald/templates/gateway/mirror/deployment.yaml +++ b/charts/vald/templates/gateway/mirror/deployment.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/hpa.yaml b/charts/vald/templates/gateway/mirror/hpa.yaml index 41e339d981..d0094ead4b 100644 --- a/charts/vald/templates/gateway/mirror/hpa.yaml +++ b/charts/vald/templates/gateway/mirror/hpa.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/ing.yaml b/charts/vald/templates/gateway/mirror/ing.yaml index 32ce915750..99d1258019 100644 --- a/charts/vald/templates/gateway/mirror/ing.yaml +++ b/charts/vald/templates/gateway/mirror/ing.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/networkpolicy.yaml b/charts/vald/templates/gateway/mirror/networkpolicy.yaml index bab43b69fb..0c2d31b30a 100644 --- a/charts/vald/templates/gateway/mirror/networkpolicy.yaml +++ b/charts/vald/templates/gateway/mirror/networkpolicy.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/pdb.yaml b/charts/vald/templates/gateway/mirror/pdb.yaml index 3c31028b63..36d8ba3064 100644 --- a/charts/vald/templates/gateway/mirror/pdb.yaml +++ b/charts/vald/templates/gateway/mirror/pdb.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/priorityclass.yaml b/charts/vald/templates/gateway/mirror/priorityclass.yaml index 7cc208c236..f22a1fe3a2 100644 --- a/charts/vald/templates/gateway/mirror/priorityclass.yaml +++ b/charts/vald/templates/gateway/mirror/priorityclass.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/serviceaccount.yaml b/charts/vald/templates/gateway/mirror/serviceaccount.yaml index 9288e0ac9d..6aab125708 100644 --- a/charts/vald/templates/gateway/mirror/serviceaccount.yaml +++ b/charts/vald/templates/gateway/mirror/serviceaccount.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/templates/gateway/mirror/svc.yaml b/charts/vald/templates/gateway/mirror/svc.yaml index cee5cd1609..908d94845c 100644 --- a/charts/vald/templates/gateway/mirror/svc.yaml +++ b/charts/vald/templates/gateway/mirror/svc.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/values/multi-vald/dev-vald-01.yaml b/charts/vald/values/multi-vald/dev-vald-01.yaml index 03fc608003..9c26c7c425 100644 --- a/charts/vald/values/multi-vald/dev-vald-01.yaml +++ b/charts/vald/values/multi-vald/dev-vald-01.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/values/multi-vald/dev-vald-02.yaml b/charts/vald/values/multi-vald/dev-vald-02.yaml index 4e5f11e2a4..35d03c177b 100644 --- a/charts/vald/values/multi-vald/dev-vald-02.yaml +++ b/charts/vald/values/multi-vald/dev-vald-02.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/values/multi-vald/dev-vald-03.yaml b/charts/vald/values/multi-vald/dev-vald-03.yaml index 0723a6486b..4579a564db 100644 --- a/charts/vald/values/multi-vald/dev-vald-03.yaml +++ b/charts/vald/values/multi-vald/dev-vald-03.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml index acc148dc1d..b4933f8cbe 100644 --- a/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml +++ b/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/charts/vald/values/multi-vald/mirror-target.yaml b/charts/vald/values/multi-vald/mirror-target.yaml index 8a0ab15a01..f5f49cf3a9 100644 --- a/charts/vald/values/multi-vald/mirror-target.yaml +++ b/charts/vald/values/multi-vald/mirror-target.yaml @@ -1,6 +1,6 @@ --- # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/cmd/gateway/mirror/main.go b/cmd/gateway/mirror/main.go index 78a04611a4..ed7658c40d 100644 --- a/cmd/gateway/mirror/main.go +++ b/cmd/gateway/mirror/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/cmd/gateway/mirror/sample.yaml b/cmd/gateway/mirror/sample.yaml index bac898cdca..9646caf784 100644 --- a/cmd/gateway/mirror/sample.yaml +++ b/cmd/gateway/mirror/sample.yaml @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index adeb5910eb..438790483a 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:latest # -# Copyright (C) 2019-2023 vdaas.org vald team +# Copyright (C) 2019-2024 vdaas.org vald team # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. diff --git a/example/client/mirror/main.go b/example/client/mirror/main.go index e4bb45fc9c..38d586ed64 100644 --- a/example/client/mirror/main.go +++ b/example/client/mirror/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/client/v1/client/mirror/mirror.go b/internal/client/v1/client/mirror/mirror.go index c82befc7a6..c90b3b9c2b 100644 --- a/internal/client/v1/client/mirror/mirror.go +++ b/internal/client/v1/client/mirror/mirror.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/client/v1/client/mirror/option.go b/internal/client/v1/client/mirror/option.go index 16a43ddb6f..4d671a8771 100644 --- a/internal/client/v1/client/mirror/option.go +++ b/internal/client/v1/client/mirror/option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/config/mirror.go b/internal/config/mirror.go index 29989b43d0..c545fd0cb8 100644 --- a/internal/config/mirror.go +++ b/internal/config/mirror.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/hash/hash.go b/internal/hash/hash.go index 9b5e3254e7..8dad439a7a 100644 --- a/internal/hash/hash.go +++ b/internal/hash/hash.go @@ -1,10 +1,11 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/hash/hash_test.go b/internal/hash/hash_test.go index 85c29c03b6..2d1a46b843 100644 --- a/internal/hash/hash_test.go +++ b/internal/hash/hash_test.go @@ -1,10 +1,11 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/internal/k8s/vald/mirror/api/v1/target_types.go b/internal/k8s/vald/mirror/api/v1/target_types.go index 0129d3560c..0263e5ad26 100644 --- a/internal/k8s/vald/mirror/api/v1/target_types.go +++ b/internal/k8s/vald/mirror/api/v1/target_types.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/k8s/vald/mirror/target/option.go b/internal/k8s/vald/mirror/target/option.go index db84f37a7c..cbf3829d5d 100644 --- a/internal/k8s/vald/mirror/target/option.go +++ b/internal/k8s/vald/mirror/target/option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/k8s/vald/mirror/target/target.go b/internal/k8s/vald/mirror/target/target.go index 17c7164196..cbfb1f60ae 100644 --- a/internal/k8s/vald/mirror/target/target.go +++ b/internal/k8s/vald/mirror/target/target.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/k8s/vald/mirror/target/target_template.go b/internal/k8s/vald/mirror/target/target_template.go index 4e52774fd1..e037aea8d9 100644 --- a/internal/k8s/vald/mirror/target/target_template.go +++ b/internal/k8s/vald/mirror/target/target_template.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/k8s/vald/mirror/target/target_template_option.go b/internal/k8s/vald/mirror/target/target_template_option.go index 7f064289db..2a7f68a8cb 100644 --- a/internal/k8s/vald/mirror/target/target_template_option.go +++ b/internal/k8s/vald/mirror/target/target_template_option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/net/grpc/metadata.go b/internal/net/grpc/metadata.go index e32a0bb3e1..fdc1d26e74 100644 --- a/internal/net/grpc/metadata.go +++ b/internal/net/grpc/metadata.go @@ -1,5 +1,5 @@ // -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/observability/metrics/gateway/mirror/mirror.go b/internal/observability/metrics/gateway/mirror/mirror.go index ae4b5d8d24..4c6dd3757e 100644 --- a/internal/observability/metrics/gateway/mirror/mirror.go +++ b/internal/observability/metrics/gateway/mirror/mirror.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/test/mock/client/mirror_client_mock.go b/internal/test/mock/client/mirror_client_mock.go index d99af5609e..10cd4563ac 100644 --- a/internal/test/mock/client/mirror_client_mock.go +++ b/internal/test/mock/client/mirror_client_mock.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/test/mock/k8s/controller_runtime.go b/internal/test/mock/k8s/controller_runtime.go index 10090e0a9c..c08fec5414 100644 --- a/internal/test/mock/k8s/controller_runtime.go +++ b/internal/test/mock/k8s/controller_runtime.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/internal/test/mock/k8s/reconciler.go b/internal/test/mock/k8s/reconciler.go index 2613368110..09809d7012 100644 --- a/internal/test/mock/k8s/reconciler.go +++ b/internal/test/mock/k8s/reconciler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/config/config.go b/pkg/gateway/mirror/config/config.go index 07bd4238b2..8528da24c0 100644 --- a/pkg/gateway/mirror/config/config.go +++ b/pkg/gateway/mirror/config/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/handler/doc.go b/pkg/gateway/mirror/handler/doc.go index 79092b1747..75fbe95246 100644 --- a/pkg/gateway/mirror/handler/doc.go +++ b/pkg/gateway/mirror/handler/doc.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 86c7d9ad46..9a04ccc00e 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/handler/grpc/handler_test.go b/pkg/gateway/mirror/handler/grpc/handler_test.go index 1066c72ba7..fb55eb1b53 100644 --- a/pkg/gateway/mirror/handler/grpc/handler_test.go +++ b/pkg/gateway/mirror/handler/grpc/handler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/handler/grpc/mock_test.go b/pkg/gateway/mirror/handler/grpc/mock_test.go index 642d45de87..a09cbb567a 100644 --- a/pkg/gateway/mirror/handler/grpc/mock_test.go +++ b/pkg/gateway/mirror/handler/grpc/mock_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/handler/grpc/option.go b/pkg/gateway/mirror/handler/grpc/option.go index be9acc9e16..5832e37be9 100644 --- a/pkg/gateway/mirror/handler/grpc/option.go +++ b/pkg/gateway/mirror/handler/grpc/option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/handler/rest/handler.go b/pkg/gateway/mirror/handler/rest/handler.go index 6134bf0124..70ed6dbff7 100644 --- a/pkg/gateway/mirror/handler/rest/handler.go +++ b/pkg/gateway/mirror/handler/rest/handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/handler/rest/option.go b/pkg/gateway/mirror/handler/rest/option.go index d983d16ab9..56272ff02e 100644 --- a/pkg/gateway/mirror/handler/rest/option.go +++ b/pkg/gateway/mirror/handler/rest/option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/router/option.go b/pkg/gateway/mirror/router/option.go index 0ee345d62a..7b3e7d1782 100644 --- a/pkg/gateway/mirror/router/option.go +++ b/pkg/gateway/mirror/router/option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/router/router.go b/pkg/gateway/mirror/router/router.go index d84864b7b8..d65b106652 100644 --- a/pkg/gateway/mirror/router/router.go +++ b/pkg/gateway/mirror/router/router.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/discovery.go b/pkg/gateway/mirror/service/discovery.go index 1b4009a231..bb65304288 100644 --- a/pkg/gateway/mirror/service/discovery.go +++ b/pkg/gateway/mirror/service/discovery.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/discovery_option.go b/pkg/gateway/mirror/service/discovery_option.go index 632a0e97df..f43ec58c82 100644 --- a/pkg/gateway/mirror/service/discovery_option.go +++ b/pkg/gateway/mirror/service/discovery_option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/discovery_test.go b/pkg/gateway/mirror/service/discovery_test.go index ca9e930efc..cc4665bbe7 100644 --- a/pkg/gateway/mirror/service/discovery_test.go +++ b/pkg/gateway/mirror/service/discovery_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/doc.go b/pkg/gateway/mirror/service/doc.go index 4c81def1e7..d65bc59868 100644 --- a/pkg/gateway/mirror/service/doc.go +++ b/pkg/gateway/mirror/service/doc.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index 90067e9161..632f9db8a6 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/gateway_mock_test.go b/pkg/gateway/mirror/service/gateway_mock_test.go index 1003af7c52..9bd0641033 100644 --- a/pkg/gateway/mirror/service/gateway_mock_test.go +++ b/pkg/gateway/mirror/service/gateway_mock_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index 6cb9c29cb5..892ef39f1a 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/mirror_mock_test.go b/pkg/gateway/mirror/service/mirror_mock_test.go index d03eea0c12..56d828b305 100644 --- a/pkg/gateway/mirror/service/mirror_mock_test.go +++ b/pkg/gateway/mirror/service/mirror_mock_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/mirror_option.go b/pkg/gateway/mirror/service/mirror_option.go index e23db56aa1..1b7243c382 100644 --- a/pkg/gateway/mirror/service/mirror_option.go +++ b/pkg/gateway/mirror/service/mirror_option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/mirror_test.go b/pkg/gateway/mirror/service/mirror_test.go index 2ac692ef1f..598a3b1841 100644 --- a/pkg/gateway/mirror/service/mirror_test.go +++ b/pkg/gateway/mirror/service/mirror_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/service/option.go b/pkg/gateway/mirror/service/option.go index 1c80092be5..6408cf9fcd 100644 --- a/pkg/gateway/mirror/service/option.go +++ b/pkg/gateway/mirror/service/option.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. diff --git a/pkg/gateway/mirror/usecase/vald.go b/pkg/gateway/mirror/usecase/vald.go index 808224a38e..7937ba4728 100644 --- a/pkg/gateway/mirror/usecase/vald.go +++ b/pkg/gateway/mirror/usecase/vald.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 vdaas.org vald team +// Copyright (C) 2019-2024 vdaas.org vald team // // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. From f55617cfc3c41c60a1146daea14cae2b2707460a Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 9 Jan 2024 17:28:17 +0900 Subject: [PATCH 87/93] feat: add ingress rule for lb and filter Signed-off-by: hlts2 --- charts/vald/templates/gateway/mirror/ing.yaml | 28 +++++++++++++++++++ charts/vald/templates/gateway/mirror/pdb.yaml | 4 +++ 2 files changed, 32 insertions(+) diff --git a/charts/vald/templates/gateway/mirror/ing.yaml b/charts/vald/templates/gateway/mirror/ing.yaml index 99d1258019..e0524652e7 100644 --- a/charts/vald/templates/gateway/mirror/ing.yaml +++ b/charts/vald/templates/gateway/mirror/ing.yaml @@ -14,8 +14,14 @@ # limitations under the License. # {{- $gateway := .Values.gateway.mirror -}} +{{- $lb := .Values.gateway.lb -}} +{{- $filter := .Values.gateway.filter -}} {{- if and $gateway.enabled $gateway.ingress.enabled }} +{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} apiVersion: networking.k8s.io/v1 +{{- else }} +apiVersion: networking.k8s.io/v1alpha1 +{{- end }} kind: Ingress metadata: annotations: @@ -44,4 +50,26 @@ spec: name: {{ $gateway.name }} {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} pathType: {{ $gateway.ingress.pathType }} + {{- if $lb.enabled }} + - path: "/vald.v1.Search/*" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} + pathType: {{ $gateway.ingress.pathType }} + - path: "/vald.v1.Object/*" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} + pathType: {{ $gateway.ingress.pathType }} + {{- end }} + {{- if $filter.enabled }} + - path: "/vald.v1.Filter/*" + backend: + service: + name: {{ $filter.name }} + {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} + pathType: {{ $gateway.ingress.pathType }} + {{- end }} {{- end }} diff --git a/charts/vald/templates/gateway/mirror/pdb.yaml b/charts/vald/templates/gateway/mirror/pdb.yaml index 36d8ba3064..4776797849 100644 --- a/charts/vald/templates/gateway/mirror/pdb.yaml +++ b/charts/vald/templates/gateway/mirror/pdb.yaml @@ -15,7 +15,11 @@ # {{- $gateway := .Values.gateway.mirror -}} {{- if $gateway.enabled }} +{{- if (.Capabilities.APIVersions.Has "policy/v1") }} apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 +{{- end }} kind: PodDisruptionBudget metadata: name: {{ $gateway.name }} From e7cba07fa02ea4bee2c45976b8fba379edd4d225 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 9 Jan 2024 19:00:19 +0900 Subject: [PATCH 88/93] fix: deleted wildcard path Signed-off-by: hlts2 --- charts/vald/templates/gateway/mirror/ing.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/vald/templates/gateway/mirror/ing.yaml b/charts/vald/templates/gateway/mirror/ing.yaml index e0524652e7..e54e3f73a5 100644 --- a/charts/vald/templates/gateway/mirror/ing.yaml +++ b/charts/vald/templates/gateway/mirror/ing.yaml @@ -51,13 +51,13 @@ spec: {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} pathType: {{ $gateway.ingress.pathType }} {{- if $lb.enabled }} - - path: "/vald.v1.Search/*" + - path: "/vald.v1.Search" backend: service: name: {{ $lb.name }} {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} pathType: {{ $gateway.ingress.pathType }} - - path: "/vald.v1.Object/*" + - path: "/vald.v1.Object" backend: service: name: {{ $lb.name }} @@ -65,7 +65,7 @@ spec: pathType: {{ $gateway.ingress.pathType }} {{- end }} {{- if $filter.enabled }} - - path: "/vald.v1.Filter/*" + - path: "/vald.v1.Filter" backend: service: name: {{ $filter.name }} From 052b1124de18084638272876b78e44370b78d975 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 10 Jan 2024 14:36:48 +0900 Subject: [PATCH 89/93] fix: ingress unified into one manifest Signed-off-by: hlts2 --- .../vald-helm-operator/crds/valdrelease.yaml | 5 + charts/vald/templates/gateway/filter/ing.yaml | 54 ----------- charts/vald/templates/gateway/ing.yaml | 95 +++++++++++++++++++ charts/vald/templates/gateway/lb/ing.yaml | 54 ----------- charts/vald/templates/gateway/mirror/ing.yaml | 75 --------------- charts/vald/values.schema.json | 10 ++ charts/vald/values.yaml | 6 ++ 7 files changed, 116 insertions(+), 183 deletions(-) delete mode 100644 charts/vald/templates/gateway/filter/ing.yaml create mode 100644 charts/vald/templates/gateway/ing.yaml delete mode 100644 charts/vald/templates/gateway/lb/ing.yaml delete mode 100644 charts/vald/templates/gateway/mirror/ing.yaml diff --git a/charts/vald-helm-operator/crds/valdrelease.yaml b/charts/vald-helm-operator/crds/valdrelease.yaml index 63d4e10b24..214ee2b95d 100644 --- a/charts/vald-helm-operator/crds/valdrelease.yaml +++ b/charts/vald-helm-operator/crds/valdrelease.yaml @@ -6402,6 +6402,11 @@ spec: annotations: type: object x-kubernetes-preserve-unknown-fields: true + defaultBackend: + type: object + properties: + enabled: + type: boolean enabled: type: boolean host: diff --git a/charts/vald/templates/gateway/filter/ing.yaml b/charts/vald/templates/gateway/filter/ing.yaml deleted file mode 100644 index 69dc41301d..0000000000 --- a/charts/vald/templates/gateway/filter/ing.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright (C) 2019-2024 vdaas.org vald team -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# You may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -{{- $gateway := .Values.gateway.filter -}} -{{- $mgateway := .Values.gateway.mirror -}} -{{- if and $gateway.enabled $gateway.ingress.enabled (not $mgateway.enabled) }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} -apiVersion: networking.k8s.io/v1 -{{- else }} -apiVersion: networking.k8s.io/v1alpha1 -{{- end }} -kind: Ingress -metadata: - annotations: - {{- toYaml $gateway.ingress.annotations | nindent 4 }} - labels: - name: {{ $gateway.name }}-ingress - app: {{ $gateway.name }}-ingress - app.kubernetes.io/name: {{ include "vald.name" . }} - helm.sh/chart: {{ include "vald.chart" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/version: {{ .Chart.Version }} - app.kubernetes.io/component: gateway-filter - name: {{ $gateway.name }}-ingress -spec: - {{- if $gateway.ingress.defaultBackend.enabled }} - defaultBackend: - service: - name: {{ $gateway.name }} - {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 6 }} - {{- end }} - rules: - - host: {{ $gateway.ingress.host }} - http: - paths: - - backend: - service: - name: {{ $gateway.name }} - {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} - pathType: {{ $gateway.ingress.pathType }} -{{- end }} diff --git a/charts/vald/templates/gateway/ing.yaml b/charts/vald/templates/gateway/ing.yaml new file mode 100644 index 0000000000..986cae4ee5 --- /dev/null +++ b/charts/vald/templates/gateway/ing.yaml @@ -0,0 +1,95 @@ +# +# Copyright (C) 2019-2024 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- $filter := .Values.gateway.filter -}} +{{- $filterIngEnabled := and $filter.enabled $filter.ingress.enabled -}} +{{- $mirror := .Values.gateway.mirror -}} +{{- $mirrorIngEnabled := and $mirror.enabled $mirror.ingress.enabled -}} +{{- $lb := .Values.gateway.lb -}} +{{- $lbIngEnabled := and $lb.enabled $lb.ingress.enabled -}} +{{- $gateway := "" -}} +{{- $gatewayName := "" -}} +{{- if or $filterIngEnabled $mirrorIngEnabled $lbIngEnabled }} +{{- if $filterIngEnabled }} +{{- $gateway = $filter -}} +{{- $gatewayName = "gateway-filter" }} +{{- else if $mirrorIngEnabled }} +{{- $gateway = $mirror -}} +{{- $gatewayName = "gateway-mirror" }} +{{- else }} +{{- $gateway = $lb -}} +{{- $gatewayName = "gateway-lb" }} +{{- end }} +{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} +apiVersion: networking.k8s.io/v1 +{{- else }} +apiVersion: networking.k8s.io/v1alpha1 +{{- end }} +kind: Ingress +metadata: + annotations: + {{- toYaml $gateway.ingress.annotations | nindent 4 }} + labels: + name: {{ .Release.Name }}-ingress + app: {{ .Release.Name }}-ingress + app.kubernetes.io/name: {{ include "vald.name" . }} + helm.sh/chart: {{ include "vald.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.Version }} + app.kubernetes.io/component: {{ $gatewayName }} +spec: + {{- if $gateway.ingress.defaultBackend.enabled }} + defaultBackend: + service: + name: {{ $gateway.name }} + {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 6 }} + {{- end }} + rules: + - host: {{ $gateway.ingress.host }} + http: + paths: + {{- if $filterIngEnabled }} + - backend: + service: + name: {{ $filter.name }} + {{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }} + pathType: {{ $filter.ingress.pathType }} + {{- else if and $mirrorIngEnabled $lb.enabled }} + - backend: + service: + name: {{ $mirror.name }} + {{- include "vald.ingressPort" (dict "Values" $mirror.ingress) | nindent 12 }} + pathType: {{ $mirror.ingress.pathType }} + - path: "/vald.v1.Search" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $mirror.ingress) | nindent 12 }} + pathType: {{ $mirror.ingress.pathType }} + - path: "/vald.v1.Object" + backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $mirror.ingress) | nindent 12 }} + pathType: {{ $mirror.ingress.pathType }} + {{- else if $lbIngEnabled }} + - backend: + service: + name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $lb.ingress.pathType }} + {{- end }} +{{- end }} diff --git a/charts/vald/templates/gateway/lb/ing.yaml b/charts/vald/templates/gateway/lb/ing.yaml deleted file mode 100644 index 41b10eb49e..0000000000 --- a/charts/vald/templates/gateway/lb/ing.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright (C) 2019-2024 vdaas.org vald team -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# You may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -{{- $gateway := .Values.gateway.lb -}} -{{- $mgateway := .Values.gateway.mirror -}} -{{- if and $gateway.enabled $gateway.ingress.enabled (not $mgateway.enabled) }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} -apiVersion: networking.k8s.io/v1 -{{- else }} -apiVersion: networking.k8s.io/v1alpha1 -{{- end }} -kind: Ingress -metadata: - annotations: - {{- toYaml $gateway.ingress.annotations | nindent 4 }} - labels: - name: {{ $gateway.name }}-ingress - app: {{ $gateway.name }}-ingress - app.kubernetes.io/name: {{ include "vald.name" . }} - helm.sh/chart: {{ include "vald.chart" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/version: {{ .Chart.Version }} - app.kubernetes.io/component: gateway-lb - name: {{ $gateway.name }}-ingress -spec: - {{- if $gateway.ingress.defaultBackend.enabled }} - defaultBackend: - service: - name: {{ $gateway.name }} - {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 6 }} - {{- end }} - rules: - - host: {{ $gateway.ingress.host }} - http: - paths: - - backend: - service: - name: {{ $gateway.name }} - {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} - pathType: {{ $gateway.ingress.pathType }} -{{- end }} diff --git a/charts/vald/templates/gateway/mirror/ing.yaml b/charts/vald/templates/gateway/mirror/ing.yaml deleted file mode 100644 index e54e3f73a5..0000000000 --- a/charts/vald/templates/gateway/mirror/ing.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright (C) 2019-2024 vdaas.org vald team -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# You may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -{{- $gateway := .Values.gateway.mirror -}} -{{- $lb := .Values.gateway.lb -}} -{{- $filter := .Values.gateway.filter -}} -{{- if and $gateway.enabled $gateway.ingress.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} -apiVersion: networking.k8s.io/v1 -{{- else }} -apiVersion: networking.k8s.io/v1alpha1 -{{- end }} -kind: Ingress -metadata: - annotations: - {{- toYaml $gateway.ingress.annotations | nindent 4 }} - labels: - name: {{ $gateway.name }}-ingress - app: {{ $gateway.name }}-ingress - app.kubernetes.io/name: {{ include "vald.name" . }} - helm.sh/chart: {{ include "vald.chart" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/version: {{ .Chart.Version }} - app.kubernetes.io/component: gateway-mirror - name: {{ $gateway.name }}-ingress -spec: - defaultBackend: - service: - name: {{ $gateway.name }} - {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 6 }} - rules: - - host: {{ $gateway.ingress.host }} - http: - paths: - - backend: - service: - name: {{ $gateway.name }} - {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} - pathType: {{ $gateway.ingress.pathType }} - {{- if $lb.enabled }} - - path: "/vald.v1.Search" - backend: - service: - name: {{ $lb.name }} - {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} - pathType: {{ $gateway.ingress.pathType }} - - path: "/vald.v1.Object" - backend: - service: - name: {{ $lb.name }} - {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} - pathType: {{ $gateway.ingress.pathType }} - {{- end }} - {{- if $filter.enabled }} - - path: "/vald.v1.Filter" - backend: - service: - name: {{ $filter.name }} - {{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }} - pathType: {{ $gateway.ingress.pathType }} - {{- end }} -{{- end }} diff --git a/charts/vald/values.schema.json b/charts/vald/values.schema.json index ad59e22bc2..41cd419a73 100644 --- a/charts/vald/values.schema.json +++ b/charts/vald/values.schema.json @@ -10646,6 +10646,16 @@ "type": "object", "description": "annotations for ingress" }, + "defaultBackend": { + "type": "object", + "description": "defaultBackend config", + "properties": { + "enabled": { + "type": "boolean", + "description": "gateway ingress defaultBackend enabled" + } + } + }, "enabled": { "type": "boolean", "description": "gateway ingress enabled" diff --git a/charts/vald/values.yaml b/charts/vald/values.yaml index 66014659d7..312fc09df7 100644 --- a/charts/vald/values.yaml +++ b/charts/vald/values.yaml @@ -1644,6 +1644,12 @@ gateway: # @schema {"name": "gateway.mirror.ingress.servicePort", "type": "string"} # gateway.mirror.ingress.servicePort -- service port to be exposed by ingress servicePort: grpc + # @schema {"name": "gateway.mirror.ingress.defaultBackend", "type": "object"} + # gateway.mirror.ingress.defaultBackend -- defaultBackend config + defaultBackend: + # @schema {"name": "gateway.mirror.ingress.defaultBackend.enabled", "type": "boolean"} + # gateway.mirror.ingress.defaultBackend.enabled -- gateway ingress defaultBackend enabled + enabled: true # @schema {"name": "gateway.mirror.resources", "type": "object", "anchor": "resources"} # gateway.mirror.resources -- compute resources resources: From 4812983abad1133d5e10f3d2f5bcf7ddf2112e4e Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 10 Jan 2024 14:41:33 +0900 Subject: [PATCH 90/93] fix: make format Signed-off-by: hlts2 --- apis/docs/v1/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/docs/v1/docs.md b/apis/docs/v1/docs.md index 893fbf1ef5..3cdd7ab520 100644 --- a/apis/docs/v1/docs.md +++ b/apis/docs/v1/docs.md @@ -1151,7 +1151,7 @@ Represent the index manager service. ## v1/mirror/mirror.proto -Copyright (C) 2019-2023 vdaas.org vald team <vald@vdaas.org> +Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org> Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. From 41d77407b9d209a072a79460eaae31d1bb962b97 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 10 Jan 2024 15:08:39 +0900 Subject: [PATCH 91/93] fix: lb ingress port settings and small refactor Signed-off-by: hlts2 --- charts/vald/templates/gateway/ing.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/vald/templates/gateway/ing.yaml b/charts/vald/templates/gateway/ing.yaml index 986cae4ee5..d692476a5b 100644 --- a/charts/vald/templates/gateway/ing.yaml +++ b/charts/vald/templates/gateway/ing.yaml @@ -68,21 +68,21 @@ spec: {{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }} pathType: {{ $filter.ingress.pathType }} {{- else if and $mirrorIngEnabled $lb.enabled }} - - backend: - service: - name: {{ $mirror.name }} - {{- include "vald.ingressPort" (dict "Values" $mirror.ingress) | nindent 12 }} - pathType: {{ $mirror.ingress.pathType }} - path: "/vald.v1.Search" backend: service: name: {{ $lb.name }} - {{- include "vald.ingressPort" (dict "Values" $mirror.ingress) | nindent 12 }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} pathType: {{ $mirror.ingress.pathType }} - path: "/vald.v1.Object" backend: service: name: {{ $lb.name }} + {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }} + pathType: {{ $mirror.ingress.pathType }} + - backend: + service: + name: {{ $mirror.name }} {{- include "vald.ingressPort" (dict "Values" $mirror.ingress) | nindent 12 }} pathType: {{ $mirror.ingress.pathType }} {{- else if $lbIngEnabled }} From 0a5d3352586c196169ed416c5324eee1571de666 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 10 Jan 2024 16:23:21 +0900 Subject: [PATCH 92/93] feat: add cluster wide ingress resource name Signed-off-by: hlts2 --- charts/vald/templates/gateway/ing.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/vald/templates/gateway/ing.yaml b/charts/vald/templates/gateway/ing.yaml index d692476a5b..d9dff5060c 100644 --- a/charts/vald/templates/gateway/ing.yaml +++ b/charts/vald/templates/gateway/ing.yaml @@ -42,14 +42,15 @@ metadata: annotations: {{- toYaml $gateway.ingress.annotations | nindent 4 }} labels: - name: {{ .Release.Name }}-ingress - app: {{ .Release.Name }}-ingress + name: {{ $gateway.name }}-ingress + app: {{ $gateway.name }}-ingress app.kubernetes.io/name: {{ include "vald.name" . }} helm.sh/chart: {{ include "vald.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.Version }} app.kubernetes.io/component: {{ $gatewayName }} + name: {{ .Release.Name }}-ingress spec: {{- if $gateway.ingress.defaultBackend.enabled }} defaultBackend: From 21d8cac57e9b4015a33340eed583adc392c5dfb4 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 10 Jan 2024 17:19:49 +0900 Subject: [PATCH 93/93] fix: add deploy ingress resource using make command Signed-off-by: hlts2 --- Makefile.d/k8s.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.d/k8s.mk b/Makefile.d/k8s.mk index c81a2f1d88..04c14875b1 100644 --- a/Makefile.d/k8s.mk +++ b/Makefile.d/k8s.mk @@ -45,7 +45,7 @@ k8s/manifest/update: \ mkdir -p k8s/index/job/readreplica mv $(TEMP_DIR)/vald/templates/agent k8s/agent mv $(TEMP_DIR)/vald/templates/discoverer k8s/discoverer - mv $(TEMP_DIR)/vald/templates/gateway/lb k8s/gateway/lb + mv $(TEMP_DIR)/vald/templates/gateway k8s/gateway mv $(TEMP_DIR)/vald/templates/manager/index k8s/manager/index mv $(TEMP_DIR)/vald/templates/index/job/correction k8s/index/job/correction mv $(TEMP_DIR)/vald/templates/index/job/creation k8s/index/job/creation @@ -96,6 +96,7 @@ k8s/vald/deploy: kubectl apply -f $(TEMP_DIR)/vald/templates/agent || true kubectl apply -f $(TEMP_DIR)/vald/templates/agent/readreplica || true kubectl apply -f $(TEMP_DIR)/vald/templates/discoverer || true + kubectl apply -f $(TEMP_DIR)/vald/templates/gateway || true kubectl apply -f $(TEMP_DIR)/vald/templates/gateway/lb || true kubectl apply -f $(TEMP_DIR)/vald/crds || true kubectl apply -f $(TEMP_DIR)/vald/templates/gateway/mirror || true @@ -129,6 +130,7 @@ k8s/vald/delete: kubectl delete -f $(TEMP_DIR)/vald/templates/index/job/correction kubectl delete -f $(TEMP_DIR)/vald/templates/index/job/creation kubectl delete -f $(TEMP_DIR)/vald/templates/index/job/save + kubectl delete -f $(TEMP_DIR)/vald/templates/gateway kubectl delete -f $(TEMP_DIR)/vald/templates/gateway/lb kubectl delete -f $(TEMP_DIR)/vald/templates/manager/index kubectl delete -f $(TEMP_DIR)/vald/templates/discoverer