milvus各组件的结构体分析

milvus各组件的结构体分析

各组件启动,需要构建各组件的结构体,一共8个。

go 复制代码
runComponent(ctx, localMsg, wg, components.NewRootCoord, metrics.RegisterRootCoord)
runComponent(ctx, localMsg, wg, components.NewProxy, metrics.RegisterProxy)
runComponent(ctx, localMsg, wg, components.NewQueryCoord, metrics.RegisterQueryCoord)
runComponent(ctx, localMsg, wg, components.NewQueryNode, metrics.RegisterQueryNode)
runComponent(ctx, localMsg, wg, components.NewDataCoord, metrics.RegisterDataCoord)
runComponent(ctx, localMsg, wg, components.NewDataNode, metrics.RegisterDataNode)
runComponent(ctx, localMsg, wg, components.NewIndexCoord, func(registry *prometheus.Registry)
runComponent(ctx, localMsg, wg, components.NewIndexNode, metrics.RegisterIndexNode)

真正的组件功能API都在Server端。

go 复制代码
type RootCoord struct {
    // 传递上下文
    ctx context.Context
    // 实现 RoodCoord grpc server
    svr *grpcrootcoord.Server
}
go 复制代码
type Proxy struct {
    // 实现 Proxy grpc server
    svr *grpcproxy.Server
}
go 复制代码
type QueryCoord struct {
    // 传递上下文
    ctx context.Context
    // 实现 QueryCoord grpc server
    svr *grpcquerycoord.Server
}
go 复制代码
type QueryNode struct {
    // 传递上下文
    ctx context.Context
    // 实现 QueryNode grpc server
    svr *grpcquerynode.Server
}
go 复制代码
type DataCoord struct {
    // 传递上下文
    ctx context.Context
    // 实现 DataCoord grpc server
    svr *grpcdatacoord.Server
}
go 复制代码
type DataNode struct {
    // 传递上下文
    ctx context.Context
    // 实现 DataNode grpc server
    svr *grpcdatanode.Server
}

由于IndexCoord和DataCoord合并了,这里结构体为空。

go 复制代码
type IndexCoord struct{}
go 复制代码
type IndexNode struct {
    // 实现 IndexNode grpc server
    svr *grpcindexnode.Server
}

只有Proxy和IndexNode没有ctx。为什么这2个没有ctx??

最原始的ctx为:

go 复制代码
ctx, cancel := context.WithCancel(context.Background())

Server里的ctx为:

go 复制代码
ctx1, cancel := context.WithCancel(ctx)

服务端路径:

复制代码
internal\distributed\rootcoord\service.go
internal\distributed\proxy\service.go
internal\distributed\querycoord\service.go
internal\distributed\querynode\service.go
internal\distributed\datacoord\service.go
internal\distributed\datanode\service.go
internal\distributed\indexnode\service.go

每个服务端都有自己的API。

相关推荐
SuniaWang3 天前
Milvus 深度解析:为 AI 而生的云原生向量数据库
数据库·人工智能·milvus
£漫步 云端彡3 天前
安装 Milvus Standalone 模式的完整指南及常见问题解决
milvus
寂寞旅行12 天前
向量数据库Milvus的使用
数据库·milvus
CCPC不拿奖不改名13 天前
虚拟机基础:在VMware WorkStation上安装Linux为容器化部署打基础
linux·运维·服务器·人工智能·milvus·知识库搭建·容器化部署
heimeiyingwang13 天前
如何用向量数据库构建企业级语义检索系统
数据库·mongodb·nosql·milvus
rongyili8814 天前
Dify 外部知识库集成 Milvus 实战指南
开发语言·python·milvus
Hoking15 天前
milvus向量数据库介绍与部署(docker-compose)
人工智能·milvus·向量数据库
IT_Octopus15 天前
AI 工程 生产级别 向量数据库 Milvus 部署架构&多租户方案&节点流程简单总结
数据库·架构·milvus
IT_Octopus16 天前
AI 工程 生产级别向量数据库Milvus2.6.10性能测试报告
数据库·人工智能·milvus
陌陌62317 天前
应届生第一门 AI 大模型实战课:RAG、Dify、Milvus 与 Vibe Coding
人工智能·milvus