mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix: Added GetMetrics back to IndexNodeServer to ensure compatibility (#45073)
issue: #45070 --------- Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
c328fd3c6a
commit
b069eeecd2
@ -197,7 +197,7 @@ func (c *Client) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest
|
||||
req.GetBase(),
|
||||
commonpbutil.FillMsgBaseFromClient(c.serverID))
|
||||
return wrapGrpcCall(ctx, c, func(client DataNodeClient) (*milvuspb.GetMetricsResponse, error) {
|
||||
return client.GetMetrics(ctx, req)
|
||||
return client.DataNodeClient.GetMetrics(ctx, req)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import "common.proto";
|
||||
import "schema.proto";
|
||||
import "data_coord.proto";
|
||||
import "index_coord.proto";
|
||||
import "milvus.proto";
|
||||
|
||||
|
||||
service IndexNode {
|
||||
@ -26,6 +27,11 @@ service IndexNode {
|
||||
// Deprecated
|
||||
rpc DropJobsV2(DropJobsV2Request) returns (common.Status) {}
|
||||
|
||||
// https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
|
||||
rpc GetMetrics(milvus.GetMetricsRequest)
|
||||
returns (milvus.GetMetricsResponse) {
|
||||
}
|
||||
|
||||
rpc CreateTask(CreateTaskRequest) returns (common.Status) {}
|
||||
rpc QueryTask(QueryTaskRequest) returns (QueryTaskResponse) {}
|
||||
rpc DropTask(DropTaskRequest) returns (common.Status) {}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -9,6 +9,7 @@ package workerpb
|
||||
import (
|
||||
context "context"
|
||||
commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
|
||||
milvuspb "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
@ -27,6 +28,7 @@ const (
|
||||
IndexNode_CreateJobV2_FullMethodName = "/milvus.proto.index.IndexNode/CreateJobV2"
|
||||
IndexNode_QueryJobsV2_FullMethodName = "/milvus.proto.index.IndexNode/QueryJobsV2"
|
||||
IndexNode_DropJobsV2_FullMethodName = "/milvus.proto.index.IndexNode/DropJobsV2"
|
||||
IndexNode_GetMetrics_FullMethodName = "/milvus.proto.index.IndexNode/GetMetrics"
|
||||
IndexNode_CreateTask_FullMethodName = "/milvus.proto.index.IndexNode/CreateTask"
|
||||
IndexNode_QueryTask_FullMethodName = "/milvus.proto.index.IndexNode/QueryTask"
|
||||
IndexNode_DropTask_FullMethodName = "/milvus.proto.index.IndexNode/DropTask"
|
||||
@ -50,6 +52,8 @@ type IndexNodeClient interface {
|
||||
QueryJobsV2(ctx context.Context, in *QueryJobsV2Request, opts ...grpc.CallOption) (*QueryJobsV2Response, error)
|
||||
// Deprecated
|
||||
DropJobsV2(ctx context.Context, in *DropJobsV2Request, opts ...grpc.CallOption) (*commonpb.Status, error)
|
||||
// https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
|
||||
GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest, opts ...grpc.CallOption) (*milvuspb.GetMetricsResponse, error)
|
||||
CreateTask(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*commonpb.Status, error)
|
||||
QueryTask(ctx context.Context, in *QueryTaskRequest, opts ...grpc.CallOption) (*QueryTaskResponse, error)
|
||||
DropTask(ctx context.Context, in *DropTaskRequest, opts ...grpc.CallOption) (*commonpb.Status, error)
|
||||
@ -126,6 +130,15 @@ func (c *indexNodeClient) DropJobsV2(ctx context.Context, in *DropJobsV2Request,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *indexNodeClient) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest, opts ...grpc.CallOption) (*milvuspb.GetMetricsResponse, error) {
|
||||
out := new(milvuspb.GetMetricsResponse)
|
||||
err := c.cc.Invoke(ctx, IndexNode_GetMetrics_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *indexNodeClient) CreateTask(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
|
||||
out := new(commonpb.Status)
|
||||
err := c.cc.Invoke(ctx, IndexNode_CreateTask_FullMethodName, in, out, opts...)
|
||||
@ -171,6 +184,8 @@ type IndexNodeServer interface {
|
||||
QueryJobsV2(context.Context, *QueryJobsV2Request) (*QueryJobsV2Response, error)
|
||||
// Deprecated
|
||||
DropJobsV2(context.Context, *DropJobsV2Request) (*commonpb.Status, error)
|
||||
// https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
|
||||
GetMetrics(context.Context, *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error)
|
||||
CreateTask(context.Context, *CreateTaskRequest) (*commonpb.Status, error)
|
||||
QueryTask(context.Context, *QueryTaskRequest) (*QueryTaskResponse, error)
|
||||
DropTask(context.Context, *DropTaskRequest) (*commonpb.Status, error)
|
||||
@ -201,6 +216,9 @@ func (UnimplementedIndexNodeServer) QueryJobsV2(context.Context, *QueryJobsV2Req
|
||||
func (UnimplementedIndexNodeServer) DropJobsV2(context.Context, *DropJobsV2Request) (*commonpb.Status, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DropJobsV2 not implemented")
|
||||
}
|
||||
func (UnimplementedIndexNodeServer) GetMetrics(context.Context, *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetMetrics not implemented")
|
||||
}
|
||||
func (UnimplementedIndexNodeServer) CreateTask(context.Context, *CreateTaskRequest) (*commonpb.Status, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateTask not implemented")
|
||||
}
|
||||
@ -348,6 +366,24 @@ func _IndexNode_DropJobsV2_Handler(srv interface{}, ctx context.Context, dec fun
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IndexNode_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(milvuspb.GetMetricsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IndexNodeServer).GetMetrics(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IndexNode_GetMetrics_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IndexNodeServer).GetMetrics(ctx, req.(*milvuspb.GetMetricsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IndexNode_CreateTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateTaskRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@ -437,6 +473,10 @@ var IndexNode_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "DropJobsV2",
|
||||
Handler: _IndexNode_DropJobsV2_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetMetrics",
|
||||
Handler: _IndexNode_GetMetrics_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateTask",
|
||||
Handler: _IndexNode_CreateTask_Handler,
|
||||
|
||||
@ -95,6 +95,10 @@ func (c *dataNodeClient) CreateJobV2(ctx context.Context, in *workerpb.CreateJob
|
||||
return c.IndexNodeClient.CreateJobV2(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (c *dataNodeClient) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest, opts ...grpc.CallOption) (*milvuspb.GetMetricsResponse, error) {
|
||||
return c.DataNodeClient.GetMetrics(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (c *dataNodeClient) Close() error {
|
||||
return c.conn.Close()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user