Add enum Role in internal.proto

Signed-off-by: XuanYang-cn <xuan.yang@zilliz.com>
pull/4973/head^2
XuanYang-cn 2021-01-23 18:56:08 +08:00 committed by yefu.chen
parent e2b45f9866
commit b794921b7e
7 changed files with 18 additions and 5 deletions

View File

@ -262,7 +262,7 @@ func (sa *SegIDAssigner) syncSegments() bool {
defer cancel()
req := &datapb.AssignSegIDRequest{
NodeID: sa.PeerID,
PeerRole: "ProxyNode",
PeerRole: typeutil.ProxyNodeRole,
SegIDRequests: sa.segReqs,
}

View File

@ -15,6 +15,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/zilliztech/milvus-distributed/internal/util/tsoutil"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
@ -1147,7 +1148,7 @@ func TestMaster(t *testing.T) {
resp, err := cli.AssignSegmentID(ctx, &datapb.AssignSegIDRequest{
NodeID: 1,
PeerRole: "ProxyNode",
PeerRole: typeutil.ProxyNodeRole,
SegIDRequests: []*datapb.SegIDRequest{
{Count: 10000, ChannelName: "0", CollName: collName, PartitionName: partitionName},
},

View File

@ -612,7 +612,7 @@ func (c *Core) GetComponentStates(empty *commonpb.Empty) (*internalpb2.Component
return &internalpb2.ComponentStates{
State: &internalpb2.ComponentInfo{
NodeID: int64(Params.NodeID),
Role: "master",
Role: typeutil.MasterServiceRole,
StateCode: code,
ExtraInfo: nil,
},

View File

@ -10,7 +10,6 @@ enum StateCode {
ABNORMAL = 2;
}
message ComponentInfo {
int64 nodeID = 1;
string role = 2;

View File

@ -182,7 +182,7 @@ func (node *QueryNode) GetComponentStates() (*internalpb2.ComponentStates, error
}
info := &internalpb2.ComponentInfo{
NodeID: Params.QueryNodeID,
Role: "query-node",
Role: typeutil.QueryNodeRole,
StateCode: code,
}
stats := &internalpb2.ComponentStates{

View File

@ -3,3 +3,15 @@ package typeutil
type Timestamp = uint64
type IntPrimaryKey = int64
type UniqueID = int64
const (
MasterServiceRole = "MasterService"
ProxyServiceRole = "ProxyService"
ProxyNodeRole = "ProxyNode"
QueryServiceRole = "QueryService"
QueryNodeRole = "QueryNode"
IndexServiceRole = "IndexService"
IndexNodeRole = "IndexNode"
DataServiceRole = "DataService"
DataNodeRole = "DataNode"
)

View File

@ -17,6 +17,7 @@ echo $MILVUS_DIR
go test -race -cover "${MILVUS_DIR}/kv/..." -failfast
go test -race -cover "${MILVUS_DIR}/proxynode/..." -failfast
go test -race -cover "${MILVUS_DIR}/writenode/..." -failfast
go test -race -cover "${MILVUS_DIR}/datanode/..." -failfast
go test -race -cover "${MILVUS_DIR}/master/..." -failfast
go test -race -cover "${MILVUS_DIR}/indexnode/..." -failfast
go test -race -cover "${MILVUS_DIR}/msgstream/..." "${MILVUS_DIR}/querynode/..." "${MILVUS_DIR}/storage" "${MILVUS_DIR}/util/..." -failfast