Remove unused code for creating index (#24442)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2023-05-26 16:49:26 +08:00 committed by GitHub
parent f1d657beb0
commit 6209d5d717
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 37 deletions

View File

@ -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"

View File

@ -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

View File

@ -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,

View File

@ -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()