提交 1abc6927 编写于 作者: G GuoRentong 提交者: yefu.chen

Update doc: service api

Signed-off-by: NGuoRentong <rentong.guo@zilliz.com>
上级 bb8da156
...@@ -10,18 +10,42 @@ ...@@ -10,18 +10,42 @@
#### 8.2 API #### 8.2 API
```protobuf ```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 { enum IndexStatus {
NONE = 0; NONE = 0;
UNISSUED = 1; UNISSUED = 1;
INPROGRESS = 2; INPROGRESS = 2;
FINISHED = 3; FINISHED = 3;
} }
```
```go
type IndexDescription struct { type IndexDescription struct {
ID UniqueID ID UniqueID
Status IndexStatus Status IndexStatus
...@@ -29,12 +53,15 @@ type IndexDescription struct { ...@@ -29,12 +53,15 @@ type IndexDescription struct {
ScheduleTime time.Time ScheduleTime time.Time
BuildCompleteTime time.Time BuildCompleteTime time.Time
} }
```
type Client interface {
BuildIndex(dataPaths []string, typeParams map[string]string, indexParams map[string]string) (UniqueID, error) * *GetIndexFilePaths*
DescribeIndex(indexID UniqueID) (*IndexDescription, error)
GetIndexFilePaths(indexID UniqueID) ([]string, error) ```go
type IndexFilePaths struct {
FilePaths []string
} }
``` ```
...@@ -10,8 +10,18 @@ ...@@ -10,8 +10,18 @@
#### 8.2 API #### 8.2 API
```go
type Client interface {
CreateChannels(req CreateChannelRequest) (ChannelID []string, error)
DestoryChannels(channelID []string) error
DescribeChannels(channelID []string) (ChannelDescriptions, error)
}
```
* *CreateChannels*
```go ```go
type OwnerDescription struct { type OwnerDescription struct {
Role string Role string
...@@ -20,14 +30,23 @@ type OwnerDescription struct { ...@@ -20,14 +30,23 @@ type OwnerDescription struct {
DescriptionText string DescriptionText string
} }
type CreateChannelRequest struct {
OwnerDescription OwnerDescription
numChannels int
}
```
* *DescribeChannels*
```go
type ChannelDescription struct { type ChannelDescription struct {
Owner OwnerDescription Owner OwnerDescription
} }
type Client interface { type ChannelDescriptions struct {
CreateChannels(ownerDescription OwnerDescription, numChannels int) (ChannelID []string, error) Descriptions []ChannelDescription
DestoryChannels(channelID []string) error
DescribeChannels(channelID []string) ([]ChannelDescription, error)
} }
``` ```
...@@ -4,20 +4,25 @@ ...@@ -4,20 +4,25 @@
#### 6.0 Proxy Service API #### 6.0 Proxy Service API
```protobuf ```go
message Credential { type Client interface {
string address GetTimeTickChannel() (string, error)
//TODO: we should add keys/tokens here GetStatsChannel() (string, error)
} }
```
message ProxyInfo {
common.Status #### 6.1 Gateway API
string address
int32 port ```go
type ProxyInfo struct {
Address string
Port int32
} }
service ProxyService { type Client interface {
rpc RegisterLink(Credential) returns (ProxyInfo){} //TODO: call IAM RegisterLink() (ProxyInfo, error)
} }
``` ```
......
...@@ -2,6 +2,32 @@ ...@@ -2,6 +2,32 @@
## 10. Master ## 10. Master
,
#### 10.1 API
```go
type Client interface {
CreateCollection(req CreateCollectionRequest) error
DropCollection(req DropCollectionRequest) error
HasCollection(req HasCollectionRequest) (bool, error)
DescribeCollection(req DescribeCollectionRequest) (CollectionDescription, error)
ShowCollections(req ShowCollectionRequest) ([]string, error)
CreatePartition(req CreatePartitionRequest) error
DropPartition(req DropPartitionRequest) error
HasPartition(req HasPartitionRequest) (bool, error)
DescribePartition(req DescribePartitionRequest) (PartitionDescription, error)
ShowPartitions(req ShowPartitionRequest) ([]string, error)
AllocTimestamp(req TsoRequest) (TsoResponse, error)
AllocID(req IDRequest) (IDResponse, error)
GetDdChannel() (string, error)
GetTimeTickChannel() (string, error)
GetStatsChannel() (string, error)
}
```
#### 10.1 Interfaces (RPC) #### 10.1 Interfaces (RPC)
......
...@@ -10,48 +10,23 @@ ...@@ -10,48 +10,23 @@
#### 8.2 API #### 8.2 API
```go ```go
type Client interface { type Client interface {
CreateQueryNodeGroup(nodeInstanceType string, numInstances int) (groupID UniqueID, error) DescribeService() (ServiceDescription, error)
DestoryQueryNodeGroup(groupID UniqueID) error DescribeParition(req DescribeParitionRequest) (PartitionDescriptions, error)
DescribeQueryNodeGroup(groupID UniqueID) (QueryNodeGroupDescription, error) LoadPartitions(req LoadPartitonRequest) error
DescribeParition(groupID UniqueID, dbID UniqueID, collID UniqueID, partitionIDs []UniqueID) ([]PartitionDescription, error) ReleasePartitions(req ReleasePartitionRequest) error
CreateQueryChannel(groupID UniqueID) (QueryChannelInfo, error) CreateQueryChannel() (QueryChannels, error)
LoadPartitions(groupID UniqueID, dbID UniqueID, collID UniqueID, partitionIDs []UniqueID) error GetTimeTickChannel() (string, error)
ReleasePartitions(groupID UniqueID, dbID UniqueID, collID UniqueID, PartitionIDs []UniqueID) error GetStatsChannel() (string, error)
} }
``` ```
####
```go
// examples of node instance type (nodeInstanceType)
defaultInstanceType = "default"
userDefinedInstanceType = "custom.instance.type"
ec2StandardInstanceType = "c4.2xlarge"
```
* *DescribeService*
```go ```go
type QueryChannelInfo struct {
RequestChannel string
ResultChannel string
}
```
```go
type ResourceCost struct {
MemUsage int64
CpuUsage float32
}
type QueryNodeDescription struct { type QueryNodeDescription struct {
ResourceCost ResourceCost ResourceCost ResourceCost
} }
...@@ -64,7 +39,7 @@ type DbDescription struct { ...@@ -64,7 +39,7 @@ type DbDescription struct {
CollectionDescriptions []CollectionDescription CollectionDescriptions []CollectionDescription
} }
type QueryNodeGroupDescription struct { type ServiceDescription struct {
DbDescriptions map[UniqueID]DbDescription DbDescriptions map[UniqueID]DbDescription
NodeDescriptions map[UniqueID]QueryNodeDescription NodeDescriptions map[UniqueID]QueryNodeDescription
} }
...@@ -72,7 +47,15 @@ type QueryNodeGroupDescription struct { ...@@ -72,7 +47,15 @@ type QueryNodeGroupDescription struct {
* *DescribeParition*
```go ```go
type DescribeParitionRequest struct {
DbID UniqueID
CollectionID UniqueID
partitionIDs []UniqueID
}
type PartitionState = int type PartitionState = int
const ( const (
...@@ -84,11 +67,55 @@ const ( ...@@ -84,11 +67,55 @@ const (
IN_GPU PartitionState = 5 IN_GPU PartitionState = 5
) )
type ResourceCost struct {
MemUsage int64
CpuUsage float32
}
type PartitionDescription struct { type PartitionDescription struct {
ID UniqueID ID UniqueID
State PartitionState State PartitionState
ResourceCost ResourceCost ResourceCost ResourceCost
} }
type PartitionDescriptions struct {
PartitionDescriptions []PartitionDescription
}
```
* *CreateQueryChannel*
```go
type QueryChannels struct {
RequestChannel string
ResultChannel string
}
```
* *LoadPartitions*
```go
type LoadPartitonRequest struct {
DbID UniqueID
CollectionID UniqueID
PartitionIDs []UniqueID
}
```
* *ReleasePartitions*
```go
type ReleasePartitionRequest struct {
DbID UniqueID
CollectionID UniqueID
PartitionIDs []UniqueID
}
``` ```
......
## 8. Data Service
#### 8.1 Overview
#### 8.2 API
```go
type Client interface {
AssignSegmentID(req AssignSegIDRequest) (AssignSegIDResponse, error)
Flush(req FlushRequest) (error)
GetInsertBinlogPaths(req InsertBinlogPathRequest) (InsertBinlogPathsResponse, error)
GetInsertChannels(req InsertChannelRequest) ([]string, error)
GetTimeTickChannel() (string, error)
GetStatsChannel() (string, error)
}
```
* *AssignSegmentID*
```go
type SegIDRequest struct {
Count uint32
ChannelID string
CollectionID UniqueID
PartitionID UniqueID
}
type AssignSegIDRequest struct {
PerChannelRequest []SegIDRequest
}
type SegIDAssignment struct {
SegID UniqueID
ChannelID string
Count uint32
CollectionID UniqueID
PartitionID UniqueID
ExpireTime Timestamp
}
type AssignSegIDResponse struct {
PerChannelResponse []SegIDAssignment
}
```
* *Flush*
```go
type FlushRequest struct {
DbID UniqueID
CollectionID UniqueID
}
```
* *GetInsertBinlogPaths*
```go
type InsertBinlogPathRequest struct {
segmentID UniqueID
}
type InsertBinlogPathsResponse struct {
FieldIdxToPaths map[int32][]string
}
```
* *GetInsertChannels*
```go
type InsertChannelRequest struct {
DbID UniqueID
CollectionID UniqueID
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册