mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
a09a3a1905
Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
3.4 KiB
3.4 KiB
8. Index Service
8.1 Overview
8.2 Index Service Interface
type IndexCoord interface {
Component
TimeTickProvider
RegisterNode(ctx context.Context, req *indexpb.RegisterNodeRequest) (*indexpb.RegisterNodeResponse, error)
BuildIndex(ctx context.Context, req *indexpb.BuildIndexRequest) (*indexpb.BuildIndexResponse, error)
DropIndex(ctx context.Context, req *indexpb.DropIndexRequest) (*commonpb.Status, error)
GetIndexStates(ctx context.Context, req *indexpb.IndexStatesRequest) (*indexpb.IndexStatesResponse, error)
GetIndexFilePaths(ctx context.Context, req *indexpb.IndexFilePathsRequest) (*indexpb.IndexFilePathsResponse, error)
NotifyBuildIndex(ctx context.Context, nty *indexpb.BuildIndexNotification) (*commonpb.Status, error)
}
- RegisterNode
type MsgBase struct {
MsgType MsgType
MsgID UniqueID
Timestamp uint64
SourceID UniqueID
}
type Address struct {
Ip string
Port int64
}
type RegisterNodeRequest struct {
Base *commonpb.MsgBase
Address *commonpb.Address
}
type InitParams struct {
NodeID UniqueID
StartParams []*commonpb.KeyValuePair
}
type RegisterNodeResponse struct {
InitParams *internalpb.InitParams
Status *commonpb.Status
}
- BuildIndex
type KeyValuePair struct {
Key string
Value string
}
type BuildIndexRequest struct {
IndexBuildID UniqueID
IndexName string
IndexID UniqueID
DataPaths []string
TypeParams []*commonpb.KeyValuePair
IndexParams []*commonpb.KeyValuePair
}
type BuildIndexResponse struct {
Status *commonpb.Status
IndexBuildID UniqueID
}
- DropIndex
type DropIndexRequest struct {
IndexID UniqueID
}
- GetIndexStates
type GetIndexStatesRequest struct {
IndexBuildIDs []UniqueID
}
const (
IndexState_IndexStateNone IndexState = 0
IndexState_Unissued IndexState = 1
IndexState_InProgress IndexState = 2
IndexState_Finished IndexState = 3
IndexState_Failed IndexState = 4
IndexState_Deleted IndexState = 5
)
type IndexInfo struct {
State commonpb.IndexState
IndexBuildID UniqueID
IndexID UniqueID
IndexName string
Reason string
}
type GetIndexStatesResponse struct {
Status *commonpb.Status
States []*IndexInfo
}
- GetIndexFilePaths
type GetIndexFilePathsRequest struct {
IndexBuildIDs []UniqueID
}
type IndexFilePathInfo struct {
Status *commonpb.Status
IndexBuildID UniqueID
IndexFilePaths []string
}
type GetIndexFilePathsResponse struct {
Status *commonpb.Status
FilePaths []*IndexFilePathInfo
}
- NotifyBuildIndex
type NotifyBuildIndexRequest struct {
Status *commonpb.Status
IndexBuildID UniqueID
IndexFilePaths []string
NodeID UniqueID
}
8.3 Index Node Interface
type IndexNode interface {
Component
TimeTickProvider
BuildIndex(ctx context.Context, req *indexpb.BuildIndexRequest) (*commonpb.Status, error)
DropIndex(ctx context.Context, req *indexpb.DropIndexRequest) (*commonpb.Status, error)
}
- BuildIndex
type KeyValuePair struct {
Key string
Value string
}
type BuildIndexRequest struct {
IndexBuildID UniqueID
IndexName string
IndexID UniqueID
DataPaths []string
TypeParams []*commonpb.KeyValuePair
IndexParams []*commonpb.KeyValuePair
}
- DropIndex
type DropIndexRequest struct {
IndexID UniqueID
}