mirror of https://github.com/milvus-io/milvus.git
Fix golint error in querycoord (#9836)
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/9770/head
parent
3b230b5cd9
commit
609cc24309
|
@ -166,7 +166,7 @@ func TestGrpcRequest(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("Test AddQueryChannel", func(t *testing.T) {
|
||||
reqChannel, resChannel, err := cluster.clusterMeta.GetQueryChannel(defaultCollectionID)
|
||||
reqChannel, resChannel, err := cluster.clusterMeta.getQueryChannel(defaultCollectionID)
|
||||
assert.Nil(t, err)
|
||||
addQueryChannelReq := &querypb.AddQueryChannelRequest{
|
||||
NodeID: nodeID,
|
||||
|
@ -179,7 +179,7 @@ func TestGrpcRequest(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("Test RemoveQueryChannel", func(t *testing.T) {
|
||||
reqChannel, resChannel, err := cluster.clusterMeta.GetQueryChannel(defaultCollectionID)
|
||||
reqChannel, resChannel, err := cluster.clusterMeta.getQueryChannel(defaultCollectionID)
|
||||
assert.Nil(t, err)
|
||||
removeQueryChannelReq := &querypb.RemoveQueryChannelRequest{
|
||||
NodeID: nodeID,
|
||||
|
|
|
@ -445,7 +445,7 @@ func (qc *QueryCoord) CreateQueryChannel(ctx context.Context, req *querypb.Creat
|
|||
}
|
||||
|
||||
collectionID := req.CollectionID
|
||||
queryChannel, queryResultChannel, err := qc.meta.GetQueryChannel(collectionID)
|
||||
queryChannel, queryResultChannel, err := qc.meta.getQueryChannel(collectionID)
|
||||
if err != nil {
|
||||
status.ErrorCode = commonpb.ErrorCode_UnexpectedError
|
||||
status.Reason = err.Error()
|
||||
|
|
|
@ -63,7 +63,7 @@ type Meta interface {
|
|||
removeDmChannel(collectionID UniqueID, nodeID int64, channels []string) error
|
||||
|
||||
getQueryChannelInfoByID(collectionID UniqueID) (*querypb.QueryChannelInfo, error)
|
||||
GetQueryChannel(collectionID UniqueID) (string, string, error)
|
||||
getQueryChannel(collectionID UniqueID) (string, string, error)
|
||||
|
||||
setLoadType(collectionID UniqueID, loadType querypb.LoadType) error
|
||||
getLoadType(collectionID UniqueID) (querypb.LoadType, error)
|
||||
|
@ -578,7 +578,7 @@ func (m *MetaReplica) removeDmChannel(collectionID UniqueID, nodeID int64, chann
|
|||
return errors.New("addDmChannels: can't find collection in collectionInfos")
|
||||
}
|
||||
|
||||
func (m *MetaReplica) GetQueryChannel(collectionID UniqueID) (string, string, error) {
|
||||
func (m *MetaReplica) getQueryChannel(collectionID UniqueID) (string, string, error) {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
|
@ -601,7 +601,7 @@ func (m *MetaReplica) GetQueryChannel(collectionID UniqueID) (string, string, er
|
|||
}
|
||||
err := saveQueryChannelInfo(collectionID, queryChannelInfo, m.client)
|
||||
if err != nil {
|
||||
log.Error("GetQueryChannel: save channel to etcd error", zap.Error(err))
|
||||
log.Error("getQueryChannel: save channel to etcd error", zap.Error(err))
|
||||
return "", "", err
|
||||
}
|
||||
m.queryChannelInfos[collectionID] = queryChannelInfo
|
||||
|
|
|
@ -232,8 +232,8 @@ func TestMetaFunc(t *testing.T) {
|
|||
assert.Equal(t, defaultSegmentID, infos[0].SegmentID)
|
||||
})
|
||||
|
||||
t.Run("Test GetQueryChannel", func(t *testing.T) {
|
||||
reqChannel, resChannel, err := meta.GetQueryChannel(defaultCollectionID)
|
||||
t.Run("Test getQueryChannel", func(t *testing.T) {
|
||||
reqChannel, resChannel, err := meta.getQueryChannel(defaultCollectionID)
|
||||
assert.NotNil(t, reqChannel)
|
||||
assert.NotNil(t, resChannel)
|
||||
assert.Nil(t, err)
|
||||
|
|
|
@ -1038,7 +1038,7 @@ func (lst *LoadSegmentTask) Reschedule(ctx context.Context) ([]task, error) {
|
|||
|
||||
hasWatchQueryChannel := lst.cluster.hasWatchedQueryChannel(lst.ctx, nodeID, collectionID)
|
||||
if !hasWatchQueryChannel {
|
||||
queryChannel, queryResultChannel, err := lst.meta.GetQueryChannel(collectionID)
|
||||
queryChannel, queryResultChannel, err := lst.meta.getQueryChannel(collectionID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -1257,7 +1257,7 @@ func (wdt *WatchDmChannelTask) Reschedule(ctx context.Context) ([]task, error) {
|
|||
|
||||
hasWatchQueryChannel := wdt.cluster.hasWatchedQueryChannel(wdt.ctx, nodeID, collectionID)
|
||||
if !hasWatchQueryChannel {
|
||||
queryChannel, queryResultChannel, err := wdt.meta.GetQueryChannel(collectionID)
|
||||
queryChannel, queryResultChannel, err := wdt.meta.getQueryChannel(collectionID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -1818,7 +1818,7 @@ func assignInternalTask(ctx context.Context,
|
|||
for nodeID, watched := range watchQueryChannelInfo {
|
||||
if !watched {
|
||||
ctx = opentracing.ContextWithSpan(context.Background(), sp)
|
||||
queryChannel, queryResultChannel, err := meta.GetQueryChannel(collectionID)
|
||||
queryChannel, queryResultChannel, err := meta.getQueryChannel(collectionID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue