2021-01-19 11:37:16 +08:00
|
|
|
package datanode
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zilliztech/milvus-distributed/internal/msgstream"
|
2021-03-12 14:22:09 +08:00
|
|
|
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb"
|
2021-01-19 11:37:16 +08:00
|
|
|
"github.com/zilliztech/milvus-distributed/internal/util/flowgraph"
|
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
Msg = flowgraph.Msg
|
|
|
|
MsgStreamMsg = flowgraph.MsgStreamMsg
|
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
key2SegMsg struct {
|
|
|
|
tsMessages []msgstream.TsMsg
|
|
|
|
timeRange TimeRange
|
|
|
|
}
|
|
|
|
|
|
|
|
ddMsg struct {
|
2021-02-26 10:13:36 +08:00
|
|
|
collectionRecords map[UniqueID][]*metaOperateRecord
|
|
|
|
partitionRecords map[UniqueID][]*metaOperateRecord
|
|
|
|
flushMessages []*flushMsg
|
|
|
|
gcRecord *gcRecord
|
|
|
|
timeRange TimeRange
|
2021-01-19 11:37:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
metaOperateRecord struct {
|
|
|
|
createOrDrop bool // create: true, drop: false
|
|
|
|
timestamp Timestamp
|
|
|
|
}
|
|
|
|
|
|
|
|
insertMsg struct {
|
|
|
|
insertMessages []*msgstream.InsertMsg
|
2021-01-22 09:36:40 +08:00
|
|
|
flushMessages []*flushMsg
|
2021-01-19 11:37:16 +08:00
|
|
|
gcRecord *gcRecord
|
|
|
|
timeRange TimeRange
|
2021-03-12 14:22:09 +08:00
|
|
|
startPositions []*internalpb.MsgPosition
|
2021-03-16 17:55:42 +08:00
|
|
|
endPositions []*internalpb.MsgPosition
|
2021-01-19 11:37:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
deleteMsg struct {
|
|
|
|
deleteMessages []*msgstream.DeleteMsg
|
|
|
|
timeRange TimeRange
|
|
|
|
}
|
|
|
|
|
|
|
|
gcMsg struct {
|
|
|
|
gcRecord *gcRecord
|
|
|
|
timeRange TimeRange
|
|
|
|
}
|
|
|
|
|
|
|
|
gcRecord struct {
|
|
|
|
collections []UniqueID
|
|
|
|
}
|
2021-01-22 09:36:40 +08:00
|
|
|
|
|
|
|
flushMsg struct {
|
|
|
|
msgID UniqueID
|
2021-01-26 14:46:54 +08:00
|
|
|
timestamp Timestamp
|
2021-01-22 09:36:40 +08:00
|
|
|
segmentIDs []UniqueID
|
|
|
|
collectionID UniqueID
|
|
|
|
}
|
2021-01-19 11:37:16 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func (ksMsg *key2SegMsg) TimeTick() Timestamp {
|
|
|
|
return ksMsg.timeRange.timestampMax
|
|
|
|
}
|
|
|
|
|
|
|
|
func (suMsg *ddMsg) TimeTick() Timestamp {
|
|
|
|
return suMsg.timeRange.timestampMax
|
|
|
|
}
|
|
|
|
|
|
|
|
func (iMsg *insertMsg) TimeTick() Timestamp {
|
|
|
|
return iMsg.timeRange.timestampMax
|
|
|
|
}
|
|
|
|
|
|
|
|
func (dMsg *deleteMsg) TimeTick() Timestamp {
|
|
|
|
return dMsg.timeRange.timestampMax
|
|
|
|
}
|
|
|
|
|
|
|
|
func (gcMsg *gcMsg) TimeTick() Timestamp {
|
|
|
|
return gcMsg.timeRange.timestampMax
|
|
|
|
}
|