zhenshan.cao e9122921b9 Use type alias
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
2020-11-04 17:58:43 +08:00

41 lines
664 B
Go

package proxy
import (
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb"
)
type task interface {
Id() UniqueID // return ReqId
Type() internalpb.MsgType
GetTs() Timestamp
SetTs(ts Timestamp)
PreExecute() error
Execute() error
PostExecute() error
WaitToFinish() error
Notify() error
}
type baseTask struct {
ReqType internalpb.MsgType
ReqId UniqueID
Ts Timestamp
ProxyId UniqueID
}
func (bt *baseTask) Id() UniqueID {
return bt.ReqId
}
func (bt *baseTask) Type() internalpb.MsgType {
return bt.ReqType
}
func (bt *baseTask) GetTs() Timestamp {
return bt.Ts
}
func (bt *baseTask) SetTs(ts Timestamp) {
bt.Ts = ts
}