diff --git a/pkg/agent/core/faiss/handler/grpc/flush.go b/pkg/agent/core/faiss/handler/grpc/flush.go new file mode 100644 index 0000000000..dbaef33c9c --- /dev/null +++ b/pkg/agent/core/faiss/handler/grpc/flush.go @@ -0,0 +1,25 @@ +// 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. +package grpc + +import ( + "context" + + "github.com/vdaas/vald/apis/grpc/v1/payload" +) + +// TODO: implement Flush Handler +func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (*payload.Info_Index_Count, error) { + return s.UnimplementedValdServer.UnimplementedFlushServer.Flush(ctx, req) +} diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index c94d631dc9..edafb8e872 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -3341,6 +3341,11 @@ func (s *server) doStreamListObject(ctx context.Context, client vald.Object_Stre } } +// TODO: implement Flush handler +func (s *server) Flush(ctx context.Context, req *payload.Flush_Request) (*payload.Info_Index_Count, error) { + return s.UnimplementedFlushServer.Flush(ctx, req) +} + func (s *server) isProxied(ctx context.Context) bool { return s.gateway.FromForwardedContext(ctx) != "" } diff --git a/tests/e2e/crud/crud_test.go b/tests/e2e/crud/crud_test.go index 7db953c655..b35014282c 100644 --- a/tests/e2e/crud/crud_test.go +++ b/tests/e2e/crud/crud_test.go @@ -416,7 +416,11 @@ func TestE2EStandardCRUD(t *testing.T) { err = op.Flush(t, ctx) if err != nil { - t.Fatalf("an error occurred: %s", err) + // TODO: Remove code check afeter Flush API is available for agent-faiss and mirror-gateway + st, _, _ := status.ParseError(err, codes.Unknown, "") + if st.Code() != codes.Unimplemented { + t.Fatalf("an error occurred: %s", err) + } } }