Cai Yudong 92e429d812
Rename IndexService to IndexCoord (#5932)
* rename package indexservice to indexcoord

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename indexservice to indexcoord

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* fix queryservice static-check

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* move distributed/indexservice to distributed/indexcoord

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* move internal/indexservice to internal/indexcoord

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename indexservice to indexcoord

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename MasterComponent to RootCoordComponent

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename master to rootcoord for queryservice

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename master to rootcoord for dataservice

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename master to rootcoord for datanode

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename master to rootcoord for proxynode

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename master to rootcoord for querynode

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename master to rootcoord

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename IndexService to IndexCoord

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* rename IndexService to IndexCoord

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* fix rebase issue

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
2021-06-21 17:28:03 +08:00

70 lines
1.8 KiB
Go

// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License.
package indexcoord
import (
"github.com/milvus-io/milvus/internal/log"
"github.com/milvus-io/milvus/internal/proto/commonpb"
)
func CompareAddress(a *commonpb.Address, b *commonpb.Address) bool {
if a == b {
return true
}
return a.Ip == b.Ip && a.Port == b.Port
}
func compare2Array(arr1, arr2 interface{}) bool {
p1, ok := arr1.([]*commonpb.KeyValuePair)
if ok {
p2, ok1 := arr2.([]*commonpb.KeyValuePair)
if ok1 {
for _, param1 := range p1 {
sameParams := false
for _, param2 := range p2 {
if param1.Key == param2.Key && param1.Value == param2.Value {
sameParams = true
}
}
if !sameParams {
return false
}
}
return true
}
log.Error("IndexCoord compare2Array arr2 should be commonpb.KeyValuePair")
return false
}
v1, ok2 := arr1.([]string)
if ok2 {
v2, ok3 := arr2.([]string)
if ok3 {
for _, s1 := range v1 {
sameParams := false
for _, s2 := range v2 {
if s1 == s2 {
sameParams = true
}
}
if !sameParams {
return false
}
}
return true
}
log.Error("IndexCoord compare2Array arr2 type should be string array")
return false
}
log.Error("IndexCoord compare2Array param type should be commonpb.KeyValuePair or string array")
return false
}