2021-01-14 06:24:14 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package milvus.proto.query;
|
|
|
|
|
2021-04-22 06:45:57 +00:00
|
|
|
option go_package = "github.com/milvus-io/milvus/internal/proto/querypb";
|
2021-01-14 06:24:14 +00:00
|
|
|
|
|
|
|
import "common.proto";
|
2021-01-22 06:28:06 +00:00
|
|
|
import "milvus.proto";
|
2021-01-14 06:24:14 +00:00
|
|
|
import "internal.proto";
|
2021-02-06 09:37:10 +00:00
|
|
|
import "schema.proto";
|
2021-06-22 02:42:07 +00:00
|
|
|
import "data_coord.proto";
|
2021-01-14 06:24:14 +00:00
|
|
|
|
2021-06-22 08:44:09 +00:00
|
|
|
service QueryCoord {
|
2021-03-12 06:22:09 +00:00
|
|
|
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) {}
|
2021-11-06 08:54:59 +00:00
|
|
|
rpc LoadBalance(LoadBalanceRequest) returns (common.Status) {}
|
2021-08-17 02:06:11 +00:00
|
|
|
|
|
|
|
// https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
|
|
|
|
rpc GetMetrics(milvus.GetMetricsRequest) returns (milvus.GetMetricsResponse) {}
|
2021-03-12 06:22:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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) {}
|
2021-11-05 06:47:19 +00:00
|
|
|
rpc WatchDeltaChannels(WatchDeltaChannelsRequest) returns (common.Status) {}
|
2021-03-12 06:22:09 +00:00
|
|
|
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) {}
|
2021-08-17 02:06:11 +00:00
|
|
|
|
|
|
|
// https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
|
|
|
|
rpc GetMetrics(milvus.GetMetricsRequest) returns (milvus.GetMetricsResponse) {}
|
2021-03-12 06:22:09 +00:00
|
|
|
}
|
|
|
|
|
2021-12-15 08:53:12 +00:00
|
|
|
//--------------------QueryCoord grpc request and response proto------------------
|
2021-03-12 06:22:09 +00:00
|
|
|
message ShowCollectionsRequest {
|
2021-01-16 07:06:19 +00:00
|
|
|
common.MsgBase base = 1;
|
2021-09-22 12:04:13 +00:00
|
|
|
// Not useful for now
|
2021-01-16 07:31:10 +00:00
|
|
|
int64 dbID = 2;
|
2021-08-02 14:39:25 +00:00
|
|
|
repeated int64 collectionIDs = 3;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 06:22:09 +00:00
|
|
|
message ShowCollectionsResponse {
|
2021-01-16 07:31:10 +00:00
|
|
|
common.Status status = 1;
|
|
|
|
repeated int64 collectionIDs = 2;
|
2021-08-02 14:39:25 +00:00
|
|
|
repeated int64 inMemory_percentages = 3;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-06-15 04:41:40 +00:00
|
|
|
message ShowPartitionsRequest {
|
|
|
|
common.MsgBase base = 1;
|
|
|
|
int64 dbID = 2;
|
|
|
|
int64 collectionID = 3;
|
2021-08-02 14:39:25 +00:00
|
|
|
repeated int64 partitionIDs = 4;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ShowPartitionsResponse {
|
|
|
|
common.Status status = 1;
|
|
|
|
repeated int64 partitionIDs = 2;
|
2021-08-02 14:39:25 +00:00
|
|
|
repeated int64 inMemory_percentages = 3;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
2021-01-14 06:24:14 +00:00
|
|
|
message LoadCollectionRequest {
|
2021-01-16 07:06:19 +00:00
|
|
|
common.MsgBase base = 1;
|
2021-01-16 07:31:10 +00:00
|
|
|
int64 dbID = 2;
|
2021-01-14 06:24:14 +00:00
|
|
|
int64 collectionID = 3;
|
2021-02-06 09:37:10 +00:00
|
|
|
schema.CollectionSchema schema = 4;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ReleaseCollectionRequest {
|
2021-01-16 07:06:19 +00:00
|
|
|
common.MsgBase base = 1;
|
2021-01-16 07:31:10 +00:00
|
|
|
int64 dbID = 2;
|
2021-01-14 06:24:14 +00:00
|
|
|
int64 collectionID = 3;
|
2021-06-19 03:45:09 +00:00
|
|
|
int64 nodeID = 4;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-06-15 04:41:40 +00:00
|
|
|
message LoadPartitionsRequest {
|
2021-01-16 07:06:19 +00:00
|
|
|
common.MsgBase base = 1;
|
2021-01-16 07:31:10 +00:00
|
|
|
int64 dbID = 2;
|
|
|
|
int64 collectionID = 3;
|
2021-06-15 04:41:40 +00:00
|
|
|
repeated int64 partitionIDs = 4;
|
|
|
|
schema.CollectionSchema schema = 5;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-06-15 04:41:40 +00:00
|
|
|
message ReleasePartitionsRequest {
|
|
|
|
common.MsgBase base = 1;
|
|
|
|
int64 dbID = 2;
|
|
|
|
int64 collectionID = 3;
|
|
|
|
repeated int64 partitionIDs = 4;
|
2021-06-19 03:45:09 +00:00
|
|
|
int64 nodeID = 5;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message CreateQueryChannelRequest {
|
|
|
|
int64 collectionID = 1;
|
2021-06-18 02:33:58 +00:00
|
|
|
int64 proxyID = 2;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message CreateQueryChannelResponse {
|
2021-01-16 07:31:10 +00:00
|
|
|
common.Status status = 1;
|
2021-12-15 08:53:12 +00:00
|
|
|
string query_channel = 2;
|
|
|
|
string query_result_channel = 3;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetPartitionStatesRequest {
|
|
|
|
common.MsgBase base = 1;
|
|
|
|
int64 dbID = 2;
|
|
|
|
int64 collectionID = 3;
|
|
|
|
repeated int64 partitionIDs = 4;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 06:22:09 +00:00
|
|
|
message GetPartitionStatesResponse {
|
2021-01-16 07:31:10 +00:00
|
|
|
common.Status status = 1;
|
|
|
|
repeated PartitionStates partition_descriptions = 2;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-06-15 04:41:40 +00:00
|
|
|
message GetSegmentInfoRequest {
|
2021-01-16 07:06:19 +00:00
|
|
|
common.MsgBase base = 1;
|
2021-10-20 11:47:35 +00:00
|
|
|
repeated int64 segmentIDs = 2; // deprecated
|
|
|
|
int64 collectionID = 3;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-06-15 04:41:40 +00:00
|
|
|
message GetSegmentInfoResponse {
|
2021-01-16 07:31:10 +00:00
|
|
|
common.Status status = 1;
|
2021-06-15 04:41:40 +00:00
|
|
|
repeated SegmentInfo infos = 2;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-12-15 08:53:12 +00:00
|
|
|
//-----------------query node grpc request and response proto----------------
|
2021-03-12 06:22:09 +00:00
|
|
|
message AddQueryChannelRequest {
|
2021-01-16 07:06:19 +00:00
|
|
|
common.MsgBase base = 1;
|
2021-06-15 04:41:40 +00:00
|
|
|
int64 nodeID = 2;
|
|
|
|
int64 collectionID = 3;
|
2021-12-15 08:53:12 +00:00
|
|
|
string query_channel = 4;
|
|
|
|
string query_result_channel = 5;
|
2021-12-21 05:50:54 +00:00
|
|
|
internal.MsgPosition seek_position = 6;
|
|
|
|
repeated SegmentInfo global_sealed_segments = 7;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 06:22:09 +00:00
|
|
|
message RemoveQueryChannelRequest {
|
2021-06-15 04:41:40 +00:00
|
|
|
common.MsgBase base = 1;
|
|
|
|
int64 nodeID = 2;
|
|
|
|
int64 collectionID = 3;
|
2021-12-15 08:53:12 +00:00
|
|
|
string query_channel = 4;
|
|
|
|
string query_result_channel = 5;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 06:22:09 +00:00
|
|
|
message WatchDmChannelsRequest {
|
2021-01-16 07:06:19 +00:00
|
|
|
common.MsgBase base = 1;
|
2021-06-15 04:41:40 +00:00
|
|
|
int64 nodeID = 2;
|
|
|
|
int64 collectionID = 3;
|
2021-12-17 12:12:42 +00:00
|
|
|
repeated int64 partitionIDs = 4;
|
2021-06-16 03:09:56 +00:00
|
|
|
repeated data.VchannelInfo infos = 5;
|
2021-06-15 04:41:40 +00:00
|
|
|
schema.CollectionSchema schema = 6;
|
2021-06-16 03:09:56 +00:00
|
|
|
repeated data.SegmentInfo exclude_infos = 7;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
2021-11-05 06:47:19 +00:00
|
|
|
message WatchDeltaChannelsRequest {
|
|
|
|
common.MsgBase base = 1;
|
|
|
|
int64 nodeID = 2;
|
|
|
|
int64 collectionID = 3;
|
|
|
|
repeated data.VchannelInfo infos = 4;
|
|
|
|
}
|
|
|
|
|
2021-06-15 04:41:40 +00:00
|
|
|
message SegmentLoadInfo {
|
|
|
|
int64 segmentID = 1;
|
|
|
|
int64 partitionID = 2;
|
|
|
|
int64 collectionID = 3;
|
|
|
|
int64 dbID = 4;
|
|
|
|
int64 flush_time = 5;
|
2021-06-16 03:09:56 +00:00
|
|
|
repeated data.FieldBinlog binlog_paths = 6;
|
2021-09-07 03:35:18 +00:00
|
|
|
int64 num_of_rows = 7;
|
2021-10-22 06:31:13 +00:00
|
|
|
repeated data.FieldBinlog statslogs = 8;
|
2021-12-19 12:00:42 +00:00
|
|
|
repeated data.FieldBinlog deltalogs = 9;
|
2021-11-08 13:00:02 +00:00
|
|
|
repeated int64 compactionFrom = 10; // segmentIDs compacted from
|
2021-12-30 11:09:33 +00:00
|
|
|
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;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 06:22:09 +00:00
|
|
|
message LoadSegmentsRequest {
|
2021-01-16 07:06:19 +00:00
|
|
|
common.MsgBase base = 1;
|
2021-10-22 11:07:15 +00:00
|
|
|
int64 dst_nodeID = 2;
|
2021-06-15 04:41:40 +00:00
|
|
|
repeated SegmentLoadInfo infos = 3;
|
|
|
|
schema.CollectionSchema schema = 4;
|
2021-12-15 08:53:12 +00:00
|
|
|
int64 source_nodeID = 5;
|
|
|
|
int64 collectionID = 6;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 06:22:09 +00:00
|
|
|
message ReleaseSegmentsRequest {
|
2021-01-16 07:06:19 +00:00
|
|
|
common.MsgBase base = 1;
|
2021-06-15 04:41:40 +00:00
|
|
|
int64 nodeID = 2;
|
2021-09-22 12:06:09 +00:00
|
|
|
// Not useful for now
|
2021-06-15 04:41:40 +00:00
|
|
|
int64 dbID = 3;
|
|
|
|
int64 collectionID = 4;
|
|
|
|
repeated int64 partitionIDs = 5;
|
|
|
|
repeated int64 segmentIDs = 6;
|
2021-01-14 06:24:14 +00:00
|
|
|
}
|
|
|
|
|
2021-12-15 08:53:12 +00:00
|
|
|
//----------------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;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
2021-08-02 14:39:25 +00:00
|
|
|
enum LoadType {
|
2021-12-15 08:53:12 +00:00
|
|
|
UnKnowType = 0;
|
|
|
|
LoadPartition = 1;
|
|
|
|
loadCollection = 2;
|
2021-08-02 14:39:25 +00:00
|
|
|
}
|
|
|
|
|
2021-12-15 08:53:12 +00:00
|
|
|
message DmChannelWatchInfo {
|
|
|
|
int64 collectionID = 1;
|
2021-12-21 03:57:39 +00:00
|
|
|
string dmChannel = 2;
|
|
|
|
int64 nodeID_loaded = 3;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message QueryChannelInfo {
|
|
|
|
int64 collectionID = 1;
|
2021-12-15 08:53:12 +00:00
|
|
|
string query_channel = 2;
|
|
|
|
string query_result_channel = 3;
|
2021-10-22 11:07:15 +00:00
|
|
|
repeated SegmentInfo global_sealed_segments = 4;
|
|
|
|
internal.MsgPosition seek_position = 5;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
2021-12-15 08:53:12 +00:00
|
|
|
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;
|
2021-12-30 11:09:33 +00:00
|
|
|
repeated VecFieldIndexInfo index_infos = 13;
|
2021-12-15 08:53:12 +00:00
|
|
|
}
|
|
|
|
|
2021-06-15 04:41:40 +00:00
|
|
|
message CollectionInfo {
|
|
|
|
int64 collectionID = 1;
|
|
|
|
repeated int64 partitionIDs = 2;
|
2021-08-02 14:39:25 +00:00
|
|
|
repeated PartitionStates partition_states = 3;
|
2021-12-21 03:57:39 +00:00
|
|
|
LoadType load_type = 4;
|
|
|
|
schema.CollectionSchema schema = 5;
|
|
|
|
repeated int64 released_partitionIDs = 6;
|
|
|
|
int64 inMemory_percentage = 7;
|
2021-06-15 04:41:40 +00:00
|
|
|
}
|
|
|
|
|
2022-01-17 09:37:37 +00:00
|
|
|
message UnsubscribeChannels {
|
|
|
|
int64 collectionID = 1;
|
|
|
|
repeated string channels = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UnsubscribeChannelInfo {
|
|
|
|
int64 nodeID = 1;
|
|
|
|
repeated UnsubscribeChannels collection_channels = 2;
|
|
|
|
}
|
|
|
|
|
2021-12-15 08:53:12 +00:00
|
|
|
//---- synchronize messages proto between QueryCoord and QueryNode -----
|
2021-10-26 07:18:22 +00:00
|
|
|
message SegmentChangeInfo {
|
|
|
|
int64 online_nodeID = 1;
|
|
|
|
repeated SegmentInfo online_segments = 2;
|
|
|
|
int64 offline_nodeID = 3;
|
|
|
|
repeated SegmentInfo offline_segments = 4;
|
|
|
|
}
|
|
|
|
|
2021-10-09 06:45:00 +00:00
|
|
|
message SealedSegmentsChangeInfo {
|
|
|
|
common.MsgBase base = 1;
|
2021-10-26 07:18:22 +00:00
|
|
|
repeated SegmentChangeInfo infos = 2;
|
2021-10-09 06:45:00 +00:00
|
|
|
}
|