Make gen msg private (#10115)

Signed-off-by: godchen <qingxiang.chen@zilliz.com>
pull/11263/head
godchen 2021-11-04 15:36:19 +08:00 committed by GitHub
parent de7ea4a4e9
commit b63a9521c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -249,7 +249,7 @@ func TestFlowGraphDeleteNode_Operate(t *testing.T) {
delNode, err := newDeleteNode(ctx, fm, c)
assert.Nil(te, err)
msg := GenFlowGraphDeleteMsg(pks, chanName)
msg := genFlowGraphDeleteMsg(pks, chanName)
msg.segmentsToFlush = segIDs
// this will fail since ts = 0 will trigger mocked error
var fgMsg flowgraph.Msg = &msg
@ -273,7 +273,7 @@ func TestFlowGraphDeleteNode_Operate(t *testing.T) {
delNode, err := newDeleteNode(ctx, fm, c)
assert.Nil(te, err)
msg := GenFlowGraphDeleteMsg(pks, chanName)
msg := genFlowGraphDeleteMsg(pks, chanName)
msg.segmentsToFlush = segIDs
msg.endPositions[0].Timestamp = 100 // set to normal timestamp

View File

@ -202,7 +202,7 @@ func TestFlowGraphInsertBufferNode_Operate(t *testing.T) {
collectionID: UniqueID(1),
}
inMsg := GenFlowGraphInsertMsg(insertChannelName)
inMsg := genFlowGraphInsertMsg(insertChannelName)
var fgMsg flowgraph.Msg = &inMsg
iBNode.Operate([]flowgraph.Msg{fgMsg})
}
@ -406,7 +406,7 @@ func TestFlowGraphInsertBufferNode_AutoFlush(t *testing.T) {
// Auto flush number of rows set to 2
inMsg := GenFlowGraphInsertMsg("datanode-03-test-autoflush")
inMsg := genFlowGraphInsertMsg("datanode-03-test-autoflush")
inMsg.insertMessages = dataFactory.GetMsgStreamInsertMsgs(2)
var iMsg flowgraph.Msg = &inMsg
@ -523,7 +523,7 @@ func TestFlowGraphInsertBufferNode_AutoFlush(t *testing.T) {
flushPacks = flushPacks[:0]
fpMut.Unlock()
inMsg := GenFlowGraphInsertMsg("datanode-03-test-autoflush")
inMsg := genFlowGraphInsertMsg("datanode-03-test-autoflush")
inMsg.insertMessages = dataFactory.GetMsgStreamInsertMsgs(2)
for i := range inMsg.insertMessages {
@ -728,7 +728,7 @@ func TestInsertBufferNode_bufferInsertMsg(t *testing.T) {
iBNode, err := newInsertBufferNode(ctx, flushChan, fm, newCache(), c)
require.NoError(t, err)
inMsg := GenFlowGraphInsertMsg(insertChannelName)
inMsg := genFlowGraphInsertMsg(insertChannelName)
for _, msg := range inMsg.insertMessages {
msg.EndTimestamp = 101 // ts valid
err = iBNode.bufferInsertMsg(msg, &internalpb.MsgPosition{})

View File

@ -452,7 +452,7 @@ func (df *DataFactory) GenMsgStreamDeleteMsg(pks []int64, chanName string) *msgs
return msg
}
func GenFlowGraphInsertMsg(chanName string) flowGraphMsg {
func genFlowGraphInsertMsg(chanName string) flowGraphMsg {
timeRange := TimeRange{
timestampMin: 0,
timestampMax: math.MaxUint64,
@ -482,7 +482,7 @@ func GenFlowGraphInsertMsg(chanName string) flowGraphMsg {
return *fgMsg
}
func GenFlowGraphDeleteMsg(pks []int64, chanName string) flowGraphMsg {
func genFlowGraphDeleteMsg(pks []int64, chanName string) flowGraphMsg {
timeRange := TimeRange{
timestampMin: 0,
timestampMax: math.MaxUint64,