2020-10-29 12:42:47 +00:00
|
|
|
package msgstream
|
|
|
|
|
|
|
|
import (
|
2021-01-18 11:32:08 +00:00
|
|
|
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb2"
|
2020-11-03 06:53:36 +00:00
|
|
|
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
|
|
|
|
)
|
2020-10-29 12:42:47 +00:00
|
|
|
|
2020-11-04 09:58:43 +00:00
|
|
|
type UniqueID = typeutil.UniqueID
|
|
|
|
type Timestamp = typeutil.Timestamp
|
|
|
|
type IntPrimaryKey = typeutil.IntPrimaryKey
|
2021-01-20 09:34:50 +00:00
|
|
|
type MsgPosition = internalpb2.MsgPosition
|
2020-11-04 09:58:43 +00:00
|
|
|
|
2020-10-29 12:42:47 +00:00
|
|
|
type MsgPack struct {
|
2021-01-20 09:34:50 +00:00
|
|
|
BeginTs Timestamp
|
|
|
|
EndTs Timestamp
|
|
|
|
Msgs []TsMsg
|
|
|
|
StartPositions []*MsgPosition
|
|
|
|
endPositions []*MsgPosition
|
2020-10-29 12:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-11-17 06:10:07 +00:00
|
|
|
type RepackFunc func(msgs []TsMsg, hashKeys [][]int32) (map[int32]*MsgPack, error)
|
2020-10-29 12:42:47 +00:00
|
|
|
|
|
|
|
type MsgStream interface {
|
2020-11-02 08:01:04 +00:00
|
|
|
Start()
|
|
|
|
Close()
|
2021-02-03 09:30:10 +00:00
|
|
|
Chan() <-chan *MsgPack
|
2020-11-02 08:01:04 +00:00
|
|
|
|
2020-11-07 05:19:31 +00:00
|
|
|
Produce(*MsgPack) error
|
|
|
|
Broadcast(*MsgPack) error
|
|
|
|
Consume() *MsgPack
|
2021-01-20 09:34:50 +00:00
|
|
|
Seek(offset *MsgPosition) error
|
2020-11-12 03:18:23 +00:00
|
|
|
}
|