mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
ff2a68e65a
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
35 lines
909 B
Go
35 lines
909 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
|
|
allowUnavailable bool
|
|
}
|
|
|
|
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, t.allowUnavailable)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
aliases := t.core.meta.ListAliasesByID(coll.CollectionID)
|
|
t.Rsp = convertModelToDesc(coll, aliases)
|
|
return nil
|
|
}
|