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。

相关推荐
Cherry Zack9 小时前
windows系统docker装milvus向量数据库
milvus
分布式存储与RustFS3 天前
告别复杂配置:用Milvus、RustFS和Vibe Coding,60分钟DIY专属Chatbot
wpf·文件系统·milvus·对象存储·minio·rustfs·vibe
泥烟4 天前
使用Milvus和DeepSeek构建RAG demo
大模型·milvus·deepseek
XXX-X-XXJ5 天前
二:RAG 的 “语义密码”:向量、嵌入模型与 Milvus 向量数据库实操
人工智能·git·后端·python·django·milvus
Roam-G6 天前
在 Mac 上使用 Docker 安装 Milvus 2.6.2
docker·容器·milvus
2301_794333911 个月前
Docker Compose 运行 Milvus (Mac) 并与 python 连接测试
macos·docker·milvus
勇往直前plus1 个月前
Milvus快速入门以及用 Java 操作 Milvus
java·spring boot·embedding·milvus
乔公子搬砖2 个月前
构建企业级RAG系统:基于Milvus的模块化实现与全流程解析
大数据·人工智能·python·ai·milvus·rag·向量库
runfarther2 个月前
Milvus 向量数据库开发实战指南
python·ai·大语言模型·数据库开发·milvus
耳东哇2 个月前
在使用spring ai进行llm处理的rag的时候,选择milvus还是neo4j呢?
人工智能·neo4j·milvus