Fix golint error in querycoord (#9836)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/9770/head
zhenshan.cao 2021-10-13 21:46:32 +08:00 committed by GitHub
parent 3b230b5cd9
commit 609cc24309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 11 deletions

View File

@ -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,

View File

@ -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()

View File

@ -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

View File

@ -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)

View File

@ -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
}