mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
d7f38a803d
Signed-off-by: SimFG <bang.fu@zilliz.com> Signed-off-by: SimFG <bang.fu@zilliz.com>
30 lines
684 B
Go
30 lines
684 B
Go
package rootcoord
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus/api/commonpb"
|
|
|
|
"github.com/milvus-io/milvus/api/milvuspb"
|
|
)
|
|
|
|
type dropAliasTask struct {
|
|
baseTaskV2
|
|
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())
|
|
}
|