mirror of
https://github.com/milvus-io/milvus.git
synced 2026-10-12 02:19:10 +00:00
Set metric type while init the collection (#24665)
Signed-off-by: yah01 <[email protected]>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user