mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 04:19:18 +08:00
a55f739608
Signed-off-by: SimFG <bang.fu@zilliz.com> Signed-off-by: SimFG <bang.fu@zilliz.com>
30 lines
700 B
Go
30 lines
700 B
Go
package rootcoord
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/commonpb"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/milvuspb"
|
|
)
|
|
|
|
type dropAliasTask struct {
|
|
baseTask
|
|
Req *milvuspb.DropAliasRequest
|
|
}
|
|
|
|
func (t *dropAliasTask) Prepare(ctx context.Context) error {
|
|
if err := CheckMsgType(t.Req.GetBase().GetMsgType(), commonpb.MsgType_DropAlias); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (t *dropAliasTask) Execute(ctx context.Context) error {
|
|
// drop alias is atomic enough.
|
|
if err := t.core.ExpireMetaCache(ctx, []string{t.Req.GetAlias()}, InvalidCollectionID, t.GetTs()); err != nil {
|
|
return err
|
|
}
|
|
return t.core.meta.DropAlias(ctx, t.Req.GetAlias(), t.GetTs())
|
|
}
|