mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix etcd path bug
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
This commit is contained in:
parent
41297f89b5
commit
bd696486c9
@ -3,6 +3,7 @@ package reader
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"path"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -22,17 +23,17 @@ const (
|
||||
)
|
||||
|
||||
func GetCollectionObjId(key string) string {
|
||||
prefix := conf.Config.Etcd.Rootpath + CollectonPrefix
|
||||
prefix := path.Join(conf.Config.Etcd.Rootpath, CollectonPrefix) + "/"
|
||||
return strings.TrimPrefix(key, prefix)
|
||||
}
|
||||
|
||||
func GetSegmentObjId(key string) string {
|
||||
prefix := conf.Config.Etcd.Rootpath + SegmentPrefix
|
||||
prefix := path.Join(conf.Config.Etcd.Rootpath, SegmentPrefix) + "/"
|
||||
return strings.TrimPrefix(key, prefix)
|
||||
}
|
||||
|
||||
func isCollectionObj(key string) bool {
|
||||
prefix := conf.Config.Etcd.Rootpath + CollectonPrefix
|
||||
prefix := path.Join(conf.Config.Etcd.Rootpath, CollectonPrefix) + "/"
|
||||
prefix = strings.TrimSpace(prefix)
|
||||
println("prefix is :$", prefix)
|
||||
index := strings.Index(key, prefix)
|
||||
@ -41,7 +42,7 @@ func isCollectionObj(key string) bool {
|
||||
}
|
||||
|
||||
func isSegmentObj(key string) bool {
|
||||
prefix := conf.Config.Etcd.Rootpath + SegmentPrefix
|
||||
prefix := path.Join(conf.Config.Etcd.Rootpath, SegmentPrefix) + "/"
|
||||
prefix = strings.TrimSpace(prefix)
|
||||
index := strings.Index(key, prefix)
|
||||
return index == 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user