milvus.proto 8.0 KB
Newer Older
1 2 3 4 5 6
syntax = "proto3";
package milvus.proto.milvus;

option go_package = "github.com/zilliztech/milvus-distributed/internal/proto/milvuspb";

import "common.proto";
Y
yukun 已提交
7
import "schema.proto";
8 9

message CreateCollectionRequest {
10
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
11
  string db_name = 2;
12
  string collection_name = 3;
Y
yukun 已提交
13
  // `schema` is the serialized `schema.CollectionSchema`
Z
zhenshan.cao 已提交
14
  bytes schema = 4;
15 16 17 18
}


message DropCollectionRequest {
19
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
20
  string db_name = 2;
21
  string collection_name = 3;
22 23 24
}

message HasCollectionRequest {
25
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
26
  string db_name = 2;
27 28 29
  string collection_name = 3;
}

Y
yukun 已提交
30 31 32 33 34
message BoolResponse {
  common.Status status = 1;
  bool value = 2;
}

Z
zhenshan.cao 已提交
35 36 37 38 39
message StringResponse {
  common.Status status = 1;
  string value = 2;
}

40
message DescribeCollectionRequest {
41
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
42
  string db_name = 2;
43 44 45 46
  string collection_name = 3;
}

message DescribeCollectionResponse {
Y
yukun 已提交
47 48
  common.Status status = 1;
  schema.CollectionSchema schema = 2;
49
  int64 collectionID = 3;
50 51 52
}

message LoadCollectionRequest {
53
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
54
  string db_name = 2;
55 56 57 58
  string collection_name = 3;
}

message ReleaseCollectionRequest {
59
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
60
  string db_name = 2;
61 62 63 64
  string collection_name = 3;
}

message CollectionStatsRequest {
65
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
66
  string db_name = 2;
67 68 69 70
  string collection_name = 3;
}

message CollectionStatsResponse {
Z
zhenshan.cao 已提交
71 72
  common.Status status = 1;
  repeated common.KeyValuePair stats = 2;
73 74 75 76
}


message ShowCollectionRequest {
77
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
78
  string db_name = 2;
79 80 81
}

message ShowCollectionResponse {
Z
zhenshan.cao 已提交
82 83
  common.Status status = 1;
  repeated string collection_names = 2;
84 85 86 87
}


message CreatePartitionRequest {
88
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
89
  string db_name = 2;
90 91 92 93 94 95
  string collection_name = 3;
  string partition_name = 4;
}


message DropPartitionRequest {
96
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
97
  string db_name = 2;
98 99 100 101 102
  string collection_name = 3;
  string partition_name = 4;
}

message HasPartitionRequest {
103
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
104
  string db_name = 2;
105 106 107 108 109
  string collection_name = 3;
  string partition_name = 4;
}

message LoadPartitonRequest {
110
  common.MsgBase base = 1;
111 112 113 114 115 116
  string db_name = 2;
  string collection_name = 3;
  repeated string partition_names = 4;
}

message ReleasePartitionRequest {
117
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
118
  string db_name = 2;
119 120 121 122 123
  string collection_name = 3;
  repeated  string partition_names = 4;
}

message PartitionStatsRequest  {
124
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
125
  string db_name = 2;
126 127 128 129 130
  string collection_name = 3;
  string partition_name = 4;
}

message PartitionStatsResponse {
Z
zhenshan.cao 已提交
131 132
  common.Status status = 1;
  repeated common.KeyValuePair stats = 2;
133 134 135
}

message ShowPartitionRequest {
136
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
137
  string db_name = 2;
138
  string collection_name = 3;
139
  int64 collectionID = 4;
140 141 142
}

message ShowPartitionResponse {
Z
zhenshan.cao 已提交
143 144 145
  common.Status status = 1;
  repeated string partition_names = 2;
  repeated int64 partitionIDs = 3;
146 147 148 149 150 151 152 153 154 155 156
}

message DescribeSegmentRequest {
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 segmentID = 3;
}

message DescribeSegmentResponse {
  common.Status status = 1;
  int64 indexID = 2;
N
neza2017 已提交
157
  int64 buildID = 3;
158 159
}

160 161 162 163 164 165 166 167 168 169
message ShowSegmentRequest {
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
}

message ShowSegmentResponse {
  common.Status status = 1;
  repeated int64 segmentIDs = 2;
}
170 171

message CreateIndexRequest {
172
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
173
  string db_name = 2;
174 175 176 177 178 179
  string collection_name = 3;
  string field_name = 4;
  repeated common.KeyValuePair extra_params = 5;
}

message DescribeIndexRequest {
180
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
181
  string db_name = 2;
182 183
  string collection_name = 3;
  string field_name = 4;
184
  string index_name = 5;
185 186 187 188 189 190 191 192
}

message IndexDescription {
  string index_name = 1;
  repeated common.KeyValuePair params = 2;
}

message DescribeIndexResponse {
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
  common.Status status = 1;
  repeated IndexDescription index_descriptions = 2;
}

message IndexStateRequest {
  common.MsgBase base = 1;
  string db_name = 2 ;
  string collection_name = 3;
  string field_name = 4;
  string index_name = 5;
}

message IndexStateResponse {
  common.Status status = 1;
  common.IndexState state = 2;
208 209 210
}

message InsertRequest {
211
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
212
  string db_name = 2;
213 214 215 216 217 218 219
  string collection_name = 3;
  string partition_name = 4;
  repeated common.Blob row_data = 5;
  repeated uint32  hash_keys = 6;
}

message InsertResponse {
Z
zhenshan.cao 已提交
220 221 222
  common.Status status = 1;
  int64  rowID_begin = 2;
  int64  rowID_end = 3;
Y
yukun 已提交
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
}

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;
240 241 242
}

message SearchRequest {
243
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
244
  string db_name = 2;
245 246 247
  string collection_name = 3;
  repeated  string partition_names = 4;
  string dsl = 5;
Y
yukun 已提交
248 249 250 251 252 253 254 255 256 257
  // serialized `PlaceholderGroup`
  bytes placeholder_group = 6;
}

message Hits {
  repeated int64 IDs = 1;
  repeated bytes row_data = 2;
  repeated float scores = 3;
}

258
message SearchResults {
Y
yukun 已提交
259 260
  common.Status status = 1;
  repeated bytes hits = 2;
261 262 263
}

message FlushRequest {
264
  common.MsgBase base = 1;
265
  string db_name = 2;
266
  repeated string collection_names = 3;
Y
yukun 已提交
267 268
}

Z
zhenshan.cao 已提交
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292

message PersistentSegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
  uint64 open_time = 4;
  uint64 sealed_time = 5;
  uint64 flushed_time = 6;
  int64 num_rows = 7;
  int64 mem_size = 8;
  common.SegmentState state = 9;
}

message PersistentSegmentInfoRequest {
  common.MsgBase base = 1;
  string dbName = 2;
  string collectionName = 3;
}

message PersistentSegmentInfoResponse {
  common.Status status = 1;
  repeated PersistentSegmentInfo infos = 2;
}

Z
zhenshan.cao 已提交
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
message QuerySegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
  int64 mem_size = 4;
  int64 num_rows = 5;
  string index_name = 6;
  int64 indexID = 7;
}

message QuerySegmentInfoRequest {
  common.MsgBase base = 1;
  string dbName = 2;
  string collectionName = 3;
}

message QuerySegmentInfoResponse {
  common.Status status = 1;
  repeated QuerySegmentInfo infos = 2;
}

Y
yukun 已提交
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
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) {}
334
  rpc GetIndexState(IndexStateRequest) returns (IndexStateResponse) {}
Y
yukun 已提交
335 336

  rpc Insert(InsertRequest) returns (InsertResponse) {}
337
  rpc Search(SearchRequest) returns (SearchResults) {}
Y
yukun 已提交
338
  rpc Flush(FlushRequest) returns (common.Status) {}
Z
zhenshan.cao 已提交
339 340

  rpc GetDdChannel(common.Empty) returns (StringResponse) {}
Z
zhenshan.cao 已提交
341 342

  rpc GetPersistentSegmentInfo(PersistentSegmentInfoRequest) returns (PersistentSegmentInfoResponse) {}
Z
zhenshan.cao 已提交
343
  rpc GetQuerySegmentInfo(QuerySegmentInfoRequest) returns (QuerySegmentInfoResponse) {}
Z
zhenshan.cao 已提交
344

Y
yukun 已提交
345
}
D
dragondriver 已提交
346 347 348 349 350 351 352 353 354

message RegisterLinkResponse {
  common.Address address = 1;
  common.Status status = 2;
}

service ProxyService {
  rpc RegisterLink(common.Empty) returns (RegisterLinkResponse) {}
}