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。

相关推荐
小毅&Nora19 小时前
【向量数据库】Milvus 向量数据库 ④ 向量索引的存储结构与查询执行模型:从 Faiss 到 Knowhere 的源码解剖
向量·milvus·faiss
码农胖虎-java1 天前
【AI】向量数据库选型实战:pgvector vs Milvus vs Qdrant
数据库·milvus·pg
树叶会结冰2 天前
Milvus:可检索记忆的漂流瓶
langchain·milvus·llamaindex
Learn Forever2 天前
【向量库-Milvus】Milvus部署及使用
milvus
秋氘渔2 天前
LlamaIndex 实战 Milvus 向量数据库:从 CRUD 到 智能检索
milvus·llamaindex
玖日大大3 天前
Milvus 深度解析:开源向量数据库的技术架构、实践指南与生态生态
数据库·开源·milvus
长路 ㅤ   5 天前
Milvus向量库Java对接使用指南
milvus·向量数据库·索引优化·混合搜索·ann搜索
福大大架构师每日一题7 天前
milvus v2.6.8 发布:搜索高亮上线,性能与稳定性全面跃升,生产环境强烈推荐升级
android·java·milvus
Clarence Liu9 天前
Milvus学习(1) 架构和部署
学习·架构·milvus
托尼吴10 天前
milvus 向量数据库学习笔记-基础认识
数据库·学习·milvus