mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 21:09:06 +08:00
f02bd8c8f5
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
57 lines
1.9 KiB
Go
57 lines
1.9 KiB
Go
package querynode
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zilliztech/milvus-distributed/internal/msgstream"
|
|
"github.com/zilliztech/milvus-distributed/internal/util/flowgraph"
|
|
)
|
|
|
|
func (dsService *dataSyncService) newDmInputNode(ctx context.Context) *flowgraph.InputNode {
|
|
receiveBufSize := Params.InsertReceiveBufSize
|
|
pulsarBufSize := Params.InsertPulsarBufSize
|
|
|
|
msgStreamURL := Params.PulsarAddress
|
|
|
|
consumeChannels := Params.InsertChannelNames
|
|
consumeSubName := Params.MsgChannelSubName
|
|
|
|
insertStream := msgstream.NewPulsarTtMsgStream(ctx, receiveBufSize)
|
|
insertStream.SetPulsarClient(msgStreamURL)
|
|
unmarshalDispatcher := msgstream.NewUnmarshalDispatcher()
|
|
insertStream.CreatePulsarConsumers(consumeChannels, consumeSubName, unmarshalDispatcher, pulsarBufSize)
|
|
|
|
var stream msgstream.MsgStream = insertStream
|
|
dsService.dmStream = stream
|
|
|
|
maxQueueLength := Params.FlowGraphMaxQueueLength
|
|
maxParallelism := Params.FlowGraphMaxParallelism
|
|
|
|
node := flowgraph.NewInputNode(&stream, "dmInputNode", maxQueueLength, maxParallelism)
|
|
return node
|
|
}
|
|
|
|
func (dsService *dataSyncService) newDDInputNode(ctx context.Context) *flowgraph.InputNode {
|
|
receiveBufSize := Params.DDReceiveBufSize
|
|
pulsarBufSize := Params.DDPulsarBufSize
|
|
|
|
msgStreamURL := Params.PulsarAddress
|
|
|
|
consumeChannels := Params.DDChannelNames
|
|
consumeSubName := Params.MsgChannelSubName
|
|
|
|
ddStream := msgstream.NewPulsarTtMsgStream(ctx, receiveBufSize)
|
|
ddStream.SetPulsarClient(msgStreamURL)
|
|
unmarshalDispatcher := msgstream.NewUnmarshalDispatcher()
|
|
ddStream.CreatePulsarConsumers(consumeChannels, consumeSubName, unmarshalDispatcher, pulsarBufSize)
|
|
|
|
var stream msgstream.MsgStream = ddStream
|
|
dsService.ddStream = stream
|
|
|
|
maxQueueLength := Params.FlowGraphMaxQueueLength
|
|
maxParallelism := Params.FlowGraphMaxParallelism
|
|
|
|
node := flowgraph.NewInputNode(&stream, "ddInputNode", maxQueueLength, maxParallelism)
|
|
return node
|
|
}
|