Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add mirror gateway definition #1792

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
90c71c0
add mirroring service definition
hlts2 Sep 21, 2022
c996f51
rename
hlts2 Sep 22, 2022
1b1af8c
make proto/add & make format
hlts2 Sep 22, 2022
51ab8e0
Revert "make proto/add & make format"
hlts2 Sep 22, 2022
563c93d
make proto/add & make format
hlts2 Sep 22, 2022
b4e2e0c
make proto/add & make format
hlts2 Sep 22, 2022
d4eeee0
deleted unused file
hlts2 Sep 22, 2022
af51fe2
add request to get mirror servers
hlts2 Sep 26, 2022
7be9e9d
make proto/add & make format
hlts2 Sep 26, 2022
5fb8bb3
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Oct 3, 2022
6f79781
Update apis/proto/v1/mirror/mirror.proto
hlts2 Oct 3, 2022
8494ba6
fix advertisement to advertise
hlts2 Oct 3, 2022
70ab37d
make proto/add && make format
hlts2 Oct 3, 2022
6f50818
Apply suggestions from code review
hlts2 Oct 3, 2022
c58c5fa
make proto/all & make format
hlts2 Oct 3, 2022
63dd42e
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Oct 6, 2022
5cdcc39
apply suggestion and make proto/all & make format
hlts2 Oct 12, 2022
59919fc
make proto/all & make format
hlts2 Oct 12, 2022
ab39018
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Oct 17, 2022
1e6d763
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Oct 20, 2022
6d214af
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Oct 24, 2022
5b15d5a
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Oct 25, 2022
6699cb5
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Oct 26, 2022
6d070ad
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Oct 27, 2022
d3fa067
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Nov 1, 2022
493c0c9
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Nov 7, 2022
c7b5e57
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Nov 14, 2022
8448af8
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Nov 18, 2022
faac11a
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Nov 21, 2022
dc23ac0
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Nov 21, 2022
64ee5bd
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Nov 22, 2022
8771309
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Nov 28, 2022
531fbce
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Nov 29, 2022
08c83c9
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Dec 1, 2022
c89ac32
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Dec 5, 2022
8cc04db
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Dec 7, 2022
918d792
Format code with prettier and gofumpt
deepsource-autofix[bot] Dec 7, 2022
10d28a2
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Dec 12, 2022
387a372
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Dec 26, 2022
a75ddf0
make proto/all & make foramt
hlts2 Dec 26, 2022
4d14867
Format code with prettier and gofumpt
deepsource-autofix[bot] Dec 26, 2022
61cdfaf
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Dec 26, 2022
c8b31eb
make proto/add & make format
hlts2 Dec 26, 2022
12b0066
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Jan 4, 2023
bf91706
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Jan 11, 2023
942e488
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Jan 17, 2023
2dba9ed
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Jan 25, 2023
cd31baf
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Jan 30, 2023
2857f1a
Merge branch 'main' into feature/add-mirror-gateway-definition
hlts2 Feb 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions apis/docs/v1/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
- [apis/proto/v1/manager/index/index_manager.proto](#apis_proto_v1_manager_index_index_manager-proto)
- [Index](#manager-index-v1-Index)

- [apis/proto/v1/mirroring/mirroring.proto](#apis_proto_v1_mirroring_mirroring-proto)
- [Mirroring](#mirroring-v1-Mirroring)

- [apis/proto/v1/payload/payload.proto](#apis_proto_v1_payload_payload-proto)
- [Control](#payload-v1-Control)
- [Control.CreateIndexRequest](#payload-v1-Control-CreateIndexRequest)
Expand Down Expand Up @@ -49,6 +52,9 @@
- [Insert.MultiRequest](#payload-v1-Insert-MultiRequest)
- [Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest)
- [Insert.Request](#payload-v1-Insert-Request)
- [Mirroring](#payload-v1-Mirroring)
- [Mirroring.Request](#payload-v1-Mirroring-Request)
- [Mirroring.Target](#payload-v1-Mirroring-Target)
- [Object](#payload-v1-Object)
- [Object.Blob](#payload-v1-Object-Blob)
- [Object.Distance](#payload-v1-Object-Distance)
Expand Down Expand Up @@ -278,6 +284,32 @@ Represent the index manager service.



<a name="apis_proto_v1_mirroring_mirroring-proto"></a>
<p align="right"><a href="#top">Top</a></p>

## apis/proto/v1/mirroring/mirroring.proto









<a name="mirroring-v1-Mirroring"></a>

### Mirroring
Represent the mirroring service.

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Register | [.payload.v1.Mirroring.Request](#payload-v1-Mirroring-Request) | [.payload.v1.Empty](#payload-v1-Empty) | Register the RPC to register other mirroring servers. |





<a name="apis_proto_v1_payload_payload-proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down Expand Up @@ -676,6 +708,47 @@ Represent the insert request.



<a name="payload-v1-Mirroring"></a>

### Mirroring
hlts2 marked this conversation as resolved.
Show resolved Hide resolved
Mirroring related messages.






<a name="payload-v1-Mirroring-Request"></a>

### Mirroring.Request
Represent the mirroring request.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| targets | [Mirroring.Target](#payload-v1-Mirroring-Target) | repeated | The mirroring server targets. |






<a name="payload-v1-Mirroring-Target"></a>

### Mirroring.Target
Request server information.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ip | [string](#string) | | The target ip. |
| port | [uint32](#uint32) | | The target port. |






<a name="payload-v1-Object"></a>

### Object
Expand Down
99 changes: 99 additions & 0 deletions apis/grpc/v1/mirroring/mirroring.pb.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
//
// Copyright (C) 2019-2022 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.
//

package mirroring

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_mirroring_mirroring_proto protoreflect.FileDescriptor

var file_apis_proto_v1_mirroring_mirroring_proto_rawDesc = []byte{
0x0a, 0x27, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f,
0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72,
0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x69, 0x72, 0x72, 0x6f,
0x72, 0x69, 0x6e, 0x67, 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, 0x09, 0x4d,
0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x5c, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69,
0x73, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76,
0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13,
0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73,
0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x42, 0x60, 0x0a, 0x1f, 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, 0x69, 0x6e, 0x67, 0x42, 0x0d, 0x56, 0x61, 0x6c, 0x64, 0x4d,
0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x01, 0x5a, 0x2c, 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, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var file_apis_proto_v1_mirroring_mirroring_proto_goTypes = []interface{}{
(*payload.Mirroring_Request)(nil), // 0: payload.v1.Mirroring.Request
(*payload.Empty)(nil), // 1: payload.v1.Empty
}
var file_apis_proto_v1_mirroring_mirroring_proto_depIdxs = []int32{
0, // 0: mirroring.v1.Mirroring.Register:input_type -> payload.v1.Mirroring.Request
1, // 1: mirroring.v1.Mirroring.Register:output_type -> payload.v1.Empty
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
}

func init() { file_apis_proto_v1_mirroring_mirroring_proto_init() }
func file_apis_proto_v1_mirroring_mirroring_proto_init() {
if File_apis_proto_v1_mirroring_mirroring_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_apis_proto_v1_mirroring_mirroring_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_apis_proto_v1_mirroring_mirroring_proto_goTypes,
DependencyIndexes: file_apis_proto_v1_mirroring_mirroring_proto_depIdxs,
}.Build()
File_apis_proto_v1_mirroring_mirroring_proto = out.File
file_apis_proto_v1_mirroring_mirroring_proto_rawDesc = nil
file_apis_proto_v1_mirroring_mirroring_proto_goTypes = nil
file_apis_proto_v1_mirroring_mirroring_proto_depIdxs = nil
}
127 changes: 127 additions & 0 deletions apis/grpc/v1/mirroring/mirroring_vtproto.pb.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
//
// Copyright (C) 2019-2022 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.
//

package mirroring

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

// MirroringClient is the client API for Mirroring 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 MirroringClient interface {
// Register the RPC to register other mirroring servers.
Register(ctx context.Context, in *payload.Mirroring_Request, opts ...grpc.CallOption) (*payload.Empty, error)
}

type mirroringClient struct {
cc grpc.ClientConnInterface
}

func NewMirroringClient(cc grpc.ClientConnInterface) MirroringClient {
return &mirroringClient{cc}
}

func (c *mirroringClient) Register(ctx context.Context, in *payload.Mirroring_Request, opts ...grpc.CallOption) (*payload.Empty, error) {
out := new(payload.Empty)
err := c.cc.Invoke(ctx, "/mirroring.v1.Mirroring/Register", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}

// MirroringServer is the server API for Mirroring service.
// All implementations must embed UnimplementedMirroringServer
// for forward compatibility
type MirroringServer interface {
// Register the RPC to register other mirroring servers.
Register(context.Context, *payload.Mirroring_Request) (*payload.Empty, error)
mustEmbedUnimplementedMirroringServer()
}

// UnimplementedMirroringServer must be embedded to have forward compatible implementations.
type UnimplementedMirroringServer struct {
}

func (UnimplementedMirroringServer) Register(context.Context, *payload.Mirroring_Request) (*payload.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
}
func (UnimplementedMirroringServer) mustEmbedUnimplementedMirroringServer() {}

// UnsafeMirroringServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MirroringServer will
// result in compilation errors.
type UnsafeMirroringServer interface {
mustEmbedUnimplementedMirroringServer()
}

func RegisterMirroringServer(s grpc.ServiceRegistrar, srv MirroringServer) {
s.RegisterService(&Mirroring_ServiceDesc, srv)
}

func _Mirroring_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(payload.Mirroring_Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MirroringServer).Register(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/mirroring.v1.Mirroring/Register",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MirroringServer).Register(ctx, req.(*payload.Mirroring_Request))
}
return interceptor(ctx, in, info, handler)
}

// Mirroring_ServiceDesc is the grpc.ServiceDesc for Mirroring service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Mirroring_ServiceDesc = grpc.ServiceDesc{
ServiceName: "mirroring.v1.Mirroring",
HandlerType: (*MirroringServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Register",
Handler: _Mirroring_Register_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "apis/proto/v1/mirroring/mirroring.proto",
}
Loading