Skip to content

Commit

Permalink
Add UpdateTimestamp API
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango committed Aug 14, 2024
1 parent 4fb802d commit f333828
Show file tree
Hide file tree
Showing 118 changed files with 9,321 additions and 1,257 deletions.
3,949 changes: 3,811 additions & 138 deletions .cspell.json

Large diffs are not rendered by default.

22 changes: 5 additions & 17 deletions .gitfiles
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# 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.
#
.all-contributorsrc
.commit_template
.cspell.json
Expand Down Expand Up @@ -140,7 +125,6 @@ Makefile
Makefile.d/actions.mk
Makefile.d/bench.mk
Makefile.d/build.mk
Makefile.d/client.mk
Makefile.d/dependencies.mk
Makefile.d/docker.mk
Makefile.d/e2e.mk
Expand Down Expand Up @@ -1904,6 +1888,11 @@ rust/libs/ngt-rs/src/input.h
rust/libs/ngt-rs/src/lib.rs
rust/libs/ngt/Cargo.toml
rust/libs/ngt/src/lib.rs
rust/libs/observability/Cargo.toml
rust/libs/observability/src/config.rs
rust/libs/observability/src/lib.rs
rust/libs/observability/src/macros.rs
rust/libs/observability/src/observability.rs
rust/libs/proto/Cargo.toml
rust/libs/proto/src/core.v1.tonic.rs
rust/libs/proto/src/discoverer.v1.tonic.rs
Expand Down Expand Up @@ -1965,7 +1954,6 @@ versions/PROTOBUF_VERSION
versions/REVIEWDOG_VERSION
versions/RUST_VERSION
versions/TELEPRESENCE_VERSION
versions/VALDCLI_VERSION
versions/VALD_VERSION
versions/YQ_VERSION
versions/ZLIB_VERSION
Expand Down
2 changes: 1 addition & 1 deletion .github/helm/values/values-correction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

defaults:
logging:
level: info
level: debug
networkPolicy:
enabled: true
gateway:
Expand Down
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ PROTOBUF_VERSION := $(eval PROTOBUF_VERSION := $(shell cat versions/PRO
REVIEWDOG_VERSION := $(eval REVIEWDOG_VERSION := $(shell cat versions/REVIEWDOG_VERSION))$(REVIEWDOG_VERSION)
RUST_VERSION := $(eval RUST_VERSION := $(shell cat versions/RUST_VERSION))$(RUST_VERSION)
TELEPRESENCE_VERSION := $(eval TELEPRESENCE_VERSION := $(shell cat versions/TELEPRESENCE_VERSION))$(TELEPRESENCE_VERSION)
VALDCLI_VERSION := $(eval VALDCLI_VERSION := $(shell cat versions/VALDCLI_VERSION))$(VALDCLI_VERSION)
YQ_VERSION := $(eval YQ_VERSION := $(shell cat versions/YQ_VERSION))$(YQ_VERSION)
ZLIB_VERSION := $(eval ZLIB_VERSION := $(shell cat versions/ZLIB_VERSION))$(ZLIB_VERSION)

Expand Down Expand Up @@ -455,7 +454,6 @@ init: \
tools/install: \
helm/install \
kind/install \
valdcli/install \
telepresence/install \
textlint/install

Expand Down Expand Up @@ -620,10 +618,6 @@ version/helm:
version/yq:
@echo $(YQ_VERSION)

.PHONY: version/valdcli
version/valdcli:
@echo $(VALDCLI_VERSION)

.PHONY: version/telepresence
version/telepresence:
@echo $(TELEPRESENCE_VERSION)
Expand Down Expand Up @@ -737,14 +731,14 @@ files/textlint: \
## run cspell for document
docs/cspell:\
cspell/install
cspell-cli $(ROOTDIR)/docs/**/*.md --show-suggestions $(CSPELL_EXTRA_OPTIONS)
cspell $(ROOTDIR)/docs/**/*.md --show-suggestions $(CSPELL_EXTRA_OPTIONS)

.PHONY: files/cspell
## run cspell for document
files/cspell: \
files \
cspell/install
cspell-cli $(ROOTDIR)/.gitfiles --show-suggestions $(CSPELL_EXTRA_OPTIONS)
cspell $(ROOTDIR)/.gitfiles --show-suggestions $(CSPELL_EXTRA_OPTIONS)

.PHONY: changelog/update
## update changelog
Expand All @@ -766,7 +760,6 @@ changelog/next/print:
include Makefile.d/actions.mk
include Makefile.d/bench.mk
include Makefile.d/build.mk
include Makefile.d/client.mk
include Makefile.d/dependencies.mk
include Makefile.d/docker.mk
include Makefile.d/e2e.mk
Expand All @@ -775,7 +768,7 @@ include Makefile.d/helm.mk
include Makefile.d/k3d.mk
include Makefile.d/k8s.mk
include Makefile.d/kind.mk
include Makefile.d/minikube.mk
include Makefile.d/proto.mk
include Makefile.d/test.mk
include Makefile.d/tools.mk
include Makefile.d/minikube.mk
45 changes: 0 additions & 45 deletions Makefile.d/client.mk

This file was deleted.

6 changes: 0 additions & 6 deletions Makefile.d/dependencies.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ update/libs: \
update/rust \
update/telepresence \
update/vald \
update/valdcli \
update/yq \
update/zlib

Expand Down Expand Up @@ -227,11 +226,6 @@ update/hdf5:
update/vald:
curl -fsSL https://api.github.com/repos/$(REPO)/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' > $(ROOTDIR)/versions/VALD_VERSION

.PHONY: update/valdcli
## update vald client library made by clojure self version
update/valdcli:
curl -fsSL https://api.github.com/repos/$(REPO)-client-clj/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' > $(ROOTDIR)/versions/VALDCLI_VERSION

.PHONY: update/template
## update PULL_REQUEST_TEMPLATE and ISSUE_TEMPLATE
update/template:
Expand Down
29 changes: 28 additions & 1 deletion Makefile.d/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,34 @@ textlint/ci/install:
cspell/install: $(NPM_GLOBAL_PREFIX)/bin/cspell

$(NPM_GLOBAL_PREFIX)/bin/cspell:
npm install -g cspell@latest
npm install -g cspell@latest \
@cspell/dict-cpp \
@cspell/dict-docker \
@cspell/dict-en_us \
@cspell/dict-fullstack \
@cspell/dict-git \
@cspell/dict-golang \
@cspell/dict-k8s \
@cspell/dict-makefile \
@cspell/dict-markdown \
@cspell/dict-npm \
@cspell/dict-public-licenses \
@cspell/dict-rust \
@cspell/dict-shell
cspell link add @cspell/dict-cpp
cspell link add @cspell/dict-docker
cspell link add @cspell/dict-en_us
cspell link add @cspell/dict-fullstack
cspell link add @cspell/dict-git
cspell link add @cspell/dict-golang
cspell link add @cspell/dict-k8s
cspell link add @cspell/dict-makefile
cspell link add @cspell/dict-markdown
cspell link add @cspell/dict-npm
cspell link add @cspell/dict-public-licenses
cspell link add @cspell/dict-rust
cspell link add @cspell/dict-shell


.PHONY: buf/install
buf/install: $(BINDIR)/buf
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ make init
## Contributors

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand Down
11 changes: 6 additions & 5 deletions apis/docs/v1/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1664,11 +1664,12 @@ Search service provides ways to search indexed vectors.

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. |
| 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. |
| UpdateTimestamp | [.payload.v1.Object.Timestamp](#payload-v1-Object-Timestamp) | [.payload.v1.Object.Location](#payload-v1-Object-Location) | A method to update timestamp an indexed vector. |

<a name="v1_vald_upsert-proto"></a>

Expand Down
41 changes: 25 additions & 16 deletions apis/grpc/v1/vald/update.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions apis/grpc/v1/vald/update_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ type UpdateClient interface {
StreamUpdate(ctx context.Context, opts ...grpc.CallOption) (Update_StreamUpdateClient, error)
// A method to update multiple indexed vectors in a single request.
MultiUpdate(ctx context.Context, in *payload.Update_MultiRequest, opts ...grpc.CallOption) (*payload.Object_Locations, error)
// A method to update timestamp an indexed vector.
UpdateTimestamp(ctx context.Context, in *payload.Object_Timestamp, opts ...grpc.CallOption) (*payload.Object_Location, error)
}

type updateClient struct {
Expand Down Expand Up @@ -113,6 +115,17 @@ func (c *updateClient) MultiUpdate(
return out, nil
}

func (c *updateClient) UpdateTimestamp(
ctx context.Context, in *payload.Object_Timestamp, opts ...grpc.CallOption,
) (*payload.Object_Location, error) {
out := new(payload.Object_Location)
err := c.cc.Invoke(ctx, "/vald.v1.Update/UpdateTimestamp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}

// UpdateServer is the server API for Update service.
// All implementations must embed UnimplementedUpdateServer
// for forward compatibility
Expand All @@ -123,6 +136,8 @@ type UpdateServer interface {
StreamUpdate(Update_StreamUpdateServer) error
// A method to update multiple indexed vectors in a single request.
MultiUpdate(context.Context, *payload.Update_MultiRequest) (*payload.Object_Locations, error)
// A method to update timestamp an indexed vector.
UpdateTimestamp(context.Context, *payload.Object_Timestamp) (*payload.Object_Location, error)
mustEmbedUnimplementedUpdateServer()
}

Expand All @@ -144,6 +159,12 @@ func (UnimplementedUpdateServer) MultiUpdate(
) (*payload.Object_Locations, error) {
return nil, status.Errorf(codes.Unimplemented, "method MultiUpdate not implemented")
}

func (UnimplementedUpdateServer) UpdateTimestamp(
context.Context, *payload.Object_Timestamp,
) (*payload.Object_Location, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateTimestamp not implemented")
}
func (UnimplementedUpdateServer) mustEmbedUnimplementedUpdateServer() {}

// UnsafeUpdateServer may be embedded to opt out of forward compatibility for this service.
Expand Down Expand Up @@ -223,6 +244,26 @@ func _Update_MultiUpdate_Handler(
return interceptor(ctx, in, info, handler)
}

func _Update_UpdateTimestamp_Handler(
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Object_Timestamp)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UpdateServer).UpdateTimestamp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vald.v1.Update/UpdateTimestamp",
}
handler := func(ctx context.Context, req any) (any, error) {
return srv.(UpdateServer).UpdateTimestamp(ctx, req.(*payload.Object_Timestamp))
}
return interceptor(ctx, in, info, handler)
}

// Update_ServiceDesc is the grpc.ServiceDesc for Update service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
Expand All @@ -238,6 +279,10 @@ var Update_ServiceDesc = grpc.ServiceDesc{
MethodName: "MultiUpdate",
Handler: _Update_MultiUpdate_Handler,
},
{
MethodName: "UpdateTimestamp",
Handler: _Update_UpdateTimestamp_Handler,
},
},
Streams: []grpc.StreamDesc{
{
Expand Down
Loading

0 comments on commit f333828

Please sign in to comment.