提交 50a5f974 编写于 作者: X xige-16 提交者: yefu.chen

Delete componentStateResponse in queryService.proto

Signed-off-by: Nxige-16 <xi.ge@zilliz.com>
上级 f5977a13
......@@ -54,11 +54,7 @@ func (c *Client) Stop() error {
}
func (c *Client) GetComponentStates() (*internalpb2.ComponentStates, error) {
states, err := c.grpcClient.GetComponentStates(context.TODO(), nil)
if err != nil {
return nil, err
}
return states.States, nil
return c.grpcClient.GetComponentStates(context.TODO(), nil)
}
func (c *Client) GetTimeTickChannel() (string, error) {
......
......@@ -283,18 +283,9 @@ func (s *Server) GetStatsChannel(ctx context.Context, in *commonpb.Empty) (*milv
}, nil
}
func (s *Server) GetComponentStates(ctx context.Context, in *commonpb.Empty) (*querypb.ComponentStatesResponse, error) {
func (s *Server) GetComponentStates(ctx context.Context, in *commonpb.Empty) (*internalpb2.ComponentStates, error) {
// ignore ctx and in
componentStates, err := s.impl.GetComponentStates()
if err != nil {
return nil, err
}
return &querypb.ComponentStatesResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
},
States: componentStates,
}, nil
return s.impl.GetComponentStates()
}
func (s *Server) AddQueryChannel(ctx context.Context, in *querypb.AddQueryChannelsRequest) (*commonpb.Status, error) {
......
......@@ -140,11 +140,6 @@ message ReleaseSegmentRequest {
repeated int64 fieldIDs = 6;
}
message ComponentStatesResponse {
common.Status status = 1;
internal.ComponentStates states = 2;
}
message SegmentInfo {
int64 segmentID = 1;
int64 collectionID = 2;
......@@ -187,7 +182,7 @@ service QueryService {
service QueryNode {
rpc GetTimeTickChannel(common.Empty) returns (milvus.StringResponse) {}
rpc GetStatsChannel(common.Empty) returns (milvus.StringResponse) {}
rpc GetComponentStates(common.Empty) returns (ComponentStatesResponse) {}
rpc GetComponentStates(common.Empty) returns (internal.ComponentStates) {}
rpc AddQueryChannel(AddQueryChannelsRequest) returns (common.Status) {}
rpc RemoveQueryChannel(RemoveQueryChannelsRequest) returns (common.Status) {}
......
......@@ -274,18 +274,26 @@ func (node *QueryNode) SetDataService(data DataServiceInterface) error {
}
func (node *QueryNode) GetComponentStates() (*internalpb2.ComponentStates, error) {
stats := &internalpb2.ComponentStates{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
},
}
code, ok := node.stateCode.Load().(internalpb2.StateCode)
if !ok {
return nil, errors.New("unexpected error in type assertion")
errMsg := "unexpected error in type assertion"
stats.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
Reason: errMsg,
}
return stats, errors.New(errMsg)
}
info := &internalpb2.ComponentInfo{
NodeID: Params.QueryNodeID,
Role: typeutil.QueryNodeRole,
StateCode: code,
}
stats := &internalpb2.ComponentStates{
State: info,
}
stats.State = info
return stats, nil
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册