mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
1. Add function storage in rootcoord 2. Parse udf expression 3. Execute wasm in core Signed-off-by: Ziyu Wang <15871035978@163.com> Signed-off-by: Ziyu Wang <15871035978@163.com>
33 lines
813 B
Go
33 lines
813 B
Go
package rootcoord
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus/api/commonpb"
|
|
"github.com/milvus-io/milvus/internal/proto/rootcoordpb"
|
|
)
|
|
|
|
type getFunctionInfoTask struct {
|
|
baseTask
|
|
Req *rootcoordpb.GetFunctionInfoRequest
|
|
Rsp *rootcoordpb.GetFunctionInfoResponse
|
|
}
|
|
|
|
func (t *getFunctionInfoTask) Prepare(ctx context.Context) error {
|
|
if err := CheckMsgType(t.Req.GetBase().GetMsgType(), commonpb.MsgType_GetFunctionInfo); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (t *getFunctionInfoTask) Execute(ctx context.Context) error {
|
|
t.Rsp.Status = succStatus()
|
|
functionInfo, err := t.core.meta.GetFunctionInfo(ctx, t.Req.GetFunctionName(), t.GetTs())
|
|
if err != nil {
|
|
t.Rsp.Status = failStatus(commonpb.ErrorCode_UnexpectedError, err.Error())
|
|
return err
|
|
}
|
|
t.Rsp.Info = functionInfo
|
|
return nil
|
|
}
|