mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
Merge RootCoord, DataCoord And QueryCoord into MixCoord Make Session into one issue : https://github.com/milvus-io/milvus/issues/37764 --------- Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
43 lines
1.5 KiB
Go
43 lines
1.5 KiB
Go
package broker
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
|
|
"github.com/milvus-io/milvus/internal/types"
|
|
"github.com/milvus-io/milvus/pkg/v2/proto/datapb"
|
|
"github.com/milvus-io/milvus/pkg/v2/proto/internalpb"
|
|
"github.com/milvus-io/milvus/pkg/v2/util/typeutil"
|
|
)
|
|
|
|
// Broker is the interface for datanode to interact with other components.
|
|
//
|
|
//go:generate mockery --name=Broker --structname=MockBroker --output=./ --filename=mock_broker.go --with-expecter --inpackage
|
|
type Broker interface {
|
|
DataCoord
|
|
}
|
|
|
|
type coordBroker struct {
|
|
*dataCoordBroker
|
|
}
|
|
|
|
func NewCoordBroker(mixc types.MixCoordClient, serverID int64) Broker {
|
|
return &coordBroker{
|
|
dataCoordBroker: &dataCoordBroker{
|
|
client: mixc,
|
|
serverID: serverID,
|
|
},
|
|
}
|
|
}
|
|
|
|
// DataCoord is the interface wraps `DataCoord` grpc call
|
|
type DataCoord interface {
|
|
AssignSegmentID(ctx context.Context, reqs ...*datapb.SegmentIDRequest) ([]typeutil.UniqueID, error)
|
|
ReportTimeTick(ctx context.Context, msgs []*msgpb.DataNodeTtMsg) error
|
|
GetSegmentInfo(ctx context.Context, segmentIDs []int64) ([]*datapb.SegmentInfo, error)
|
|
UpdateChannelCheckpoint(ctx context.Context, channelCPs []*msgpb.MsgPosition) error
|
|
SaveBinlogPaths(ctx context.Context, req *datapb.SaveBinlogPathsRequest) error
|
|
DropVirtualChannel(ctx context.Context, req *datapb.DropVirtualChannelRequest) (*datapb.DropVirtualChannelResponse, error)
|
|
ImportV2(ctx context.Context, in *internalpb.ImportRequestInternal) (*internalpb.ImportResponse, error)
|
|
}
|