mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
Remove unused code for creating index (#24442)
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
f1d657beb0
commit
6209d5d717
@ -1625,12 +1625,11 @@ func (node *Proxy) CreateIndex(ctx context.Context, request *milvuspb.CreateInde
|
||||
defer sp.End()
|
||||
|
||||
cit := &createIndexTask{
|
||||
ctx: ctx,
|
||||
Condition: NewTaskCondition(ctx),
|
||||
req: request,
|
||||
rootCoord: node.rootCoord,
|
||||
datacoord: node.dataCoord,
|
||||
queryCoord: node.queryCoord,
|
||||
ctx: ctx,
|
||||
Condition: NewTaskCondition(ctx),
|
||||
req: request,
|
||||
rootCoord: node.rootCoord,
|
||||
datacoord: node.dataCoord,
|
||||
}
|
||||
|
||||
method := "CreateIndex"
|
||||
|
@ -52,12 +52,11 @@ const (
|
||||
|
||||
type createIndexTask struct {
|
||||
Condition
|
||||
req *milvuspb.CreateIndexRequest
|
||||
ctx context.Context
|
||||
rootCoord types.RootCoord
|
||||
datacoord types.DataCoord
|
||||
queryCoord types.QueryCoord
|
||||
result *commonpb.Status
|
||||
req *milvuspb.CreateIndexRequest
|
||||
ctx context.Context
|
||||
rootCoord types.RootCoord
|
||||
datacoord types.DataCoord
|
||||
result *commonpb.Status
|
||||
|
||||
isAutoIndex bool
|
||||
newIndexParams []*commonpb.KeyValuePair
|
||||
|
@ -255,21 +255,11 @@ func TestCreateIndexTask_PreExecute(t *testing.T) {
|
||||
FieldName: fieldName,
|
||||
},
|
||||
datacoord: dc,
|
||||
queryCoord: nil,
|
||||
result: nil,
|
||||
collectionID: collectionID,
|
||||
}
|
||||
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
qc := getMockQueryCoord()
|
||||
qc.EXPECT().ShowCollections(mock.Anything, mock.Anything).Return(&querypb.ShowCollectionsResponse{
|
||||
Status: &commonpb.Status{
|
||||
ErrorCode: commonpb.ErrorCode_Success,
|
||||
},
|
||||
CollectionIDs: []int64{},
|
||||
}, nil)
|
||||
cit.queryCoord = qc
|
||||
|
||||
err := cit.PreExecute(ctx)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
@ -305,7 +295,6 @@ func Test_parseIndexParams(t *testing.T) {
|
||||
},
|
||||
ctx: nil,
|
||||
rootCoord: nil,
|
||||
queryCoord: nil,
|
||||
result: nil,
|
||||
isAutoIndex: false,
|
||||
newIndexParams: nil,
|
||||
@ -390,7 +379,6 @@ func Test_parseIndexParams(t *testing.T) {
|
||||
},
|
||||
ctx: nil,
|
||||
rootCoord: nil,
|
||||
queryCoord: nil,
|
||||
result: nil,
|
||||
isAutoIndex: false,
|
||||
newIndexParams: nil,
|
||||
@ -487,7 +475,6 @@ func Test_parseIndexParams(t *testing.T) {
|
||||
},
|
||||
ctx: nil,
|
||||
rootCoord: nil,
|
||||
queryCoord: nil,
|
||||
result: nil,
|
||||
isAutoIndex: false,
|
||||
newIndexParams: nil,
|
||||
|
@ -2375,18 +2375,6 @@ func Test_createIndexTask_PreExecute(t *testing.T) {
|
||||
FieldName: fieldName,
|
||||
},
|
||||
}
|
||||
qc := getQueryCoord()
|
||||
qc.EXPECT().ShowPartitions(mock.Anything, mock.Anything).Return(&querypb.ShowPartitionsResponse{
|
||||
Status: &commonpb.Status{
|
||||
ErrorCode: commonpb.ErrorCode_Success,
|
||||
Reason: "",
|
||||
},
|
||||
PartitionIDs: []int64{},
|
||||
}, nil)
|
||||
qc.EXPECT().ShowCollections(mock.Anything, mock.Anything).Return(&querypb.ShowCollectionsResponse{
|
||||
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
|
||||
}, nil)
|
||||
cit.queryCoord = qc
|
||||
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
cache := newMockCache()
|
||||
|
Loading…
Reference in New Issue
Block a user