2020-10-29 12:42:47 +00:00
|
|
|
package msgstream
|
|
|
|
|
|
|
|
import (
|
|
|
|
internalPb "github.com/zilliztech/milvus-distributed/internal/proto/internalpb"
|
|
|
|
)
|
|
|
|
|
2020-11-04 09:58:43 +00:00
|
|
|
type MsgType = internalPb.MsgType
|
2020-10-29 12:42:47 +00:00
|
|
|
|
|
|
|
type TsMsg interface {
|
2020-11-02 08:01:04 +00:00
|
|
|
BeginTs() Timestamp
|
|
|
|
EndTs() Timestamp
|
2020-10-29 12:42:47 +00:00
|
|
|
Type() MsgType
|
2020-11-02 08:01:04 +00:00
|
|
|
HashKeys() []int32
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
type BaseMsg struct {
|
|
|
|
BeginTimestamp Timestamp
|
2020-11-05 11:11:12 +00:00
|
|
|
EndTimestamp Timestamp
|
|
|
|
HashValues []int32
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-11-05 11:11:12 +00:00
|
|
|
func (bm *BaseMsg) BeginTs() Timestamp {
|
2020-11-05 10:01:33 +00:00
|
|
|
return bm.BeginTimestamp
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
func (bm *BaseMsg) EndTs() Timestamp {
|
|
|
|
return bm.EndTimestamp
|
2020-11-02 08:01:04 +00:00
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
func (bm *BaseMsg) HashKeys() []int32 {
|
|
|
|
return bm.HashValues
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
/////////////////////////////////////////Insert//////////////////////////////////////////
|
|
|
|
type InsertMsg struct {
|
|
|
|
BaseMsg
|
|
|
|
internalPb.InsertRequest
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
func (it *InsertMsg) Type() MsgType {
|
|
|
|
return it.MsgType
|
2020-11-02 08:01:04 +00:00
|
|
|
}
|
|
|
|
|
2020-10-29 12:42:47 +00:00
|
|
|
/////////////////////////////////////////Delete//////////////////////////////////////////
|
2020-11-05 10:01:33 +00:00
|
|
|
type DeleteMsg struct {
|
|
|
|
BaseMsg
|
2020-10-29 12:42:47 +00:00
|
|
|
internalPb.DeleteRequest
|
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
func (dt *DeleteMsg) Type() MsgType {
|
2020-11-04 09:58:43 +00:00
|
|
|
return dt.MsgType
|
2020-11-02 08:01:04 +00:00
|
|
|
}
|
|
|
|
|
2020-10-29 12:42:47 +00:00
|
|
|
/////////////////////////////////////////Search//////////////////////////////////////////
|
2020-11-05 10:01:33 +00:00
|
|
|
type SearchMsg struct {
|
|
|
|
BaseMsg
|
2020-10-29 12:42:47 +00:00
|
|
|
internalPb.SearchRequest
|
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
func (st *SearchMsg) Type() MsgType {
|
2020-11-04 09:58:43 +00:00
|
|
|
return st.MsgType
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/////////////////////////////////////////SearchResult//////////////////////////////////////////
|
2020-11-05 10:01:33 +00:00
|
|
|
type SearchResultMsg struct {
|
|
|
|
BaseMsg
|
2020-10-29 12:42:47 +00:00
|
|
|
internalPb.SearchResult
|
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
func (srt *SearchResultMsg) Type() MsgType {
|
2020-11-04 09:58:43 +00:00
|
|
|
return srt.MsgType
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-11-04 08:28:14 +00:00
|
|
|
/////////////////////////////////////////TimeTick//////////////////////////////////////////
|
2020-11-05 10:01:33 +00:00
|
|
|
type TimeTickMsg struct {
|
|
|
|
BaseMsg
|
2020-11-03 08:38:16 +00:00
|
|
|
internalPb.TimeTickMsg
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
func (tst *TimeTickMsg) Type() MsgType {
|
2020-11-04 09:58:43 +00:00
|
|
|
return tst.MsgType
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-11-05 10:01:33 +00:00
|
|
|
///////////////////////////////////////////Key2Seg//////////////////////////////////////////
|
|
|
|
//type Key2SegMsg struct {
|
|
|
|
// BaseMsg
|
|
|
|
// internalPb.Key2SegMsg
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//func (k2st *Key2SegMsg) Type() MsgType {
|
|
|
|
// return
|
|
|
|
//}
|