mirror of https://github.com/milvus-io/milvus.git
Change interface: add index id and index name params
Signed-off-by: neza2017 <yefu.chen@zilliz.com>pull/4973/head^2
parent
bfa14d40a8
commit
899d31e72d
|
@ -98,7 +98,7 @@ func TestGrpcService(t *testing.T) {
|
|||
|
||||
var binlogLock sync.Mutex
|
||||
binlogPathArray := make([]string, 0, 16)
|
||||
core.BuildIndexReq = func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair) (typeutil.UniqueID, error) {
|
||||
core.BuildIndexReq = func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair, indexID typeutil.UniqueID, indexName string) (typeutil.UniqueID, error) {
|
||||
binlogLock.Lock()
|
||||
defer binlogLock.Unlock()
|
||||
binlogPathArray = append(binlogPathArray, binlog...)
|
||||
|
|
|
@ -152,7 +152,7 @@ type Core struct {
|
|||
GetBinlogFilePathsFromDataServiceReq func(segID typeutil.UniqueID, fieldID typeutil.UniqueID) ([]string, error)
|
||||
|
||||
//TODO, call index builder's client to build index, return build id
|
||||
BuildIndexReq func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair) (typeutil.UniqueID, error)
|
||||
BuildIndexReq func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair, indexID typeutil.UniqueID, indexName string) (typeutil.UniqueID, error)
|
||||
|
||||
//TODO, proxy service interface, notify proxy service to drop collection
|
||||
InvalidateCollectionMetaCache func(ts typeutil.Timestamp, dbName string, collectionName string) error
|
||||
|
@ -671,11 +671,13 @@ func (c *Core) SetDataService(s DataServiceInterface) error {
|
|||
}
|
||||
|
||||
func (c *Core) SetIndexService(s IndexServiceInterface) error {
|
||||
c.BuildIndexReq = func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair) (typeutil.UniqueID, error) {
|
||||
c.BuildIndexReq = func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair, indexID typeutil.UniqueID, indexName string) (typeutil.UniqueID, error) {
|
||||
rsp, err := s.BuildIndex(&indexpb.BuildIndexRequest{
|
||||
DataPaths: binlog,
|
||||
TypeParams: typeParams,
|
||||
IndexParams: indexParams,
|
||||
IndexID: indexID,
|
||||
IndexName: indexName,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
|
|
@ -628,7 +628,7 @@ func (t *CreateIndexTask) BuildIndex() error {
|
|||
})
|
||||
}
|
||||
}
|
||||
bldID, err = t.core.BuildIndexReq(binlogs, t.fieldSchema.TypeParams, t.indexParams)
|
||||
bldID, err = t.core.BuildIndexReq(binlogs, t.fieldSchema.TypeParams, t.indexParams, idxID, t.indexName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue