Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/agent-ngt/remove-invalid-index-hung
Browse files Browse the repository at this point in the history
  • Loading branch information
kpango committed Feb 20, 2024
2 parents cc408d9 + d482c0f commit f402f7d
Show file tree
Hide file tree
Showing 20 changed files with 303 additions and 277 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,16 @@ Docker images tagging policy:
## Vald Users

<p align="center">
<img src="./assets/image/vald-users/yahoojapan.svg" alt="yahoojapan" width="30%" />
&nbsp; &nbsp; &nbsp; &nbsp;
<img src="./assets/image/vald-users/japansearch_color.png.webp" alt="jpsearch" />
</ul>
<a href="https://www.lycorp.co.jp/en/" target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./assets/image/vald-users/lycorp_white.png">
<source media="(prefers-color-scheme: light)" srcset="./assets/image/vald-users/lycorp_black.png">
<img alt="LY" src="./assets/image/vald-users/lycorp.png" width="150" height="120">
</picture>
</a>
<a href="https://jpsearch.go.jp/" target="_blank">
<img src="./assets/image/vald-users/japansearch_color.png" alt="jpsearch" width="150" height="120"/>
</a>
</p>

## Contribution
Expand Down
23 changes: 23 additions & 0 deletions apis/grpc/v1/mirror/mirror.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// 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.
// 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 provides vald server interface
package mirror

const (
RPCServiceName = "Mirror"
RegisterRPCName = "Register"
)
36 changes: 0 additions & 36 deletions apis/grpc/v1/vald/vald.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package vald

import (
"github.com/vdaas/vald/apis/grpc/v1/mirror"
grpc "google.golang.org/grpc"
)

Expand All @@ -36,11 +35,6 @@ type ServerWithFilter interface {
FilterServer
}

type ServerWithMirror interface {
Server
mirror.MirrorServer
}

type UnimplementedValdServer struct {
UnimplementedInsertServer
UnimplementedUpdateServer
Expand All @@ -55,11 +49,6 @@ type UnimplementedValdServerWithFilter struct {
UnimplementedFilterServer
}

type UnimplementedValdServerWithMirror struct {
UnimplementedValdServer
mirror.UnimplementedMirrorServer
}

type Client interface {
InsertClient
UpdateClient
Expand All @@ -74,11 +63,6 @@ type ClientWithFilter interface {
FilterClient
}

type ClientWithMirror interface {
Client
mirror.MirrorClient
}

const PackageName = "vald.v1"

const (
Expand All @@ -89,7 +73,6 @@ const (
RemoveRPCServiceName = "Remove"
ObjectRPCServiceName = "Object"
FilterRPCServiceName = "Filter"
MirrorRPCServiceName = "Mirror"
)

const (
Expand Down Expand Up @@ -143,8 +126,6 @@ const (
GetTimestampRPCName = "GetTimestamp"
StreamGetObjectRPCName = "StreamGetObject"
StreamListObjectRPCName = "StreamListObject"

RegisterRPCName = "Register"
)

type client struct {
Expand All @@ -156,11 +137,6 @@ type client struct {
ObjectClient
}

type clientWithMirror struct {
Client
mirror.MirrorClient
}

func RegisterValdServer(s *grpc.Server, srv Server) {
RegisterInsertServer(s, srv)
RegisterUpdateServer(s, srv)
Expand All @@ -175,11 +151,6 @@ 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),
Expand All @@ -190,10 +161,3 @@ func NewValdClient(conn *grpc.ClientConn) Client {
NewObjectClient(conn),
}
}

func NewValdClientWithMirror(conn *grpc.ClientConn) ClientWithMirror {
return &clientWithMirror{
Client: NewValdClient(conn),
MirrorClient: mirror.NewMirrorClient(conn),
}
}
Binary file added assets/image/vald-users/japansearch_color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/image/vald-users/japansearch_color.png.webp
Binary file not shown.
Binary file added assets/image/vald-users/lycorp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/vald-users/lycorp_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/vald-users/lycorp_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/image/vald-users/yahoojapan.svg

This file was deleted.

3 changes: 1 addition & 2 deletions internal/client/v1/client/mirror/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (

"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"
Expand Down Expand Up @@ -69,7 +68,7 @@ func (c *client) GRPCClient() grpc.Client {
}

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)
ctx, span := trace.StartSpan(grpc.WrapGRPCMethod(ctx, "internal/client/"+mirror.RegisterRPCName), apiName+"/"+mirror.RegisterRPCName)
defer func() {
if span != nil {
span.End()
Expand Down
4 changes: 3 additions & 1 deletion internal/test/mock/client/mirror_client_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ package client
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/net/grpc"
)

type MirrorClientMock struct {
vald.ClientWithMirror
vald.Client
mirror.MirrorClient

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)
Expand Down
Loading

0 comments on commit f402f7d

Please sign in to comment.