query_coord.proto 10.5 KB
Newer Older
1 2 3 4
syntax = "proto3";

package milvus.proto.query;

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

import "common.proto";
X
xige-16 已提交
8
import "milvus.proto";
9
import "internal.proto";
10
import "schema.proto";
11
import "data_coord.proto";
12

13
service QueryCoord {
G
godchen 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26 27
  rpc GetComponentStates(internal.GetComponentStatesRequest) returns (internal.ComponentStates) {}
  rpc GetTimeTickChannel(internal.GetTimeTickChannelRequest) returns(milvus.StringResponse) {}
  rpc GetStatisticsChannel(internal.GetStatisticsChannelRequest) returns(milvus.StringResponse){}

  rpc ShowCollections(ShowCollectionsRequest) returns (ShowCollectionsResponse) {}
  rpc ShowPartitions(ShowPartitionsRequest) returns (ShowPartitionsResponse) {}

  rpc LoadPartitions(LoadPartitionsRequest) returns (common.Status) {}
  rpc ReleasePartitions(ReleasePartitionsRequest) returns (common.Status) {}
  rpc LoadCollection(LoadCollectionRequest) returns (common.Status) {}
  rpc ReleaseCollection(ReleaseCollectionRequest) returns (common.Status) {}

  rpc GetPartitionStates(GetPartitionStatesRequest) returns (GetPartitionStatesResponse) {}
  rpc GetSegmentInfo(GetSegmentInfoRequest) returns (GetSegmentInfoResponse) {}
B
bigsheeper 已提交
28
  rpc LoadBalance(LoadBalanceRequest) returns (common.Status) {}
29 30 31

  // https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
  rpc GetMetrics(milvus.GetMetricsRequest) returns (milvus.GetMetricsResponse) {}
32 33

  // https://wiki.lfaidata.foundation/display/MIL/MEP+23+--+Multiple+memory+replication+design
X
XuanYang-cn 已提交
34
  rpc GetReplicas(milvus.GetReplicasRequest) returns (milvus.GetReplicasResponse) {}
35
  rpc GetShardLeaders(GetShardLeadersRequest) returns (GetShardLeadersResponse) {}
G
godchen 已提交
36 37 38 39 40 41 42 43
}

service QueryNode {
  rpc GetComponentStates(internal.GetComponentStatesRequest) returns (internal.ComponentStates) {}
  rpc GetTimeTickChannel(internal.GetTimeTickChannelRequest) returns(milvus.StringResponse) {}
  rpc GetStatisticsChannel(internal.GetStatisticsChannelRequest) returns(milvus.StringResponse){}

  rpc WatchDmChannels(WatchDmChannelsRequest) returns (common.Status) {}
44
  rpc WatchDeltaChannels(WatchDeltaChannelsRequest) returns (common.Status) {}
G
godchen 已提交
45 46 47 48 49
  rpc LoadSegments(LoadSegmentsRequest) returns (common.Status) {}
  rpc ReleaseCollection(ReleaseCollectionRequest) returns (common.Status) {}
  rpc ReleasePartitions(ReleasePartitionsRequest) returns (common.Status) {}
  rpc ReleaseSegments(ReleaseSegmentsRequest) returns (common.Status) {}
  rpc GetSegmentInfo(GetSegmentInfoRequest) returns (GetSegmentInfoResponse) {}
50
  rpc SyncReplicaSegments(SyncReplicaSegmentsRequest) returns (common.Status) {}
51

52 53
  rpc Search(SearchRequest) returns (internal.SearchResults) {}
  rpc Query(QueryRequest) returns (internal.RetrieveResults) {}
54

55 56
  // https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
  rpc GetMetrics(milvus.GetMetricsRequest) returns (milvus.GetMetricsResponse) {}
G
godchen 已提交
57 58
}

X
xige-16 已提交
59
//--------------------QueryCoord grpc request and response proto------------------
G
godchen 已提交
60
message ShowCollectionsRequest {
61
  common.MsgBase base = 1;
62
  // Not useful for now
X
xige-16 已提交
63
  int64 dbID = 2;
64
  repeated int64 collectionIDs = 3;
65 66
}

G
godchen 已提交
67
message ShowCollectionsResponse {
X
xige-16 已提交
68 69
  common.Status status = 1;
  repeated int64 collectionIDs = 2;
70
  repeated int64 inMemory_percentages = 3;
71
  repeated bool query_service_available = 4;
72 73
}

74 75 76 77
message ShowPartitionsRequest {
  common.MsgBase base = 1;
  int64 dbID = 2;
  int64 collectionID = 3;
78
  repeated int64 partitionIDs = 4;
79 80 81 82 83
}

message ShowPartitionsResponse {
  common.Status status = 1;
  repeated int64 partitionIDs = 2;
84
  repeated int64 inMemory_percentages = 3;
85 86
}

87
message LoadCollectionRequest {
88
  common.MsgBase base = 1;
X
xige-16 已提交
89
  int64 dbID = 2;
90
  int64 collectionID = 3;
91
  schema.CollectionSchema schema = 4;
92
  int32 replica_number = 5;
93 94 95
}

message ReleaseCollectionRequest {
96
  common.MsgBase base = 1;
X
xige-16 已提交
97
  int64 dbID = 2;
98
  int64 collectionID = 3;
99
  int64 nodeID = 4;
100 101
}

102
message LoadPartitionsRequest {
103
  common.MsgBase base = 1;
X
xige-16 已提交
104 105
  int64 dbID = 2;
  int64 collectionID = 3;
106 107
  repeated int64 partitionIDs = 4;
  schema.CollectionSchema schema = 5;
108
  int32 replica_number = 6;
109 110
}

111 112 113 114 115
message ReleasePartitionsRequest {
  common.MsgBase base = 1;
  int64 dbID = 2;
  int64 collectionID = 3;
  repeated int64 partitionIDs = 4;
116
  int64 nodeID = 5;
117 118 119 120 121 122 123
}

message GetPartitionStatesRequest {
  common.MsgBase base = 1;
  int64 dbID = 2;
  int64 collectionID = 3;
  repeated int64 partitionIDs = 4;
124 125
}

G
godchen 已提交
126
message GetPartitionStatesResponse {
X
xige-16 已提交
127 128
  common.Status status = 1;
  repeated PartitionStates partition_descriptions = 2;
129 130
}

131
message GetSegmentInfoRequest {
132
  common.MsgBase base = 1;
133 134
  repeated int64 segmentIDs = 2; // deprecated
  int64 collectionID = 3;
135 136
}

137
message GetSegmentInfoResponse {
X
xige-16 已提交
138
  common.Status status = 1;
139
  repeated SegmentInfo infos = 2;
140 141
}

142 143 144 145 146 147
message GetShardLeadersRequest {
  common.MsgBase base = 1;
  int64 collectionID = 2;
}

message GetShardLeadersResponse {
148 149
  common.Status status = 1;
  repeated ShardLeadersList shards = 2;
150 151
}

152
message ShardLeadersList {  // All leaders of all replicas of one shard
153
  string channel_name = 1;
154 155
  repeated int64 node_ids = 2;
  repeated string node_addrs = 3;
156 157
}

X
xige-16 已提交
158
//-----------------query node grpc request and response proto----------------
159 160 161
message LoadMetaInfo {
  LoadType load_type = 1;
  int64 collectionID = 2;
162
  repeated int64 partitionIDs = 3;
163 164
}

G
godchen 已提交
165
message WatchDmChannelsRequest {
166
  common.MsgBase base = 1;
167 168
  int64 nodeID = 2;
  int64 collectionID = 3;
169
  repeated int64 partitionIDs = 4;
170
  repeated data.VchannelInfo infos = 5;
171
  schema.CollectionSchema schema = 6;
172
  repeated data.SegmentInfo exclude_infos = 7;
173
  LoadMetaInfo load_meta = 8;
174
  int64 replicaID = 9;
175
  map<int64, data.SegmentInfo> segment_infos = 10;
176 177
}

178 179 180 181 182
message WatchDeltaChannelsRequest {
  common.MsgBase base = 1;
  int64 nodeID = 2;
  int64 collectionID = 3;
  repeated data.VchannelInfo infos = 4;
183
  int64 replica_id = 5;
184
  LoadMetaInfo load_meta = 9;
185 186
}

187 188 189 190 191 192
message SegmentLoadInfo {
  int64 segmentID = 1;
  int64 partitionID = 2;
  int64 collectionID = 3;
  int64 dbID = 4;
  int64 flush_time = 5;
193
  repeated data.FieldBinlog binlog_paths = 6;
194
  int64 num_of_rows = 7;
195
  repeated data.FieldBinlog statslogs = 8;
196
  repeated data.FieldBinlog deltalogs = 9;
197
  repeated int64 compactionFrom = 10; // segmentIDs compacted from
198
  repeated FieldIndexInfo index_infos = 11;
199
  int64 segment_size = 12;
200
  string insert_channel = 13;
201 202
}

203
message FieldIndexInfo {
204 205 206 207 208 209 210 211
  int64 fieldID =1;
  bool enable_index = 2;
  string index_name = 3;
  int64 indexID = 4;
  int64 buildID = 5;
  repeated common.KeyValuePair index_params = 6;
  repeated string index_file_paths = 7;
  int64 index_size = 8;
212 213
}

G
godchen 已提交
214
message LoadSegmentsRequest {
215
  common.MsgBase base = 1;
216
  int64 dst_nodeID = 2;
217 218
  repeated SegmentLoadInfo infos = 3;
  schema.CollectionSchema schema = 4;
X
xige-16 已提交
219 220
  int64 source_nodeID = 5;
  int64 collectionID = 6;
221
  LoadMetaInfo load_meta = 7;
222
  int64 replicaID = 8;
223
  repeated internal.MsgPosition delta_positions = 9;
224 225
}

G
godchen 已提交
226
message ReleaseSegmentsRequest {
227
  common.MsgBase base = 1;
228
  int64 nodeID = 2;
229
  // Not useful for now
230 231 232 233
  int64 dbID = 3;
  int64 collectionID = 4;
  repeated int64 partitionIDs = 5;
  repeated int64 segmentIDs = 6;
234
  DataScope scope = 7; // All, Streaming, Historical
235 236
}

237
message SearchRequest {
238
  internal.SearchRequest req = 1;
239 240
  string dml_channel = 2;
  repeated int64 segmentIDs = 3;
241 242
  bool from_shard_leader = 4;
  DataScope scope = 5; // All, Streaming, Historical
243 244 245
}

message QueryRequest {
246
  internal.RetrieveRequest req = 1;
247 248
  string dml_channel = 2;
  repeated int64 segmentIDs = 3;
249 250
  bool from_shard_leader = 4;
  DataScope scope = 5; // All, Streaming, Historical
251 252
}

253 254 255 256 257 258 259 260 261 262 263 264
message SyncReplicaSegmentsRequest {
  common.MsgBase base = 1;
  string vchannel_name = 2;
  repeated ReplicaSegmentsInfo replica_segments = 3;
}

message ReplicaSegmentsInfo {
  int64 node_id = 1;
  int64 partition_id = 2;
  repeated int64 segment_ids = 3;
}

X
xige-16 已提交
265 266 267 268
//----------------request auto triggered by QueryCoord-----------------
message HandoffSegmentsRequest {
  common.MsgBase base = 1;
  repeated SegmentInfo segmentInfos = 2;
Y
yah01 已提交
269
  repeated int64 released_segments = 3;
X
xige-16 已提交
270 271 272 273 274 275 276 277
}

message LoadBalanceRequest {
  common.MsgBase base = 1;
  repeated int64 source_nodeIDs = 2;
  TriggerCondition balance_reason = 3;
  repeated int64 dst_nodeIDs = 4;
  repeated int64 sealed_segmentIDs = 5;
278
  int64 collectionID = 6;
X
xige-16 已提交
279 280 281
}

//-------------------- internal meta proto------------------
282 283 284 285 286 287 288 289

enum DataScope {
  UnKnown = 0;
  All = 1;
  Streaming = 2;
  Historical = 3;
}

X
xige-16 已提交
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
enum PartitionState {
  NotExist = 0;
  NotPresent = 1;
  OnDisk = 2;
  PartialInMemory = 3;
  InMemory = 4;
  PartialInGPU = 5;
  InGPU = 6;
}

enum TriggerCondition {
  UnKnowCondition = 0;
  Handoff = 1;
  LoadBalance = 2;
  GrpcRequest = 3;
  NodeDown = 4;
306 307
}

308
enum LoadType {
309
  UnKnownType = 0;
X
xige-16 已提交
310
  LoadPartition = 1;
311
  LoadCollection = 2;
312 313
}

X
xige-16 已提交
314 315
message DmChannelWatchInfo {
  int64 collectionID = 1;
316 317
  string dmChannel = 2;
  int64 nodeID_loaded = 3;
318
  int64 replicaID = 4;
319
  repeated int64 node_ids = 5;
320 321 322 323
}

message QueryChannelInfo {
  int64 collectionID = 1;
X
xige-16 已提交
324 325
  string query_channel = 2;
  string query_result_channel = 3;
326 327
  repeated SegmentInfo global_sealed_segments = 4;
  internal.MsgPosition seek_position = 5;
328 329
}

X
xige-16 已提交
330 331 332 333 334 335 336 337 338 339
message PartitionStates {
  int64 partitionID = 1;
  PartitionState state = 2;
  int64 inMemory_percentage = 3;
}

message SegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
340
  // deprecated, check node_ids(NodeIds) field
X
xige-16 已提交
341 342 343 344 345 346 347 348 349
  int64 nodeID = 4;
  int64 mem_size = 5;
  int64 num_rows = 6;
  string index_name = 7;
  int64 indexID = 8;
  string dmChannel = 9;
  repeated int64 compactionFrom = 10;
  bool createdByCompaction = 11;
  common.SegmentState segment_state = 12;
350
  repeated FieldIndexInfo index_infos = 13;
351 352
  repeated int64 replica_ids = 14;
  repeated int64 node_ids = 15;
X
xige-16 已提交
353 354
}

355 356 357
message CollectionInfo {
  int64 collectionID = 1;
  repeated int64 partitionIDs = 2;
358
  repeated PartitionStates partition_states = 3;
359 360 361 362
  LoadType load_type = 4;
  schema.CollectionSchema schema = 5;
  repeated int64 released_partitionIDs = 6;
  int64 inMemory_percentage = 7;
363
  repeated int64 replica_ids = 8;
364 365 366
  int32 replica_number = 9;
}

367 368 369 370 371 372 373 374 375 376
message UnsubscribeChannels {
  int64 collectionID = 1;
  repeated string channels = 2;
}

message UnsubscribeChannelInfo {
  int64 nodeID = 1;
  repeated UnsubscribeChannels collection_channels = 2;
}

X
xige-16 已提交
377
//---- synchronize messages proto between QueryCoord and QueryNode -----
378 379 380 381 382 383 384
message SegmentChangeInfo {
  int64 online_nodeID = 1;
  repeated SegmentInfo online_segments = 2;
  int64 offline_nodeID = 3;
  repeated SegmentInfo offline_segments = 4;
}

385 386
message SealedSegmentsChangeInfo {
  common.MsgBase base = 1;
387
  repeated SegmentChangeInfo infos = 2;
388
}