milvus/internal/rootcoord/describe_collection_task.go
Jiquan Long 89541a6f68
Revert parallel ddl (#20118)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
2022-10-28 13:25:34 +08:00

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
}