Set metric type while init the collection (#24665)

Signed-off-by: yah01 <[email protected]>
This commit is contained in:
yah01
2023-06-06 13:24:36 +08:00
committed by GitHub
parent 2c1c0f3ed3
commit fb66924c90
2 changed files with 4 additions and 8 deletions
+4 -6
View File
@@ -25,11 +25,12 @@ package segments
import "C"
import (
"sync"
"unsafe"
"github.com/milvus-io/milvus/internal/proto/segcorepb"
"github.com/milvus-io/milvus/pkg/log"
"go.uber.org/zap"
"sync"
"unsafe"
"github.com/golang/protobuf/proto"
@@ -70,6 +71,7 @@ func (m *collectionManager) Put(collectionID int64, schema *schemapb.CollectionS
}
collection := NewCollection(collectionID, schema, meta, loadMeta.GetLoadType())
collection.metricType = loadMeta.GetMetricType()
collection.AddPartition(loadMeta.GetPartitionIDs()...)
m.collections[collectionID] = collection
}
@@ -123,10 +125,6 @@ func (c *Collection) GetLoadType() querypb.LoadType {
return c.loadType
}
func (c *Collection) SetMetricType(metricType string) {
c.metricType = metricType
}
func (c *Collection) GetMetricType() string {
return c.metricType
}
-2
View File
@@ -248,8 +248,6 @@ func (node *QueryNode) WatchDmChannels(ctx context.Context, req *querypb.WatchDm
IndexMetas: fieldIndexMetas,
MaxIndexRowCount: maxIndexRecordPerSegment,
}, req.GetLoadMeta())
collection := node.manager.Collection.Get(req.GetCollectionID())
collection.SetMetricType(req.GetLoadMeta().GetMetricType())
delegator, err := delegator.NewShardDelegator(req.GetCollectionID(), req.GetReplicaID(), channel.GetChannelName(), req.GetVersion(),
node.clusterManager, node.manager, node.tSafeManager, node.loader, node.factory, channel.GetSeekPosition().GetTimestamp())
if err != nil {