mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 03:18:29 +08:00
a55f739608
Signed-off-by: SimFG <bang.fu@zilliz.com> Signed-off-by: SimFG <bang.fu@zilliz.com>
29 lines
733 B
Go
29 lines
733 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 alterAliasTask struct {
|
|
baseTask
|
|
Req *milvuspb.AlterAliasRequest
|
|
}
|
|
|
|
func (t *alterAliasTask) Prepare(ctx context.Context) error {
|
|
if err := CheckMsgType(t.Req.GetBase().GetMsgType(), commonpb.MsgType_AlterAlias); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (t *alterAliasTask) Execute(ctx context.Context) error {
|
|
if err := t.core.ExpireMetaCache(ctx, []string{t.Req.GetAlias()}, InvalidCollectionID, t.GetTs()); err != nil {
|
|
return err
|
|
}
|
|
// alter alias is atomic enough.
|
|
return t.core.meta.AlterAlias(ctx, t.Req.GetAlias(), t.Req.GetCollectionName(), t.GetTs())
|
|
}
|