data_coord.proto 22.8 KB
Newer Older
1 2 3 4
syntax = "proto3";

package milvus.proto.data;

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

import "common.proto";
import "internal.proto";
S
sunby 已提交
9
import "milvus.proto";
S
sunby 已提交
10
import "schema.proto";
C
cai.zhang 已提交
11
import "index_coord.proto";
12

13 14 15
// TODO: import google/protobuf/empty.proto
message Empty {}

16 17 18 19
enum SegmentType {
  New = 0;
  Normal = 1;
  Flushed = 2;
20
  Compacted = 3;
21 22
}

23
service DataCoord {
24
  rpc GetComponentStates(milvus.GetComponentStatesRequest) returns (milvus.ComponentStates) {}
G
godchen 已提交
25 26 27
  rpc GetTimeTickChannel(internal.GetTimeTickChannelRequest) returns(milvus.StringResponse) {}
  rpc GetStatisticsChannel(internal.GetStatisticsChannelRequest) returns(milvus.StringResponse){}

28
  rpc Flush(FlushRequest) returns (FlushResponse) {}
G
godchen 已提交
29 30 31 32 33 34 35 36 37 38 39

  rpc AssignSegmentID(AssignSegmentIDRequest) returns (AssignSegmentIDResponse) {}

  rpc GetSegmentInfo(GetSegmentInfoRequest) returns (GetSegmentInfoResponse) {}
  rpc GetSegmentStates(GetSegmentStatesRequest) returns (GetSegmentStatesResponse) {}
  rpc GetInsertBinlogPaths(GetInsertBinlogPathsRequest) returns (GetInsertBinlogPathsResponse) {}

  rpc GetCollectionStatistics(GetCollectionStatisticsRequest) returns (GetCollectionStatisticsResponse) {}
  rpc GetPartitionStatistics(GetPartitionStatisticsRequest) returns (GetPartitionStatisticsResponse) {}

  rpc GetSegmentInfoChannel(GetSegmentInfoChannelRequest) returns (milvus.StringResponse){}
40 41

  rpc SaveBinlogPaths(SaveBinlogPathsRequest) returns (common.Status){}
42
  rpc GetRecoveryInfo(GetRecoveryInfoRequest) returns (GetRecoveryInfoResponse){}
43
  rpc GetFlushedSegments(GetFlushedSegmentsRequest) returns(GetFlushedSegmentsResponse){}
44
  rpc GetSegmentsByStates(GetSegmentsByStatesRequest) returns(GetSegmentsByStatesResponse){}
45

46
  rpc ShowConfigurations(internal.ShowConfigurationsRequest) returns (internal.ShowConfigurationsResponse){}
47 48
  // https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
  rpc GetMetrics(milvus.GetMetricsRequest) returns (milvus.GetMetricsResponse) {}
49 50 51
  rpc ManualCompaction(milvus.ManualCompactionRequest) returns (milvus.ManualCompactionResponse) {}
  rpc GetCompactionState(milvus.GetCompactionStateRequest) returns (milvus.GetCompactionStateResponse) {}
  rpc GetCompactionStateWithPlans(milvus.GetCompactionPlansRequest) returns (milvus.GetCompactionPlansResponse) {}
G
godchen 已提交
52 53

  rpc WatchChannels(WatchChannelsRequest) returns (WatchChannelsResponse) {}
B
Bingyi Sun 已提交
54
  rpc GetFlushState(milvus.GetFlushStateRequest) returns (milvus.GetFlushStateResponse) {}
55
  rpc DropVirtualChannel(DropVirtualChannelRequest) returns (DropVirtualChannelResponse) {}
G
groot 已提交
56

57
  rpc SetSegmentState(SetSegmentStateRequest) returns (SetSegmentStateResponse) {}
G
groot 已提交
58
  // https://wiki.lfaidata.foundation/display/MIL/MEP+24+--+Support+bulk+load
59
  rpc Import(ImportTaskRequest) returns (ImportTaskResponse) {}
60
  rpc UpdateSegmentStatistics(UpdateSegmentStatisticsRequest) returns (common.Status) {}
B
bigsheeper 已提交
61
  rpc UpdateChannelCheckpoint(UpdateChannelCheckpointRequest) returns (common.Status) {}
62

63 64 65
  rpc SaveImportSegment(SaveImportSegmentRequest) returns(common.Status) {}
  rpc UnsetIsImportingState(UnsetIsImportingStateRequest) returns(common.Status) {}
  rpc MarkSegmentsDropped(MarkSegmentsDroppedRequest) returns(common.Status) {}
J
jaime 已提交
66

J
jaime 已提交
67
  rpc BroadcastAlteredCollection(AlterCollectionRequest) returns (common.Status) {}
68 69

  rpc CheckHealth(milvus.CheckHealthRequest) returns (milvus.CheckHealthResponse) {}
70

C
cai.zhang 已提交
71
  rpc CreateIndex(index.CreateIndexRequest) returns (common.Status){}
72
  // Deprecated: use DescribeIndex instead
C
cai.zhang 已提交
73 74 75 76 77
  rpc GetIndexState(index.GetIndexStateRequest) returns (index.GetIndexStateResponse) {}
  rpc GetSegmentIndexState(index.GetSegmentIndexStateRequest) returns (index.GetSegmentIndexStateResponse) {}
  rpc GetIndexInfos(index.GetIndexInfoRequest) returns (index.GetIndexInfoResponse){}
  rpc DropIndex(index.DropIndexRequest) returns (common.Status) {}
  rpc DescribeIndex(index.DescribeIndexRequest) returns (index.DescribeIndexResponse) {}
78
  // Deprecated: use DescribeIndex instead
C
cai.zhang 已提交
79
  rpc GetIndexBuildProgress(index.GetIndexBuildProgressRequest) returns (index.GetIndexBuildProgressResponse) {}
80 81

  rpc GcConfirm(GcConfirmRequest) returns (GcConfirmResponse) {}
G
godchen 已提交
82 83 84
}

service DataNode {
85
  rpc GetComponentStates(milvus.GetComponentStatesRequest) returns (milvus.ComponentStates) {}
86
  rpc GetStatisticsChannel(internal.GetStatisticsChannelRequest) returns (milvus.StringResponse) {}
G
godchen 已提交
87 88 89

  rpc WatchDmChannels(WatchDmChannelsRequest) returns (common.Status) {}
  rpc FlushSegments(FlushSegmentsRequest) returns(common.Status) {}
90

91
  rpc ShowConfigurations(internal.ShowConfigurationsRequest) returns (internal.ShowConfigurationsResponse){}
92 93
  // https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
  rpc GetMetrics(milvus.GetMetricsRequest) returns (milvus.GetMetricsResponse) {}
94

S
sunby 已提交
95
  rpc Compaction(CompactionPlan) returns (common.Status) {}
96
  rpc GetCompactionState(CompactionStateRequest) returns (CompactionStateResponse) {}
97
  rpc SyncSegments(SyncSegmentsRequest) returns (common.Status) {}
G
groot 已提交
98 99

  // https://wiki.lfaidata.foundation/display/MIL/MEP+24+--+Support+bulk+load
100
  rpc Import(ImportTaskRequest) returns(common.Status) {}
101 102

  rpc ResendSegmentStats(ResendSegmentStatsRequest) returns(ResendSegmentStatsResponse) {}
103

104
  rpc AddImportSegment(AddImportSegmentRequest) returns(AddImportSegmentResponse) {}
G
godchen 已提交
105
}
106

G
godchen 已提交
107 108 109
message FlushRequest {
  common.MsgBase base = 1;
  int64 dbID = 2;
110
  repeated int64 segmentIDs = 3;
G
godchen 已提交
111 112
  int64 collectionID = 4;
}
113

114 115 116 117
message FlushResponse {
  common.Status status = 1;
  int64 dbID = 2;
  int64 collectionID = 3;
118 119 120
  repeated int64 segmentIDs = 4; // newly sealed segments
  repeated int64 flushSegmentIDs = 5; // old flushed segment
  int64 timeOfSeal = 6;
121 122
}

G
godchen 已提交
123
message SegmentIDRequest {
124
  uint32 count = 1;
G
godchen 已提交
125 126
  string channel_name = 2;
  int64 collectionID = 3;
127
  int64 partitionID = 4;
G
groot 已提交
128
  bool isImport = 5;        // Indicate whether this request comes from a bulk insert task.
129
  int64 importTaskID = 6;   // Needed for segment lock.
130 131
}

G
godchen 已提交
132
message AssignSegmentIDRequest {
133 134
  int64 nodeID = 1;
  string peer_role = 2;
G
godchen 已提交
135
  repeated SegmentIDRequest segmentIDRequests = 3;
136 137
}

G
godchen 已提交
138
message SegmentIDAssignment {
139
  int64 segID = 1;
G
godchen 已提交
140
  string channel_name = 2;
141 142 143 144 145 146 147
  uint32 count = 3;
  int64 collectionID = 4;
  int64 partitionID = 5;
  uint64 expire_time = 6;
  common.Status status = 7;
}

G
godchen 已提交
148 149
message AssignSegmentIDResponse {
  repeated SegmentIDAssignment segIDAssignments = 1;
S
sunby 已提交
150
  common.Status status = 2;
151 152
}

G
godchen 已提交
153
message GetSegmentStatesRequest {
154
  common.MsgBase base = 1;
G
godchen 已提交
155
  repeated int64 segmentIDs = 2;
Z
zhenshan.cao 已提交
156 157 158 159
}

message SegmentStateInfo {
  int64 segmentID = 1;
Z
zhenshan.cao 已提交
160
  common.SegmentState state = 2;
161 162 163
  internal.MsgPosition start_position = 3;
  internal.MsgPosition end_position = 4;
  common.Status status = 5;
164 165
}

G
godchen 已提交
166
message GetSegmentStatesResponse {
Z
zhenshan.cao 已提交
167 168
  common.Status status = 1;
  repeated SegmentStateInfo states = 2;
169 170
}

G
godchen 已提交
171
message GetSegmentInfoRequest {
172
  common.MsgBase base = 1;
G
godchen 已提交
173
  repeated int64 segmentIDs = 2;
174
  bool includeUnHealthy =3;
175 176
}

G
godchen 已提交
177 178 179
message GetSegmentInfoResponse {
  common.Status status = 1;
  repeated SegmentInfo infos = 2;
180
  map<string, internal.MsgPosition> channel_checkpoint = 3;
G
godchen 已提交
181 182 183
}

message GetInsertBinlogPathsRequest {
Z
zhenshan.cao 已提交
184
  common.MsgBase base = 1;
G
godchen 已提交
185
  int64 segmentID = 2;
Z
zhenshan.cao 已提交
186 187
}

G
godchen 已提交
188 189 190 191 192 193 194
message GetInsertBinlogPathsResponse {
  repeated int64 fieldIDs = 1;
  repeated internal.StringList paths = 2;
  common.Status status = 3;
}

message GetCollectionStatisticsRequest {
S
sunby 已提交
195
  common.MsgBase base = 1;
196 197
  int64 dbID = 2;
  int64 collectionID = 3;
S
sunby 已提交
198 199
}

G
godchen 已提交
200
message GetCollectionStatisticsResponse {
S
sunby 已提交
201 202 203 204
  repeated common.KeyValuePair stats = 1;
  common.Status status = 2;
}

G
godchen 已提交
205
message GetPartitionStatisticsRequest{
S
sunby 已提交
206
  common.MsgBase base = 1;
207 208
  int64 dbID = 2;
  int64 collectionID = 3;
209
  repeated int64 partitionIDs = 4;
S
sunby 已提交
210 211
}

G
godchen 已提交
212
message GetPartitionStatisticsResponse {
S
sunby 已提交
213 214 215 216
  repeated common.KeyValuePair stats = 1;
  common.Status status = 2;
}

G
godchen 已提交
217
message GetSegmentInfoChannelRequest {
X
XuanYang-cn 已提交
218 219
}

220 221 222
message VchannelInfo {
  int64 collectionID = 1;
  string channelName = 2;
223
  internal.MsgPosition seek_position = 3;
224 225 226 227 228 229
  repeated SegmentInfo unflushedSegments = 4; // deprecated, keep it for compatibility
  repeated SegmentInfo flushedSegments = 5; // deprecated, keep it for compatibility
  repeated SegmentInfo dropped_segments = 6; // deprecated, keep it for compatibility
  repeated int64 unflushedSegmentIds = 7;
  repeated int64 flushedSegmentIds = 8;
  repeated int64 dropped_segmentIds = 9;
230 231
  repeated int64 indexed_segmentIds = 10;
  repeated SegmentInfo indexed_segments = 11;
232 233
}

G
godchen 已提交
234 235
message WatchDmChannelsRequest {
  common.MsgBase base = 1;
236
  repeated VchannelInfo vchannels = 2;
X
XuanYang-cn 已提交
237 238
}

G
godchen 已提交
239 240 241 242
message FlushSegmentsRequest {
  common.MsgBase base = 1;
  int64 dbID = 2;
  int64 collectionID = 3;
243
  repeated int64 segmentIDs = 4; // segments to flush
X
XuanYang-cn 已提交
244 245
}

G
godchen 已提交
246 247 248 249
message SegmentMsg{
  common.MsgBase base = 1;
  SegmentInfo segment = 2;
}
N
neza2017 已提交
250

S
sunby 已提交
251 252 253 254 255
message SegmentInfo {
  int64 ID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
  string insert_channel = 4;
S
sunby 已提交
256
  int64 num_of_rows = 5;
257
  common.SegmentState state = 6;
S
sunby 已提交
258 259 260 261
  int64 max_row_num = 7;
  uint64 last_expire_time = 8;
  internal.MsgPosition start_position = 9;
  internal.MsgPosition dml_position = 10;
262
  // binlogs consist of insert binlogs
S
sunby 已提交
263
  repeated FieldBinlog binlogs = 11;
264
  repeated FieldBinlog statslogs = 12;
265 266
  // deltalogs consists of delete binlogs. FieldID is not used yet since delete is always applied on primary key
  repeated FieldBinlog deltalogs = 13;
S
sunby 已提交
267 268
  bool createdByCompaction = 14;
  repeated int64 compactionFrom = 15;
269
  uint64 dropped_at = 16; // timestamp when segment marked drop
270
  // A flag indicating if:
G
groot 已提交
271 272
  // (1) this segment is created by bulk insert, and
  // (2) the bulk insert task that creates this segment has not yet reached `ImportCompleted` state.
273
  bool is_importing = 17;
J
jaime 已提交
274
  bool is_fake = 18;
S
sunby 已提交
275
}
276

277
message SegmentStartPosition {
278
  internal.MsgPosition start_position = 1;
279
  int64 segmentID = 2;
280 281 282 283
}

message SaveBinlogPathsRequest {
  common.MsgBase base = 1;
284 285
  int64 segmentID = 2;
  int64 collectionID = 3;
S
sunby 已提交
286
  repeated FieldBinlog field2BinlogPaths = 4;
S
sunby 已提交
287
  repeated CheckPoint checkPoints = 5;
288
  repeated SegmentStartPosition start_positions = 6;
289
  bool flushed = 7;
290
  repeated FieldBinlog field2StatslogPaths = 8;
291
  repeated FieldBinlog deltalogs = 9;
292
  bool dropped = 10;
293
  bool importing = 11;
294 295 296 297
}

message CheckPoint {
  int64 segmentID = 1;
S
sunby 已提交
298 299
  internal.MsgPosition position = 2;
  int64 num_of_rows = 3;
300 301
}

302 303 304 305 306
message DeltaLogInfo {
  uint64 record_entries = 1;
  uint64 timestamp_from = 2;
  uint64 timestamp_to = 3;
  string delta_log_path = 4;
307
  int64 delta_log_size = 5;
308 309
}

S
sunby 已提交
310 311 312 313
message DataNodeTtMsg {
    common.MsgBase base =1;
    string channel_name = 2;
    uint64 timestamp = 3;
314 315 316 317 318 319
    repeated SegmentStats segments_stats = 4;
}

message SegmentStats {
  int64 SegmentID = 1;
  int64 NumRows = 2;
S
sunby 已提交
320 321
}

322
enum ChannelWatchState {
323 324 325 326 327 328 329 330
  Uncomplete = 0; // deprecated, keep it for compatibility
  Complete = 1; // deprecated, keep it for compatibility
  ToWatch = 2;
  WatchSuccess = 3;
  WatchFailure = 4;
  ToRelease = 5;
  ReleaseSuccess = 6;
  ReleaseFailure = 7;
331 332 333 334 335
}

message ChannelStatus {
  string name = 1;
  ChannelWatchState state=2;
336
  int64 collectionID = 3;
337 338 339 340 341 342 343 344
}

message DataNodeInfo {
  string address = 1;
  int64 version  = 2;
  repeated ChannelStatus channels = 3;
}

345 346 347
message SegmentBinlogs {
  int64 segmentID = 1;
  repeated FieldBinlog fieldBinlogs = 2;
348
  int64 num_of_rows = 3;
349
  repeated FieldBinlog statslogs = 4;
350
  repeated FieldBinlog deltalogs = 5;
351
  string insert_channel = 6;
352 353 354 355
}

message FieldBinlog{
  int64 fieldID = 1;
356 357 358 359 360 361 362
  repeated Binlog binlogs = 2;
}

message Binlog {
  int64 entries_num = 1;
  uint64 timestamp_from = 2;
  uint64 timestamp_to = 3;
363
  // deprecated
364
  string log_path = 4;
365
  int64 log_size = 5;
366
  int64 logID = 6;
367 368
}

369
message GetRecoveryInfoResponse {
370
  common.Status status = 1;
371 372 373 374 375 376 377 378 379 380
  repeated VchannelInfo channels = 2;
  repeated SegmentBinlogs binlogs = 3;
}

message GetRecoveryInfoRequest {
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
}

381 382 383 384 385 386 387 388 389 390 391 392
message GetSegmentsByStatesRequest {
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
  repeated common.SegmentState states = 4;
}

message GetSegmentsByStatesResponse {
  common.Status status = 1;
  repeated int64 segments = 2;
}

393 394 395 396
message GetFlushedSegmentsRequest {
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
397
  bool includeUnhealthy = 4;
398 399 400 401 402 403 404 405 406 407 408 409
}

message GetFlushedSegmentsResponse {
  common.Status status = 1;
  repeated int64 segments = 2;
}

message SegmentFlushCompletedMsg {
  common.MsgBase base = 1;
  SegmentInfo segment = 2;
}

410 411 412 413
message ChannelWatchInfo {
    VchannelInfo vchan= 1;
    int64 startTs = 2;
    ChannelWatchState state = 3;
414 415 416
    // the timeout ts, datanode shall do nothing after it
    // if the timeout is not set(= 0), original infinite retry logic shall be applied
    int64 timeoutTs = 4;
417 418
    // the schema of the collection to watch, to avoid get schema rpc issues.
    schema.CollectionSchema schema = 5;
419
}
420

S
sunby 已提交
421 422
enum CompactionType {
  UndefinedCompaction = 0;
423
  reserved 1;
S
sunby 已提交
424
  MergeCompaction = 2;
425
  MixCompaction = 3;
S
sunby 已提交
426 427
}

428 429 430 431
message CompactionStateRequest {
  common.MsgBase base = 1;
}

432 433 434 435 436
message SyncSegmentsRequest {
  int64 planID = 1;
  int64 compacted_to = 2;
  int64 num_of_rows = 3;
  repeated int64 compacted_from = 4;
437
  repeated FieldBinlog stats_logs = 5;
438 439
}

S
sunby 已提交
440 441 442 443
message CompactionSegmentBinlogs {
  int64 segmentID = 1;
  repeated FieldBinlog fieldBinlogs = 2;
  repeated FieldBinlog field2StatslogPaths = 3;
444
  repeated FieldBinlog deltalogs = 4;
445
  string insert_channel = 5;
S
sunby 已提交
446 447 448 449
}

message CompactionPlan {
  int64 planID = 1;
S
sunby 已提交
450
  repeated CompactionSegmentBinlogs segmentBinlogs = 2;
S
sunby 已提交
451 452 453 454
  uint64 start_time = 3;
  int32 timeout_in_seconds = 4;
  CompactionType type = 5;
  uint64 timetravel = 6;
S
sunby 已提交
455
  string channel = 7;
J
jaime 已提交
456
  int64 collection_ttl = 8;
457
  int64 total_rows = 9;
S
sunby 已提交
458 459 460 461 462 463 464 465
}

message CompactionResult {
  int64 planID = 1;
  int64 segmentID = 2;
  int64 num_of_rows = 3;
  repeated FieldBinlog insert_logs = 4;
  repeated FieldBinlog field2StatslogPaths = 5;
466
  repeated FieldBinlog deltalogs = 6;
467
  string channel = 7;
S
sunby 已提交
468 469
}

470 471 472 473 474 475 476 477 478 479 480
message CompactionStateResult {
  int64 planID = 1;
  common.CompactionState state = 2;
  CompactionResult result = 3;
}

message CompactionStateResponse {
  common.Status status = 1;
  repeated CompactionStateResult results = 2;
}

481 482 483 484
// Deprecated
message SegmentFieldBinlogMeta {
  int64  fieldID = 1;
  string binlog_path = 2;
485
}
G
godchen 已提交
486 487 488 489

message WatchChannelsRequest {
  int64 collectionID = 1;
  repeated string channelNames = 2;
490
  repeated common.KeyDataPair start_positions = 3;
491
  schema.CollectionSchema schema = 4; 
G
godchen 已提交
492 493 494 495 496
}

message WatchChannelsResponse {
  common.Status status = 1;
}
497

498 499 500 501 502 503 504 505 506 507
message SetSegmentStateRequest {
  common.MsgBase base = 1;
  int64 segment_id = 2;
  common.SegmentState new_state = 3;
}

message SetSegmentStateResponse {
  common.Status status = 1;
}

508
message DropVirtualChannelRequest {
509 510
  common.MsgBase base = 1;
  string channel_name = 2;
511 512 513 514 515 516 517 518
  repeated DropVirtualChannelSegment segments = 3;
}

message DropVirtualChannelSegment {
  int64 segmentID = 1;
  int64 collectionID = 2;
  repeated FieldBinlog field2BinlogPaths = 3;
  repeated FieldBinlog field2StatslogPaths = 4;
519
  repeated FieldBinlog deltalogs = 5;
520 521 522 523 524 525 526 527
  internal.MsgPosition startPosition = 6;
  internal.MsgPosition checkPoint = 7;
  int64 numOfRows = 8;
}

message DropVirtualChannelResponse {
  common.Status status = 1;
}
G
groot 已提交
528

G
groot 已提交
529
message ImportTask {
G
groot 已提交
530
  common.Status status = 1;
531 532
  int64 collection_id = 2;                   // target collection ID
  int64 partition_id = 3;                    // target partition ID
533 534 535 536 537
  repeated string channel_names = 4;         // target channel names of the collection.
  bool row_based = 5;                        // the file is row-based or column-based
  int64 task_id = 6;                         // id of the task
  repeated string files = 7;                 // file paths to be imported
  repeated common.KeyValuePair infos = 8;    // extra information about the task, bucket, etc.
G
groot 已提交
538 539
}

540 541 542 543 544 545 546 547 548
message ImportTaskState {
  common.ImportState stateCode = 1;    // Import state code.
  repeated int64 segments = 2;         // Ids of segments created in import task.
  repeated int64 row_ids = 3;          // Row IDs for the newly inserted rows.
  int64 row_count = 4;                 // # of rows added in the import task.
  string error_message = 5;            // Error message for the failed task.
}

message ImportTaskInfo {
549 550 551 552 553 554 555 556 557 558 559
  int64 id = 1;                                 // Task ID.
  int64 request_id = 2 [deprecated = true];     // Request ID of the import task.
  int64 datanode_id = 3;                        // ID of DataNode that processes the task.
  int64 collection_id = 4;                      // Collection ID for the import task.
  int64 partition_id = 5;                       // Partition ID for the import task.
  repeated string channel_names = 6;            // Names of channels for the collection.
  string bucket = 7;                            // Bucket for the import task.
  bool row_based = 8;                           // Boolean indicating whether import files are row-based or column-based.
  repeated string files = 9;                    // A list of files to import.
  int64 create_ts = 10;                         // Timestamp when the import task is created.
  ImportTaskState state = 11;                   // State of the import task.
560 561
  string collection_name = 12;                  // Collection name for the import task.
  string partition_name = 13;                   // Partition name for the import task.
562
  repeated common.KeyValuePair infos = 14;      // extra information about the task, bucket, etc.
G
groot 已提交
563
  int64 start_ts = 15;                          // Timestamp when the import task is sent to datanode to execute.
564 565
}

G
groot 已提交
566 567
message ImportTaskResponse {
  common.Status status = 1;
568 569 570 571 572 573 574 575
  int64 datanode_id = 2;         // which datanode takes this task
}

message ImportTaskRequest {
  common.MsgBase base = 1;
  ImportTask import_task = 2;          // Target import task.
  repeated int64 working_nodes = 3;    // DataNodes that are currently working.
}
576 577 578 579

message UpdateSegmentStatisticsRequest {
  common.MsgBase base = 1;
  repeated SegmentStats stats = 2;
580 581
}

B
bigsheeper 已提交
582 583 584 585 586 587
message UpdateChannelCheckpointRequest {
  common.MsgBase base = 1;
  string vChannel = 2;
  internal.MsgPosition position = 3;
}

588 589 590 591 592 593 594 595
message ResendSegmentStatsRequest {
  common.MsgBase base = 1;
}

message ResendSegmentStatsResponse {
  common.Status status = 1;
  repeated int64 seg_resent = 2;
}
596

597
message AddImportSegmentRequest {
598 599 600 601 602 603
  common.MsgBase base = 1;
  int64 segment_id = 2;
  string channel_name = 3;
  int64 collection_id = 4;
  int64 partition_id = 5;
  int64 row_num = 6;
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
  repeated FieldBinlog stats_log = 7;
}

message AddImportSegmentResponse {
  common.Status status = 1;
  bytes channel_pos = 2;
}

message SaveImportSegmentRequest {
  common.MsgBase base = 1;
  int64 segment_id = 2;
  string channel_name = 3;
  int64 collection_id = 4;
  int64 partition_id = 5;
  int64 row_num = 6;
  SaveBinlogPathsRequest save_binlog_path_req = 7;
  bytes dml_position_id = 8;
}

message UnsetIsImportingStateRequest {
  common.MsgBase base = 1;
  repeated int64 segment_ids = 2;       // IDs of segments whose `isImport` states need to be unset.
}

message MarkSegmentsDroppedRequest {
  common.MsgBase base = 1;
  repeated int64 segment_ids = 2;       // IDs of segments that needs to be marked as `dropped`.
631
}
632 633 634 635 636 637

message SegmentReferenceLock {
  int64 taskID = 1;
  int64 nodeID = 2;
  repeated int64 segmentIDs = 3;
}
J
jaime 已提交
638 639 640 641 642 643 644 645 646


message AlterCollectionRequest {
  int64  collectionID = 1;
  schema.CollectionSchema schema = 2;
  repeated int64 partitionIDs = 3;
  repeated common.KeyDataPair start_positions = 4;
  repeated common.KeyValuePair properties = 5;
}
647

648 649 650 651 652 653 654 655 656 657
message GcConfirmRequest {
  int64 collection_id = 1;
  int64 partition_id = 2; // -1 means whole collection.
}

message GcConfirmResponse {
  common.Status status = 1;
  bool gc_finished = 2;
}

C
cai.zhang 已提交
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 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 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796
//message IndexInfo {
//  int64 collectionID = 1;
//  int64 fieldID = 2;
//  string index_name = 3;
//  int64 indexID = 4;
//  repeated common.KeyValuePair type_params = 5;
//  repeated common.KeyValuePair index_params = 6;
//  // index build progress
//  // The real-time statistics may not be expected due to the existence of the compaction mechanism.
//  int64 indexed_rows = 7;
//  int64 total_rows = 8;
//  // index state
//  common.IndexState state = 9;
//  string index_state_fail_reason = 10;
//  bool is_auto_index = 11;
//  repeated common.KeyValuePair user_index_params = 12;
//}
//
//message FieldIndex {
//  IndexInfo index_info = 1;
//  bool deleted = 2;
//  uint64 create_time = 3;
//}
//
//message SegmentIndex {
//  int64 collectionID = 1;
//  int64 partitionID = 2;
//  int64 segmentID = 3;
//  int64 num_rows = 4;
//  int64 indexID = 5;
//  int64 buildID = 6;
//  int64 nodeID = 7;
//  int64 index_version = 8;
//  common.IndexState state = 9;
//  string fail_reason = 10;
//  repeated string index_file_keys = 11;
//  bool deleted = 12;
//  uint64 create_time = 13;
//  uint64 serialize_size = 14;
//  bool write_handoff = 15;
//}
//
//message GetIndexStateRequest {
//  int64 collectionID = 1;
//  string index_name = 2;
//}
//
//message GetIndexStateResponse {
//  common.Status status = 1;
//  common.IndexState state = 2;
//  string fail_reason = 3;
//}
//
//message GetSegmentIndexStateRequest {
//  int64 collectionID = 1;
//  string index_name = 2;
//  repeated int64 segmentIDs = 3;
//}
//
//message SegmentIndexState {
//  int64 segmentID = 1;
//  common.IndexState state = 2;
//  string fail_reason = 3;
//}
//
//message GetSegmentIndexStateResponse {
//  common.Status status = 1;
//  repeated SegmentIndexState states = 2;
//}
//
//message CreateIndexRequest {
//  int64 collectionID = 1;
//  int64 fieldID = 2;
//  string index_name = 3;
//  repeated common.KeyValuePair type_params = 4;
//  repeated common.KeyValuePair index_params = 5;
//  uint64 timestamp = 6;
//  bool  is_auto_index = 7;
//  repeated common.KeyValuePair user_index_params = 8;
//}
//
//message GetIndexInfoRequest {
//  int64 collectionID = 1;
//  repeated int64 segmentIDs = 2;
//  string index_name = 3;
//}
//
//message IndexFilePathInfo {
//  int64 segmentID = 1;
//  int64 fieldID = 2;
//  int64 indexID = 3;
//  int64 buildID = 4;
//  string index_name = 5;
//  repeated common.KeyValuePair index_params = 6;
//  repeated string index_file_paths = 7;
//  uint64 serialized_size = 8;
//  int64 index_version = 9;
//  int64 num_rows = 10;
//}
//
//message SegmentIndexInfo {
//  int64 collectionID = 1;
//  int64 segmentID = 2;
//  bool enable_index = 3;
//  repeated IndexFilePathInfo index_infos = 4;
//}
//
//message GetIndexInfoResponse {
//  common.Status status = 1;
//  map<int64, SegmentIndexInfo> segment_info = 2;
//}
//
//message DropIndexRequest {
//  int64 collectionID = 1;
//  repeated int64 partitionIDs = 2;
//  string index_name = 3;
//  bool drop_all = 4;
//}
//
//message DescribeIndexRequest {
//  int64 collectionID = 1;
//  string index_name = 2;
//}
//
//message DescribeIndexResponse {
//  common.Status status = 1;
//  repeated IndexInfo index_infos = 2;
//}
//
//message GetIndexBuildProgressRequest {
//  int64 collectionID = 1;
//  string index_name = 2;
//}
//
//message GetIndexBuildProgressResponse {
//  common.Status status = 1;
//  int64 indexed_rows = 2;
//  int64 total_rows = 3;
//}