milvus.proto 22.3 KB
Newer Older
1 2 3
syntax = "proto3";
package milvus.proto.milvus;

X
Xiangyu Wang 已提交
4
option go_package = "github.com/milvus-io/milvus/internal/proto/milvuspb";
5 6

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

G
godchen 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
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(GetCollectionStatisticsRequest) returns (GetCollectionStatisticsResponse) {}
  rpc ShowCollections(ShowCollectionsRequest) returns (ShowCollectionsResponse) {}

  rpc CreatePartition(CreatePartitionRequest) returns (common.Status) {}
  rpc DropPartition(DropPartitionRequest) returns (common.Status) {}
  rpc HasPartition(HasPartitionRequest) returns (BoolResponse) {}
  rpc LoadPartitions(LoadPartitionsRequest) returns (common.Status) {}
  rpc ReleasePartitions(ReleasePartitionsRequest) returns (common.Status) {}
  rpc GetPartitionStatistics(GetPartitionStatisticsRequest) returns (GetPartitionStatisticsResponse) {}
  rpc ShowPartitions(ShowPartitionsRequest) returns (ShowPartitionsResponse) {}

Y
Yusup 已提交
27 28 29 30
  rpc CreateAlias(CreateAliasRequest) returns (common.Status) {}
  rpc DropAlias(DropAliasRequest) returns (common.Status) {}
  rpc AlterAlias(AlterAliasRequest) returns (common.Status) {}

G
godchen 已提交
31 32 33
  rpc CreateIndex(CreateIndexRequest) returns (common.Status) {}
  rpc DescribeIndex(DescribeIndexRequest) returns (DescribeIndexResponse) {}
  rpc GetIndexState(GetIndexStateRequest) returns (GetIndexStateResponse) {}
34
  rpc GetIndexBuildProgress(GetIndexBuildProgressRequest) returns (GetIndexBuildProgressResponse) {}
G
godchen 已提交
35 36
  rpc DropIndex(DropIndexRequest) returns (common.Status) {}

37
  rpc Insert(InsertRequest) returns (MutationResult) {}
G
groot 已提交
38
  rpc Delete(DeleteRequest) returns (MutationResult) {}
G
godchen 已提交
39
  rpc Search(SearchRequest) returns (SearchResults) {}
40
  rpc Flush(FlushRequest) returns (FlushResponse) {}
X
Xiangyu Wang 已提交
41
  rpc Query(QueryRequest) returns (QueryResults) {}
42
  rpc CalcDistance(CalcDistanceRequest) returns (CalcDistanceResults) {}
G
godchen 已提交
43

44
  rpc GetFlushState(GetFlushStateRequest) returns (GetFlushStateResponse) {}
G
godchen 已提交
45 46 47
  rpc GetPersistentSegmentInfo(GetPersistentSegmentInfoRequest) returns (GetPersistentSegmentInfoResponse) {}
  rpc GetQuerySegmentInfo(GetQuerySegmentInfoRequest) returns (GetQuerySegmentInfoResponse) {}

X
Xiangyu Wang 已提交
48 49
  rpc Dummy(DummyRequest) returns (DummyResponse) {}

G
godchen 已提交
50 51
  // TODO: remove
  rpc RegisterLink(RegisterLinkRequest) returns (RegisterLinkResponse) {}
52 53 54

  // https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
  rpc GetMetrics(GetMetricsRequest) returns (GetMetricsResponse) {}
B
bigsheeper 已提交
55
  rpc LoadBalance(LoadBalanceRequest) returns (common.Status) {}
56 57
  rpc GetCompactionState(GetCompactionStateRequest) returns (GetCompactionStateResponse) {}
  rpc ManualCompaction(ManualCompactionRequest) returns (ManualCompactionResponse) {}
58
  rpc GetCompactionStateWithPlans(GetCompactionPlansRequest) returns (GetCompactionPlansResponse) {}
G
groot 已提交
59 60 61 62

  // https://wiki.lfaidata.foundation/display/MIL/MEP+24+--+Support+bulk+load
  rpc Import(ImportRequest) returns (ImportResponse) {}
  rpc GetImportState(GetImportStateRequest) returns (GetImportStateResponse) {}
G
godchen 已提交
63 64
}

Y
Yusup 已提交
65 66
message CreateAliasRequest {
  common.MsgBase base = 1;
C
Cai Yudong 已提交
67 68 69
  string db_name = 2;
  string collection_name = 3;
  string alias = 4;
Y
Yusup 已提交
70 71 72 73
}

message DropAliasRequest {
  common.MsgBase base = 1;
C
Cai Yudong 已提交
74 75
  string db_name = 2;
  string alias = 3;
Y
Yusup 已提交
76 77 78 79
}

message AlterAliasRequest{
  common.MsgBase base = 1;
C
Cai Yudong 已提交
80 81 82
  string db_name = 2;
  string collection_name = 3;
  string alias = 4;
Y
Yusup 已提交
83 84
}

85
/**
Y
Yusup 已提交
86
* Create collection in milvus
87
*/
88
message CreateCollectionRequest {
89 90 91
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
92
  string db_name = 2;
93 94 95 96 97
  // The unique collection name in milvus.(Required)
  string collection_name = 3; 
  // The serialized `schema.CollectionSchema`(Required)
  bytes schema = 4; 
  // Once set, no modification is allowed (Optional)
98
  // https://github.com/milvus-io/milvus/issues/6690
99
  int32 shards_num = 5;
100 101
  // The consistency level that the collection used, modification is not supported now.
  common.ConsistencyLevel consistency_level = 6;
102 103
}

104 105 106
/**
* Drop collection in milvus, also will drop data in collection. 
*/
107
message DropCollectionRequest {
108 109 110
  // Not useful for now
  common.MsgBase base = 1; 
  // Not useful for now
Z
zhenshan.cao 已提交
111
  string db_name = 2;
112 113
  // The unique collection name in milvus.(Required)
  string collection_name = 3;
114 115
}

116 117 118
/**
* Check collection exist in milvus or not.
*/
119
message HasCollectionRequest {
120 121 122
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
123
  string db_name = 2;
124 125
  // The collection name you want to check.
  string collection_name = 3; 
126
  // If time_stamp is not zero, will return true when time_stamp >= created collection timestamp, otherwise will return false.
N
neza2017 已提交
127
  uint64 time_stamp = 4;
128 129
}

130

Y
yukun 已提交
131 132 133 134 135
message BoolResponse {
  common.Status status = 1;
  bool value = 2;
}

Z
zhenshan.cao 已提交
136 137 138 139 140
message StringResponse {
  common.Status status = 1;
  string value = 2;
}

141 142 143
/**
* Get collection meta datas like: schema, collectionID, shards number ...
*/
144
message DescribeCollectionRequest {
145 146 147
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
148
  string db_name = 2;
149
  // The collection name you want to describe, you can pass collection_name or collectionID
150
  string collection_name = 3;
151
  // The collection ID you want to describe
N
neza2017 已提交
152
  int64 collectionID = 4;
153
  // If time_stamp is not zero, will describe collection success when time_stamp >= created collection timestamp, otherwise will throw error.
N
neza2017 已提交
154
  uint64 time_stamp = 5;
155 156
}

157 158 159
/**
* DescribeCollection Response
*/
160
message DescribeCollectionResponse {
161
  // Contain error_code and reason
Y
yukun 已提交
162
  common.Status status = 1;
163
  // The schema param when you created collection.
Y
yukun 已提交
164
  schema.CollectionSchema schema = 2;
165
  // The collection id
166
  int64 collectionID = 3;
167
  // System design related, users should not perceive
168
  repeated string virtual_channel_names = 4;
169
  // System design related, users should not perceive
170
  repeated string physical_channel_names = 5;
171 172 173 174 175
  // Hybrid timestamp in milvus
  uint64 created_timestamp = 6;
  // The utc timestamp calculated by created_timestamp
  uint64 created_utc_timestamp = 7;
  // The shards number you set.
Y
Yusup 已提交
176 177 178
  int32 shards_num = 8;
  // The aliases of this collection
  repeated string aliases = 9;
179 180
  // The message ID/posititon when collection is created
  repeated common.KeyDataPair start_positions = 10;
181 182
  // The consistency level that the collection used, modification is not supported now.
  common.ConsistencyLevel consistency_level = 11;
183 184
  // The collection name
  string collection_name = 12;
185 186
}

187 188 189
/**
* Load collection data into query nodes, then you can do vector search on this collection.
*/
190
message LoadCollectionRequest {
191 192 193
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
194
  string db_name = 2;
195 196
  // The collection name you want to load
  string collection_name = 3;
197 198
}

199 200 201
/**
* Release collection data from query nodes, then you can't do vector search on this collection.
*/
202
message ReleaseCollectionRequest {
203 204 205
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
206
  string db_name = 2;
207 208
  // The collection name you want to release
  string collection_name = 3;
209 210
}

211 212 213
/**
* Get collection statistics like row_count.
*/
G
godchen 已提交
214
message GetCollectionStatisticsRequest {
215 216 217
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
218
  string db_name = 2;
219 220
  // The collection name you want get statistics
  string collection_name = 3;
221 222
}

223 224 225
/**
* Will return collection statistics in stats field like [{key:"row_count",value:"1"}]
*/
G
godchen 已提交
226
message GetCollectionStatisticsResponse {
227
  // Contain error_code and reason
Z
zhenshan.cao 已提交
228
  common.Status status = 1;
229
  // Collection statistics data
Z
zhenshan.cao 已提交
230
  repeated common.KeyValuePair stats = 2;
231 232
}

233 234 235
/*
* This is for ShowCollectionsRequest type field.
*/
236
enum ShowType {
237
  // Will return all colloections 
238
  All = 0;
239
  // Will return loaded collections with their inMemory_percentages
240 241 242
  InMemory = 1;
}

243 244 245
/*
* List collections 
*/
G
godchen 已提交
246
message ShowCollectionsRequest {
247 248 249
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
250
  string db_name = 2;
251
  // Not useful for now
N
neza2017 已提交
252
  uint64 time_stamp = 3;
253
  // Decide return Loaded collections or All collections(Optional)
254
  ShowType type = 4;
255 256
  // When type is InMemory, will return these collection's inMemory_percentages.(Optional)
  repeated string collection_names = 5; 
257 258
}

259 260 261
/*
* Return basic collection infos.
*/
G
godchen 已提交
262
message ShowCollectionsResponse {
263
  // Contain error_code and reason
Z
zhenshan.cao 已提交
264
  common.Status status = 1;
265
  // Collection name array
Z
zhenshan.cao 已提交
266
  repeated string collection_names = 2;
267
  // Collection Id array
268
  repeated int64 collection_ids = 3;
269 270 271 272 273 274
  // Hybrid timestamps in milvus
  repeated uint64 created_timestamps = 4;
  // The utc timestamp calculated by created_timestamp
  repeated uint64 created_utc_timestamps = 5;
  // Load percentage on querynode when type is InMemory
  repeated int64 inMemory_percentages = 6; 
275 276
}

277 278 279
/*
* Create partition in created collection.
*/
280
message CreatePartitionRequest {
281 282 283
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
284
  string db_name = 2;
285 286 287 288
  // The collection name in milvus
  string collection_name = 3;
  // The partition name you want to create.
  string partition_name = 4;
289 290
}

291 292 293
/*
* Drop partition in created collection.
*/
294
message DropPartitionRequest {
295 296 297
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
298
  string db_name = 2;
299 300 301 302
  // The collection name in milvus
  string collection_name = 3;
  // The partition name you want to drop
  string partition_name = 4; 
303 304
}

305 306 307
/*
* Check if partition exist in collection or not.
*/
308
message HasPartitionRequest {
309 310 311
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
312
  string db_name = 2;
313 314 315 316
  // The collection name in milvus
  string collection_name = 3;
  // The partition name you want to check
  string partition_name = 4;
317 318
}

319 320 321 322
/*
* Load specific partitions data of one collection into query nodes
* Then you can get these data as result when you do vector search on this collection.
*/
G
godchen 已提交
323
message LoadPartitionsRequest {
324 325 326
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
327
  string db_name = 2;
328 329 330 331
  // The collection name in milvus
  string collection_name = 3;
  // The partition names you want to load
  repeated string partition_names = 4;
332 333
}

334 335 336 337
/*
* Release specific partitions data of one collection from query nodes.
* Then you can not get these data as result when you do vector search on this collection.
*/
G
godchen 已提交
338
message ReleasePartitionsRequest {
339 340 341
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
342
  string db_name = 2;
343 344 345 346
  // The collection name in milvus
  string collection_name = 3;
  // The partition names you want to release
  repeated string partition_names = 4;
347 348
}

349 350 351
/*
* Get partition statistics like row_count.
*/
G
godchen 已提交
352
message GetPartitionStatisticsRequest {
353 354 355
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
356
  string db_name = 2;
357 358 359 360
  // The collection name in milvus
  string collection_name = 3;
  // The partition name you want to collect statistics
  string partition_name = 4; 
361 362
}

G
godchen 已提交
363
message GetPartitionStatisticsResponse {
Z
zhenshan.cao 已提交
364 365
  common.Status status = 1;
  repeated common.KeyValuePair stats = 2;
366
}
367

368 369 370
/*
* List all partitions for particular collection
*/
G
godchen 已提交
371
message ShowPartitionsRequest {
372 373 374
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
375
  string db_name = 2;
376 377 378
  // The collection name you want to describe, you can pass collection_name or collectionID
  string collection_name = 3;
  // The collection id in milvus
379
  int64 collectionID = 4;
380 381 382
  // When type is InMemory, will return these patitions's inMemory_percentages.(Optional)
  repeated string partition_names = 5;
  // Decide return Loaded partitions or All partitions(Optional)
383
  ShowType type = 6;
384 385
}

386 387 388 389
/*
* List all partitions for particular collection response.
* The returned datas are all rows, we can format to columns by therir index.
*/
G
godchen 已提交
390
message ShowPartitionsResponse {
391
  // Contain error_code and reason
Z
zhenshan.cao 已提交
392
  common.Status status = 1;
393
  // All partition names for this collection
Z
zhenshan.cao 已提交
394
  repeated string partition_names = 2;
395
  // All partition ids for this collection
Z
zhenshan.cao 已提交
396
  repeated int64 partitionIDs = 3;
397 398 399 400 401 402
  // All hybrid timestamps
  repeated uint64 created_timestamps = 4;
  // All utc timestamps calculated by created_timestamps
  repeated uint64 created_utc_timestamps = 5;
  // Load percentage on querynode
  repeated int64 inMemory_percentages = 6;
403 404 405 406 407 408 409 410 411 412 413
}

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

message DescribeSegmentResponse {
  common.Status status = 1;
  int64 indexID = 2;
N
neza2017 已提交
414
  int64 buildID = 3;
415
  bool enable_index = 4;
416
  int64 fieldID = 5;
417 418
}

G
godchen 已提交
419
message ShowSegmentsRequest {
420 421 422 423 424
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
}

G
godchen 已提交
425
message ShowSegmentsResponse {
426 427 428
  common.Status status = 1;
  repeated int64 segmentIDs = 2;
}
429

430 431 432
/*
* Create index for vector datas
*/
433
message CreateIndexRequest {
434 435 436
  // Not useful for now
  common.MsgBase base = 1; 
  // Not useful for now
Z
zhenshan.cao 已提交
437
  string db_name = 2;
438 439 440 441 442
  // The particular collection name you want to create index.
  string collection_name = 3;
  // The vector field name in this particular collection
  string field_name = 4;
  // Support keys: index_type,metric_type, params. Different index_type may has different params.
443 444 445
  repeated common.KeyValuePair extra_params = 5;
  // Version before 2.0.2 doesn't contain index_name, we use default index name.
  string index_name = 6;
446 447
}

448 449 450 451
/*
* Get created index information. 
* Current release of Milvus only supports showing latest built index.
*/
452
message DescribeIndexRequest {
453 454 455
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
456
  string db_name = 2;
457 458 459
  // The particular collection name in Milvus
  string collection_name = 3;
   // The vector field name in this particular collection
460
  string field_name = 4;
461 462
  // No need to set up for now @2021.06.30
  string index_name = 5; 
463 464
}

465 466 467
/*
* Index informations
*/
468
message IndexDescription {
469
  // Index name
470
  string index_name = 1;
471
  // Index id
G
godchen 已提交
472
  int64 indexID = 2;
473
  // Will return index_type, metric_type, params(like nlist).
474
  repeated common.KeyValuePair params = 3;
475
  // The vector field name
476
  string field_name = 4;
477 478
}

479 480 481
/*
* Describe index response
*/
482
message DescribeIndexResponse {
483
  // Response status
484
  common.Status status = 1;
485
  // All index informations, for now only return tha latest index you created for the collection.
486 487 488
  repeated IndexDescription index_descriptions = 2;
}

489 490 491
/*
*  Get index building progress 
*/
492
message GetIndexBuildProgressRequest {
493 494 495
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
496
  string db_name = 2 ;
497 498 499
  // The collection name in milvus
  string collection_name = 3;
  // The vector field name in this collection
500
  string field_name = 4;
501 502
  // Not useful for now
  string index_name = 5;
503 504 505 506 507 508 509 510
}

message GetIndexBuildProgressResponse {
  common.Status status = 1;
  int64 indexed_rows = 2;
  int64 total_rows = 3;
}

G
godchen 已提交
511
message GetIndexStateRequest {
Z
zhenshan.cao 已提交
512
  common.MsgBase base = 1; // must
513
  string db_name = 2 ;
Z
zhenshan.cao 已提交
514
  string collection_name = 3; // must
515
  string field_name = 4;
Z
zhenshan.cao 已提交
516
  string index_name = 5; // No need to set up for now @2021.06.30
517 518
}

G
godchen 已提交
519
message GetIndexStateResponse {
520 521
  common.Status status = 1;
  common.IndexState state = 2;
522
  string fail_reason = 3;
523 524
}

X
xige-16 已提交
525
message DropIndexRequest {
Z
zhenshan.cao 已提交
526
  common.MsgBase base = 1; // must
X
xige-16 已提交
527
  string db_name = 2;
Z
zhenshan.cao 已提交
528
  string collection_name = 3; // must
X
xige-16 已提交
529
  string field_name = 4;
Z
zhenshan.cao 已提交
530
  string index_name = 5; // No need to set up for now @2021.06.30
X
xige-16 已提交
531 532
}

533
message InsertRequest {
534
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
535
  string db_name = 2;
536 537 538 539
  string collection_name = 3;
  string partition_name = 4;
  repeated schema.FieldData fields_data = 5;
  repeated uint32 hash_keys = 6;
540
  uint32 num_rows = 7;
541 542
}

543
message MutationResult {
Z
zhenshan.cao 已提交
544
  common.Status status = 1;
545 546 547 548 549 550 551 552
  schema.IDs IDs = 2; // required for insert, delete
  repeated uint32 succ_index = 3; // error indexes indicate
  repeated uint32 err_index = 4; // error indexes indicate
  bool acknowledged = 5;
  int64 insert_cnt = 6;
  int64 delete_cnt = 7;
  int64 upsert_cnt = 8;
  uint64 timestamp = 9;
Y
yukun 已提交
553 554
}

G
groot 已提交
555 556 557 558 559 560
message DeleteRequest {
  common.MsgBase base = 1;
  string db_name = 2;
  string collection_name = 3;
  string partition_name = 4;
  string expr = 5;
561
  repeated uint32 hash_keys = 6;
G
groot 已提交
562 563
}

Y
yukun 已提交
564
enum PlaceholderType {
G
godchen 已提交
565 566 567
  None = 0;
  BinaryVector = 100;
  FloatVector = 101;
Y
yukun 已提交
568 569 570 571 572 573 574 575 576 577 578
}

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;
579 580 581
}

message SearchRequest {
Z
zhenshan.cao 已提交
582
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
583
  string db_name = 2;
Z
zhenshan.cao 已提交
584 585 586
  string collection_name = 3; // must
  repeated string partition_names = 4; // must
  string dsl = 5; // must
Y
yukun 已提交
587
  // serialized `PlaceholderGroup`
Z
zhenshan.cao 已提交
588 589
  bytes placeholder_group = 6; // must
  common.DslType dsl_type = 7; // must
590 591 592
  repeated string output_fields = 8;
  repeated common.KeyValuePair search_params = 9; // must
  uint64 travel_timestamp = 10;
593
  uint64 guarantee_timestamp = 11; // guarantee_timestamp
Y
yukun 已提交
594 595 596 597 598 599 600 601
}

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

602
message SearchResults {
Y
yukun 已提交
603
  common.Status status = 1;
604
  schema.SearchResultData results = 2;
605
  string collection_name = 3;
606 607 608
}

message FlushRequest {
609
  common.MsgBase base = 1;
610
  string db_name = 2;
611
  repeated string collection_names = 3;
Y
yukun 已提交
612 613
}

614 615 616 617 618 619
message FlushResponse{
  common.Status status = 1;
  string db_name = 2;
  map<string, schema.LongArray> coll_segIDs = 3;
}

X
Xiangyu Wang 已提交
620 621 622 623 624 625 626
message QueryRequest {
  common.MsgBase base = 1;
  string db_name = 2;
  string collection_name = 3;
  string expr = 4;
  repeated string output_fields = 5;
  repeated string partition_names = 6;
627 628
  uint64 travel_timestamp = 7;
  uint64 guarantee_timestamp = 8; // guarantee_timestamp
X
Xiangyu Wang 已提交
629 630 631 632 633
}

message QueryResults {
  common.Status status = 1;
  repeated schema.FieldData fields_data = 2;
634
  string collection_name = 3;
X
Xiangyu Wang 已提交
635 636
}

637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666
message VectorIDs {
  string collection_name = 1;
  string field_name = 2;
  schema.IDs id_array = 3;
  repeated string partition_names = 4;
}

message VectorsArray {
  oneof array {
    VectorIDs id_array = 1; // vector ids
    schema.VectorField data_array = 2; // vectors data
  } 
}

message CalcDistanceRequest {
  common.MsgBase base = 1;
  VectorsArray op_left = 2; // vectors on the left of operator
  VectorsArray op_right = 3; // vectors on the right of operator
  repeated common.KeyValuePair params = 4; // "metric":"L2"/"IP"/"HAMMIN"/"TANIMOTO"
}

message CalcDistanceResults {
  common.Status status = 1;
  // num(op_left)*num(op_right) distance values, "HAMMIN" return integer distance
  oneof array {
    	schema.IntArray int_dist = 2;
	schema.FloatArray float_dist = 3;
  }
}

Z
zhenshan.cao 已提交
667 668 669 670
message PersistentSegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
671 672
  int64 num_rows = 4;
  common.SegmentState state = 5;
Z
zhenshan.cao 已提交
673 674
}

G
godchen 已提交
675
message GetPersistentSegmentInfoRequest {
Z
zhenshan.cao 已提交
676
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
677
  string dbName = 2;
Z
zhenshan.cao 已提交
678
  string collectionName = 3; // must
Z
zhenshan.cao 已提交
679 680
}

G
godchen 已提交
681
message GetPersistentSegmentInfoResponse {
Z
zhenshan.cao 已提交
682 683 684 685
  common.Status status = 1;
  repeated PersistentSegmentInfo infos = 2;
}

Z
zhenshan.cao 已提交
686 687 688 689 690 691 692 693
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;
694 695
  int64 nodeID = 8;
  common.SegmentState state = 9;
Z
zhenshan.cao 已提交
696 697
}

G
godchen 已提交
698
message GetQuerySegmentInfoRequest {
Z
zhenshan.cao 已提交
699
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
700
  string dbName = 2;
Z
zhenshan.cao 已提交
701
  string collectionName = 3; // must
Z
zhenshan.cao 已提交
702 703
}

G
godchen 已提交
704
message GetQuerySegmentInfoResponse {
Z
zhenshan.cao 已提交
705 706 707 708
  common.Status status = 1;
  repeated QuerySegmentInfo infos = 2;
}

X
Xiangyu Wang 已提交
709 710 711 712 713 714 715
message DummyRequest {
  string request_type = 1;
}

message DummyResponse {
  string response = 1;
}
Z
zhenshan.cao 已提交
716

G
godchen 已提交
717
message RegisterLinkRequest {
Y
yukun 已提交
718
}
D
dragondriver 已提交
719 720 721 722 723 724

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

725 726 727 728 729 730 731 732 733 734 735
message GetMetricsRequest {
  common.MsgBase base = 1;
  string request = 2; // request is of jsonic format
}

message GetMetricsResponse {
  common.Status status = 1;
  string response = 2;  // response is of jsonic format
  string component_name = 3; // metrics from which component
}

B
bigsheeper 已提交
736 737 738 739 740 741 742 743 744 745
/*
* Do load balancing operation from src_nodeID to dst_nodeID.
*/
message LoadBalanceRequest {
  common.MsgBase base = 1;
  int64 src_nodeID = 2;
  repeated int64 dst_nodeIDs = 3;
  repeated int64 sealed_segmentIDs = 4;
}

746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782
message ManualCompactionRequest {
  int64 collectionID = 1;
  uint64 timetravel = 2;
}

message ManualCompactionResponse {
  common.Status status = 1;
  int64 compactionID = 2;
}

message GetCompactionStateRequest {
  int64 compactionID = 1;
}

message GetCompactionStateResponse {
  common.Status status = 1;
  common.CompactionState state = 2;
  int64 executingPlanNo = 3;
  int64 timeoutPlanNo = 4;
  int64 completedPlanNo = 5;
}

message GetCompactionPlansRequest {
  int64 compactionID = 1;
}

message GetCompactionPlansResponse {
  common.Status status = 1;
  common.CompactionState state = 2;
  repeated CompactionMergeInfo mergeInfos = 3;
}

message CompactionMergeInfo {
  repeated int64 sources = 1;
  int64 target = 2;
}

B
Bingyi Sun 已提交
783 784 785 786 787 788 789 790 791
message GetFlushStateRequest {
  repeated int64 segmentIDs = 1;
}

message GetFlushStateResponse {
  common.Status status = 1;
  bool flushed = 2;
}

G
groot 已提交
792 793 794 795 796
message ImportRequest {
  string collection_name = 1;  // target collection
  string partition_name = 2;  // target partition
  bool row_based = 3;  // the file is row-based or column-based
  repeated string files = 4;  // file paths to be imported
G
groot 已提交
797
  repeated common.KeyValuePair options = 5;  // import options, bucket, etc.
G
groot 已提交
798 799 800 801 802 803 804 805 806 807 808 809 810
}
 
message ImportResponse {
  common.Status status = 1;
  repeated int64 tasks = 2;  // id array of import tasks
}
 
message GetImportStateRequest {
  int64 task = 1;  // id of an import task
}
 
message GetImportStateResponse {
  common.Status status = 1;
G
groot 已提交
811 812 813 814
  common.ImportState state = 2;                   // is this import task finished or not
  int64 row_count = 3;                     // if the task is finished, this value is how many rows are imported. if the task is not finished, this value is how many rows are parsed. return 0 if failed.
  repeated int64 id_list = 4;              // auto generated ids if the primary key is autoid
  repeated common.KeyValuePair infos = 5;  // more informations about the task, progress percent, file path, failed reason, etc.
G
groot 已提交
815 816
}

D
dragondriver 已提交
817
service ProxyService {
G
godchen 已提交
818
  rpc RegisterLink(RegisterLinkRequest) returns (RegisterLinkResponse) {}
Y
Yusup 已提交
819
}