milvus.proto 20.8 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
godchen 已提交
59 60
}

Y
Yusup 已提交
61 62
message CreateAliasRequest {
  common.MsgBase base = 1;
C
Cai Yudong 已提交
63 64 65
  string db_name = 2;
  string collection_name = 3;
  string alias = 4;
Y
Yusup 已提交
66 67 68 69
}

message DropAliasRequest {
  common.MsgBase base = 1;
C
Cai Yudong 已提交
70 71
  string db_name = 2;
  string alias = 3;
Y
Yusup 已提交
72 73 74 75
}

message AlterAliasRequest{
  common.MsgBase base = 1;
C
Cai Yudong 已提交
76 77 78
  string db_name = 2;
  string collection_name = 3;
  string alias = 4;
Y
Yusup 已提交
79 80
}

81
/**
Y
Yusup 已提交
82
* Create collection in milvus
83
*/
84
message CreateCollectionRequest {
85 86 87
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
88
  string db_name = 2;
89 90 91 92 93
  // 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)
94
  // https://github.com/milvus-io/milvus/issues/6690
95
  int32 shards_num = 5;
96 97
  // The consistency level that the collection used, modification is not supported now.
  common.ConsistencyLevel consistency_level = 6;
98 99
}

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

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

126

Y
yukun 已提交
127 128 129 130 131
message BoolResponse {
  common.Status status = 1;
  bool value = 2;
}

Z
zhenshan.cao 已提交
132 133 134 135 136
message StringResponse {
  common.Status status = 1;
  string value = 2;
}

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

153 154 155
/**
* DescribeCollection Response
*/
156
message DescribeCollectionResponse {
157
  // Contain error_code and reason
Y
yukun 已提交
158
  common.Status status = 1;
159
  // The schema param when you created collection.
Y
yukun 已提交
160
  schema.CollectionSchema schema = 2;
161
  // The collection id
162
  int64 collectionID = 3;
163
  // System design related, users should not perceive
164
  repeated string virtual_channel_names = 4;
165
  // System design related, users should not perceive
166
  repeated string physical_channel_names = 5;
167 168 169 170 171
  // 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 已提交
172 173 174
  int32 shards_num = 8;
  // The aliases of this collection
  repeated string aliases = 9;
175 176
  // The message ID/posititon when collection is created
  repeated common.KeyDataPair start_positions = 10;
177 178
  // The consistency level that the collection used, modification is not supported now.
  common.ConsistencyLevel consistency_level = 11;
179 180
}

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

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

205 206 207
/**
* Get collection statistics like row_count.
*/
G
godchen 已提交
208
message GetCollectionStatisticsRequest {
209 210 211
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
212
  string db_name = 2;
213 214
  // The collection name you want get statistics
  string collection_name = 3;
215 216
}

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

227 228 229
/*
* This is for ShowCollectionsRequest type field.
*/
230
enum ShowType {
231
  // Will return all colloections 
232
  All = 0;
233
  // Will return loaded collections with their inMemory_percentages
234 235 236
  InMemory = 1;
}

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

253 254 255
/*
* Return basic collection infos.
*/
G
godchen 已提交
256
message ShowCollectionsResponse {
257
  // Contain error_code and reason
Z
zhenshan.cao 已提交
258
  common.Status status = 1;
259
  // Collection name array
Z
zhenshan.cao 已提交
260
  repeated string collection_names = 2;
261
  // Collection Id array
262
  repeated int64 collection_ids = 3;
263 264 265 266 267 268
  // 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; 
269 270
}

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

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

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

313 314 315 316
/*
* 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 已提交
317
message LoadPartitionsRequest {
318 319 320
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
321
  string db_name = 2;
322 323 324 325
  // The collection name in milvus
  string collection_name = 3;
  // The partition names you want to load
  repeated string partition_names = 4;
326 327
}

328 329 330 331
/*
* 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 已提交
332
message ReleasePartitionsRequest {
333 334 335
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
336
  string db_name = 2;
337 338 339 340
  // The collection name in milvus
  string collection_name = 3;
  // The partition names you want to release
  repeated string partition_names = 4;
341 342
}

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

G
godchen 已提交
357
message GetPartitionStatisticsResponse {
Z
zhenshan.cao 已提交
358 359
  common.Status status = 1;
  repeated common.KeyValuePair stats = 2;
360
}
361

362 363 364
/*
* List all partitions for particular collection
*/
G
godchen 已提交
365
message ShowPartitionsRequest {
366 367 368
  // Not useful for now
  common.MsgBase base = 1;
  // Not useful for now
Z
zhenshan.cao 已提交
369
  string db_name = 2;
370 371 372
  // The collection name you want to describe, you can pass collection_name or collectionID
  string collection_name = 3;
  // The collection id in milvus
373
  int64 collectionID = 4;
374 375 376
  // 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)
377
  ShowType type = 6;
378 379
}

380 381 382 383
/*
* List all partitions for particular collection response.
* The returned datas are all rows, we can format to columns by therir index.
*/
G
godchen 已提交
384
message ShowPartitionsResponse {
385
  // Contain error_code and reason
Z
zhenshan.cao 已提交
386
  common.Status status = 1;
387
  // All partition names for this collection
Z
zhenshan.cao 已提交
388
  repeated string partition_names = 2;
389
  // All partition ids for this collection
Z
zhenshan.cao 已提交
390
  repeated int64 partitionIDs = 3;
391 392 393 394 395 396
  // 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;
397 398 399 400 401 402 403 404 405 406 407
}

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

message DescribeSegmentResponse {
  common.Status status = 1;
  int64 indexID = 2;
N
neza2017 已提交
408
  int64 buildID = 3;
409
  bool enable_index = 4;
410
  int64 fieldID = 5;
411 412
}

G
godchen 已提交
413
message ShowSegmentsRequest {
414 415 416 417 418
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
}

G
godchen 已提交
419
message ShowSegmentsResponse {
420 421 422
  common.Status status = 1;
  repeated int64 segmentIDs = 2;
}
423

424 425 426
/*
* Create index for vector datas
*/
427
message CreateIndexRequest {
428 429 430
  // Not useful for now
  common.MsgBase base = 1; 
  // Not useful for now
Z
zhenshan.cao 已提交
431
  string db_name = 2;
432 433 434 435 436 437
  // 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; 
438 439
}

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

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

471 472 473
/*
* Describe index response
*/
474
message DescribeIndexResponse {
475
  // Response status
476
  common.Status status = 1;
477
  // All index informations, for now only return tha latest index you created for the collection.
478 479 480
  repeated IndexDescription index_descriptions = 2;
}

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

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

G
godchen 已提交
503
message GetIndexStateRequest {
Z
zhenshan.cao 已提交
504
  common.MsgBase base = 1; // must
505
  string db_name = 2 ;
Z
zhenshan.cao 已提交
506
  string collection_name = 3; // must
507
  string field_name = 4;
Z
zhenshan.cao 已提交
508
  string index_name = 5; // No need to set up for now @2021.06.30
509 510
}

G
godchen 已提交
511
message GetIndexStateResponse {
512 513
  common.Status status = 1;
  common.IndexState state = 2;
514
  string fail_reason = 3;
515 516
}

X
xige-16 已提交
517
message DropIndexRequest {
Z
zhenshan.cao 已提交
518
  common.MsgBase base = 1; // must
X
xige-16 已提交
519
  string db_name = 2;
Z
zhenshan.cao 已提交
520
  string collection_name = 3; // must
X
xige-16 已提交
521
  string field_name = 4;
Z
zhenshan.cao 已提交
522
  string index_name = 5; // No need to set up for now @2021.06.30
X
xige-16 已提交
523 524
}

525
message InsertRequest {
526
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
527
  string db_name = 2;
528 529 530 531
  string collection_name = 3;
  string partition_name = 4;
  repeated schema.FieldData fields_data = 5;
  repeated uint32 hash_keys = 6;
532
  uint32 num_rows = 7;
533 534
}

535
message MutationResult {
Z
zhenshan.cao 已提交
536
  common.Status status = 1;
537 538 539 540 541 542 543 544
  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 已提交
545 546
}

G
groot 已提交
547 548 549 550 551 552
message DeleteRequest {
  common.MsgBase base = 1;
  string db_name = 2;
  string collection_name = 3;
  string partition_name = 4;
  string expr = 5;
553
  repeated uint32 hash_keys = 6;
G
groot 已提交
554 555
}

Y
yukun 已提交
556
enum PlaceholderType {
G
godchen 已提交
557 558 559
  None = 0;
  BinaryVector = 100;
  FloatVector = 101;
Y
yukun 已提交
560 561 562 563 564 565 566 567 568 569 570
}

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;
571 572 573
}

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

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

594
message SearchResults {
Y
yukun 已提交
595
  common.Status status = 1;
596
  schema.SearchResultData results = 2;
597 598 599
}

message FlushRequest {
600
  common.MsgBase base = 1;
601
  string db_name = 2;
602
  repeated string collection_names = 3;
Y
yukun 已提交
603 604
}

605 606 607 608 609 610
message FlushResponse{
  common.Status status = 1;
  string db_name = 2;
  map<string, schema.LongArray> coll_segIDs = 3;
}

X
Xiangyu Wang 已提交
611 612 613 614 615 616 617
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;
618 619
  uint64 travel_timestamp = 7;
  uint64 guarantee_timestamp = 8; // guarantee_timestamp
X
Xiangyu Wang 已提交
620 621 622 623 624 625 626
}

message QueryResults {
  common.Status status = 1;
  repeated schema.FieldData fields_data = 2;
}

627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656
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 已提交
657 658 659 660
message PersistentSegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
661 662
  int64 num_rows = 4;
  common.SegmentState state = 5;
Z
zhenshan.cao 已提交
663 664
}

G
godchen 已提交
665
message GetPersistentSegmentInfoRequest {
Z
zhenshan.cao 已提交
666
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
667
  string dbName = 2;
Z
zhenshan.cao 已提交
668
  string collectionName = 3; // must
Z
zhenshan.cao 已提交
669 670
}

G
godchen 已提交
671
message GetPersistentSegmentInfoResponse {
Z
zhenshan.cao 已提交
672 673 674 675
  common.Status status = 1;
  repeated PersistentSegmentInfo infos = 2;
}

Z
zhenshan.cao 已提交
676 677 678 679 680 681 682 683
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;
684 685
  int64 nodeID = 8;
  common.SegmentState state = 9;
Z
zhenshan.cao 已提交
686 687
}

G
godchen 已提交
688
message GetQuerySegmentInfoRequest {
Z
zhenshan.cao 已提交
689
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
690
  string dbName = 2;
Z
zhenshan.cao 已提交
691
  string collectionName = 3; // must
Z
zhenshan.cao 已提交
692 693
}

G
godchen 已提交
694
message GetQuerySegmentInfoResponse {
Z
zhenshan.cao 已提交
695 696 697 698
  common.Status status = 1;
  repeated QuerySegmentInfo infos = 2;
}

X
Xiangyu Wang 已提交
699 700 701 702 703 704 705
message DummyRequest {
  string request_type = 1;
}

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

G
godchen 已提交
707
message RegisterLinkRequest {
Y
yukun 已提交
708
}
D
dragondriver 已提交
709 710 711 712 713 714

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

715 716 717 718 719 720 721 722 723 724 725
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 已提交
726 727 728 729 730 731 732 733 734 735
/*
* 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;
}

736 737 738 739 740 741 742 743 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
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 已提交
773 774 775 776 777 778 779 780 781
message GetFlushStateRequest {
  repeated int64 segmentIDs = 1;
}

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

D
dragondriver 已提交
782
service ProxyService {
G
godchen 已提交
783
  rpc RegisterLink(RegisterLinkRequest) returns (RegisterLinkResponse) {}
Y
Yusup 已提交
784
}