2021-12-01 18:45:32 +08:00
|
|
|
// Licensed to the LF AI & Data foundation under one
|
|
|
|
// or more contributor license agreements. See the NOTICE file
|
|
|
|
// distributed with this work for additional information
|
|
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
|
|
// to you under the Apache License, Version 2.0 (the
|
|
|
|
// "License"); you may not use this file except in compliance
|
2021-04-19 13:47:10 +08:00
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
2021-12-01 18:45:32 +08:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2021-04-19 13:47:10 +08:00
|
|
|
//
|
2021-12-01 18:45:32 +08:00
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
2021-04-19 13:47:10 +08:00
|
|
|
|
2021-01-16 10:12:14 +08:00
|
|
|
package querynode
|
2020-11-02 19:30:12 +08:00
|
|
|
|
|
|
|
import (
|
2021-04-22 14:45:57 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/msgstream"
|
|
|
|
"github.com/milvus-io/milvus/internal/util/flowgraph"
|
2020-11-02 19:30:12 +08:00
|
|
|
)
|
|
|
|
|
2021-09-24 21:37:57 +08:00
|
|
|
// Msg is an interface which has a function named TimeTick
|
2020-11-02 19:30:12 +08:00
|
|
|
type Msg = flowgraph.Msg
|
2021-09-24 21:37:57 +08:00
|
|
|
|
|
|
|
// MsgStreamMsg is an implementation of interface Msg
|
2020-11-09 16:27:11 +08:00
|
|
|
type MsgStreamMsg = flowgraph.MsgStreamMsg
|
2020-11-02 19:30:12 +08:00
|
|
|
|
2021-12-10 18:33:23 +08:00
|
|
|
// insertMsg is an implementation of interface Msg
|
2020-11-09 16:27:11 +08:00
|
|
|
type insertMsg struct {
|
2020-11-05 18:01:33 +08:00
|
|
|
insertMessages []*msgstream.InsertMsg
|
2021-10-15 16:54:43 +08:00
|
|
|
deleteMessages []*msgstream.DeleteMsg
|
2020-11-12 12:04:12 +08:00
|
|
|
timeRange TimeRange
|
2020-11-02 19:30:12 +08:00
|
|
|
}
|
|
|
|
|
2021-12-10 18:41:21 +08:00
|
|
|
// deleteMsg is an implementation of interface Msg
|
2021-11-06 11:02:58 +08:00
|
|
|
type deleteMsg struct {
|
|
|
|
deleteMessages []*msgstream.DeleteMsg
|
|
|
|
timeRange TimeRange
|
|
|
|
}
|
|
|
|
|
2021-12-10 18:43:09 +08:00
|
|
|
// serviceTimeMsg is an implementation of interface Msg
|
2020-11-02 19:30:12 +08:00
|
|
|
type serviceTimeMsg struct {
|
2021-01-06 16:44:12 +08:00
|
|
|
timeRange TimeRange
|
|
|
|
}
|
|
|
|
|
2021-12-13 21:23:55 +08:00
|
|
|
// TimeTick returns timestamp of insertMsg
|
2020-11-02 19:30:12 +08:00
|
|
|
func (iMsg *insertMsg) TimeTick() Timestamp {
|
|
|
|
return iMsg.timeRange.timestampMax
|
|
|
|
}
|
|
|
|
|
2021-12-13 21:25:45 +08:00
|
|
|
// TimeTick returns timestamp of deleteMsg
|
2021-11-06 11:02:58 +08:00
|
|
|
func (dMsg *deleteMsg) TimeTick() Timestamp {
|
|
|
|
return dMsg.timeRange.timestampMax
|
|
|
|
}
|
|
|
|
|
2021-12-13 21:27:36 +08:00
|
|
|
// TimeTick returns timestamp of serviceTimeMsg
|
2020-11-02 19:30:12 +08:00
|
|
|
func (stMsg *serviceTimeMsg) TimeTick() Timestamp {
|
|
|
|
return stMsg.timeRange.timestampMax
|
|
|
|
}
|