mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
84 lines
1.1 KiB
Markdown
84 lines
1.1 KiB
Markdown
|
|
|
|
## 8. Index Service
|
|
|
|
|
|
|
|
#### 8.1 Overview
|
|
|
|
<img src="./figs/index_service.jpeg" width=700>
|
|
|
|
#### 8.2 API
|
|
|
|
```go
|
|
type Client interface {
|
|
BuildIndex(req BuildIndexRequest) (BuildIndexResponse, error)
|
|
DescribeIndex(indexID UniqueID) (IndexDescription, error)
|
|
GetIndexFilePaths(indexID UniqueID) (IndexFilePaths, error)
|
|
}
|
|
```
|
|
|
|
|
|
|
|
* *BuildIndex*
|
|
|
|
```go
|
|
type BuildIndexRequest struct {
|
|
DataPaths []string
|
|
TypeParams map[string]string
|
|
IndexParams map[string]string
|
|
}
|
|
|
|
type BuildIndexResponse struct {
|
|
IndexID UniqueID
|
|
}
|
|
```
|
|
|
|
|
|
|
|
* *DescribeIndex*
|
|
|
|
```go
|
|
enum IndexStatus {
|
|
NONE = 0;
|
|
UNISSUED = 1;
|
|
INPROGRESS = 2;
|
|
FINISHED = 3;
|
|
}
|
|
|
|
type IndexDescription struct {
|
|
ID UniqueID
|
|
Status IndexStatus
|
|
EnqueueTime time.Time
|
|
ScheduleTime time.Time
|
|
BuildCompleteTime time.Time
|
|
}
|
|
```
|
|
|
|
|
|
|
|
* *GetIndexFilePaths*
|
|
|
|
```go
|
|
type IndexFilePaths struct {
|
|
FilePaths []string
|
|
}
|
|
```
|
|
|
|
|
|
|
|
#### 8.3 Index Node
|
|
|
|
```go
|
|
type IndexNode interface {
|
|
Start() error
|
|
Close() error
|
|
|
|
SetTimeTickChannel(channelID string) error
|
|
SetStatsChannel(channelID string) error
|
|
|
|
BuildIndex(req BuildIndexRequest) (BuildIndexResponse, error)
|
|
}
|
|
```
|
|
|