mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
a7eae3a4c1
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
package querynode
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zilliztech/milvus-distributed/internal/msgstream/pulsarms"
|
|
"github.com/zilliztech/milvus-distributed/internal/util/flowgraph"
|
|
)
|
|
|
|
func (dsService *dataSyncService) newDmInputNode(ctx context.Context) *flowgraph.InputNode {
|
|
factory := pulsarms.NewFactory(Params.PulsarAddress, Params.InsertReceiveBufSize, Params.InsertPulsarBufSize)
|
|
|
|
// query node doesn't need to consume any topic
|
|
insertStream, _ := factory.NewTtMsgStream(ctx)
|
|
dsService.dmStream = insertStream
|
|
|
|
maxQueueLength := Params.FlowGraphMaxQueueLength
|
|
maxParallelism := Params.FlowGraphMaxParallelism
|
|
|
|
node := flowgraph.NewInputNode(&insertStream, "dmInputNode", maxQueueLength, maxParallelism)
|
|
return node
|
|
}
|
|
|
|
func (dsService *dataSyncService) newDDInputNode(ctx context.Context) *flowgraph.InputNode {
|
|
factory := pulsarms.NewFactory(Params.PulsarAddress, Params.DDReceiveBufSize, Params.DDPulsarBufSize)
|
|
|
|
consumeChannels := Params.DDChannelNames
|
|
consumeSubName := Params.MsgChannelSubName
|
|
|
|
ddStream, _ := factory.NewTtMsgStream(ctx)
|
|
ddStream.AsConsumer(consumeChannels, consumeSubName)
|
|
|
|
dsService.ddStream = ddStream
|
|
|
|
maxQueueLength := Params.FlowGraphMaxQueueLength
|
|
maxParallelism := Params.FlowGraphMaxParallelism
|
|
|
|
node := flowgraph.NewInputNode(&ddStream, "ddInputNode", maxQueueLength, maxParallelism)
|
|
return node
|
|
}
|