2021-11-10 23:57:08 +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-06-22 14:40:07 +08:00
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
2021-11-10 23:57:08 +08:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2021-06-22 14:40:07 +08:00
|
|
|
//
|
2021-11-10 23:57:08 +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-06-22 14:40:07 +08:00
|
|
|
|
|
|
|
package proxy
|
2021-05-21 09:52:20 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
2022-03-02 16:23:55 +08:00
|
|
|
"strconv"
|
2021-05-21 09:52:20 +08:00
|
|
|
"sync"
|
|
|
|
|
2023-02-26 11:31:49 +08:00
|
|
|
"github.com/cockroachdb/errors"
|
|
|
|
|
2023-06-09 01:28:37 +08:00
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
|
2021-09-13 17:12:19 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/types"
|
2023-04-06 19:14:32 +08:00
|
|
|
"github.com/milvus-io/milvus/pkg/log"
|
|
|
|
"github.com/milvus-io/milvus/pkg/metrics"
|
|
|
|
"github.com/milvus-io/milvus/pkg/mq/msgstream"
|
|
|
|
"github.com/milvus-io/milvus/pkg/util/commonpbutil"
|
|
|
|
"github.com/milvus-io/milvus/pkg/util/paramtable"
|
2021-09-09 10:06:29 +08:00
|
|
|
|
2021-06-08 19:25:37 +08:00
|
|
|
"go.uber.org/zap"
|
2021-05-21 09:52:20 +08:00
|
|
|
)
|
|
|
|
|
2021-10-01 15:32:15 +08:00
|
|
|
// channelsMgr manages the pchans, vchans and related message stream of collections.
|
2021-05-21 09:52:20 +08:00
|
|
|
type channelsMgr interface {
|
|
|
|
getChannels(collectionID UniqueID) ([]pChan, error)
|
|
|
|
getVChannels(collectionID UniqueID) ([]vChan, error)
|
2022-06-09 17:34:09 +08:00
|
|
|
getOrCreateDmlStream(collectionID UniqueID) (msgstream.MsgStream, error)
|
2022-10-18 19:17:27 +08:00
|
|
|
removeDMLStream(collectionID UniqueID)
|
|
|
|
removeAllDMLStream()
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
type channelInfos struct {
|
|
|
|
// It seems that there is no need to maintain relationships between vchans & pchans.
|
|
|
|
vchans []vChan
|
|
|
|
pchans []pChan
|
|
|
|
}
|
|
|
|
|
|
|
|
type streamInfos struct {
|
|
|
|
channelInfos channelInfos
|
|
|
|
stream msgstream.MsgStream
|
|
|
|
}
|
|
|
|
|
|
|
|
func removeDuplicate(ss []string) []string {
|
|
|
|
m := make(map[string]struct{})
|
|
|
|
filtered := make([]string, 0, len(ss))
|
|
|
|
for _, s := range ss {
|
|
|
|
if _, ok := m[s]; !ok {
|
|
|
|
filtered = append(filtered, s)
|
|
|
|
m[s] = struct{}{}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return filtered
|
|
|
|
}
|
|
|
|
|
|
|
|
func newChannels(vchans []vChan, pchans []pChan) (channelInfos, error) {
|
|
|
|
if len(vchans) != len(pchans) {
|
2023-09-01 13:09:01 +08:00
|
|
|
log.Error("physical channels mismatch virtual channels", zap.Int("len(VirtualChannelNames)", len(vchans)), zap.Int("len(PhysicalChannelNames)", len(pchans)))
|
|
|
|
return channelInfos{}, fmt.Errorf("physical channels mismatch virtual channels, len(VirtualChannelNames): %v, len(PhysicalChannelNames): %v", len(vchans), len(pchans))
|
2022-06-02 15:34:04 +08:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
// remove duplicate physical channels.
|
|
|
|
return channelInfos{vchans: vchans, pchans: removeDuplicate(pchans)}, nil
|
|
|
|
*/
|
|
|
|
return channelInfos{vchans: vchans, pchans: pchans}, nil
|
|
|
|
}
|
|
|
|
|
2021-12-20 17:55:16 +08:00
|
|
|
// getChannelsFuncType returns the channel information according to the collection id.
|
2022-06-02 15:34:04 +08:00
|
|
|
type getChannelsFuncType = func(collectionID UniqueID) (channelInfos, error)
|
2021-12-20 17:55:16 +08:00
|
|
|
|
2021-12-21 20:59:11 +08:00
|
|
|
// repackFuncType repacks message into message pack.
|
2021-06-18 10:33:58 +08:00
|
|
|
type repackFuncType = func(tsMsgs []msgstream.TsMsg, hashKeys [][]int32) (map[int32]*msgstream.MsgPack, error)
|
2021-05-29 15:09:30 +08:00
|
|
|
|
2021-12-20 17:52:00 +08:00
|
|
|
// getDmlChannelsFunc returns a function about how to get dml channels of a collection.
|
2021-09-13 17:12:19 +08:00
|
|
|
func getDmlChannelsFunc(ctx context.Context, rc types.RootCoord) getChannelsFuncType {
|
2022-06-02 15:34:04 +08:00
|
|
|
return func(collectionID UniqueID) (channelInfos, error) {
|
2021-09-13 17:12:19 +08:00
|
|
|
req := &milvuspb.DescribeCollectionRequest{
|
2022-10-19 10:01:26 +08:00
|
|
|
Base: commonpbutil.NewMsgBase(commonpbutil.WithMsgType(commonpb.MsgType_DescribeCollection)),
|
2022-06-02 15:34:04 +08:00
|
|
|
CollectionID: collectionID,
|
2021-09-13 17:12:19 +08:00
|
|
|
}
|
2022-06-02 15:34:04 +08:00
|
|
|
|
2021-09-13 17:12:19 +08:00
|
|
|
resp, err := rc.DescribeCollection(ctx, req)
|
|
|
|
if err != nil {
|
2022-06-02 15:34:04 +08:00
|
|
|
log.Error("failed to describe collection", zap.Error(err), zap.Int64("collection", collectionID))
|
|
|
|
return channelInfos{}, err
|
2021-09-13 17:12:19 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
if resp.GetStatus().GetErrorCode() != commonpb.ErrorCode_Success {
|
|
|
|
log.Error("failed to describe collection",
|
|
|
|
zap.String("error_code", resp.GetStatus().GetErrorCode().String()),
|
|
|
|
zap.String("reason", resp.GetStatus().GetReason()))
|
|
|
|
return channelInfos{}, errors.New(resp.GetStatus().GetReason())
|
2021-09-13 17:12:19 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
return newChannels(resp.GetVirtualChannelNames(), resp.GetPhysicalChannelNames())
|
2021-09-13 17:12:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-29 15:09:30 +08:00
|
|
|
type singleTypeChannelsMgr struct {
|
2022-06-02 15:34:04 +08:00
|
|
|
infos map[UniqueID]streamInfos // collection id -> stream infos
|
|
|
|
mu sync.RWMutex
|
2021-06-18 10:33:58 +08:00
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
getChannelsFunc getChannelsFuncType
|
|
|
|
repackFunc repackFuncType
|
2021-05-21 09:52:20 +08:00
|
|
|
msgStreamFactory msgstream.Factory
|
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
func (mgr *singleTypeChannelsMgr) getAllChannels(collectionID UniqueID) (channelInfos, error) {
|
|
|
|
mgr.mu.RLock()
|
|
|
|
defer mgr.mu.RUnlock()
|
2021-05-21 09:52:20 +08:00
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
infos, ok := mgr.infos[collectionID]
|
|
|
|
if ok {
|
|
|
|
return infos.channelInfos, nil
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
return channelInfos{}, fmt.Errorf("collection not found in channels manager: %d", collectionID)
|
|
|
|
}
|
2021-05-21 09:52:20 +08:00
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
func (mgr *singleTypeChannelsMgr) getPChans(collectionID UniqueID) ([]pChan, error) {
|
|
|
|
channelInfos, err := mgr.getChannelsFunc(collectionID)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
2022-06-02 15:34:04 +08:00
|
|
|
return channelInfos.pchans, nil
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
func (mgr *singleTypeChannelsMgr) getVChans(collectionID UniqueID) ([]vChan, error) {
|
|
|
|
channelInfos, err := mgr.getChannelsFunc(collectionID)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
2021-08-31 10:25:59 +08:00
|
|
|
}
|
2022-06-02 15:34:04 +08:00
|
|
|
return channelInfos.vchans, nil
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
// getChannels returns the physical channels.
|
|
|
|
func (mgr *singleTypeChannelsMgr) getChannels(collectionID UniqueID) ([]pChan, error) {
|
|
|
|
var channelInfos channelInfos
|
|
|
|
channelInfos, err := mgr.getAllChannels(collectionID)
|
|
|
|
if err != nil {
|
|
|
|
return mgr.getPChans(collectionID)
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
2022-06-02 15:34:04 +08:00
|
|
|
return channelInfos.pchans, nil
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
// getVChannels returns the virtual channels.
|
|
|
|
func (mgr *singleTypeChannelsMgr) getVChannels(collectionID UniqueID) ([]vChan, error) {
|
|
|
|
var channelInfos channelInfos
|
|
|
|
channelInfos, err := mgr.getAllChannels(collectionID)
|
|
|
|
if err != nil {
|
|
|
|
return mgr.getVChans(collectionID)
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
2022-06-02 15:34:04 +08:00
|
|
|
return channelInfos.vchans, nil
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
func (mgr *singleTypeChannelsMgr) streamExistPrivate(collectionID UniqueID) bool {
|
|
|
|
streamInfos, ok := mgr.infos[collectionID]
|
|
|
|
return ok && streamInfos.stream != nil
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2023-08-16 10:29:33 +08:00
|
|
|
func createStream(factory msgstream.Factory, pchans []pChan, repack repackFuncType) (msgstream.MsgStream, error) {
|
2022-06-02 15:34:04 +08:00
|
|
|
var stream msgstream.MsgStream
|
|
|
|
var err error
|
2021-05-21 09:52:20 +08:00
|
|
|
|
2023-08-16 10:29:33 +08:00
|
|
|
stream, err = factory.NewMsgStream(context.Background())
|
2021-05-21 09:52:20 +08:00
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
stream.AsProducer(pchans)
|
|
|
|
if repack != nil {
|
|
|
|
stream.SetRepackFunc(repack)
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
2022-06-02 15:34:04 +08:00
|
|
|
runtime.SetFinalizer(stream, func(stream msgstream.MsgStream) {
|
|
|
|
stream.Close()
|
|
|
|
})
|
2021-05-21 09:52:20 +08:00
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
return stream, nil
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
func incPChansMetrics(pchans []pChan) {
|
|
|
|
for _, pc := range pchans {
|
2022-11-04 14:25:38 +08:00
|
|
|
metrics.ProxyMsgStreamObjectsForPChan.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), pc).Inc()
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
func decPChanMetrics(pchans []pChan) {
|
|
|
|
for _, pc := range pchans {
|
2022-11-04 14:25:38 +08:00
|
|
|
metrics.ProxyMsgStreamObjectsForPChan.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), pc).Dec()
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
2022-05-31 22:58:02 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
// createMsgStream create message stream for specified collection. Idempotent.
|
2022-06-09 17:34:09 +08:00
|
|
|
// If stream already exists, directly return it and no error will be returned.
|
|
|
|
func (mgr *singleTypeChannelsMgr) createMsgStream(collectionID UniqueID) (msgstream.MsgStream, error) {
|
|
|
|
mgr.mu.RLock()
|
|
|
|
infos, ok := mgr.infos[collectionID]
|
|
|
|
if ok && infos.stream != nil {
|
|
|
|
// already exist.
|
|
|
|
mgr.mu.RUnlock()
|
|
|
|
return infos.stream, nil
|
2022-05-31 22:58:02 +08:00
|
|
|
}
|
2022-06-09 17:34:09 +08:00
|
|
|
mgr.mu.RUnlock()
|
2022-05-31 22:58:02 +08:00
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
channelInfos, err := mgr.getChannelsFunc(collectionID)
|
2021-05-21 09:52:20 +08:00
|
|
|
if err != nil {
|
2022-06-09 17:34:09 +08:00
|
|
|
// What if stream created by other goroutines?
|
2022-06-02 15:34:04 +08:00
|
|
|
log.Error("failed to get channels", zap.Error(err), zap.Int64("collection", collectionID))
|
2022-06-09 17:34:09 +08:00
|
|
|
return nil, err
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2023-08-16 10:29:33 +08:00
|
|
|
stream, err := createStream(mgr.msgStreamFactory, channelInfos.pchans, mgr.repackFunc)
|
2021-05-21 09:52:20 +08:00
|
|
|
if err != nil {
|
2022-06-09 17:34:09 +08:00
|
|
|
// What if stream created by other goroutines?
|
2022-06-02 15:34:04 +08:00
|
|
|
log.Error("failed to create message stream", zap.Error(err), zap.Int64("collection", collectionID))
|
2022-06-09 17:34:09 +08:00
|
|
|
return nil, err
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-09 17:34:09 +08:00
|
|
|
mgr.mu.Lock()
|
|
|
|
defer mgr.mu.Unlock()
|
|
|
|
if !mgr.streamExistPrivate(collectionID) {
|
|
|
|
log.Info("create message stream", zap.Int64("collection", collectionID),
|
|
|
|
zap.Strings("virtual_channels", channelInfos.vchans),
|
|
|
|
zap.Strings("physical_channels", channelInfos.pchans))
|
|
|
|
mgr.infos[collectionID] = streamInfos{channelInfos: channelInfos, stream: stream}
|
|
|
|
incPChansMetrics(channelInfos.pchans)
|
|
|
|
}
|
2022-06-02 15:34:04 +08:00
|
|
|
|
2022-06-09 17:34:09 +08:00
|
|
|
return mgr.infos[collectionID].stream, nil
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
func (mgr *singleTypeChannelsMgr) lockGetStream(collectionID UniqueID) (msgstream.MsgStream, error) {
|
|
|
|
mgr.mu.RLock()
|
|
|
|
defer mgr.mu.RUnlock()
|
|
|
|
streamInfos, ok := mgr.infos[collectionID]
|
|
|
|
if ok {
|
|
|
|
return streamInfos.stream, nil
|
|
|
|
}
|
|
|
|
return nil, fmt.Errorf("collection not found: %d", collectionID)
|
|
|
|
}
|
2021-05-21 09:52:20 +08:00
|
|
|
|
2022-06-09 17:34:09 +08:00
|
|
|
// getOrCreateStream get message stream of specified collection.
|
2022-06-02 15:34:04 +08:00
|
|
|
// If stream don't exists, call createMsgStream to create for it.
|
2022-06-09 17:34:09 +08:00
|
|
|
func (mgr *singleTypeChannelsMgr) getOrCreateStream(collectionID UniqueID) (msgstream.MsgStream, error) {
|
2022-06-02 15:34:04 +08:00
|
|
|
if stream, err := mgr.lockGetStream(collectionID); err == nil {
|
|
|
|
return stream, nil
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-09 17:34:09 +08:00
|
|
|
return mgr.createMsgStream(collectionID)
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
// removeStream remove the corresponding stream of the specified collection. Idempotent.
|
|
|
|
// If stream already exists, remove it, otherwise do nothing.
|
2022-10-18 19:17:27 +08:00
|
|
|
func (mgr *singleTypeChannelsMgr) removeStream(collectionID UniqueID) {
|
2022-06-02 15:34:04 +08:00
|
|
|
mgr.mu.Lock()
|
|
|
|
defer mgr.mu.Unlock()
|
|
|
|
if info, ok := mgr.infos[collectionID]; ok {
|
|
|
|
decPChanMetrics(info.channelInfos.pchans)
|
2022-09-27 19:18:54 +08:00
|
|
|
info.stream.Close()
|
2022-06-02 15:34:04 +08:00
|
|
|
delete(mgr.infos, collectionID)
|
2022-03-15 21:51:21 +08:00
|
|
|
}
|
2022-09-27 19:18:54 +08:00
|
|
|
log.Info("dml stream removed", zap.Int64("collection_id", collectionID))
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2022-06-02 15:34:04 +08:00
|
|
|
// removeAllStream remove all message stream.
|
2022-10-18 19:17:27 +08:00
|
|
|
func (mgr *singleTypeChannelsMgr) removeAllStream() {
|
2022-06-02 15:34:04 +08:00
|
|
|
mgr.mu.Lock()
|
|
|
|
defer mgr.mu.Unlock()
|
|
|
|
for _, info := range mgr.infos {
|
2022-09-27 19:18:54 +08:00
|
|
|
info.stream.Close()
|
2022-06-02 15:34:04 +08:00
|
|
|
decPChanMetrics(info.channelInfos.pchans)
|
|
|
|
}
|
|
|
|
mgr.infos = make(map[UniqueID]streamInfos)
|
2022-09-27 19:18:54 +08:00
|
|
|
log.Info("all dml stream removed")
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
|
2021-06-18 10:33:58 +08:00
|
|
|
func newSingleTypeChannelsMgr(
|
|
|
|
getChannelsFunc getChannelsFuncType,
|
|
|
|
msgStreamFactory msgstream.Factory,
|
|
|
|
repackFunc repackFuncType,
|
|
|
|
) *singleTypeChannelsMgr {
|
2021-05-29 15:09:30 +08:00
|
|
|
return &singleTypeChannelsMgr{
|
2022-06-02 15:34:04 +08:00
|
|
|
infos: make(map[UniqueID]streamInfos),
|
|
|
|
getChannelsFunc: getChannelsFunc,
|
|
|
|
repackFunc: repackFunc,
|
|
|
|
msgStreamFactory: msgStreamFactory,
|
2021-05-29 15:09:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-13 11:04:33 +08:00
|
|
|
// implementation assertion
|
|
|
|
var _ channelsMgr = (*channelsMgrImpl)(nil)
|
|
|
|
|
2021-12-29 17:44:34 +08:00
|
|
|
// channelsMgrImpl implements channelsMgr.
|
2021-05-29 15:09:30 +08:00
|
|
|
type channelsMgrImpl struct {
|
|
|
|
dmlChannelsMgr *singleTypeChannelsMgr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (mgr *channelsMgrImpl) getChannels(collectionID UniqueID) ([]pChan, error) {
|
|
|
|
return mgr.dmlChannelsMgr.getChannels(collectionID)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (mgr *channelsMgrImpl) getVChannels(collectionID UniqueID) ([]vChan, error) {
|
|
|
|
return mgr.dmlChannelsMgr.getVChannels(collectionID)
|
|
|
|
}
|
|
|
|
|
2022-06-09 17:34:09 +08:00
|
|
|
func (mgr *channelsMgrImpl) getOrCreateDmlStream(collectionID UniqueID) (msgstream.MsgStream, error) {
|
|
|
|
return mgr.dmlChannelsMgr.getOrCreateStream(collectionID)
|
2021-05-29 15:09:30 +08:00
|
|
|
}
|
|
|
|
|
2022-10-18 19:17:27 +08:00
|
|
|
func (mgr *channelsMgrImpl) removeDMLStream(collectionID UniqueID) {
|
|
|
|
mgr.dmlChannelsMgr.removeStream(collectionID)
|
2021-05-29 15:09:30 +08:00
|
|
|
}
|
|
|
|
|
2022-10-18 19:17:27 +08:00
|
|
|
func (mgr *channelsMgrImpl) removeAllDMLStream() {
|
|
|
|
mgr.dmlChannelsMgr.removeAllStream()
|
2021-05-29 15:09:30 +08:00
|
|
|
}
|
|
|
|
|
2022-01-04 14:09:52 +08:00
|
|
|
// newChannelsMgrImpl constructs a channels manager.
|
2021-08-31 10:25:59 +08:00
|
|
|
func newChannelsMgrImpl(
|
2021-06-18 10:33:58 +08:00
|
|
|
getDmlChannelsFunc getChannelsFuncType,
|
|
|
|
dmlRepackFunc repackFuncType,
|
|
|
|
msgStreamFactory msgstream.Factory,
|
2021-08-31 10:25:59 +08:00
|
|
|
) *channelsMgrImpl {
|
2021-05-21 09:52:20 +08:00
|
|
|
return &channelsMgrImpl{
|
2023-08-16 10:29:33 +08:00
|
|
|
dmlChannelsMgr: newSingleTypeChannelsMgr(getDmlChannelsFunc, msgStreamFactory, dmlRepackFunc),
|
2021-05-21 09:52:20 +08:00
|
|
|
}
|
|
|
|
}
|