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。

相关推荐
Zilliz Planet3 天前
快速实现AI搜索!Fivetran 支持 Milvus 作为数据迁移目标
人工智能·milvus
花千树-0107 天前
Milvus - 架构设计详解
milvus
花千树-0107 天前
Milvus - 安装与部署教程
milvus
苍墨穹天10 天前
基于milvus数据库的RAG-Demo
langchain·milvus
花千树-01011 天前
Milvus - 从数据库到 Partition Key 实现多租户
数据库·milvus
chenkangck5015 天前
AI大模型之旅--milvus向量库安装
人工智能·aigc·milvus
MonkeyKing_sunyuhua20 天前
实现从 Milvus 中获取数据,并基于嵌入向量重新排序的功能
numpy·milvus
我爱学Python!20 天前
大模型教程:使用 Milvus、vLLM 和 Llama 3.1 搭建 RAG 应用
自然语言处理·大模型·llm·大语言模型·llama·milvus·rag
苍墨穹天20 天前
windows系统docker装milvus向量数据库
docker·容器·milvus
Zilliz Planet23 天前
使用 Milvus、vLLM 和 Llama 3.1 搭建 RAG 应用
llama·milvus