From ad244dc4e897cdc31dd7e447defcb573e24e81e2 Mon Sep 17 00:00:00 2001 From: dragondriver Date: Tue, 26 Jan 2021 15:09:31 +0800 Subject: [PATCH] Add initial interface to proxy service client Signed-off-by: dragondriver --- internal/distributed/proxyservice/client.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/internal/distributed/proxyservice/client.go b/internal/distributed/proxyservice/client.go index 94c29241ad..d53b9c83f2 100644 --- a/internal/distributed/proxyservice/client.go +++ b/internal/distributed/proxyservice/client.go @@ -3,6 +3,10 @@ package grpcproxyservice import ( "context" + "github.com/zilliztech/milvus-distributed/internal/proto/internalpb2" + + "github.com/zilliztech/milvus-distributed/internal/proto/commonpb" + "google.golang.org/grpc" "github.com/zilliztech/milvus-distributed/internal/proto/proxypb" @@ -44,6 +48,18 @@ func (c *Client) InvalidateCollectionMetaCache(request *proxypb.InvalidateCollMe return err } +func (c *Client) GetTimeTickChannel() (string, error) { + response, err := c.proxyServiceClient.GetTimeTickChannel(c.ctx, &commonpb.Empty{}) + if err != nil { + return "", err + } + return response.Value, nil +} + +func (c *Client) GetComponentStates() (*internalpb2.ComponentStates, error) { + return c.proxyServiceClient.GetComponentStates(c.ctx, &commonpb.Empty{}) +} + func NewClient(address string) *Client { return &Client{ address: address,