milvus/internal/reader/flow_graph_msg_stream_input_nodes.go
bigsheeper be409b29c8 Refactor cgo collection, partition and segment
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2020-11-09 18:07:15 +08:00

29 lines
776 B
Go

package reader
import (
"context"
"github.com/zilliztech/milvus-distributed/internal/util/flowgraph"
"github.com/zilliztech/milvus-distributed/internal/msgstream"
)
func newDmInputNode(ctx context.Context, pulsarURL string) *flowgraph.InputNode {
const (
receiveBufSize = 1024
pulsarBufSize = 1024
)
consumeChannels := []string{"insert"}
consumeSubName := "insertSub"
insertStream := msgstream.NewPulsarMsgStream(ctx, receiveBufSize)
insertStream.SetPulsarCient(pulsarURL)
unmarshalDispatcher := msgstream.NewUnmarshalDispatcher()
insertStream.CreatePulsarConsumers(consumeChannels, consumeSubName, unmarshalDispatcher, pulsarBufSize)
var stream msgstream.MsgStream = insertStream
node := flowgraph.NewInputNode(&stream, "dmInputNode")
return node
}