milvus/pkg/streaming/proto/messages.proto
chyezh c725416288
enhance: move streaming proto into pkg (#35284)
issue: #33285

- move streaming related proto into pkg.
- add v2 message type and change flush message into v2 message.

Signed-off-by: chyezh <chyezh@outlook.com>
2024-08-07 10:34:16 +08:00

117 lines
3.2 KiB
Protocol Buffer

syntax = "proto3";
package milvus.proto.messages;
option go_package = "github.com/milvus-io/milvus/pkg/streaming/proto/messagespb";
// MessageID is the unique identifier of a message.
message MessageID {
string id = 1;
}
// Message is the basic unit of communication between publisher and consumer.
message Message {
bytes payload = 1; // message body
map<string, string> properties = 2; // message properties
}
// ImmutableMessage is the message that can not be modified anymore.
message ImmutableMessage {
MessageID id = 1;
bytes payload = 2; // message body
map<string, string> properties = 3; // message properties
}
// MessageType is the type of message.
enum MessageType {
Unknown = 0;
TimeTick = 1;
Insert = 2;
Delete = 3;
Flush = 4;
CreateCollection = 5;
DropCollection = 6;
CreatePartition = 7;
DropPartition = 8;
}
///
/// Message Payload Definitions
/// Some message payload is defined at msg.proto at milvus-proto for
/// compatibility.
/// 1. InsertRequest
/// 2. DeleteRequest
/// 3. TimeTickRequest
/// 4. CreateCollectionRequest
/// 5. DropCollectionRequest
/// 6. CreatePartitionRequest
/// 7. DropPartitionRequest
///
// FlushMessageBody is the body of flush message.
message FlushMessageBody {
int64 collection_id =
1; // indicate which the collection that segment belong to.
repeated int64 segment_id = 2; // indicate which segment to flush.
}
///
/// Message Header Definitions
/// Used to fast handling at streaming node write ahead.
/// The header should be simple and light enough to be parsed.
/// Do not put too much information in the header if unnecessary.
///
// TimeTickMessageHeader just nothing.
message TimeTickMessageHeader {}
// InsertMessageHeader is the header of insert message.
message InsertMessageHeader {
int64 collection_id = 1;
repeated PartitionSegmentAssignment partitions = 2;
}
// PartitionSegmentAssignment is the segment assignment of a partition.
message PartitionSegmentAssignment {
int64 partition_id = 1;
uint64 rows = 2;
uint64 binary_size = 3;
SegmentAssignment segment_assignment = 4;
}
// SegmentAssignment is the assignment of a segment.
message SegmentAssignment {
int64 segment_id = 1;
}
// DeleteMessageHeader
message DeleteMessageHeader {
int64 collection_id = 1;
}
// FlushMessageHeader just nothing.
message FlushMessageHeader {}
// CreateCollectionMessageHeader is the header of create collection message.
message CreateCollectionMessageHeader {
int64 collection_id = 1;
repeated int64 partition_ids = 2;
}
// DropCollectionMessageHeader is the header of drop collection message.
message DropCollectionMessageHeader {
int64 collection_id = 1;
}
// CreatePartitionMessageHeader is the header of create partition message.
message CreatePartitionMessageHeader {
int64 collection_id = 1;
int64 partition_id = 2;
}
// DropPartitionMessageHeader is the header of drop partition message.
message DropPartitionMessageHeader {
int64 collection_id = 1;
int64 partition_id = 2;
}