Add service interface to milvus.proto

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
This commit is contained in:
dragondriver 2021-01-15 16:51:21 +08:00 committed by yefu.chen
parent 31178d6a5c
commit e6225a7030
4 changed files with 1397 additions and 115 deletions

View File

@ -5,11 +5,13 @@ option go_package = "github.com/zilliztech/milvus-distributed/internal/proto/mil
import "common.proto";
import "internal.proto";
import "schema.proto";
message CreateCollectionRequest {
internal.MsgBase base = 1;
string db_name = 2;
string collectionName = 3;
// `schema` is the serialized `schema.CollectionSchema`
bytes schema = 4;
}
@ -26,6 +28,11 @@ message HasCollectionRequest {
string collection_name = 3;
}
message BoolResponse {
common.Status status = 1;
bool value = 2;
}
message DescribeCollectionRequest {
internal.MsgBase base = 1;
string db_name = 2;
@ -33,7 +40,8 @@ message DescribeCollectionRequest {
}
message DescribeCollectionResponse {
repeated bytes schema = 1;
common.Status status = 1;
schema.CollectionSchema schema = 2;
}
message LoadCollectionRequest {
@ -56,6 +64,7 @@ message CollectionStatsRequest {
message CollectionStatsResponse {
repeated common.KeyValuePair stats = 1;
common.Status status = 2;
}
@ -66,6 +75,7 @@ message ShowCollectionRequest {
message ShowCollectionResponse {
repeated string collection_names = 1;
common.Status status = 2;
}
@ -114,6 +124,7 @@ message PartitionStatsRequest {
message PartitionStatsResponse {
repeated common.KeyValuePair stats = 1;
common.Status status = 2;
}
message ShowPartitionRequest {
@ -124,6 +135,7 @@ message ShowPartitionRequest {
message ShowPartitionResponse {
repeated string partition_names = 1;
common.Status status = 2;
}
@ -149,6 +161,7 @@ message IndexDescription {
message DescribeIndexResponse {
repeated IndexDescription index_descriptions = 1;
common.Status status = 2;
}
message InsertRequest {
@ -163,6 +176,24 @@ message InsertRequest {
message InsertResponse {
int64 rowID_begin = 1;
int64 rowID_end = 2;
common.Status status = 3;
}
enum PlaceholderType {
NONE = 0;
VECTOR_BINARY = 100;
VECTOR_FLOAT = 101;
}
message PlaceholderValue {
string tag = 1;
PlaceholderType type = 2;
// values is a 2d-array, every array contains a vector
repeated bytes values = 3;
}
message PlaceholderGroup {
repeated PlaceholderValue placeholders = 1;
}
message SearchRequest {
@ -171,11 +202,49 @@ message SearchRequest {
string collection_name = 3;
repeated string partition_names = 4;
string dsl = 5;
repeated bytes placeholder_group = 6;
// serialized `PlaceholderGroup`
bytes placeholder_group = 6;
}
message Hits {
repeated int64 IDs = 1;
repeated bytes row_data = 2;
repeated float scores = 3;
}
message QueryResult {
common.Status status = 1;
repeated bytes hits = 2;
}
message FlushRequest {
internal.MsgBase base = 1;
string db_name = 2;
string collection_name = 3;
}
}
service MilvusService {
rpc CreateCollection(CreateCollectionRequest) returns (common.Status) {}
rpc DropCollection(DropCollectionRequest) returns (common.Status) {}
rpc HasCollection(HasCollectionRequest) returns (BoolResponse) {}
rpc LoadCollection(LoadCollectionRequest) returns (common.Status) {}
rpc ReleaseCollection(ReleaseCollectionRequest) returns (common.Status) {}
rpc DescribeCollection(DescribeCollectionRequest) returns (DescribeCollectionResponse) {}
rpc GetCollectionStatistics(CollectionStatsRequest) returns (CollectionStatsResponse) {}
rpc ShowCollections(ShowCollectionRequest) returns (ShowCollectionResponse) {}
rpc CreatePartition(CreatePartitionRequest) returns (common.Status) {}
rpc DropPartition(DropPartitionRequest) returns (common.Status) {}
rpc HasPartition(HasPartitionRequest) returns (BoolResponse) {}
rpc LoadPartitions(LoadPartitonRequest) returns (common.Status) {}
rpc ReleasePartitions(ReleasePartitionRequest) returns (common.Status) {}
rpc GetPartitionStatistics(PartitionStatsRequest) returns (PartitionStatsResponse) {}
rpc ShowPartitions(ShowPartitionRequest) returns (ShowPartitionResponse) {}
rpc CreateIndex(CreateIndexRequest) returns (common.Status) {}
rpc DescribeIndex(DescribeIndexRequest) returns (DescribeIndexResponse) {}
rpc Insert(InsertRequest) returns (InsertResponse) {}
rpc Search(SearchRequest) returns (QueryResult) {}
rpc Flush(FlushRequest) returns (common.Status) {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,16 @@
package proxyservice
import (
"github.com/zilliztech/milvus-distributed/internal/proto/proxypb"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
)
type ServiceBase = typeutil.Service
type Interface interface {
ServiceBase
RegisterLink() (proxypb.RegisterLinkResponse, error)
RegisterNode(request proxypb.RegisterNodeRequest) (proxypb.RegisterNodeResponse, error)
// TODO: i'm sure it's not a best way to keep consistency, fix me
InvalidateCollectionMetaCache(request proxypb.InvalidateCollMetaCacheRequest) error
}

View File

@ -0,0 +1,54 @@
package proxyservice
import (
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb2"
"github.com/zilliztech/milvus-distributed/internal/proto/proxypb"
)
type ProxyService struct {
// implement Service
//nodeClients [] .Interface
// factory method
}
func (s ProxyService) Init() {
panic("implement me")
}
func (s ProxyService) Start() {
panic("implement me")
}
func (s ProxyService) Stop() {
panic("implement me")
}
func (s ProxyService) GetServiceStates() (internalpb2.ServiceStates, error) {
panic("implement me")
}
func (s ProxyService) GetTimeTickChannel() (string, error) {
panic("implement me")
}
func (s ProxyService) GetStatisticsChannel() (string, error) {
panic("implement me")
}
func (s ProxyService) RegisterLink() (proxypb.RegisterLinkResponse, error) {
panic("implement me")
}
func (s ProxyService) RegisterNode(request proxypb.RegisterNodeRequest) (proxypb.RegisterNodeResponse, error) {
panic("implement me")
}
func (s ProxyService) InvalidateCollectionMetaCache(request proxypb.InvalidateCollMetaCacheRequest) error {
panic("implement me")
}
func NewProxyServiceImpl() Interface {
return &ProxyService{}
}