query_coord.proto 9.0 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 28
  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 CreateQueryChannel(CreateQueryChannelRequest) returns (CreateQueryChannelResponse) {}
  rpc GetPartitionStates(GetPartitionStatesRequest) returns (GetPartitionStatesResponse) {}
  rpc GetSegmentInfo(GetSegmentInfoRequest) returns (GetSegmentInfoResponse) {}
B
bigsheeper 已提交
29
  rpc LoadBalance(LoadBalanceRequest) returns (common.Status) {}
30 31 32

  // https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
  rpc GetMetrics(milvus.GetMetricsRequest) returns (milvus.GetMetricsResponse) {}
G
godchen 已提交
33 34 35 36 37 38 39 40 41 42
}

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

  rpc AddQueryChannel(AddQueryChannelRequest) returns (common.Status) {}
  rpc RemoveQueryChannel(RemoveQueryChannelRequest) returns (common.Status) {}
  rpc WatchDmChannels(WatchDmChannelsRequest) returns (common.Status) {}
43
  rpc WatchDeltaChannels(WatchDeltaChannelsRequest) returns (common.Status) {}
G
godchen 已提交
44 45 46 47 48
  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) {}
49 50 51

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

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

G
godchen 已提交
62
message ShowCollectionsResponse {
X
xige-16 已提交
63 64
  common.Status status = 1;
  repeated int64 collectionIDs = 2;
65
  repeated int64 inMemory_percentages = 3;
66 67
}

68 69 70 71
message ShowPartitionsRequest {
  common.MsgBase base = 1;
  int64 dbID = 2;
  int64 collectionID = 3;
72
  repeated int64 partitionIDs = 4;
73 74 75 76 77
}

message ShowPartitionsResponse {
  common.Status status = 1;
  repeated int64 partitionIDs = 2;
78
  repeated int64 inMemory_percentages = 3;
79 80
}

81
message LoadCollectionRequest {
82
  common.MsgBase base = 1;
X
xige-16 已提交
83
  int64 dbID = 2;
84
  int64 collectionID = 3;
85
  schema.CollectionSchema schema = 4;
86 87 88
}

message ReleaseCollectionRequest {
89
  common.MsgBase base = 1;
X
xige-16 已提交
90
  int64 dbID = 2;
91
  int64 collectionID = 3;
92
  int64 nodeID = 4;
93 94
}

95
message LoadPartitionsRequest {
96
  common.MsgBase base = 1;
X
xige-16 已提交
97 98
  int64 dbID = 2;
  int64 collectionID = 3;
99 100
  repeated int64 partitionIDs = 4;
  schema.CollectionSchema schema = 5;
101 102
}

103 104 105 106 107
message ReleasePartitionsRequest {
  common.MsgBase base = 1;
  int64 dbID = 2;
  int64 collectionID = 3;
  repeated int64 partitionIDs = 4;
108
  int64 nodeID = 5;
109 110 111 112
}

message CreateQueryChannelRequest {
  int64 collectionID = 1;
113
  int64 proxyID = 2;
114 115 116
}

message CreateQueryChannelResponse {
X
xige-16 已提交
117
  common.Status status = 1;
X
xige-16 已提交
118 119
  string query_channel = 2;
  string query_result_channel = 3;
120 121 122 123 124 125 126
}

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

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

134
message GetSegmentInfoRequest {
135
  common.MsgBase base = 1;
136 137
  repeated int64 segmentIDs = 2; // deprecated
  int64 collectionID = 3;
138 139
}

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

X
xige-16 已提交
145
//-----------------query node grpc request and response proto----------------
G
godchen 已提交
146
message AddQueryChannelRequest {
147
  common.MsgBase base = 1;
148 149
  int64 nodeID = 2;
  int64 collectionID = 3;
X
xige-16 已提交
150 151
  string query_channel = 4;
  string query_result_channel = 5;
152 153
  internal.MsgPosition seek_position = 6;
  repeated SegmentInfo global_sealed_segments = 7;
154 155
}

G
godchen 已提交
156
message RemoveQueryChannelRequest {
157 158 159
  common.MsgBase base = 1;
  int64 nodeID = 2;
  int64 collectionID = 3;
X
xige-16 已提交
160 161
  string query_channel = 4;
  string query_result_channel = 5;
162 163
}

G
godchen 已提交
164
message WatchDmChannelsRequest {
165
  common.MsgBase base = 1;
166 167
  int64 nodeID = 2;
  int64 collectionID = 3;
168
  repeated int64 partitionIDs = 4;
169
  repeated data.VchannelInfo infos = 5;
170
  schema.CollectionSchema schema = 6;
171
  repeated data.SegmentInfo exclude_infos = 7;
172 173
}

174 175 176 177 178 179 180
message WatchDeltaChannelsRequest {
  common.MsgBase base = 1;
  int64 nodeID = 2;
  int64 collectionID = 3;
  repeated data.VchannelInfo infos = 4;
}

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

message VecFieldIndexInfo {
  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;
205 206
}

G
godchen 已提交
207
message LoadSegmentsRequest {
208
  common.MsgBase base = 1;
209
  int64 dst_nodeID = 2;
210 211
  repeated SegmentLoadInfo infos = 3;
  schema.CollectionSchema schema = 4;
X
xige-16 已提交
212 213
  int64 source_nodeID = 5;
  int64 collectionID = 6;
214 215
}

G
godchen 已提交
216
message ReleaseSegmentsRequest {
217
  common.MsgBase base = 1;
218
  int64 nodeID = 2;
219
  // Not useful for now
220 221 222 223
  int64 dbID = 3;
  int64 collectionID = 4;
  repeated int64 partitionIDs = 5;
  repeated int64 segmentIDs = 6;
224 225
}

X
xige-16 已提交
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
//----------------request auto triggered by QueryCoord-----------------
message HandoffSegmentsRequest {
  common.MsgBase base = 1;
  repeated SegmentInfo segmentInfos = 2;
}

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;
}

//-------------------- internal meta proto------------------
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;
257 258
}

259
enum LoadType {
X
xige-16 已提交
260 261 262
  UnKnowType = 0;
  LoadPartition = 1;
  loadCollection = 2;
263 264
}

X
xige-16 已提交
265 266
message DmChannelWatchInfo {
  int64 collectionID = 1;
267 268
  string dmChannel = 2;
  int64 nodeID_loaded = 3;
269 270 271 272
}

message QueryChannelInfo {
  int64 collectionID = 1;
X
xige-16 已提交
273 274
  string query_channel = 2;
  string query_result_channel = 3;
275 276
  repeated SegmentInfo global_sealed_segments = 4;
  internal.MsgPosition seek_position = 5;
277 278
}

X
xige-16 已提交
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
message PartitionStates {
  int64 partitionID = 1;
  PartitionState state = 2;
  int64 inMemory_percentage = 3;
}

message SegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
  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;
298
  repeated VecFieldIndexInfo index_infos = 13;
X
xige-16 已提交
299 300
}

301 302 303
message CollectionInfo {
  int64 collectionID = 1;
  repeated int64 partitionIDs = 2;
304
  repeated PartitionStates partition_states = 3;
305 306 307 308
  LoadType load_type = 4;
  schema.CollectionSchema schema = 5;
  repeated int64 released_partitionIDs = 6;
  int64 inMemory_percentage = 7;
309 310
}

311 312 313 314 315 316 317 318 319 320
message UnsubscribeChannels {
  int64 collectionID = 1;
  repeated string channels = 2;
}

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

X
xige-16 已提交
321
//---- synchronize messages proto between QueryCoord and QueryNode -----
322 323 324 325 326 327 328
message SegmentChangeInfo {
  int64 online_nodeID = 1;
  repeated SegmentInfo online_segments = 2;
  int64 offline_nodeID = 3;
  repeated SegmentInfo offline_segments = 4;
}

329 330
message SealedSegmentsChangeInfo {
  common.MsgBase base = 1;
331
  repeated SegmentChangeInfo infos = 2;
332
}