milvus.proto 21.9 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 443
  // 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.
  repeated common.KeyValuePair extra_params = 5; 
444 445
}

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

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

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

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

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

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

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

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

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

541
message MutationResult {
Z
zhenshan.cao 已提交
542
  common.Status status = 1;
543 544 545 546 547 548 549 550
  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 已提交
551 552
}

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

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

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;
577 578 579
}

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

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

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

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

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

X
Xiangyu Wang 已提交
618 619 620 621 622 623 624
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;
625 626
  uint64 travel_timestamp = 7;
  uint64 guarantee_timestamp = 8; // guarantee_timestamp
X
Xiangyu Wang 已提交
627 628 629 630 631
}

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

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
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 已提交
665 666 667 668
message PersistentSegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
669 670
  int64 num_rows = 4;
  common.SegmentState state = 5;
Z
zhenshan.cao 已提交
671 672
}

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

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

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

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

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

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

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

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

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

723 724 725 726 727 728 729 730 731 732 733
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 已提交
734 735 736 737 738 739 740 741 742 743
/*
* 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;
}

744 745 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
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 已提交
781 782 783 784 785 786 787 788 789
message GetFlushStateRequest {
  repeated int64 segmentIDs = 1;
}

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

G
groot 已提交
790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812
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
  repeated common.KeyValuePair options = 5;  // import options
}
 
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;
  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.
}

D
dragondriver 已提交
813
service ProxyService {
G
godchen 已提交
814
  rpc RegisterLink(RegisterLinkRequest) returns (RegisterLinkResponse) {}
Y
Yusup 已提交
815
}