mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
89541a6f68
Signed-off-by: longjiquan <jiquan.long@zilliz.com> Signed-off-by: longjiquan <jiquan.long@zilliz.com>
34 lines
840 B
Go
34 lines
840 B
Go
package rootcoord
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/commonpb"
|
|
"github.com/milvus-io/milvus-proto/go-api/milvuspb"
|
|
)
|
|
|
|
// describeCollectionTask describe collection request task
|
|
type describeCollectionTask struct {
|
|
baseTask
|
|
Req *milvuspb.DescribeCollectionRequest
|
|
Rsp *milvuspb.DescribeCollectionResponse
|
|
}
|
|
|
|
func (t *describeCollectionTask) Prepare(ctx context.Context) error {
|
|
if err := CheckMsgType(t.Req.Base.MsgType, commonpb.MsgType_DescribeCollection); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Execute task execution
|
|
func (t *describeCollectionTask) Execute(ctx context.Context) (err error) {
|
|
coll, err := t.core.describeCollection(ctx, t.Req)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
aliases := t.core.meta.ListAliasesByID(coll.CollectionID)
|
|
t.Rsp = convertModelToDesc(coll, aliases)
|
|
return nil
|
|
}
|