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

Update doc: service api

Signed-off-by: NGuoRentong <rentong.guo@zilliz.com>
上级 bb8da156
......@@ -10,18 +10,42 @@
#### 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 {
NONE = 0;
UNISSUED = 1;
INPROGRESS = 2;
FINISHED = 3;
}
```
```go
type IndexDescription struct {
ID UniqueID
Status IndexStatus
......@@ -29,12 +53,15 @@ type IndexDescription struct {
ScheduleTime time.Time
BuildCompleteTime time.Time
}
```
type Client interface {
BuildIndex(dataPaths []string, typeParams map[string]string, indexParams map[string]string) (UniqueID, error)
DescribeIndex(indexID UniqueID) (*IndexDescription, error)
GetIndexFilePaths(indexID UniqueID) ([]string, error)
* *GetIndexFilePaths*
```go
type IndexFilePaths struct {
FilePaths []string
}
```
......@@ -10,8 +10,18 @@
#### 8.2 API
```go
type Client interface {
CreateChannels(req CreateChannelRequest) (ChannelID []string, error)
DestoryChannels(channelID []string) error
DescribeChannels(channelID []string) (ChannelDescriptions, error)
}
```
* *CreateChannels*
```go
type OwnerDescription struct {
Role string
......@@ -20,14 +30,23 @@ type OwnerDescription struct {
DescriptionText string
}
type CreateChannelRequest struct {
OwnerDescription OwnerDescription
numChannels int
}
```
* *DescribeChannels*
```go
type ChannelDescription struct {
Owner OwnerDescription
}
type Client interface {
CreateChannels(ownerDescription OwnerDescription, numChannels int) (ChannelID []string, error)
DestoryChannels(channelID []string) error
DescribeChannels(channelID []string) ([]ChannelDescription, error)
type ChannelDescriptions struct {
Descriptions []ChannelDescription
}
```
......@@ -4,20 +4,25 @@
#### 6.0 Proxy Service API
```protobuf
message Credential {
string address
//TODO: we should add keys/tokens here
```go
type Client interface {
GetTimeTickChannel() (string, error)
GetStatsChannel() (string, error)
}
```
message ProxyInfo {
common.Status
string address
int32 port
#### 6.1 Gateway API
```go
type ProxyInfo struct {
Address string
Port int32
}
service ProxyService {
rpc RegisterLink(Credential) returns (ProxyInfo){} //TODO: call IAM
type Client interface {
RegisterLink() (ProxyInfo, error)
}
```
......
......@@ -2,6 +2,32 @@
## 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,48 +10,23 @@
#### 8.2 API
```go
type Client interface {
CreateQueryNodeGroup(nodeInstanceType string, numInstances int) (groupID UniqueID, error)
DestoryQueryNodeGroup(groupID UniqueID) error
DescribeQueryNodeGroup(groupID UniqueID) (QueryNodeGroupDescription, error)
DescribeParition(groupID UniqueID, dbID UniqueID, collID UniqueID, partitionIDs []UniqueID) ([]PartitionDescription, error)
CreateQueryChannel(groupID UniqueID) (QueryChannelInfo, error)
LoadPartitions(groupID UniqueID, dbID UniqueID, collID UniqueID, partitionIDs []UniqueID) error
ReleasePartitions(groupID UniqueID, dbID UniqueID, collID UniqueID, PartitionIDs []UniqueID) error
DescribeService() (ServiceDescription, error)
DescribeParition(req DescribeParitionRequest) (PartitionDescriptions, error)
LoadPartitions(req LoadPartitonRequest) error
ReleasePartitions(req ReleasePartitionRequest) error
CreateQueryChannel() (QueryChannels, error)
GetTimeTickChannel() (string, error)
GetStatsChannel() (string, error)
}
```
####
```go
// examples of node instance type (nodeInstanceType)
defaultInstanceType = "default"
userDefinedInstanceType = "custom.instance.type"
ec2StandardInstanceType = "c4.2xlarge"
```
* *DescribeService*
```go
type QueryChannelInfo struct {
RequestChannel string
ResultChannel string
}
```
```go
type ResourceCost struct {
MemUsage int64
CpuUsage float32
}
type QueryNodeDescription struct {
ResourceCost ResourceCost
}
......@@ -64,7 +39,7 @@ type DbDescription struct {
CollectionDescriptions []CollectionDescription
}
type QueryNodeGroupDescription struct {
type ServiceDescription struct {
DbDescriptions map[UniqueID]DbDescription
NodeDescriptions map[UniqueID]QueryNodeDescription
}
......@@ -72,7 +47,15 @@ type QueryNodeGroupDescription struct {
* *DescribeParition*
```go
type DescribeParitionRequest struct {
DbID UniqueID
CollectionID UniqueID
partitionIDs []UniqueID
}
type PartitionState = int
const (
......@@ -84,11 +67,55 @@ const (
IN_GPU PartitionState = 5
)
type ResourceCost struct {
MemUsage int64
CpuUsage float32
}
type PartitionDescription struct {
ID UniqueID
State PartitionState
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.
先完成此消息的编辑!
想要评论请 注册