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